|
|
|
@ -353,6 +353,8 @@ export default class TPMsettings extends Component {
|
|
|
|
|
test_set_permission: response.data.shixun.test_set_permission,
|
|
|
|
|
hide_code: response.data.shixun.hide_code,
|
|
|
|
|
code_hidden: response.data.shixun.code_hidden,
|
|
|
|
|
is_secret_repository: response.data.shixun.is_secret_repository,
|
|
|
|
|
init_is_secret_repository: response.data.shixun.is_secret_repository,
|
|
|
|
|
forbid_copy: response.data.shixun.forbid_copy,
|
|
|
|
|
vnc: response.data.shixun.vnc,
|
|
|
|
|
vnc_evaluate: response.data.shixun.vnc_evaluate,
|
|
|
|
@ -439,20 +441,52 @@ export default class TPMsettings extends Component {
|
|
|
|
|
|
|
|
|
|
SelectshixunCommand=(e)=>{
|
|
|
|
|
// console.log( e.target.value)
|
|
|
|
|
this.setState({
|
|
|
|
|
webssh: e.target.value,
|
|
|
|
|
});
|
|
|
|
|
if(e.target.value===2){
|
|
|
|
|
this.setState({
|
|
|
|
|
SelectTheCommandtype: true,
|
|
|
|
|
multi_webssh:false
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
SelectTheCommandtype: false,
|
|
|
|
|
multi_webssh:false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
const webssh = e.target.value
|
|
|
|
|
if (webssh == 2) {
|
|
|
|
|
this.setState({
|
|
|
|
|
webssh: webssh,
|
|
|
|
|
SelectTheCommandtype: true,
|
|
|
|
|
multi_webssh:false
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
if (this.state.init_is_secret_repository && !this.state.vnc) {
|
|
|
|
|
this.confirmDeleteSecretRepo({
|
|
|
|
|
onOk: () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
webssh: webssh,
|
|
|
|
|
SelectTheCommandtype: false,
|
|
|
|
|
multi_webssh:false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
if (!this.state.vnc) {
|
|
|
|
|
this.setState({
|
|
|
|
|
is_secret_repository: false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
webssh: webssh,
|
|
|
|
|
SelectTheCommandtype: false,
|
|
|
|
|
multi_webssh:false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
// webssh: webssh,
|
|
|
|
|
// });
|
|
|
|
|
// if(webssh===2){
|
|
|
|
|
// this.setState({
|
|
|
|
|
// SelectTheCommandtype: true,
|
|
|
|
|
// multi_webssh:false
|
|
|
|
|
// });
|
|
|
|
|
// }else{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// SelectTheCommandtype: false,
|
|
|
|
|
// multi_webssh:false
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SelectOpenpublic=(e)=>{
|
|
|
|
@ -525,6 +559,35 @@ export default class TPMsettings extends Component {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
confirmDeleteSecretRepo = ({title, onOk}) => {
|
|
|
|
|
confirm({
|
|
|
|
|
title: title || <div>
|
|
|
|
|
<div>已创建的私密版本库及其内容,将在“保存”时被删除。</div>
|
|
|
|
|
<div>是否确认取消勾选?</div>
|
|
|
|
|
</div>,
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk: () => {
|
|
|
|
|
this.setState({ is_secret_repository: false })
|
|
|
|
|
onOk && onOk()
|
|
|
|
|
},
|
|
|
|
|
onCancel() {
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
is_secret_repository = (e) => {
|
|
|
|
|
const checked = e.target.checked
|
|
|
|
|
if (!checked) {
|
|
|
|
|
if (this.state.init_is_secret_repository) {
|
|
|
|
|
this.confirmDeleteSecretRepo({
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({ is_secret_repository: false })
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({ is_secret_repository: true })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
forbid_copy = (e) => {
|
|
|
|
|
let sum = ""
|
|
|
|
|
if (e.target.checked === false) {
|
|
|
|
@ -550,11 +613,34 @@ export default class TPMsettings extends Component {
|
|
|
|
|
// } else if (e.target.checked === true) {
|
|
|
|
|
// sum = 1
|
|
|
|
|
// }
|
|
|
|
|
this.setState({
|
|
|
|
|
vnc: e.target.checked,
|
|
|
|
|
vnc_evaluate: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const vnc = e.target.checked;
|
|
|
|
|
if (!vnc) {
|
|
|
|
|
if (this.state.init_is_secret_repository && this.state.webssh != 2) {
|
|
|
|
|
this.confirmDeleteSecretRepo({
|
|
|
|
|
onOk: () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
vnc: e.target.checked,
|
|
|
|
|
vnc_evaluate: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
if (this.state.webssh != 2) {
|
|
|
|
|
this.setState({
|
|
|
|
|
is_secret_repository: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
vnc: e.target.checked,
|
|
|
|
|
vnc_evaluate: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
vnc: e.target.checked,
|
|
|
|
|
vnc_evaluate: false,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
shixunsname = (e) => {
|
|
|
|
|
// let {shixunsstatus}=this.state;
|
|
|
|
@ -782,7 +868,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
let {
|
|
|
|
|
name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, vnc_evaluate,
|
|
|
|
|
evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
|
|
|
|
|
opening_time,shixunmemoMDvalue,shixun_service_configlist
|
|
|
|
|
opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository
|
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
let newshixun_service_configlist = shixun_service_configlist.map(v => {
|
|
|
|
@ -886,6 +972,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
let Url = `/shixuns/` + id + `.json`;
|
|
|
|
|
let data = {
|
|
|
|
|
shixun:{
|
|
|
|
|
|
|
|
|
|
name: name,
|
|
|
|
|
webssh: webssh,
|
|
|
|
|
use_scope: use_scope,
|
|
|
|
@ -906,6 +993,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
description: description_editormd,
|
|
|
|
|
evaluate_script: evaluate_script_editormd,
|
|
|
|
|
},
|
|
|
|
|
is_secret_repository: is_secret_repository,
|
|
|
|
|
main_type: choice_main_type,
|
|
|
|
|
small_type: choice_small_type,
|
|
|
|
|
scope_partment: scope_partment,
|
|
|
|
@ -1460,6 +1548,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
name,
|
|
|
|
|
settingsData,
|
|
|
|
|
webssh,
|
|
|
|
|
is_secret_repository,
|
|
|
|
|
use_scope,
|
|
|
|
|
shixunsID,
|
|
|
|
|
can_copy,
|
|
|
|
@ -2199,6 +2288,15 @@ export default class TPMsettings extends Component {
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{ (vnc || webssh == 2) && <div className="clearfix mt20 ml30">
|
|
|
|
|
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>私密版本库:</span>
|
|
|
|
|
<span className="fl mt5">
|
|
|
|
|
<Checkbox checked={is_secret_repository === undefined ? false : is_secret_repository}
|
|
|
|
|
onChange={this.is_secret_repository}></Checkbox>
|
|
|
|
|
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则启用私密版本库,学员页面不能查看该版本库目录</label>
|
|
|
|
|
</span>
|
|
|
|
|
</div>}
|
|
|
|
|
|
|
|
|
|
<div className="clearfix mt20 ml30">
|
|
|
|
|
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>禁用复制粘贴:</span>
|
|
|
|
|
<span className="fl mt5">
|
|
|
|
@ -2239,7 +2337,7 @@ export default class TPMsettings extends Component {
|
|
|
|
|
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化评测:</span>
|
|
|
|
|
<span className="fl mt5 ml5">
|
|
|
|
|
<Checkbox checked={vnc_evaluate === undefined ? false : vnc_evaluate} onChange={this.shixun_vnc_evaluate}></Checkbox>
|
|
|
|
|
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则在VNC图形化实训中,给学员开启评测</label>
|
|
|
|
|
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则在学员的VNC图形化页面中,开启评测功能</label>
|
|
|
|
|
</span>
|
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|