From 477f3979d67734b1ce3d4a5597859fef8b75247f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 2 Jul 2019 11:28:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/TPMsettings/TPMsettings.js | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 5791db82c..c59b2fb68 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -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 + } + } + ) + + newchoice_small_type.some((item,key)=> { + if (item === value) { + newchoice_small_type.splice(key, 1) return true } } ) - settingsData.shixun.small_type.some((items,keys)=> { - if (items.id === value) { - newshixun_service_configs.splice(keys+1, 1) - return true - } - } - ) - - - this.setState({ choice_small_type: newchoice_small_type, shixun_service_configs:newshixun_service_configs, @@ -691,10 +690,12 @@ 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; const description_editormd = this.description_editormd.getValue(); @@ -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) => { @@ -1807,10 +1808,10 @@ export default class TPMsettings extends Component { {/*"request_limit": 10, # 内存要求*/} {/*"mirror_repository_id": 12, # 镜像id*/}
+

服务配置

{this.props.identity<2?shixun_service_configs&&shixun_service_configs.map((item,key)=>{ return(
-

服务配置

{item.name}

From 8ae79996b947c0d1e22fa77af0cfcff4a72169d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 2 Jul 2019 14:42:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 31 +- public/react/src/modules/tpm/TPMBanner.js | 2 +- public/react/src/modules/tpm/TPMIndex.css | 377 +++++++++--------- .../modules/tpm/TPMsettings/TPMsettings.js | 129 +++--- .../modules/tpm/challengesnew/TPManswer.js | 2 +- 5 files changed, 285 insertions(+), 256 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index dfd54f38b..2fc1bbe64 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -113,22 +113,21 @@ module.exports = { // First, run the linter. // It's important to do this before Babel processes the JS. - // 上线然后要注释回来 - { - test: /\.(js|jsx|mjs)$/, - enforce: 'pre', - use: [ - { - options: { - formatter: eslintFormatter, - eslintPath: require.resolve('eslint'), - - }, - loader: require.resolve('eslint-loader'), - }, - ], - include: paths.appSrc, - }, + // { + // test: /\.(js|jsx|mjs)$/, + // enforce: 'pre', + // use: [ + // { + // options: { + // formatter: eslintFormatter, + // eslintPath: require.resolve('eslint'), + // + // }, + // loader: require.resolve('eslint-loader'), + // }, + // ], + // include: paths.appSrc, + // }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index ea955b5b1..c82ca237e 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -903,7 +903,7 @@ class TPMBanner extends Component { :

复制将在后台执行
平台将为你创建一个新的同名实训和内容,请问是否继续?

+ className="task-popup-text-center font-16 pb20">复制将在后台执行,平台将为你创建
一个新的同名实训和内容,请问是否继续?

取消 diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 5f2285222..d55369370 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -1,187 +1,190 @@ -body { - overflow: auto !important; - font-family: "Microsoft YaHei"; -} - -#root { - /* ie兼容性 */ - position: relative; - min-height: 100%; -} -body>.-task-title { - opacity: 1 !important; -} -/*�����Ŵ󾵵�����·Ŵ󾵵�λ��*/ -#root .search-all { - width: 219px; -} - -/*Header START*/ -.newHeader .logoimg { - max-height: 60px; -} -.head-right i { - font-size: 20px; - float: none !important; -} -.headIcon, #header_keyword_search { - padding-top: 13px !important; -} -.search-icon { - height: 30px !important; -} -.search-icon i { - font-size: 20px; -} -#header_keyword_search i { - color: #4cacff; -} -.ant-select-selection--multiple{ - padding-bottom: 0px!important; -} -/* 先注释掉下面2个样式,这样写影响范围太广了,并不是所有的select都需要40px高 */ -/* .ant-select-selection--single{ - height:40px!important; -} -.ant-select-selection__rendered{ - line-height: 40px!important; -} */ -.ant-select-selection--multiple .ant-select-selection__rendered>ul>li, .ant-select-selection--multiple>ul>li{ - height: 30px!important; - line-height: 28px!important; -} -/*Main START*/ -.newMain { - /* 330̫���ˣ�*/ - padding-bottom: 240px !important; -} - -.newContainer{ - background: #fafafa!important; -} - -.ant-modal-title{ - font-size: 16px; - font-weight: bold !important; - color: #333; -} - -.ant-modal-title{ - text-align: center; -} -/*.ant-modal{*/ - /*top:10rem !important;*/ -/*}*/ - -@-moz-document url-prefix() { - .ant-radio-inner { - width: 17px !important; - height: 17px !important; - } -} -/* IE只能用padding,不能用上下居中 */ -.shixunDetail_top{ - display: block!important; - padding-top: 48px; -} -.totalScore{ - display: block!important; - padding-top: 28px; -} -.head-nav ul#header-nav li{ - /*font-weight: 600;*/ -} - -/*.newFooter{*/ - /*position: fixed !important;*/ -/*}*/ - -.edu-menu-panel .edu-menu-listnew:hover .careersiconfont{ - color: #000 !important; -} - - -.newHeader { - background: #24292D !important; - height: 60px !important; -} - - -/*-------------------个人主页:右侧提示区域--------------------------*/ -.-task-sidebar{position:fixed;width:40px;height:180px;right:0;bottom:30px;z-index: 10;} -.-task-sidebar>div{height: 40px;line-height: 40px;box-sizing: border-box;width:40px;background:#4CACFF;color:#fff;font-size:20px;text-align:center;margin-bottom:5px;border-radius: 4px;} -.-task-sidebar>div i{ color:#fff;} -.-task-sidebar>div i:hover{color: #fff!important;} -.gotop{background-color: rgba(208,207,207,0.5)!important;padding: 0px!important;} -.-task-desc{background:#494949;width:90px;line-height: 36px;text-align: center; - position: absolute;color: #fff;font-size: 13px;z-index: 999999;opacity: 0;} -.-task-desc div{position: absolute;top:10px;right: -7px;height: 13px;} -.-task-desc div img{float: left} -.-task-sidebar .scan_ewm{ - position: absolute !important; - right: 45px !important; - bottom: 0px !important; - background-color: #494949 !important; - -webkit-box-sizing: border-box !important; - box-sizing: border-box !important; - font-size: 14px !important; - line-height: 16px !important; - display: none; - height: 213px !important; -} -.trangle_right{position: absolute;right: -5px;bottom: 15px;width: 0;height: 0px;border-top: 6px solid transparent;border-left: 5px solid #494949;border-bottom: 6px solid transparent} - -.HeaderSearch{ - margin-top: 18px; - margin-right: 20px; -} -.HeaderSearch .ant-input-search .ant-input{ - height:30px; - background: #373e3f !important; - border: 1px solid #373e3f !important; - -} -.ant-input-search .ant-input-affix-wrapper{ - border:transparent; -} -.ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) { - /* 比较奇怪的需求,先注释掉了,如果需要启用,麻烦增加class限制,别影响别的地方的使用 */ - /* border-color: transparent; */ -} - -.ant-input:focus { - /*border-color: transparent;*/ - border-right-width: 1px !important; - outline: 0; - -webkit-box-shadow: 0 0 0 2px transparent; - box-shadow: 0 0 0 2px transparent; - border: 1px solid #d9d9d9; -} - -.HeaderSearch .ant-input-search .ant-input::-webkit-input-placeholder{ - color: #999; - font-size: 14px; -} - -.HeaderSearch .ant-input-search .ant-input:-moz-placeholder { - color: #999; - font-size: 14px; -} - -.HeaderSearch .ant-input-search .ant-input::-moz-placeholder{ - color: #999; - font-size: 14px; -} - -.HeaderSearch .ant-input-search .ant-input:-ms-input-placeholder{ - color: #999; - font-size: 14px; -} - -.HeaderSearch .ant-input-search .ant-input-suffix .anticon-search { - color: #999; -} - -.HeaderSearch .ant-input-search .ant-input{ - color: #fff; -} +body { + overflow: auto !important; + font-family: "Microsoft YaHei"; +} + +#root { + /* ie兼容性 */ + position: relative; + min-height: 100%; +} +body>.-task-title { + opacity: 1 !important; +} +/*�����Ŵ󾵵�����·Ŵ󾵵�λ��*/ +#root .search-all { + width: 219px; +} + +/*Header START*/ +.newHeader .logoimg { + max-height: 60px; +} +.head-right i { + font-size: 20px; + float: none !important; +} +.headIcon, #header_keyword_search { + padding-top: 13px !important; +} +.search-icon { + height: 30px !important; +} +.search-icon i { + font-size: 20px; +} +#header_keyword_search i { + color: #4cacff; +} +.ant-select-selection--multiple{ + padding-bottom: 0px!important; + padding-top:3px; +} +/* 先注释掉下面2个样式,这样写影响范围太广了,并不是所有的select都需要40px高 */ +/* .ant-select-selection--single{ + height:40px!important; +} +.ant-select-selection__rendered{ + line-height: 40px!important; +} */ +.ant-select-selection--multiple .ant-select-selection__rendered>ul>li, .ant-select-selection--multiple>ul>li{ + height: 25px!important; + line-height: 23px!important; + margin-bottom:3px; + margin-top:0px; +} +/*Main START*/ +.newMain { + /* 330̫���ˣ�*/ + padding-bottom: 240px !important; +} + +.newContainer{ + background: #fafafa!important; +} + +.ant-modal-title{ + font-size: 16px; + font-weight: bold !important; + color: #333; +} + +.ant-modal-title{ + text-align: center; +} +/*.ant-modal{*/ + /*top:10rem !important;*/ +/*}*/ + +@-moz-document url-prefix() { + .ant-radio-inner { + width: 17px !important; + height: 17px !important; + } +} +/* IE只能用padding,不能用上下居中 */ +.shixunDetail_top{ + display: block!important; + padding-top: 48px; +} +.totalScore{ + display: block!important; + padding-top: 28px; +} +.head-nav ul#header-nav li{ + /*font-weight: 600;*/ +} + +/*.newFooter{*/ + /*position: fixed !important;*/ +/*}*/ + +.edu-menu-panel .edu-menu-listnew:hover .careersiconfont{ + color: #000 !important; +} + + +.newHeader { + background: #24292D !important; + height: 60px !important; +} + + +/*-------------------个人主页:右侧提示区域--------------------------*/ +.-task-sidebar{position:fixed;width:40px;height:180px;right:0;bottom:30px;z-index: 10;} +.-task-sidebar>div{height: 40px;line-height: 40px;box-sizing: border-box;width:40px;background:#4CACFF;color:#fff;font-size:20px;text-align:center;margin-bottom:5px;border-radius: 4px;} +.-task-sidebar>div i{ color:#fff;} +.-task-sidebar>div i:hover{color: #fff!important;} +.gotop{background-color: rgba(208,207,207,0.5)!important;padding: 0px!important;} +.-task-desc{background:#494949;width:90px;line-height: 36px;text-align: center; + position: absolute;color: #fff;font-size: 13px;z-index: 999999;opacity: 0;} +.-task-desc div{position: absolute;top:10px;right: -7px;height: 13px;} +.-task-desc div img{float: left} +.-task-sidebar .scan_ewm{ + position: absolute !important; + right: 45px !important; + bottom: 0px !important; + background-color: #494949 !important; + -webkit-box-sizing: border-box !important; + box-sizing: border-box !important; + font-size: 14px !important; + line-height: 16px !important; + display: none; + height: 213px !important; +} +.trangle_right{position: absolute;right: -5px;bottom: 15px;width: 0;height: 0px;border-top: 6px solid transparent;border-left: 5px solid #494949;border-bottom: 6px solid transparent} + +.HeaderSearch{ + margin-top: 18px; + margin-right: 20px; +} +.HeaderSearch .ant-input-search .ant-input{ + height:30px; + background: #373e3f !important; + border: 1px solid #373e3f !important; + +} +.ant-input-search .ant-input-affix-wrapper{ + border:transparent; +} +.ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) { + /* 比较奇怪的需求,先注释掉了,如果需要启用,麻烦增加class限制,别影响别的地方的使用 */ + /* border-color: transparent; */ +} + +.ant-input:focus { + /*border-color: transparent;*/ + border-right-width: 1px !important; + outline: 0; + -webkit-box-shadow: 0 0 0 2px transparent; + box-shadow: 0 0 0 2px transparent; + border: 1px solid #d9d9d9; +} + +.HeaderSearch .ant-input-search .ant-input::-webkit-input-placeholder{ + color: #999; + font-size: 14px; +} + +.HeaderSearch .ant-input-search .ant-input:-moz-placeholder { + color: #999; + font-size: 14px; +} + +.HeaderSearch .ant-input-search .ant-input::-moz-placeholder{ + color: #999; + font-size: 14px; +} + +.HeaderSearch .ant-input-search .ant-input:-ms-input-placeholder{ + color: #999; + font-size: 14px; +} + +.HeaderSearch .ant-input-search .ant-input-suffix .anticon-search { + color: #999; +} + +.HeaderSearch .ant-input-search .ant-input{ + color: #fff; +} diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index c59b2fb68..788002b4a 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -695,7 +695,7 @@ export default class TPMsettings extends Component { 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; const description_editormd = this.description_editormd.getValue(); @@ -1116,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, + }) } @@ -1356,7 +1382,7 @@ export default class TPMsettings extends Component {
this.setConfigsInputs(e,key,1)} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
@@ -1825,7 +1852,7 @@ export default class TPMsettings extends Component {
- this.setConfigsInputs(e,key,2)} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
@@ -1833,7 +1860,7 @@ export default class TPMsettings extends Component {
- this.setConfigsInputs(e,key,3)} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
@@ -1841,7 +1868,7 @@ export default class TPMsettings extends Component {
- this.setConfigsInputs(e,key,4)} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
@@ -1851,8 +1878,8 @@ export default class TPMsettings extends Component {
) - }) :""} -
+ })} +
:""}

{ diff --git a/public/react/src/modules/tpm/challengesnew/TPManswer.js b/public/react/src/modules/tpm/challengesnew/TPManswer.js index 51659e974..c44b74966 100644 --- a/public/react/src/modules/tpm/challengesnew/TPManswer.js +++ b/public/react/src/modules/tpm/challengesnew/TPManswer.js @@ -225,7 +225,7 @@ export default class TPManswer extends Component { } } this.setState({ - answer:response.data.answer, + answer:response.data.answer, power: response.data.power, choice_url: newchoice_url, // 导航中的新建选择题url practice_url: newpractice_url, //string 导航中新建实践题url From f103d077315a7e22f6a992a30f8cf1a460362d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 2 Jul 2019 15:15:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Resource/Fileslistitem.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index afcdf35f4..c778e14c7 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -233,11 +233,7 @@ class Fileslistitem extends Component{ :"" } - - - - {discussMessage.is_publish===true?"":} - + {discussMessage.is_publish===true?:""}