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