You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
15 KiB
1 line
15 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[171],{"7ahc":function(t,e,r){"use strict";r.d(e,"a",(function(){return v}));var n=r("k1fw"),a=r("0Owb"),o=(r("+L6B"),r("2/Rp")),i=(r("y8nQ"),r("Vl3Y")),c=r("tJVT"),l=(r("OaEy"),r("2fM7")),s=r("q1tI"),u=r.n(s),f=r("VrN/"),h=r.n(f),p=(r("p77/"),r("c5Ni"),l["a"].Option),m={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(t){var e=t.value,r=t.onChange,a=t.mode,o=t.options,i=void 0===o?{}:o,l=Object(s["useRef"])(),f=Object(s["useState"])(),p=Object(c["a"])(f,2),m=p[0],d=p[1];return Object(s["useEffect"])((function(){if(m){var t=function(t){var e=t.getValue();r&&r(e)};return m.on("change",t),function(){m.off("change",t)}}}),[m,r]),Object(s["useEffect"])((function(){m&&m.setOption("mode",a)}),[m,a]),Object(s["useEffect"])((function(){m&&(e===m.getValue()&&""!==e||setTimeout((function(){m.setValue(e||" ")}),300))}),[m,e]),Object(s["useEffect"])((function(){if(l.current&&!m){var t=h.a.fromTextArea(l.current,Object(n["a"])({mode:a,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},i));d(t)}}),[l.current,m]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}e["b"]=function(t){var e=t.callback,r=t.onCancel,n=Object(s["useState"])("python"),f=Object(c["a"])(n,2),h=f[0],y=f[1];function g(t){y(d[t][1])}function b(t){e(t)}return u.a.createElement(i["a"],Object(a["a"])({},m,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),u.a.createElement(i["a"].Item,{label:"\u4ee3\u7801\u8bed\u8a00",name:"language"},u.a.createElement(l["a"],{onChange:g},Object.keys(d).map((function(t){return u.a.createElement(p,{key:t,value:t},d[t][0])})))),u.a.createElement(i["a"].Item,{label:"\u4ee3\u7801\u5185\u5bb9",name:"content",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u4ee3\u7801\u5185\u5bb9"}]},u.a.createElement(v,{mode:h})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(o["a"],{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786e\u5b9a"),u.a.createElement(o["a"],{type:"ghost",onClick:r},"\u53d6\u6d88")))}},"9ZNV":function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r("0Owb"),a=(r("+L6B"),r("2/Rp")),o=r("q1tI"),i=r.n(o),c=r("UUDw"),l=r.n(c),s=r("TSYQ"),u=r.n(s),f=function(t){var e=t.cancelText,r=void 0===e?"\u53d6\u6d88":e,o=t.okText,c=void 0===o?"\u786e\u5b9a":o,s=t.loading,f=void 0!==s&&s,h=t.hasOkBtn,p=void 0===h||h,m=t.okButtonProps,d=void 0===m?{}:m,v=t.onCancel,y=void 0===v?function(){}:v,g=t.onOk,b=void 0===g?function(){}:g,w=t.className,E=void 0===w?"":w;return i.a.createElement("div",{className:u()(l.a.buttonFixed,E)},i.a.createElement("div",{className:l.a.buttonWrap},i.a.createElement(a["a"],{size:"large",className:"".concat(l.a.button," mr20"),onClick:y},r),p&&i.a.createElement(a["a"],Object(n["a"])({size:"large",type:"primary",className:"".concat(l.a.button," mr20"),loading:f,onClick:b},d),c)))}},UUDw:function(t,e,r){t.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},baNF:function(t,e,r){"use strict";r.r(e);r("5NDa");var n=r("5rEg"),a=r("k1fw"),o=r("9og8"),i=(r("y8nQ"),r("Vl3Y")),c=r("tJVT"),l=r("PpiC"),s=r("q1tI"),u=r.n(s),f=r("Ty5D"),h=r("9kvl"),p=r("7ahc"),m=r("9ZNV"),d=r("y37m"),v=r.n(d);function y(){y=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(N){l=function(t,e,r){return t[e]=r}}function s(t,e,r,a){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new k(a||[]);return n(i,"_invoke",{value:x(t,r,c)}),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(N){return{type:"throw",arg:N}}}t.wrap=s;var f={};function h(){}function p(){}function m(){}var d={};l(d,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(S([])));g&&g!==e&&r.call(g,o)&&(d=g);var b=m.prototype=h.prototype=Object.create(d);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function a(n,o,i,c){var l=u(t[n],t,o);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){a("next",t,i,c)}),(function(t){a("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return a("throw",t,i,c)}))}c(l.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){a(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return L()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=O(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=u(n,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,f;var o=a.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=m,n(b,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:p,configurable:!0}),p.displayName=l(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,l(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(E.prototype),l(E.prototype,i,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},w(b),l(b,c,"Generator"),l(b,o,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;_(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var g=function(t){t.shixunsDetail,t.globalSetting,t.loading,t.user;var e=t.dispatch,r=(Object(l["a"])(t,["shixunsDetail","globalSetting","loading","user","dispatch"]),Object(f["l"])()),d=Object(s["useState"])({}),g=Object(c["a"])(d,2),b=(g[0],g[1]),w=Object(s["useRef"])(),E=Object(s["useRef"])(),x=i["a"].useForm(),O=Object(c["a"])(x,1),j=O[0],_=Object(s["useState"])(""),k=Object(c["a"])(_,2),S=k[0],L=k[1];Object(s["useEffect"])((function(){return e({type:"globalSetting/footerToggle",payload:!1}),function(){e({type:"globalSetting/footerToggle",payload:!0})}}),[]),Object(s["useEffect"])((function(){var t=sessionStorage.getItem("pathArray");if(t){var e=t.split(",").join("/"),r=0===e.indexOf("/")?e.substr(1):e;L(r)}}),[]),Object(s["useEffect"])((function(){var t,e,n,a;E.current=null===(t=r.pathname)||void 0===t||null===(e=t.split("/"))||void 0===e?void 0:e[2],w.current="repository"===(null===(n=r.pathname)||void 0===n||null===(a=n.split("/"))||void 0===a?void 0:a[3])}),[]);var N=function(){var t=Object(o["a"])(y().mark((function t(){var r,n,a,o=arguments;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,e({type:"shixunsDetail/addRepositoryFile",payload:{id:E.current,message:r.commitMessage,content:r.codeMirror,path:"".concat(S?"".concat(S,"/"):"").concat(r.path||""),secret_repository:!w.current||void 0}});case 3:n=t.sent,n&&(a=w.current?"/shixuns/".concat(E.current,"/repository").concat(S?"/master/shixun_show/".concat(S):""):"/shixuns/".concat(E.current,"/secret_repository"),h["c"].replace(a));case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),C=function(){var t,e;h["c"].push("/shixuns/".concat(E.current,"/").concat(null===(t=r.pathname)||void 0===t||null===(e=t.split("/"))||void 0===e?void 0:e[3]).concat(S?"/master/shixun_show/".concat(S):""))};return u.a.createElement("section",{className:v.a.bg},u.a.createElement("div",{className:v.a.wrap},u.a.createElement("div",{className:v.a.title},"\u65b0\u5efa\u6587\u4ef6"),u.a.createElement(i["a"],{className:"mt10",form:j,scrollToFirstError:!0,layout:"vertical",onFinish:N,onValuesChange:function(){return b(Object(a["a"])({},j.getFieldsValue()))}},u.a.createElement(i["a"].Item,{label:"\u6587\u4ef6\u540d\u79f0\u6216\u6587\u4ef6\u8def\u5f84\uff1a"},u.a.createElement(i["a"].Item,{name:"path",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u6587\u4ef6\u540d\u79f0\u6216\u6587\u4ef6\u8def\u5f84"},{whitespace:!0,message:"\u8bf7\u52ff\u8f93\u5165\u7a7a\u683c"}],noStyle:!0},u.a.createElement("span",null,u.a.createElement("span",{className:"mr5"},S?"".concat(S,"/"):""),u.a.createElement(n["a"],{className:v.a.width240,placeholder:"\u8bf7\u8f93\u5165\u6587\u4ef6\u540d\u79f0\u6216\u6587\u4ef6\u8def\u5f84"}))),u.a.createElement("span",{className:"ml5"},"\u63d0\u793a\uff1a1.\u8f93\u5165\u6587\u4ef6\u540d\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff1b2.\u8f93\u5165\u65b0\u6587\u4ef6\u5939\u540d/\u65b0\u6587\u4ef6\u540d\u53ef\u4ee5\u521b\u5efa\u65b0\u6587\u4ef6\u5939\u548c\u65b0\u6587\u4ef6\u3002\uff08\u5982\uff1astep1/HelloWorld.java\uff09")),u.a.createElement(i["a"].Item,{label:"\u63d0\u4ea4\u4fe1\u606f\uff1a",name:"commitMessage",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u63d0\u4ea4\u4fe1\u606f"},{whitespace:!0,message:"\u8bf7\u52ff\u8f93\u5165\u7a7a\u683c"}]},u.a.createElement(n["a"],{placeholder:"\u8bf7\u8f93\u5165\u672c\u6b21\u63d0\u4ea4\u7684\u4e3b\u8981\u4fe1\u606f\uff0c\u5408\u7406\u7684\u63cf\u8ff0\u4fe1\u606f\u6709\u5229\u4e8e\u4ee3\u7801\u5386\u53f2\u8bb0\u5f55\u7684\u7ba1\u7406"})),u.a.createElement("div",{className:"mt10 mb20"},u.a.createElement(i["a"].Item,{name:"codeMirror",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u6587\u4ef6\u5185\u5bb9"}]},u.a.createElement(p["a"],{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}))),u.a.createElement(i["a"].Item,{noStyle:!0},u.a.createElement(m["a"],{okButtonProps:{htmlType:"submit"},onCancel:C})))))};e["default"]=Object(h["a"])((function(t){var e=t.shixunsDetail,r=t.loading,n=t.globalSetting,a=t.user;return{shixunsDetail:e,globalSetting:n,user:a,loading:r.models.index}}))(g)},y37m:function(t,e,r){t.exports={bg:"bg___3LF6r",wrap:"wrap___2G3Cw",title:"title___1RMLx",path:"path___25SE5",colorBlue:"colorBlue___1sALU",width240:"width240___3YXUs"}}}]); |