|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[97046],{64261:function(e,t,n){n.d(t,{t:function(){return m}});var o=n(82242),s=n.n(o),a=(n(59301),n(3113)),i="buttonFixed___vyq30",r="button___hxmYv",l="buttonWrap___uK8dl",c=n(92310),u=n.n(c),d=n(37712),m=function(e){var t=e.cancelText,n=void 0===t?"取消":t,o=e.okText,c=void 0===o?"确定":o,m=e.loading,p=void 0!==m&&m,h=e.hasOkBtn,f=void 0===h||h,v=e.hasCancelBtn,g=void 0===v||v,x=e.okButtonProps,b=void 0===x?{}:x,y=e.onCancel,C=void 0===y?function(){}:y,S=e.onOk,j=void 0===S?function(){}:S,O=e.className,w=void 0===O?"":O;return(0,d.jsx)("div",{className:u()(i,w),children:(0,d.jsxs)("div",{className:l,children:[g&&(0,d.jsx)(a.ZP,{size:"middle",className:"".concat(r," mr20"),onClick:C,children:n}),f&&(0,d.jsx)(a.ZP,s()(s()({size:"middle",type:"primary",className:"".concat(r," mr20"),loading:p,onClick:j},b),{},{children:c}))]})})}},76810:function(e,t,n){n.d(t,{h:function(){return g}});var o=n(82242),s=n.n(o),a=n(79800),i=n.n(a),r=n(59301),l=n(57809),c=n(78241),u=n(3113),d=n(89780),m=n.n(d),p=(n(82963),n(55286),n(37712)),h=l.default.Option,f={labelCol:{span:4},wrapperCol:{span:20}},v={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 g(e){var t=e.value,n=e.onChange,o=e.mode,a=e.options,l=void 0===a?{}:a,c=(0,r.useRef)(),u=(0,r.useState)(),d=i()(u,2),h=d[0],f=d[1];return(0,r.useEffect)((function(){if(h){var e=function(e){var t=e.getValue();n&&n(t)};return h.on("change",e),function(){h.off("change",e)}}}),[h,n]),(0,r.useEffect)((function(){h&&h.setOption("mode",o)}),[h,o]),(0,r.useEffect)((function(){h&&(t===h.getValue()&&""!==t||setTimeout((function(){h.setValue(t||"")}),300))}),[h,t]),(0,r.useEffect)((function(){if(c.current&&!h){var e=m().fromTextArea(c.current,s()({mode:o,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));f(e)}}),[c.current,h]),(0,p.jsx)("div",{className:"my-codemirror-container",children:(0,p.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,o=(0,r.useState)("python"),a=i()(o,2),d=a[0],m=a[1];return(0,p.jsxs)(c.Z,s()(s()({},f),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,p.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,p.jsx)(l.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){m(v[e][1])},children:Object.keys(v).map((function(e){return(0,p.jsx)(h,{value:e,children:v[e][0]},e)}))})}),(0,p.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,p.jsx)(g,{mode:d})}),(0,p.jsxs)("div",{className:"flex-container flex-end",children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},20950:function(e,t,n){n.r(t),n.d(t,{default:function(){return w}});var o=n(82242),s=n.n(o),a=n(7557),i=n.n(a),r=n(41498),l=n.n(r),c=n(79800),u=n.n(c),d=n(39647),m=n.n(d),p=n(59301),h=n(97682),f=n(78241),v=n(92832),g=n(76810),x=n(64261),b="bg___YV4bB",y="wrap___kzW1f",C="title___qum64",S="width240___QOLSj",j=n(37712),O=["shixunsDetail","globalSetting","loading","user","dispatch"],w=(0,h.connect)((function(e){var t=e.shixunsDetail,n=e.loading;return{shixunsDetail:t,globalSetting:e.globalSetting,user:e.user,loading:n.models.index}}))((function(e){e.shixunsDetail,e.globalSetting,e.loading,e.user;var t=e.dispatch,n=(m()(e,O),(0,h.useLocation)()),o=(0,p.useState)({}),a=u()(o,2),r=(a[0],a[1]),c=(0,p.useRef)(),d=(0,p.useRef)(),w=f.Z.useForm(),N=u()(w,1)[0],k=(0,p.useState)(""),_=u()(k,2),I=_[0],Z=_[1];(0,p.useEffect)((function(){return t({type:"globalSetting/footerToggle",payload:!1}),function(){t({type:"globalSetting/footerToggle",payload:!0})}}),[]),(0,p.useEffect)((function(){var e=sessionStorage.getItem("pathArray");if(e){var t=e.split(",").join("/"),n=0===t.indexOf("/")?t.substr(1):t;Z(n)}}),[]),(0,p.useEffect)((function(){var e,t;d.current=null===(e=n.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[2],c.current="repository"===(null===(t=n.pathname)||void 0===t||null===(t=t.split("/"))||void 0===t?void 0:t[3])}),[]);var E=function(){var e=l()(i()().mark((function e(){var n,o,s=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>0&&void 0!==s[0]?s[0]:{},e.next=3,t({type:"shixunsDetail/addRepositoryFile",payload:{id:d.current,message:n.commitMessage,content:n.codeMirror,path:"".concat(I?"".concat(I,"/"):"").concat(n.path||""),secret_repository:!c.current||void 0}});case 3:e.sent&&(o=c.current?"/shixuns/".concat(d.current,"/repository").concat(I?"/master/shixun_show/".concat(I):""):"/shixuns/".concat(d.current,"/secret_repository"),h.history.replace(o));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,j.jsx)("section",{className:b,children:(0,j.jsxs)("div",{className:y,children:[(0,j.jsx)("div",{className:C,children:"新建文件"}),(0,j.jsxs)(f.Z,{className:"mt10",form:N,scrollToFirstError:!0,layout:"vertical",onFinish:E,onValuesChange:function(){return r(s()({},N.getFieldsValue()))},children:[(0,j.jsxs)(f.Z.Item,{label:"文件名称或文件路径:",children:[(0,j.jsx)(f.Z.Item,{name:"path",rules:[{required:!0,message:"请输入文件名称或文件路径"},{whitespace:!0,message:"请勿输入空格"}],noStyle:!0,children:(0,j.jsxs)("span",{children:[(0,j.jsx)("span",{className:"mr5",children:I?"".concat(I,"/"):""}),(0,j.jsx)(v.Z,{className:S,placeholder:"请输入文件名称或文件路径"})]})}),(0,j.jsx)("span",{className:"ml5",children:"提示:1.输入文件名可以创建一个新文件;2.输入新文件夹名/新文件名可以创建新文件夹和新文件。(如:step1/HelloWorld.java)"})]}),(0,j.jsx)(f.Z.Item,{label:"提交信息:",name:"commitMessage",rules:[{required:!0,message:"请输入提交信息"},{whitespace:!0,message:"请勿输入空格"}],children:(0,j.jsx)(v.Z,{placeholder:"请输入本次提交的主要信息,合理的描述信息有利于代码历史记录的管理"})}),(0,j.jsx)("div",{className:"mt10 mb20",children:(0,j.jsx)(f.Z.Item,{name:"codeMirror",rules:[{required:!0,message:"请输入文件内容"}],children:(0,j.jsx)(g.h,{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"]}})})}),(0,j.jsx)(f.Z.Item,{noStyle:!0,children:(0,j.jsx)(x.t,{okButtonProps:{htmlType:"submit"},onCancel:function(){var e;h.history.push("/shixuns/".concat(d.current,"/").concat(null===(e=n.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[3]).concat(I?"/master/shixun_show/".concat(I):""))}})})]})]})})}))},57809:function(e,t,n){var o=n(92310),s=n.n(o),a=n(77861),i=n(55405),r=n(59301),l=n(53487),c=n(62892),u=n(19080),d=n(36355),m=n(1684),p=n(93891),h=n(19716),f=n(32441),v=n(33234),g=n(14154),x=n(58582),b=n(84443),y=n(66339),C=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(n[o[s]]=e[o[s]])}return n};const S="SECRET_COMBOBOX_MODE_DO_NOT_USE",j=(e,t)=>{var n,{prefixCls:o,bordered:l=!0,className:j,rootClassName:O,getPopupContainer:w,popupClassName:N,dropdownClassName:k,listHeight:_=256,placement:I,listItemHeight:Z=24,size:E,disabled:M,notFoundContent:P,status:B,builtinPlacements:D,dropdownMatchSelectWidth:F,popupMatchSelectWidth:$,direction:T,style:A,allowClear:R}=e,W=C(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:L,getPrefixCls:H,renderEmpty:V,direction:q,virtual:z,popupMatchSelectWidth:U,popupOverflow:X,select:Y}=r.useContext(d.E_),G=H("select",o),J=H(),K=null!=T?T:q,{compactSize:Q,compactItemClassnames:ee}=(0,v.ri)(G,K),[te,ne]=(0,g.Z)(G),oe=r.useMemo((()=>{const{mode:e}=W;if("combobox"!==e)return e===S?"combobox":e}),[W.mode]),se="multiple"===oe||"tags"===oe,ae=(0,b.Z)(W.suffixIcon,W.showArrow),ie=null!==(n=null!=$?$:F)&&void 0!==n?n:U,{status:re,hasFeedback:le,isFormItemInput:ce,feedbackIcon:ue}=r.useContext(f.aM),de=(0,u.F)(re,B);let me;me=void 0!==P?P:"combobox"===oe?null:(null==V?void 0:V("Select"))||r.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:he,removeIcon:fe,clearIcon:ve}=(0,y.Z)(Object.assign(Object.assign({},W),{multiple:se,hasFeedback:le,feedbackIcon:ue,showSuffixIcon:ae,prefixCls:G,showArrow:W.showArrow,componentName:"Select"})),ge=!0===R?{clearIcon:ve}:R,xe=(0,i.Z)(W,["suffixIcon","itemIcon"]),be=s()(N||k,{[`${G}-dropdown-${K}`]:"rtl"===K},O,ne),ye=(0,h.Z)((e=>{var t;return null!==(t=null!=E?E:Q)&&void 0!==t?t:e})),Ce=r.useContext(m.Z),Se=null!=M?M:Ce,je=s()({[`${G}-lg`]:"large"===ye,[`${G}-sm`]:"small"===ye,[`${G}-rtl`]:"rtl"===K,[`${G}-borderless`]:!l,[`${G}-in-form-item`]:ce},(0,u.Z)(G,de,le),ee,null==Y?void 0:Y.className,j,O,ne),Oe=r.useMemo((()=>void 0!==I?I:"rtl"===K?"bottomRight":"bottomLeft"),[I,K]),we=(0,x.Z)(D,X);return te(r.createElement(a.ZP,Object.assign({ref:t,virtual:z,showSearch:null==Y?void 0:Y.showSearch},xe,{style:Object.assign(Object.assign({},null==Y?void 0:Y.style),A),dropdownMatchSelectWidth:ie,builtinPlacements:we,transitionName:(0,c.m)(J,"slide-up",W.transitionName),listHeight:_,listItemHeight:Z,mode:oe,prefixCls:G,placement:Oe,direction:K,suffixIcon:pe,menuItemSelectedIcon:he,removeIcon:fe,allowClear:ge,notFoundContent:me,className:je,getPopupContainer:w||L,dropdownClassName:be,disabled:Se})))};const O=r.forwardRef(j),w=(0,l.Z)(O);O.SECRET_COMBOBOX_MODE_DO_NOT_USE=S,O.Option=a.Wx,O.OptGroup=a.Xo,O._InternalPanelDoNotUseOrYouWillBeFired=w,t.default=O},8378:function(e,t){t.Z=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}})}}]); |