hjm 5 years ago
commit a809a40c92

@ -113,22 +113,21 @@ module.exports = {
// First, run the linter. // First, run the linter.
// It's important to do this before Babel processes the JS. // It's important to do this before Babel processes the JS.
// 上线然后要注释回来 // {
{ // test: /\.(js|jsx|mjs)$/,
test: /\.(js|jsx|mjs)$/, // enforce: 'pre',
enforce: 'pre', // use: [
use: [ // {
{ // options: {
options: { // formatter: eslintFormatter,
formatter: eslintFormatter, // eslintPath: require.resolve('eslint'),
eslintPath: require.resolve('eslint'), //
// },
}, // loader: require.resolve('eslint-loader'),
loader: require.resolve('eslint-loader'), // },
}, // ],
], // include: paths.appSrc,
include: paths.appSrc, // },
},
{ {
// "oneOf" will traverse all following loaders until one will // "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall // match the requirements. When no loader matches it will fall

@ -233,11 +233,7 @@ class Fileslistitem extends Component{
</Tooltip> </Tooltip>
:"" :""
} }
{discussMessage.is_publish===true?<CoursesListType typelist={["未发布"]} typesylename={""}/>:""}
{discussMessage.is_publish===true?"":<CoursesListType typelist={["未发布"]} typesylename={""}/>}
</h6> </h6>
<style> <style>
{ {

@ -903,7 +903,7 @@ class TPMBanner extends Component {
</Spin>: </Spin>:
<div> <div>
<div className="task-popup-content"><p <div className="task-popup-content"><p
className="task-popup-text-center font-16 pb20">复制将在后台执行<br/>平台将为你创建一个新的同名实训和内容请问是否继续</p> className="task-popup-text-center font-16 pb20">复制将在后台执行平台将为你创建<br/>一个新的同名实训和内容请问是否继续</p>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a onClick={this.hideForkvisible} className="task-btn fl">取消</a> <a onClick={this.hideForkvisible} className="task-btn fl">取消</a>

@ -38,6 +38,7 @@ body>.-task-title {
} }
.ant-select-selection--multiple{ .ant-select-selection--multiple{
padding-bottom: 0px!important; padding-bottom: 0px!important;
padding-top:3px;
} }
/* 先注释掉下面2个样式这样写影响范围太广了并不是所有的select都需要40px高 */ /* 先注释掉下面2个样式这样写影响范围太广了并不是所有的select都需要40px高 */
/* .ant-select-selection--single{ /* .ant-select-selection--single{
@ -47,8 +48,10 @@ body>.-task-title {
line-height: 40px!important; line-height: 40px!important;
} */ } */
.ant-select-selection--multiple .ant-select-selection__rendered>ul>li, .ant-select-selection--multiple>ul>li{ .ant-select-selection--multiple .ant-select-selection__rendered>ul>li, .ant-select-selection--multiple>ul>li{
height: 30px!important; height: 25px!important;
line-height: 28px!important; line-height: 23px!important;
margin-bottom:3px;
margin-top:0px;
} }
/*Main START*/ /*Main START*/
.newMain { .newMain {

@ -554,28 +554,27 @@ export default class TPMsettings extends Component {
} }
Deselectlittle=(value)=>{ 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 newshixun_service_configs=shixun_service_configs;
let newchoice_small_type=choice_small_type; let newchoice_small_type=choice_small_type;
newchoice_small_type.some((items,keys)=> {
if (items === value) { newshixun_service_configs.some((item,key)=> {
newchoice_small_type.splice(keys, 1) if (item.mirror_repository_id === value) {
newshixun_service_configs.splice(key, 1)
return true
}
}
)
newchoice_small_type.some((item,key)=> {
if (item === value) {
newchoice_small_type.splice(key, 1)
return true return true
} }
} }
) )
settingsData.shixun.small_type.some((items,keys)=> {
if (items.id === value) {
newshixun_service_configs.splice(keys+1, 1)
return true
}
}
)
this.setState({ this.setState({
choice_small_type: newchoice_small_type, choice_small_type: newchoice_small_type,
shixun_service_configs:newshixun_service_configs, shixun_service_configs:newshixun_service_configs,
@ -691,9 +690,11 @@ export default class TPMsettings extends Component {
opening_time,shixunmemoMDvalue,shixun_service_configlist opening_time,shixunmemoMDvalue,shixun_service_configlist
} = this.state; } = this.state;
shixun_service_configlist.map((item,key)=>{ let newshixun_service_configlist = shixun_service_configlist.map(v => {
delete item.name; 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; 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:{ shixun:{
name: name, name: name,
webssh: webssh, webssh: webssh,
user_scope: use_scope, use_scope: use_scope,
can_copy: can_copy, can_copy: can_copy,
vnc: vnc===null?undefined:vnc, vnc: vnc===null?undefined:vnc,
test_set_permission: test_set_permission, test_set_permission: test_set_permission,
@ -799,7 +800,7 @@ export default class TPMsettings extends Component {
forbid_copy: forbid_copy, forbid_copy: forbid_copy,
multi_webssh:newmulti_webssh, multi_webssh:newmulti_webssh,
opening_time:opening_time, 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:{ shixun_info:{
description: description_editormd, description: description_editormd,
@ -808,7 +809,7 @@ export default class TPMsettings extends Component {
main_type: choice_main_type, main_type: choice_main_type,
small_type: choice_small_type, small_type: choice_small_type,
scope_partment: scope_partment, scope_partment: scope_partment,
shixun_service_configs:shixun_service_configlist shixun_service_configs:newshixun_service_configlist
} }
axios.put(Url, data).then((response) => { 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:""}> <div className="width15 fl pr mr20" onMouseLeave={operateauthority?this.bigopens:""}>
<Select mode="multiple" placeholder="请选择小类别" <Select mode="multiple" placeholder="请选择小类别"
value={choice_small_type.length===0||choice_small_type[0]===""||choice_small_type===[]?undefined:choice_small_type} 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} disabled={operateauthority?false:true}
// onChange={operateauthority?this.littleClass:""} // onChange={operateauthority?this.littleClass:""}
onDeselect={operateauthority?this.Deselectlittle:""} onDeselect={operateauthority?this.Deselectlittle:""}
@ -1439,9 +1466,43 @@ export default class TPMsettings extends Component {
{ {
this.props.identity<5||this.props.power==true? this.props.identity<5||this.props.power==true?
<a onClick={this.showModal} id="define_template" <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 <Modal
keyboard={false} keyboard={false}
@ -1518,41 +1579,7 @@ export default class TPMsettings extends Component {
{/*</div>*/} {/*</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>
</div> </div>
@ -1791,32 +1818,33 @@ export default class TPMsettings extends Component {
<label style={{top:'6px'}} className="color-grey-9 ml10" >为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战</label> <label style={{top:'6px'}} className="color-grey-9 ml10" >为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战</label>
</span> </span>
</div> </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="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化:</span>
<span className="fl mt5"> <span className="fl mt5">
<Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox> <Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox>
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口否则不提供</label> <label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口否则不提供</label>
</span> </span>
</div> </div>:""}
</div> </div>
{/*"name": "我是镜像名", # 镜像名称*/} {/*"name": "我是镜像名", # 镜像名称*/}
{/*"cpu_limit": 1, # cpu核*/} {/*"cpu_limit": 1, # cpu核*/}
{/*"lower_cpu_limit": 0.1, # 最低cpu核 浮点数*/} {/*"lower_cpu_limit": 0.1, # 最低cpu核 浮点数*/}
{/*"memory_limit": 1024 ,#内存限制*/} {/*"memory_limit": 1024 ,#内存限制*/}
{/*"request_limit": 10, # 内存要求*/} {/*"request_limit": 10, # 内存要求*/}
{/*"mirror_repository_id": 12, # 镜像id*/} {/*"mirror_repository_id": 12, # 镜像id*/}
<div className="edu-back-white padding40-20 mb20"> {this.props.identity<3?<div className="edu-back-white padding40-20 mb20">
{this.props.identity<2?shixun_service_configs&&shixun_service_configs.map((item,key)=>{ <p className="color-grey-6 font-16 mb30">服务配置</p>
{ shixun_service_configs&&shixun_service_configs.map((item,key)=>{
return( return(
<div key={key}> <div key={key}>
<p className="color-grey-6 font-16 mb30">服务配置</p>
<div id="5"> <div id="5">
<p className="color-grey-6 font-16 mt30 mb20" id="shixun_scenario_type_name">{item.name}</p> <p className="color-grey-6 font-16 mt30 mb20" id="shixun_scenario_type_name">{item.name}</p>
<div className="clearfix mb5"> <div className="clearfix mb5">
<label className="panel-form-label fl">CPU()</label> <label className="panel-form-label fl">CPU()</label>
<div className="pr fl with80 status_con"> <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="请输入类别名称" /> className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div> </div>
<div className="cl"></div> <div className="cl"></div>
@ -1824,7 +1852,7 @@ export default class TPMsettings extends Component {
<div className="clearfix mb5"> <div className="clearfix mb5">
<label className="panel-form-label fl">最低CPU()</label> <label className="panel-form-label fl">最低CPU()</label>
<div className="pr fl with80 status_con"> <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="请输入类别名称" /> className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div> </div>
<div className="cl"></div> <div className="cl"></div>
@ -1832,7 +1860,7 @@ export default class TPMsettings extends Component {
<div className="clearfix mb5"> <div className="clearfix mb5">
<label className="panel-form-label fl">内存限制(M)</label> <label className="panel-form-label fl">内存限制(M)</label>
<div className="pr fl with80 status_con"> <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="请输入类别名称" /> className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div> </div>
<div className="cl"></div> <div className="cl"></div>
@ -1840,7 +1868,7 @@ export default class TPMsettings extends Component {
<div className="clearfix mb5"> <div className="clearfix mb5">
<label className="panel-form-label fl">内存要求(M)</label> <label className="panel-form-label fl">内存要求(M)</label>
<div className="pr fl with20 status_con"> <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="请输入类别名称" /> className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div> </div>
<label className="panel-form-label fl" style={{width: '48%'}}>温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label> <label className="panel-form-label fl" style={{width: '48%'}}>温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label>
@ -1850,8 +1878,8 @@ export default class TPMsettings extends Component {
</div> </div>
) )
}) :""} })}
</div> </div> :""}
<p> <p>
{ {

@ -225,7 +225,7 @@ export default class TPManswer extends Component {
} }
} }
this.setState({ this.setState({
answer:response.data.answer, answer:response.data.answer,
power: response.data.power, power: response.data.power,
choice_url: newchoice_url, // 导航中的新建选择题url choice_url: newchoice_url, // 导航中的新建选择题url
practice_url: newpractice_url, //string 导航中新建实践题url practice_url: newpractice_url, //string 导航中新建实践题url

Loading…
Cancel
Save