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