|
|
|
@ -554,28 +554,27 @@ export default class TPMsettings extends Component {
|
|
|
|
|
}
|
|
|
|
|
Deselectlittle=(value)=>{
|
|
|
|
|
|
|
|
|
|
let {settingsData,shixun_service_configs,choice_small_type}=this.state;
|
|
|
|
|
let {shixun_service_configs,choice_small_type}=this.state;
|
|
|
|
|
let newshixun_service_configs=shixun_service_configs;
|
|
|
|
|
let newchoice_small_type=choice_small_type;
|
|
|
|
|
newchoice_small_type.some((items,keys)=> {
|
|
|
|
|
if (items === value) {
|
|
|
|
|
newchoice_small_type.splice(keys, 1)
|
|
|
|
|
|
|
|
|
|
newshixun_service_configs.some((item,key)=> {
|
|
|
|
|
if (item.mirror_repository_id === value) {
|
|
|
|
|
newshixun_service_configs.splice(key, 1)
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
settingsData.shixun.small_type.some((items,keys)=> {
|
|
|
|
|
if (items.id === value) {
|
|
|
|
|
newshixun_service_configs.splice(keys+1, 1)
|
|
|
|
|
newchoice_small_type.some((item,key)=> {
|
|
|
|
|
if (item === value) {
|
|
|
|
|
newchoice_small_type.splice(key, 1)
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
choice_small_type: newchoice_small_type,
|
|
|
|
|
shixun_service_configs:newshixun_service_configs,
|
|
|
|
@ -691,9 +690,11 @@ export default class TPMsettings extends Component {
|
|
|
|
|
opening_time,shixunmemoMDvalue,shixun_service_configlist
|
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
shixun_service_configlist.map((item,key)=>{
|
|
|
|
|
delete item.name;
|
|
|
|
|
})
|
|
|
|
|
let newshixun_service_configlist = shixun_service_configlist.map(v => {
|
|
|
|
|
let v1 = Object.assign({},v);
|
|
|
|
|
delete v1.name;
|
|
|
|
|
return v1
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
|
|
|
|
|
|
|
|
|
@ -788,7 +789,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
shixun:{
|
|
|
|
|
name: name,
|
|
|
|
|
webssh: webssh,
|
|
|
|
|
user_scope: use_scope,
|
|
|
|
|
use_scope: use_scope,
|
|
|
|
|
can_copy: can_copy,
|
|
|
|
|
vnc: vnc===null?undefined:vnc,
|
|
|
|
|
test_set_permission: test_set_permission,
|
|
|
|
@ -799,7 +800,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
forbid_copy: forbid_copy,
|
|
|
|
|
multi_webssh:newmulti_webssh,
|
|
|
|
|
opening_time:opening_time,
|
|
|
|
|
mirror_script_id:choice_standard_scriptssum,
|
|
|
|
|
mirror_script_id:choice_standard_scriptssum===undefined?choice_standard_scripts:choice_standard_scriptssum,
|
|
|
|
|
},
|
|
|
|
|
shixun_info:{
|
|
|
|
|
description: description_editormd,
|
|
|
|
@ -808,7 +809,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
main_type: choice_main_type,
|
|
|
|
|
small_type: choice_small_type,
|
|
|
|
|
scope_partment: scope_partment,
|
|
|
|
|
shixun_service_configs:shixun_service_configlist
|
|
|
|
|
shixun_service_configs:newshixun_service_configlist
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.put(Url, data).then((response) => {
|
|
|
|
@ -1115,7 +1116,33 @@ export default class TPMsettings extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inputs=()=>{
|
|
|
|
|
setConfigsInputs=(e,keys,str)=>{
|
|
|
|
|
|
|
|
|
|
let {shixun_service_configs}=this.state;
|
|
|
|
|
let newshixun_service_configs=shixun_service_configs;
|
|
|
|
|
newshixun_service_configs.map((item,key)=>{
|
|
|
|
|
if(key===keys){
|
|
|
|
|
switch (str) {
|
|
|
|
|
case 1:
|
|
|
|
|
item.cpu_limit=e.target.value
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
item.lower_cpu_limit=e.target.value
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
item.memory_limit=e.target.value
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
item.request_limit=e.target.value
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
shixun_service_configs:newshixun_service_configs,
|
|
|
|
|
shixun_service_configlist:newshixun_service_configs,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1355,7 +1382,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
<div className="width15 fl pr mr20" onMouseLeave={operateauthority?this.bigopens:""}>
|
|
|
|
|
<Select mode="multiple" placeholder="请选择小类别"
|
|
|
|
|
value={choice_small_type.length===0||choice_small_type[0]===""||choice_small_type===[]?undefined:choice_small_type}
|
|
|
|
|
style={{width: 180}}
|
|
|
|
|
style={{width: 180,height:30}}
|
|
|
|
|
disabled={operateauthority?false:true}
|
|
|
|
|
// onChange={operateauthority?this.littleClass:""}
|
|
|
|
|
onDeselect={operateauthority?this.Deselectlittle:""}
|
|
|
|
@ -1439,9 +1466,43 @@ export default class TPMsettings extends Component {
|
|
|
|
|
{
|
|
|
|
|
this.props.identity<5||this.props.power==true?
|
|
|
|
|
<a onClick={this.showModal} id="define_template"
|
|
|
|
|
className="color-orange-tip ml20 mt5 fl">使用自定义脚本</a> : ""
|
|
|
|
|
className="color-orange-tip ml20 mt1 fl">使用自定义脚本</a> : ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<div className="ml6 fl pr"
|
|
|
|
|
style={{display:operateauthority?'block':"none"}}
|
|
|
|
|
>
|
|
|
|
|
<a onClick={()=>this.testscripttip(0)}><img
|
|
|
|
|
src={getImageUrl("images/educoder/problem.png") }/></a>
|
|
|
|
|
<div className="invite-tip clearfix none " id="test_script_tip"
|
|
|
|
|
style={{top: '33px', right: '-6px',width: '271px',zIndex: '10',display: testscripttiptype===true?'block':"none"}}>
|
|
|
|
|
<span className="top-black-trangle"></span>
|
|
|
|
|
<div className="padding20 invitecontent clearfix">
|
|
|
|
|
<p className="font-12 edu-txt-left">
|
|
|
|
|
使用自定义模板,平台无法自动更新脚本,<br/>
|
|
|
|
|
请在关卡创建完后手动更新脚本中的必填参<br/>
|
|
|
|
|
数和以下2个数组元素:<br/>
|
|
|
|
|
challengeProgramNames<br/>
|
|
|
|
|
sourceClassNames<br/><br/>
|
|
|
|
|
示例:有2个关卡的实训<br/><br/>
|
|
|
|
|
各关卡的待编译文件为:<br/>
|
|
|
|
|
src/step1/HelloWorld.java<br/>
|
|
|
|
|
src/step2/Other.java<br/><br/>
|
|
|
|
|
各关卡的编译后生成的执行文件为:<br/>
|
|
|
|
|
step1.HelloWorld<br/>
|
|
|
|
|
step2.Other<br/><br/>
|
|
|
|
|
则数组元素更新如下:<br/>
|
|
|
|
|
challengeProgramNames=("src/step1/<br/>
|
|
|
|
|
HelloWorld.java" "src/step2/Other.java")<br/>
|
|
|
|
|
sourceClassNames=("step1.HelloWorld<br/>
|
|
|
|
|
" "step2.Other")<br/><br/>
|
|
|
|
|
其它参数可按实际需求定制
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<p className="inviteTipbtn with100 fl">
|
|
|
|
|
<a onClick={()=>this.testscripttip(1)}>知道了</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
@ -1518,41 +1579,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
{/*</div>*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="ml6 fl pr"
|
|
|
|
|
style={{display:operateauthority?'block':"none"}}
|
|
|
|
|
>
|
|
|
|
|
<a onClick={()=>this.testscripttip(0)}><img
|
|
|
|
|
src={getImageUrl("images/educoder/problem.png") }/></a>
|
|
|
|
|
<div className="invite-tip clearfix none " id="test_script_tip"
|
|
|
|
|
style={{top: '33px', right: '-6px',width: '271px',zIndex: '10',display: testscripttiptype===true?'block':"none"}}>
|
|
|
|
|
<span className="top-black-trangle"></span>
|
|
|
|
|
<div className="padding20 invitecontent clearfix">
|
|
|
|
|
<p className="font-12 edu-txt-left">
|
|
|
|
|
使用自定义模板,平台无法自动更新脚本,<br/>
|
|
|
|
|
请在关卡创建完后手动更新脚本中的必填参<br/>
|
|
|
|
|
数和以下2个数组元素:<br/>
|
|
|
|
|
challengeProgramNames<br/>
|
|
|
|
|
sourceClassNames<br/><br/>
|
|
|
|
|
示例:有2个关卡的实训<br/><br/>
|
|
|
|
|
各关卡的待编译文件为:<br/>
|
|
|
|
|
src/step1/HelloWorld.java<br/>
|
|
|
|
|
src/step2/Other.java<br/><br/>
|
|
|
|
|
各关卡的编译后生成的执行文件为:<br/>
|
|
|
|
|
step1.HelloWorld<br/>
|
|
|
|
|
step2.Other<br/><br/>
|
|
|
|
|
则数组元素更新如下:<br/>
|
|
|
|
|
challengeProgramNames=("src/step1/<br/>
|
|
|
|
|
HelloWorld.java" "src/step2/Other.java")<br/>
|
|
|
|
|
sourceClassNames=("step1.HelloWorld<br/>
|
|
|
|
|
" "step2.Other")<br/><br/>
|
|
|
|
|
其它参数可按实际需求定制
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<p className="inviteTipbtn with100 fl">
|
|
|
|
|
<a onClick={()=>this.testscripttip(1)}>知道了</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
@ -1791,13 +1818,14 @@ export default class TPMsettings extends Component {
|
|
|
|
|
<label style={{top:'6px'}} className="color-grey-9 ml10" >(为空,则学员在实训发布后,能随时开启实训挑战;否则,学员在开启时间后,才能开启实训挑战)</label>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="clearfix mt20 ml30">
|
|
|
|
|
|
|
|
|
|
{this.props.identity<3?<div className="clearfix mt20 ml30">
|
|
|
|
|
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化:</span>
|
|
|
|
|
<span className="fl mt5">
|
|
|
|
|
<Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox>
|
|
|
|
|
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口,否则不提供</label>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
{/*"name": "我是镜像名", # 镜像名称*/}
|
|
|
|
@ -1806,17 +1834,17 @@ export default class TPMsettings extends Component {
|
|
|
|
|
{/*"memory_limit": 1024 ,#内存限制*/}
|
|
|
|
|
{/*"request_limit": 10, # 内存要求*/}
|
|
|
|
|
{/*"mirror_repository_id": 12, # 镜像id*/}
|
|
|
|
|
<div className="edu-back-white padding40-20 mb20">
|
|
|
|
|
{this.props.identity<2?shixun_service_configs&&shixun_service_configs.map((item,key)=>{
|
|
|
|
|
{this.props.identity<3?<div className="edu-back-white padding40-20 mb20">
|
|
|
|
|
<p className="color-grey-6 font-16 mb30">服务配置</p>
|
|
|
|
|
{ shixun_service_configs&&shixun_service_configs.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<div key={key}>
|
|
|
|
|
<p className="color-grey-6 font-16 mb30">服务配置</p>
|
|
|
|
|
<div id="5">
|
|
|
|
|
<p className="color-grey-6 font-16 mt30 mb20" id="shixun_scenario_type_name">{item.name}</p>
|
|
|
|
|
<div className="clearfix mb5">
|
|
|
|
|
<label className="panel-form-label fl">CPU(核):</label>
|
|
|
|
|
<div className="pr fl with80 status_con">
|
|
|
|
|
<input type="text" name="cpu_limit[]" value={item.cpu_limit} onInput={this.inputs}
|
|
|
|
|
<input type="text" value={item.cpu_limit} onInput={(e)=>this.setConfigsInputs(e,key,1)}
|
|
|
|
|
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="cl"></div>
|
|
|
|
@ -1824,7 +1852,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
<div className="clearfix mb5">
|
|
|
|
|
<label className="panel-form-label fl">最低CPU(核):</label>
|
|
|
|
|
<div className="pr fl with80 status_con">
|
|
|
|
|
<input type="text" name="lower_cpu_limit[]" value={item.lower_cpu_limit} onInput={this.inputs}
|
|
|
|
|
<input type="text" value={item.lower_cpu_limit} onInput={(e)=>this.setConfigsInputs(e,key,2)}
|
|
|
|
|
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="cl"></div>
|
|
|
|
@ -1832,7 +1860,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
<div className="clearfix mb5">
|
|
|
|
|
<label className="panel-form-label fl">内存限制(M):</label>
|
|
|
|
|
<div className="pr fl with80 status_con">
|
|
|
|
|
<input type="text" name="memory_limit[]" value={item.memory_limit} onInput={this.inputs}
|
|
|
|
|
<input type="text" value={item.memory_limit} onInput={(e)=>this.setConfigsInputs(e,key,3)}
|
|
|
|
|
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="cl"></div>
|
|
|
|
@ -1840,7 +1868,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
<div className="clearfix mb5">
|
|
|
|
|
<label className="panel-form-label fl">内存要求(M):</label>
|
|
|
|
|
<div className="pr fl with20 status_con">
|
|
|
|
|
<input type="text" name="request_limit[]" value={item.request_limit} onInput={this.inputs}
|
|
|
|
|
<input type="text" value={item.request_limit} onInput={(e)=>this.setConfigsInputs(e,key,4)}
|
|
|
|
|
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
|
|
|
|
|
</div>
|
|
|
|
|
<label className="panel-form-label fl" style={{width: '48%'}}>温馨提示:纯编程类型实训建议使用默认值,对于大数据等建议使用最大内存的30%</label>
|
|
|
|
@ -1850,8 +1878,8 @@ export default class TPMsettings extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}) :""}
|
|
|
|
|
</div>
|
|
|
|
|
})}
|
|
|
|
|
</div> :""}
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
{
|
|
|
|
|