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.
2 lines
15 KiB
2 lines
15 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[179],{"7ahc":function(H,T,a){"use strict";a.d(T,"a",function(){return B});var it=a("k1fw"),et=a("0Owb"),rt=a("+L6B"),Q=a("2/Rp"),Z=a("y8nQ"),D=a("Vl3Y"),L=a("tJVT"),lt=a("OaEy"),M=a("2fM7"),i=a("q1tI"),v=a.n(i),g=a("VrN/"),X=a.n(g),at=a("p77/"),nt=a.n(at),w=a("c5Ni"),$=a.n(w),ot=M.a.Option,_={labelCol:{span:4},wrapperCol:{span:20}},l={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"]};T.b=function(d){var E=d.callback,C=d.onCancel,p=Object(i.useState)("python"),x=Object(L.a)(p,2),P=x[0],c=x[1];function j(s){c(l[s][1])}function I(s){E(s)}return v.a.createElement(D.a,Object(et.a)({},_,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:I}),v.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(M.a,{onChange:j},Object.keys(l).map(function(s){return v.a.createElement(ot,{key:s,value:s},l[s][0])}))),v.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(B,{mode:P})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(Q.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function B(d){var E=d.value,C=d.onChange,p=d.mode,x=d.options,P=x===void 0?{}:x,c=Object(i.useRef)(),j=Object(i.useState)(),I=Object(L.a)(j,2),s=I[0],V=I[1];return Object(i.useEffect)(function(){if(s){var R=function(O){var K=O.getValue();C&&C(K)};return s.on("change",R),function(){s.off("change",R)}}},[s,C]),Object(i.useEffect)(function(){s&&s.setOption("mode",p)},[s,p]),Object(i.useEffect)(function(){s&&((E!==s.getValue()||E==="")&&setTimeout(function(){s.setValue(E||" ")},300))},[s,E]),Object(i.useEffect)(function(){if(c.current&&!s){var R=X.a.fromTextArea(c.current,Object(it.a)({mode:p,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},P));V(R)}},[c.current,s]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:c}))}},"9ZNV":function(H,T,a){"use strict";a.d(T,"a",function(){return i});var it=a("0Owb"),et=a("+L6B"),rt=a("2/Rp"),Q=a("q1tI"),Z=a.n(Q),D=a("UUDw"),L=a.n(D),lt=a("TSYQ"),M=a.n(lt),i=function(g){var X=g.cancelText,at=X===void 0?"\u53D6\u6D88":X,nt=g.okText,w=nt===void 0?"\u786E\u5B9A":nt,$=g.loading,ot=$===void 0?!1:$,_=g.hasOkBtn,l=_===void 0?!0:_,B=g.okButtonProps,d=B===void 0?{}:B,E=g.onCancel,C=E===void 0?function(){}:E,p=g.onOk,x=p===void 0?function(){}:p,P=g.className,c=P===void 0?"":P;return Z.a.createElement("div",{className:M()(L.a.buttonFixed,c)},Z.a.createElement("div",{className:L.a.buttonWrap},Z.a.createElement(rt.a,{size:"large",className:"".concat(L.a.button," mr20"),onClick:C},at),l&&Z.a.createElement(rt.a,Object(it.a)({size:"large",type:"primary",className:"".concat(L.a.button," mr20"),loading:ot,onClick:x},d),w)))}},UUDw:function(H,T,a){H.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},baNF:function(H,T,a){"use strict";a.r(T);var it=a("5NDa"),et=a("5rEg"),rt=a("k1fw"),Q=a("9og8"),Z=a("y8nQ"),D=a("Vl3Y"),L=a("tJVT"),lt=a("PpiC"),M=a("q1tI"),i=a.n(M),v=a("Ty5D"),g=a("9kvl"),X=a("7ahc"),at=a("9ZNV"),nt=a("y37m"),w=a.n(nt);function $(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */$=function(){return l};var _,l={},B=Object.prototype,d=B.hasOwnProperty,E=Object.defineProperty||function(r,t,e){r[t]=e.value},C=typeof Symbol=="function"?Symbol:{},p=C.iterator||"@@iterator",x=C.asyncIterator||"@@asyncIterator",P=C.toStringTag||"@@toStringTag";function c(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{c({},"")}catch(r){c=function(e,n,u){return e[n]=u}}function j(r,t,e,n){var u=t&&t.prototype instanceof K?t:K,o=Object.create(u.prototype),m=new _t(n||[]);return E(o,"_invoke",{value:f(r,e,m)}),o}function I(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(n){return{type:"throw",arg:n}}}l.wrap=j;var s="suspendedStart",V="suspendedYield",R="executing",G="completed",O={};function K(){}function q(){}function A(){}var F={};c(F,p,function(){return this});var ut=Object.getPrototypeOf,tt=ut&&ut(ut(W([])));tt&&tt!==B&&d.call(tt,p)&&(F=tt);var N=A.prototype=K.prototype=Object.create(F);function U(r){["next","throw","return"].forEach(function(t){c(r,t,function(e){return this._invoke(t,e)})})}function h(r,t){function e(u,o,m,y){var b=I(r[u],r,o);if(b.type!=="throw"){var Y=b.arg,k=Y.value;return k&&typeof k=="object"&&d.call(k,"__await")?t.resolve(k.__await).then(function(z){e("next",z,m,y)},function(z){e("throw",z,m,y)}):t.resolve(k).then(function(z){Y.value=z,m(Y)},function(z){return e("throw",z,m,y)})}y(b.arg)}var n;E(this,"_invoke",{value:function(o,m){function y(){return new t(function(b,Y){e(o,m,b,Y)})}return n=n?n.then(y,y):y()}})}function f(r,t,e){var n=s;return function(u,o){if(n===R)throw new Error("Generator is already running");if(n===G){if(u==="throw")throw o;return{value:_,done:!0}}for(e.method=u,e.arg=o;;){var m=e.delegate;if(m){var y=S(m,e);if(y){if(y===O)continue;return y}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(n===s)throw n=G,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);n=R;var b=I(r,t,e);if(b.type==="normal"){if(n=e.done?G:V,b.arg===O)continue;return{value:b.arg,done:e.done}}b.type==="throw"&&(n=G,e.method="throw",e.arg=b.arg)}}}function S(r,t){var e=t.method,n=r.iterator[e];if(n===_)return t.delegate=null,e==="throw"&&r.iterator.return&&(t.method="return",t.arg=_,S(r,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),O;var u=I(n,r.iterator,t.arg);if(u.type==="throw")return t.method="throw",t.arg=u.arg,t.delegate=null,O;var o=u.arg;return o?o.done?(t[r.resultName]=o.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=_),t.delegate=null,O):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function st(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function J(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function _t(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(st,this),this.reset(!0)}function W(r){if(r||r===""){var t=r[p];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var e=-1,n=function u(){for(;++e<r.length;)if(d.call(r,e))return u.value=r[e],u.done=!1,u;return u.value=_,u.done=!0,u};return n.next=n}}throw new TypeError(typeof r+" is not iterable")}return q.prototype=A,E(N,"constructor",{value:A,configurable:!0}),E(A,"constructor",{value:q,configurable:!0}),q.displayName=c(A,P,"GeneratorFunction"),l.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===q||(t.displayName||t.name)==="GeneratorFunction")},l.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,A):(r.__proto__=A,c(r,P,"GeneratorFunction")),r.prototype=Object.create(N),r},l.awrap=function(r){return{__await:r}},U(h.prototype),c(h.prototype,x,function(){return this}),l.AsyncIterator=h,l.async=function(r,t,e,n,u){u===void 0&&(u=Promise);var o=new h(j(r,t,e,n),u);return l.isGeneratorFunction(t)?o:o.next().then(function(m){return m.done?m.value:o.next()})},U(N),c(N,P,"Generator"),c(N,p,function(){return this}),c(N,"toString",function(){return"[object Generator]"}),l.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function u(){for(;e.length;){var o=e.pop();if(o in t)return u.value=o,u.done=!1,u}return u.done=!0,u}},l.values=W,_t.prototype={constructor:_t,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(J),!t)for(var e in this)e.charAt(0)==="t"&&d.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=_)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(Y,k){return m.type="throw",m.arg=t,e.next=Y,k&&(e.method="next",e.arg=_),!!k}for(var u=this.tryEntries.length-1;u>=0;--u){var o=this.tryEntries[u],m=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var y=d.call(o,"catchLoc"),b=d.call(o,"finallyLoc");if(y&&b){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(y){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!b)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 u=this.tryEntries[n];if(u.tryLoc<=this.prev&&d.call(u,"finallyLoc")&&this.prev<u.finallyLoc){var o=u;break}}o&&(t==="break"||t==="continue")&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var m=o?o.completion:{};return m.type=t,m.arg=e,o?(this.method="next",this.next=o.finallyLoc,O):this.complete(m)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),O},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),J(n),O}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var u=n.completion;if(u.type==="throw"){var o=u.arg;J(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:W(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=_),O}},l}var ot=function(l){var B=l.shixunsDetail,d=l.globalSetting,E=l.loading,C=l.user,p=l.dispatch,x=Object(lt.a)(l,["shixunsDetail","globalSetting","loading","user","dispatch"]),P=Object(v.l)(),c=Object(M.useState)({}),j=Object(L.a)(c,2),I=j[0],s=j[1],V=Object(M.useRef)(),R=Object(M.useRef)(),G=D.a.useForm(),O=Object(L.a)(G,1),K=O[0],q=Object(M.useState)(""),A=Object(L.a)(q,2),F=A[0],ut=A[1];Object(M.useEffect)(function(){return p({type:"globalSetting/footerToggle",payload:!1}),function(){p({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(M.useEffect)(function(){var U=sessionStorage.getItem("pathArray");if(U){var h=U.split(",").join("/"),f=h.indexOf("/")===0?h.substr(1):h;ut(f)}},[]),Object(M.useEffect)(function(){var U,h,f,S;R.current=(U=P.pathname)===null||U===void 0||((h=U.split("/"))===null||h===void 0)?void 0:h[2],V.current=((f=P.pathname)===null||f===void 0||((S=f.split("/"))===null||S===void 0)?void 0:S[3])==="repository"},[]);var tt=function(){var U=Object(Q.a)($().mark(function h(){var f,S,st,J=arguments;return $().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return f=J.length>0&&J[0]!==void 0?J[0]:{},W.next=3,p({type:"shixunsDetail/addRepositoryFile",payload:{id:R.current,message:f.commitMessage,content:f.codeMirror,path:"".concat(F?"".concat(F,"/"):"").concat(f.path||""),secret_repository:V.current?void 0:!0}});case 3:S=W.sent,S&&(st=V.current?"/shixuns/".concat(R.current,"/repository").concat(F?"/master/shixun_show/".concat(F):""):"/shixuns/".concat(R.current,"/secret_repository"),g.c.replace(st));case 5:case"end":return W.stop()}},h)}));return function(){return U.apply(this,arguments)}}(),N=function(){var h,f;g.c.push("/shixuns/".concat(R.current,"/").concat((h=P.pathname)===null||h===void 0||((f=h.split("/"))===null||f===void 0)?void 0:f[3]).concat(F?"/master/shixun_show/".concat(F):""))};return i.a.createElement("section",{className:w.a.bg},i.a.createElement("div",{className:w.a.wrap},i.a.createElement("div",{className:w.a.title},"\u65B0\u5EFA\u6587\u4EF6"),i.a.createElement(D.a,{className:"mt10",form:K,scrollToFirstError:!0,layout:"vertical",onFinish:tt,onValuesChange:function(){return s(Object(rt.a)({},K.getFieldsValue()))}},i.a.createElement(D.a.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},i.a.createElement(D.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},i.a.createElement("span",null,i.a.createElement("span",{className:"mr5"},F?"".concat(F,"/"):""),i.a.createElement(et.a,{className:w.a.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),i.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")),i.a.createElement(D.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"}]},i.a.createElement(et.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"})),i.a.createElement("div",{className:"mt10 mb20"},i.a.createElement(D.a.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},i.a.createElement(X.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"]}}))),i.a.createElement(D.a.Item,{noStyle:!0},i.a.createElement(at.a,{okButtonProps:{htmlType:"submit"},onCancel:N})))))};T.default=Object(g.a)(function(_){var l=_.shixunsDetail,B=_.loading,d=_.globalSetting,E=_.user;return{shixunsDetail:l,globalSetting:d,user:E,loading:B.models.index}})(ot)},y37m:function(H,T,a){H.exports={bg:"bg___3LF6r",wrap:"wrap___2G3Cw",title:"title___1RMLx",path:"path___25SE5",colorBlue:"colorBlue___1sALU",width240:"width240___3YXUs"}}}]);
|