|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[93495],{23159:function(e,n,t){t.d(n,{t:function(){return m}});var l=t(82242),i=t.n(l),s=(t(59301),t(3113)),a="buttonFixed___vyq30",c="button___hxmYv",r="buttonWrap___uK8dl",u=t(92310),o=t.n(u),d=t(37712),m=function(e){var n=e.cancelText,t=void 0===n?"取消":n,l=e.okText,u=void 0===l?"确定":l,m=e.loading,v=void 0!==m&&m,h=e.hasOkBtn,p=void 0===h||h,f=e.hasCancelBtn,x=void 0===f||f,_=e.okButtonProps,j=void 0===_?{}:_,g=e.onCancel,Z=void 0===g?function(){}:g,y=e.onOk,b=void 0===y?function(){}:y,N=e.className,w=void 0===N?"":N;return(0,d.jsx)("div",{className:o()(a,w),children:(0,d.jsxs)("div",{className:r,children:[x&&(0,d.jsx)(s.ZP,{size:"middle",className:"".concat(c," mr20"),onClick:Z,children:t}),p&&(0,d.jsx)(s.ZP,i()(i()({size:"middle",type:"primary",className:"".concat(c," mr20"),loading:v,onClick:b},j),{},{children:u}))]})})}},83481:function(e,n,t){t.d(n,{Z:function(){return G}});var l=t(37205),i=t.n(l),s=t(82242),a=t.n(s),c=t(7557),r=t.n(c),u=t(41498),o=t.n(u),d=t(79800),m=t.n(d),v=t(59301),h=t(81322),p=t(36381),f=t(92832),x=t(78241),_=t(8591),j=t(43418),g=t(24905),Z=t(6848),y=t(94001),b=t(5112),N=t(81327),w=t(95237),k=t(57809),C=t(78673),F=t(23159),P=t(84505),S="wrap___BgpUe",E="row___UWxAG",I="textarea___gaLin",T="btn___ZpuhS",L="sub___Jd_ZS",z=t(76533),O=t(25600),B=t(97600),J=t(37712),V=p.Z.Panel,q=f.Z.TextArea,G=function(e){var n,t=e.active,l=e.type,s=void 0===l?"jupyter":l,c=(0,h.useParams)(),u=x.Z.useForm(),d=m()(u,1)[0],f=(0,v.useState)({}),G=m()(f,2),R=G[0],W=G[1],U=(0,v.useState)(!1),A=m()(U,2),K=A[0],D=A[1],H=(0,v.useState)(0),Y=m()(H,2),M=Y[0],X=Y[1],Q=(0,v.useState)([]),$=m()(Q,2),ee=$[0],ne=$[1],te=(0,v.useState)([]),le=m()(te,2),ie=le[0],se=le[1],ae=(0,v.useState)([]),ce=m()(ae,2),re=ce[0],ue=ce[1],oe=null===(n=(0,B.eY)())||void 0===n||null===(n=n.shixun)||void 0===n?void 0:n.editable;(0,v.useEffect)((function(){"testCase"===t&&de()}),[t]),(0,v.useEffect)((function(){me()}),[]);var de=function(){var e=o()(r()().mark((function e(){var n,t,l,i,s,a,u,o,m,v,h,p,f,x,_,j;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[{hidden:0,input:"",output:"",score:100}],e.next=3,(0,O.ZP)("/api/shixuns/".concat(null==c?void 0:c.id,"/jupyter_evalute_setting.json"),{method:"get"});case 3:0===(null==(t=e.sent)?void 0:t.status)&&(ue(null==t||null===(l=t.data)||void 0===l?void 0:l.standard_scripts),j={open_evaluate:null==t||null===(i=t.data)||void 0===i?void 0:i.open_evaluate,exec_time:(null==t||null===(s=t.data)||void 0===s?void 0:s.exec_time)||3,test_set_score:null!==(null==t||null===(a=t.data)||void 0===a?void 0:a.test_set_score)&&(null==t||null===(u=t.data)||void 0===u?void 0:u.test_set_score),test_set_average:null===(null==t||null===(o=t.data)||void 0===o?void 0:o.test_set_average)||(null==t||null===(m=t.data)||void 0===m?void 0:m.test_set_average),choice_standard_scripts:(null==t||null===(v=t.data)||void 0===v?void 0:v.choice_standard_scripts)||null,evaluate_script:(null==t||null===(h=t.data)||void 0===h?void 0:h.evaluate_script)||"",evaluate_method:null==t||null===(p=t.data)||void 0===p?void 0:p.evaluate_method,use_jupyter_result:null==t||null===(f=t.data)||void 0===f?void 0:f.use_jupyter_result},d.setFieldsValue(j),W(j),ne(null!=t&&null!==(x=t.data)&&void 0!==x&&null!==(x=x.test_sets)&&void 0!==x&&x.length?null==t||null===(_=t.data)||void 0===_?void 0:_.test_sets:n));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=o()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,O.ZP)("/api/shixuns/".concat(null==c?void 0:c.id,"/get_jupyter_tags.json"),{method:"get"});case 2:0===(null==(n=e.sent)?void 0:n.status)&&se((null==n||null===(t=n.data)||void 0===t?void 0:t.list)||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=o()(r()().mark((function e(n){var t,l;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ee.map((function(e){return e.score})),l=t.reduce((function(e,n){return e+n}),0),!n.test_set_score||100===l){e.next=5;break}return _.ZP.warning("测试用例的评分占比之和必须等于100"),e.abrupt("return");case 5:if(3!==n.evaluate_method||null==ee||!ee.some((function(e){return!e.tags}))){e.next=8;break}return _.ZP.warning("请选择指定代码块"),e.abrupt("return");case 8:return D(!0),e.next=11,(0,O.ZP)("/api/shixuns/".concat(null==c?void 0:c.id,"/update_jupyter_evaluate_setting.json"),{method:"post",body:a()(a()({},n),{},{mirror_script_id:null==n?void 0:n.choice_standard_scripts,open_evaluate:null!=n&&n.open_evaluate?1:0,test_set:ee.map((function(e){return a()(a()({},e),{},{is_file:!1})}))})});case 11:0===e.sent.status&&_.ZP.success("保存成功"),D(!1);case 14:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),he=function(e){var n=Math.floor(100/e.length),t=n+100%e.length;e=e.map((function(l,i){return i===e.length-1?a()(a()({},l),{},{score:t}):a()(a()({},l),{},{score:n})})),ne(e)},pe=R.test_set_score,fe=R.test_set_average,xe=(R.choice_standard_scripts,R.open_evaluate);return(0,J.jsxs)("section",{className:S,children:[(0,J.jsxs)(x.Z,{form:d,disabled:!xe,layout:"vertical",onValuesChange:function(e){var n;W(a()({},d.getFieldsValue())),"test_set_average"in e&&null!=e&&e.test_set_average&&he(ee),"test_set_score"in e&&null!=e&&e.test_set_score&&(d.setFieldsValue({test_set_average:!0}),W(a()(a()({},d.getFieldsValue()),{},{test_set_average:!0})),he(ee)),"choice_standard_scripts"in e&&j.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,J.jsxs)("div",{className:"tc font16",children:["原有脚本将被新的脚本覆盖,无法撤销",(0,J.jsx)("br",{}),"是否确认执行覆盖操作"]}),onOk:(n=o()(r()().mark((function n(){var t;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,O.ZP)("/api/shixuns/".concat(null==c?void 0:c.id,"/get_script_contents.json"),{method:"get",params:{id:null==c?void 0:c.id,script_id:null==e?void 0:e.choice_standard_scripts}});case 2:null!=(t=n.sent)&&t.content&&(j.Z.info({centered:!0,title:"提示",okText:"知道啦",content:(0,J.jsx)("div",{className:"tc font16",children:"评测脚本生成成功!"})}),d.setFieldsValue({evaluate_script:null==t?void 0:t.content}),W(a()(a()({},d.getFieldsValue()),{},{evaluate_script:null==t?void 0:t.content})));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},onFinish:ve,children:[(0,J.jsx)(x.Z.Item,{name:"open_evaluate",style:{marginTop:10},valuePropName:"checked",children:(0,J.jsx)(g.Z,{disabled:!1,children:"启用Jupyter评测功能"})}),(0,J.jsx)("h4",{className:"font14",children:"评测时长限制"}),(0,J.jsx)(Z.Z,{title:!xe&&"请启用Jupyter评测功能后,进行编辑",placement:"topLeft",children:(0,J.jsx)(x.Z.Item,{label:"评测时长(秒):",name:"exec_time",className:E,rules:[{required:!0,message:"请输入评测时长限制"},{type:"number",min:3,message:"最小限制时间是3秒"}],children:(0,J.jsx)(y.Z,{size:"large",style:{width:400},min:3})})}),(0,J.jsx)("h4",{className:"font14 mb10",children:"系统评分规则"}),(0,J.jsx)(Z.Z,{title:!xe&&"请启用Jupyter评测功能后,进行编辑",placement:"topLeft",children:(0,J.jsx)(x.Z.Item,{name:"test_set_score",children:(0,J.jsx)(b.ZP.Group,{children:(0,J.jsxs)(N.Z,{direction:"vertical",children:[(0,J.jsxs)(b.ZP,{value:!1,children:["通过全部测试集",(0,J.jsx)("span",{className:"c-grey-999",children:" (学员评测,仅当所有测试集都正确时,才获得一次性奖励)"})]}),(0,J.jsxs)(b.ZP,{value:!0,children:["通过部分测试集",(0,J.jsx)("span",{className:"c-grey-999",children:" (学员评测,通过测试集即可获得对应奖励)"})]})]})})})}),(0,J.jsx)(x.Z.Item,{label:(0,J.jsx)("span",{style:{fontWeight:500},className:"c-black",children:"评测设置"}),name:"evaluate_method",style:{flexDirection:"row",marginTop:15},rules:[{required:!0,message:"请选择评测设置"}],children:(0,J.jsx)(b.ZP.Group,{children:(0,J.jsxs)(N.Z,{direction:"vertical",children:[(0,J.jsxs)(b.ZP,{value:1,children:["通过所有代码块评测",(0,J.jsx)("span",{className:"c-grey-999",children:" (对学员任务文件的所有非空代码块进行评测)"})]}),(0,J.jsxs)(b.ZP,{value:3,children:["通过指定代码块评测",(0,J.jsx)("span",{className:"c-grey-999",children:" (对学员任务文件的指定非空代码块进行评测)"})]})]})})}),(0,J.jsxs)(w.Z,{align:"middle",justify:"space-between",className:"font14",children:[(0,J.jsxs)("div",{style:{fontWeight:500},children:[(0,J.jsx)("span",{className:L,children:"*"}),"测试用例"]}),(0,J.jsx)(Z.Z,{title:!xe&&"请启用Jupyter评测功能后,进行编辑",placement:"topLeft",children:(0,J.jsx)(P.op,{style:{borderRadius:2},onClick:function(){var e=[].concat(i()(ee),[{hidden:0,input:"",output:"",score:0}]);d.getFieldValue("test_set_average")?he(e):ne(e)},children:"添加测试用例"})})]}),pe&&(0,J.jsx)(x.Z.Item,{name:"test_set_average",children:(0,J.jsxs)(b.ZP.Group,{children:[(0,J.jsx)(b.ZP,{value:!0,children:"均分比例"}),(0,J.jsx)(b.ZP,{value:!1,style:{marginLeft:50},children:"自定义比例"})]})}),(0,J.jsx)(Z.Z,{title:!xe&&"请启用Jupyter评测功能后,进行编辑",placement:"topLeft",children:(0,J.jsx)("div",{children:ee.map((function(e,n){return(0,J.jsx)(p.Z,{activeKey:M,onChange:function(){X((function(e){return e===n?null:n}))},children:(0,J.jsx)(V,{header:(0,J.jsxs)("div",{className:"font16",children:[(0,J.jsxs)("span",{className:"mr10",children:["测试用例",n+1]}),R.test_set_score&&(0,J.jsxs)("span",{style:{marginLeft:40},children:[(0,J.jsx)(y.Z,{style:{width:120},value:e.score,onClick:function(e){return e.stopPropagation()},min:0,max:100,precision:0,onBlur:function(e){if(Number(e)<0||Number(e)>100){_.ZP.info("测试用例的权重比例值限制为 0-100");var t=ee.map((function(e,t){return t===n?a()(a()({},e),{},{score:100}):e})),l={test_set_average:!1};W(a()(a()({},R),l)),d.setFieldsValue(l),ne(t)}},disabled:fe,onChange:function(e){var t=ee.map((function(t,l){return l===n?a()(a()({},t),{},{score:e?Number(e):0}):t})),l={test_set_average:!1};W(a()(a()({},R),l)),d.setFieldsValue(l),ne(t)}}),(0,J.jsx)("span",{className:"ml10 mr10",children:"%"})]}),(0,J.jsx)("span",{className:"tr flex1",style:{float:"right"},children:0!==n&&(0,J.jsx)(Z.Z,{placement:"bottom",title:"删除",children:(0,J.jsx)("span",{style:{color:"#c5c5c5"},className:"current iconfont icon-shanchu4",onClick:function(e){e.stopPropagation(),j.Z.confirm({centered:!0,icon:null,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个测试用例吗?",onOk:function(){var e=ee.filter((function(e,t){return t!==n}));he(e)}})}})})})]}),children:(0,J.jsxs)("div",{children:[3===R.evaluate_method&&(0,J.jsxs)(w.Z,{align:"middle",className:"mb20",children:[(0,J.jsxs)("div",{children:[(0,J.jsx)("span",{className:L,children:"*"}),(0,J.jsx)("span",{children:"指定代码块"}),(0,J.jsx)(Z.Z,{title:"请先在Jupyter中对您需要评测的指定代码块完成标签设置。",children:(0,J.jsx)("i",{style:{marginLeft:6,marginRight:20,color:"#145DFF"},className:"iconfont icon-xiaowenhao2 font14"})})]}),(0,J.jsx)(k.default,{value:e.tags,size:"large",style:{width:450},onChange:function(e){var t=ee.map((function(t,l){return l===n?a()(a()({},t),{},{tags:e}):t}));ne(t)},children:null==ie?void 0:ie.map((function(e){return(0,J.jsx)(k.default.Option,{value:null==e?void 0:e.tags,children:null==e?void 0:e.tags},null==e?void 0:e.tags)}))})]}),(0,J.jsxs)(w.Z,{align:"middle",children:[(0,J.jsxs)("div",{children:[" ",(0,J.jsx)("span",{children:"预期输出"})]}),(0,J.jsx)(q,{bordered:!1,className:I,rows:5,placeholder:"预期输出",value:e.output,onChange:function(e){var t=ee.map((function(t,l){return l===n?a()(a()({},t),{},{output:e.target.value}):t}));ne(t)}})]}),(0,J.jsxs)(w.Z,{className:"mt20",align:"middle",children:[(0,J.jsxs)("div",{children:[(0,J.jsx)("span",{children:"可见性"}),(0,J.jsx)(Z.Z,{title:(0,J.jsxs)("div",{children:[(0,J.jsx)("div",{children:'全部隐藏:隐藏测试集可以防止学生通过"print"等手段直接通关'}),(0,J.jsx)("div",{children:"隐藏预期输出:勾选后预期输出对学员始终不可见"}),(0,J.jsx)("div",{children:"隐藏实际输出:勾选后实际输出对学员始终不可见"})]}),children:(0,J.jsx)("i",{style:{marginLeft:6,marginRight:13,color:"#145DFF"},className:"iconfont icon-xiaowenhao2 font14"})})]}),(0,J.jsx)("div",{children:(0,J.jsx)(g.Z,{className:"font14 ml5",checked:1===e.hidden,onChange:function(e){var t=ee.map((function(t,l){if(l===n){var i={is_invisible:!1,actual_output_visible:!1};return e.target.checked&&(i={is_invisible:!0,actual_output_visible:!0}),a()(a()(a()({},t),i),{},{hidden:e.target.checked?1:0})}return t}));ne(t)},children:"全部隐藏"})}),(0,J.jsx)(g.Z,{checked:e.is_invisible,style:{margin:"0 60px"},onChange:function(e){var t=ee.map((function(t,l){if(l===n){var i=0;return e.target.checked&&t.actual_output_visible&&(i=1),a()(a()({},t),{},{hidden:i,is_invisible:e.target.checked})}return t}));ne(t)},children:"隐藏预期输出"}),(0,J.jsx)(g.Z,{checked:e.actual_output_visible,onChange:function(e){var t=ee.map((function(t,l){if(l===n){var i=0;return e.target.checked&&t.is_invisible&&(i=1),a()(a()({},t),{},{hidden:i,actual_output_visible:e.target.checked})}return t}));ne(t)},children:"隐藏实际输出"})]}),(0,J.jsxs)("div",{className:"mt20",children:[(0,J.jsx)("span",{className:"font14 mr20",children:"特殊判定:"}),(0,J.jsx)(g.Z,{checked:e.last_match_rule,onChange:function(e){var t=ee.map((function(t,l){return l===n?a()(a()({},t),{},{last_match_rule:e.target.checked}):t}));ne(t)},children:(0,J.jsxs)("span",{className:"font14",children:["末尾匹配",(0,J.jsx)("span",{className:"font12 c-light-black",children:"(实际输出与预期输出最后一行相同即可通关)"})]})})]})]})},n)},n)}))})}),(0,J.jsxs)("h4",{className:"font14 mt20 mb10",children:[(0,J.jsx)("span",{className:L,children:"*"}),"评测脚本"]}),(0,J.jsx)(Z.Z,{title:!xe&&"请启用Jupyter评测功能后,进行编辑",placement:"topLeft",children:(0,J.jsx)(x.Z.Item,{name:"choice_standard_scripts",rules:[{required:!0,message:"请选择评测脚本"}],children:(0,J.jsx)(k.default,{getPopupContainer:function(e){return e.parentNode},size:"large",style:{width:400},placeholder:"请选择评测脚本",children:re.map((function(e,n){return(0,J.jsx)(k.default.Option,{value:e.id,children:e.scptname},n)}))})})}),(0,J.jsx)(Z.Z,{title:!xe&&"请启用Jupyter评测功能后,进行编辑",placement:"topLeft",children:(0,J.jsx)(x.Z.Item,{name:"evaluate_script",children:(0,J.jsx)(z.ZP,{height:450,style:{border:"1px solid #ccc"},language:"shell",theme:"vs-light",options:{readOnly:!xe}})})}),(0,B.Ny)()&&(0,J.jsxs)(w.Z,{className:"mb20",align:"middle",children:[(0,J.jsx)(x.Z.Item,{name:"use_jupyter_result",className:"mt10",valuePropName:"checked",noStyle:!0,children:(0,J.jsx)(C.Z,{})}),(0,J.jsx)("div",{className:"ml10",children:"是否沿用Jupyter运行结果"})]})]}),(0,J.jsx)(F.t,{okText:"保存",hasOkBtn:oe,loading:K,onCancel:function(){return h.history.push("/shixuns/".concat(null==c?void 0:c.id,"/challenges"))},onOk:function(){return d.submit()},className:"jupyterLab"===s?T:""})]})}},8732:function(e,n,t){t.d(n,{Z:function(){return k}});var l=t(7557),i=t.n(l),s=t(41498),a=t.n(s),c=t(82242),r=t.n(c),u=t(79800),o=t.n(u),d=t(59301),m=t(43418),v=t(3113),h=t(8591),p=t(99313),f=t(71418),x=t(10311),_=t(94001),j=t(51945),g={modal:"modal___aF6vS",con_warp:"con_warp___W1gHS",flex:"flex___Cbe__",config_Warp:"config_Warp___lXnUZ",config_btn:"config_btn___OAH7T",sceneList:"sceneList___N5Y3k",sceneItem:"sceneItem____bE1H",sceneItemActive:"sceneItemActive___e82B8"},Z=t(72826),y=t(67147),b=t(25600),N=t(64461),w=t(37712),k=function(e){var n,t,l,s=e.visible,c=e.onOk,u=e.onCancel,k=e.info,C=(0,d.useState)("1"),F=o()(C,2),P=F[0],S=F[1],E=(0,d.useState)([]),I=o()(E,2),T=I[0],L=I[1],z=(0,d.useState)([]),O=o()(z,2),B=O[0],J=O[1],V=(0,d.useState)(0),q=o()(V,2),G=q[0],R=q[1],W=(0,d.useState)(null),U=o()(W,2),A=U[0],K=U[1],D=(0,d.useState)(!1),H=o()(D,2),Y=H[0],M=H[1];(0,d.useEffect)((function(){s&&(X(),Q(),$())}),[s]);var X=function(){S("1"),L([]),K(null),R(0)};(0,d.useEffect)((function(){var e;(null==B||null===(e=B[G])||void 0===e||null===(e=e.content)||void 0===e?void 0:e.length)>0&&K(r()(r()({},B[G].content[0]),{},{index:0}))}),[P,G,B]);var Q=function(){var e=a()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),e.next=3,(0,b.ZP)("/api/home/cpu_memory_limit.json",{method:"GET"}).then((function(e){var n=e.max_cpu,t=e.max_memory,l=e.min_cpu,i=e.min_memory,s=k.cpu,a=k.memory;L([{name:"CPU",value:s,min:l,max:n,typeName:"核"},{name:"内存",value:a,min:i,max:t,typeName:"GB"}])}));case 3:M(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=a()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.ZP)("/api/home/example_cpu_list.json",{method:"GET"}).then((function(e){if(J(e),(null==e?void 0:e.length)>0){var n,t=r()(r()({},null==e||null===(n=e[0])||void 0===n?void 0:n.content[0]),{},{index:0});K(t)}}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(e,n){L(T.map((function(t){return t.name===e?n(t):t})))};return(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(m.Z,{title:"资源配置",open:s,width:752,destroyOnClose:!0,centered:!0,onCancel:u,className:g.modal,footer:[(0,w.jsxs)("div",{className:g.btn_warp,children:[(0,w.jsx)(v.ZP,{onClick:u,children:"取消"}),(0,w.jsx)(v.ZP,{type:"primary",onClick:function(){var e=r()({},k);if("1"==P)e.cpu=T[0].value,e.memory=T[1].value;else if("2"==P){if(!A)return void h.ZP.error("请选择一条场景对应的CPU与内存");e=r()(r()({},e),{},{cpu:A.cpu,memory:A.memory})}c(e)},children:"保存"})]},"1")],children:(0,w.jsxs)(p.Z,{activeKey:P,onChange:function(e){S(e),"2"===e&&R(0)},children:[(0,w.jsx)(p.Z.TabPane,{tab:"自定义配置",children:(0,w.jsx)(f.Z,{spinning:Y,children:null==T?void 0:T.map((function(e){return(0,w.jsxs)("div",{className:g.con_warp,children:[(0,w.jsx)("div",{children:null==e?void 0:e.name}),(0,w.jsx)("div",{children:(0,w.jsx)(x.Z,{min:null==e?void 0:e.min,max:null==e?void 0:e.max,onChange:function(n){return t=n,l=null==e?void 0:e.name,void(isNaN(t)||ee(l,(function(e){return r()(r()({},e),{},{value:t})})));var t,l},value:null==e?void 0:e.value,step:.5,style:{width:482,height:6,margin:"0 20px 0 12px"}})}),(0,w.jsxs)("div",{className:"".concat(g.config_Warp," ").concat(g.flex),children:[(0,w.jsx)("div",{className:"".concat(g.config_btn," ").concat(g.flex),onClick:function(){return function(e){var n;if(console.log("decline",e.value),e.value=Number(e.value),!(e.value<=(null!==(n=e.min)&&void 0!==n?n:-1/0))){var t=e.value-.5<e.min?e.min:e.value-.5;ee(e.name,(function(e){return r()(r()({},e),{},{value:t})}))}}(e)},children:(0,w.jsx)(Z.Z,{})}),(0,w.jsx)(_.Z,{min:null==e?void 0:e.min,max:null==e?void 0:e.max,size:"large",step:"0.1",controls:!1,style:{width:50},value:null==e?void 0:e.value,onChange:function(n){!function(e,n){isNaN(e)||ee(n,(function(n){return r()(r()({},n),{},{value:e})}))}(function(e){if(null==e)return e;if(Number.isInteger(e))return e;var n=e%1;return.5===n?e:Math.floor(e)+(n<.5?.5:1)}(n),null==e?void 0:e.name)}}),(0,w.jsx)("div",{className:"".concat(g.config_btn," ").concat(g.flex),onClick:function(){return function(e){var n;if(e.value=Number(e.value),!(e.value>=(null!==(n=e.max)&&void 0!==n?n:1/0))){var t=e.value+.5>e.max?e.max:e.value+.5;ee(e.name,(function(e){return r()(r()({},e),{},{value:t})}))}}(e)},children:(0,w.jsx)(y.Z,{})})]}),(0,w.jsx)("div",{children:null==e?void 0:e.typeName})]},null==e?void 0:e.name)}))})},1),(null==B?void 0:B.length)>0&&(0,w.jsxs)(p.Z.TabPane,{tab:"按场景选择",children:[(0,w.jsx)("div",{className:g.sceneList,children:null==B?void 0:B.map((function(e,n){return(0,w.jsx)("div",{className:"".concat(g.sceneItem," ").concat(G==n&&g.sceneItemActive),onClick:function(){R(n)},children:null==e?void 0:e.name},null==e?void 0:e.id)}))}),(null==B||null===(n=B[G])||void 0===n||null===(n=n.content)||void 0===n?void 0:n.length)>0?(0,w.jsx)(j.Z,{rowSelection:{type:"radio",selectedRowKeys:[null==A?void 0:A.index],onChange:function(e,n){K(n[0])}},columns:[{title:"CPU",dataIndex:"cpu",align:"center",render:function(e,n){return(0,w.jsxs)("div",{children:[e,"核"]})}},{title:"内存",dataIndex:"memory",align:"center",render:function(e,n){return(0,w.jsxs)("div",{children:[e,"GB"]})}}],dataSource:null==B||null===(t=B[G])||void 0===t?void 0:t.content.map((function(e,n){return r()(r()({},e),{},{index:n})})),rowKey:"index",pagination:!1,scroll:(null==B||null===(l=B[G])||void 0===l||null===(l=l.content)||void 0===l?void 0:l.length)>3?{y:148}:{}}):(0,w.jsx)(N.Z,{})]},2)]})})})}},98679:function(e,n,t){function l(e){try{e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}catch(e){console.log(e,":e")}}function i(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}t.d(n,{BU:function(){return i},Dj:function(){return l},gH:function(){return s},vp:function(){return a}});var s=function(){return document.webkitExitFullscreen?"webkitfullscreenchange":document.exitFullscreen?"fullscreenchange":document.msExitFullscreen?"msfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":void 0};function a(){var e=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement;document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",e),null!=e}}}]); |