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.
NewEduCoderBuild/p__Shixuns__Detail__Reposit...

2 lines
15 KiB

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