From 1cd32549b0d96b74e86a27df0cecefa37ffb0bfc Mon Sep 17 00:00:00 2001 From: autosubmit Date: Fri, 24 Nov 2023 17:26:42 +0800 Subject: [PATCH] Auto Submit --- p__Shixuns__Edit__index.async.js | 703 ++++++++++++++++--------------- 1 file changed, 372 insertions(+), 331 deletions(-) diff --git a/p__Shixuns__Edit__index.async.js b/p__Shixuns__Edit__index.async.js index a2d145bc7e..ea27337e4c 100644 --- a/p__Shixuns__Edit__index.async.js +++ b/p__Shixuns__Edit__index.async.js @@ -13309,6 +13309,9 @@ var Collaborators = function Collaborators(_ref) { })(Collaborators)); // EXTERNAL MODULE: ./src/pages/Shixuns/Edit/body/Setting/index.tsx var Setting = __webpack_require__(30625); +// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js +var createForOfIteratorHelper = __webpack_require__(98190); +var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js var es_select = __webpack_require__(57809); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules @@ -14176,12 +14179,13 @@ var resetmodules = __webpack_require__(42175); + var Option = es_select["default"].Option; var MAX_COUNT = 3; var Environment = function Environment(_ref) { - var _cloudList$find, _mirror_repository$ch, _mirror_repository$sh2, _mirror_repository$sh3, _mirror_repository$sh4, _mirror_repository$sh5, _data$mirror_reposito2, _mirrorItems$Number2; + var _cloudList$find, _mirror_repository$ch, _mirror_repository$sh2, _mirror_repository$sh3, _mirror_repository$sh4, _mirror_repository$sh5, _mirrorItems$Number2; var practiceSetting = _ref.practiceSetting, dispatch = _ref.dispatch, shixunsDetail = _ref.shixunsDetail, @@ -14209,6 +14213,7 @@ var Environment = function Environment(_ref) { _useState10 = slicedToArray_default()(_useState9, 2), data = _useState10[0], setData = _useState10[1]; + var trackData = (0,_react_17_0_2_react.useRef)({}); //有些组件(比如:MonacoEditor)的onChange不能获取最新的state,这个可以缓存但是的data var saveData = (0,_react_17_0_2_react.useRef)({}); var _data$shixun_environm = data.shixun_environment, shixun_environment = _data$shixun_environm === void 0 ? {} : _data$shixun_environm, @@ -14356,6 +14361,7 @@ var Environment = function Environment(_ref) { } }); } + trackData.current = data; }, [data]); var checkIsEmpty = /*#__PURE__*/function () { var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() { @@ -14674,20 +14680,6 @@ var Environment = function Environment(_ref) { web_route: '', //路由 - open_start_command: false, - //启动命令选中 - start_command: "", - //启动命令代码 - open_envs: false, - //环境变量选中 - envs: "", - //环境变量代码 - privileged: false, - //访问模式 - add_cap: "", - //添加权限 - drop_cap: "", - //移除权限 private_cloud_id: null, //选中的集群 instance_startup_template_id: null, @@ -14700,6 +14692,7 @@ var Environment = function Environment(_ref) { mirror_repository: { choice_small_mirrors: [], //选中附带环境数组集合用于渲染弹框 + // "id": null, //实验镜像id // "description": "已安装软件:python2.7.9;", // "name": "Python2.7", //实验镜像名字 @@ -14711,13 +14704,22 @@ var Environment = function Environment(_ref) { // "choice_standard_scripts": null, shixun_service_configs: [ // { - // name: "Bochs/VNC(bochs-novnc:v1.0)", - // cpu_limit: 2, //CPU - // lower_cpu_limit: 0.3, //最低CPU - // memory_limit: 2048, //内存限制 - // request_limit: 512, //内存要求 - // mirror_repository_id: 183, - // resource_limit: 10000 //磁盘限制 + // name: "Bochs/VNC(bochs-novnc:v1.0)", + // cpu_limit: 2, //CPU + // lower_cpu_limit: 0.3, //最低CPU + // memory_limit: 2048, //内存限制 + // request_limit: 512, //内存要求 + // webssh_user, //用户名 + // webssh_host, //主机名 + // mirror_repository_id: 183, + // resource_limit: 10000 //磁盘限制 + // open_start_command: false, //启动命令选中 + // start_command: "", //启动命令代码 + // open_envs: false,//环境变量选中 + // envs: "",//环境变量代码 + // privileged: false, //访问模式 + // add_cap: "", //添加权限 + // drop_cap: "", //移除权限 // } ] }, @@ -15162,7 +15164,7 @@ var Environment = function Environment(_ref) { var handleConfirm = /*#__PURE__*/function () { var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() { var _tabs$find; - var _shixun_environment$p, _shixun_environment$p2, _mirror_repository$sh, regex, name, res; + var _shixun_environment$p, _shixun_environment$p2, _mirror_repository$sh, _iterator, _step, item, regex, name, res; return regeneratorRuntime_default()().wrap(function _callee11$(_context11) { while (1) switch (_context11.prev = _context11.next) { case 0: @@ -15173,7 +15175,7 @@ var Environment = function Environment(_ref) { return _context11.abrupt("return"); case 2: if (!((shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.resource_type) === 1)) { - _context11.next = 31; + _context11.next = 46; break; } if (mirror_repository !== null && mirror_repository !== void 0 && mirror_repository.id) { @@ -15213,69 +15215,92 @@ var Environment = function Environment(_ref) { setError('shixun_service_configs'); return _context11.abrupt("return"); case 20: - if (!(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.open_start_command && !(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.start_command))) { - _context11.next = 23; + _iterator = createForOfIteratorHelper_default()(mirror_repository === null || mirror_repository === void 0 ? void 0 : mirror_repository.shixun_service_configs); + _context11.prev = 21; + _iterator.s(); + case 23: + if ((_step = _iterator.n()).done) { + _context11.next = 33; + break; + } + item = _step.value; + if (!(item !== null && item !== void 0 && item.open_start_command && !(item !== null && item !== void 0 && item.start_command))) { + _context11.next = 28; break; } setError('start_command'); return _context11.abrupt("return"); - case 23: - if (!(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.open_envs && !(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.envs))) { - _context11.next = 26; + case 28: + if (!(item !== null && item !== void 0 && item.open_envs && !(item !== null && item !== void 0 && item.envs))) { + _context11.next = 31; break; } setError('envs'); return _context11.abrupt("return"); - case 26: + case 31: + _context11.next = 23; + break; + case 33: + _context11.next = 38; + break; + case 35: + _context11.prev = 35; + _context11.t0 = _context11["catch"](21); + _iterator.e(_context11.t0); + case 38: + _context11.prev = 38; + _iterator.f(); + return _context11.finish(38); + case 41: if (!(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.webssh_host)) { - _context11.next = 31; + _context11.next = 46; break; } regex = /^[a-z0-9\-]*$/; if (regex.test(shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.webssh_host)) { - _context11.next = 31; + _context11.next = 46; break; } message/* default */.ZP.warning('主机名只能输入数字、小写字母、连字符'); return _context11.abrupt("return"); - case 31: + case 46: if (!((shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.resource_type) === 2)) { - _context11.next = 44; + _context11.next = 59; break; } if (shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.operating_system) { - _context11.next = 35; + _context11.next = 50; break; } setError('system'); return _context11.abrupt("return"); - case 35: + case 50: if (shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.instance_startup_template_id) { - _context11.next = 38; + _context11.next = 53; break; } setError('template'); return _context11.abrupt("return"); - case 38: + case 53: if (!(!(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.private_is_support_vnc) && !(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.private_is_support_webssh))) { - _context11.next = 41; + _context11.next = 56; break; } setError('interface'); return _context11.abrupt("return"); - case 41: + case 56: if (!((shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.operating_system) === 1 && shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.private_is_support_vnc && isAliCloud && !(shixun_environment !== null && shixun_environment !== void 0 && shixun_environment.instance_startup_type))) { - _context11.next = 44; + _context11.next = 59; break; } setError('instance_startup_type'); return _context11.abrupt("return"); - case 44: + case 59: setBtnLoading(true); name = (_tabs$find = tabs.find(function (e) { return e.id === tabsActive; })) === null || _tabs$find === void 0 ? void 0 : _tabs$find.name; - _context11.next = 48; + _context11.next = 63; return (0,fetch/* default */.ZP)("/api/shixuns/".concat(id, "/update_for_multi.json"), { method: 'put', body: { @@ -15291,7 +15316,7 @@ var Environment = function Environment(_ref) { new_service_configs: new_service_configs } }); - case 48: + case 63: res = _context11.sent; if (res.status === 0) { getData(res.shixun_environment_id); @@ -15300,11 +15325,11 @@ var Environment = function Environment(_ref) { message/* default */.ZP.success('保存成功'); } setBtnLoading(false); - case 51: + case 66: case "end": return _context11.stop(); } - }, _callee11); + }, _callee11, null, [[21, 35, 38, 41]]); })); return function handleConfirm() { return _ref9.apply(this, arguments); @@ -15342,7 +15367,7 @@ var Environment = function Environment(_ref) { } return _context12.abrupt("return"); case 2: - cloneData = (0,lodash.cloneDeep)(data); + cloneData = (0,lodash.cloneDeep)(trackData.current); if (!(type === 'is_support_code_editor' && value)) { _context12.next = 6; break; @@ -15435,12 +15460,19 @@ var Environment = function Environment(_ref) { }; }(); var dealConfigs = function dealConfigs(i, type, value) { + var _trackData$current; var reg = /^\d*(\.\d*)?$/; - if (value.match(reg)) { - var cloneConfigs = (0,lodash.cloneDeep)(mirror_repository === null || mirror_repository === void 0 ? void 0 : mirror_repository.shixun_service_configs); - cloneConfigs[i][type] = value; - handleValueChange('mirror_repository', 'shixun_service_configs', cloneConfigs); + var item = ['cpu_limit', 'lower_cpu_limit', 'memory_limit', 'request_limit', 'resource_limit']; + var cloneConfigs = (0,lodash.cloneDeep)((_trackData$current = trackData.current) === null || _trackData$current === void 0 || (_trackData$current = _trackData$current.mirror_repository) === null || _trackData$current === void 0 ? void 0 : _trackData$current.shixun_service_configs); + if (item.includes(type)) { + if (value.match(reg)) { + cloneConfigs[i][type] = value; + handleValueChange('mirror_repository', 'shixun_service_configs', cloneConfigs); + } + return; } + cloneConfigs[i][type] = value; + handleValueChange('mirror_repository', 'shixun_service_configs', cloneConfigs); }; var dealElseConfigs = function dealElseConfigs(i, type, value) { var reg = /^\d*(\.\d*)?$/; @@ -15616,6 +15648,7 @@ var Environment = function Environment(_ref) { if (superTabs === e.id) return; if (verifyModal()) return; setSuperTabs(e.id); + setError(''); if (e.id === 0) { setData(objectSpread2_default()(objectSpread2_default()({}, data), {}, { mirror_repository: objectSpread2_default()({}, publicMirrorInfo) @@ -15631,7 +15664,6 @@ var Environment = function Environment(_ref) { mirror_repository: objectSpread2_default()({}, shareMirrorInfo) })); } - // setData({...data,mirror_repository:{...mirror_repository}}) }, children: e.name }, e.id); @@ -15793,14 +15825,14 @@ var Environment = function Environment(_ref) { children: ["\u9AD8\u7EA7\u8BBE\u7F6E", /*#__PURE__*/(0,jsx_runtime.jsx)("i", { className: "iconfont ".concat(expand ? 'icon-shouqi4' : 'icon-a-xialazhankai') })] - }), expand && /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, { - children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Label/* default */.Z, { + }), expand && /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, { + children: /*#__PURE__*/(0,jsx_runtime.jsx)(Label/* default */.Z, { required: true, - name: "\u670D\u52A1\u914D\u7F6E", + name: "\u955C\u50CF\u914D\u7F6E", align: "start", errorKey: "shixun_service_configs", errorValue: error, - errorName: "\u8BF7\u6DFB\u52A0\u670D\u52A1\u914D\u7F6E", + errorName: "\u8BF7\u6DFB\u52A0\u955C\u50CF\u914D\u7F6E", contentStyle: { overflow: mirror_repository !== null && mirror_repository !== void 0 && (_mirror_repository$sh2 = mirror_repository.shixun_service_configs) !== null && _mirror_repository$sh2 !== void 0 && _mirror_repository$sh2.length ? 'hidden' : 'initial' }, @@ -15822,6 +15854,7 @@ var Environment = function Environment(_ref) { })] }), children: mirror_repository === null || mirror_repository === void 0 || (_mirror_repository$sh5 = mirror_repository.shixun_service_configs) === null || _mirror_repository$sh5 === void 0 ? void 0 : _mirror_repository$sh5.map(function (e, i) { + var _data$mirror_reposito2; var cpu_limit = e.cpu_limit, lower_cpu_limit = e.lower_cpu_limit, memory_limit = e.memory_limit, @@ -15835,304 +15868,312 @@ var Environment = function Environment(_ref) { className: Environmentmodules.tabTitle, children: name }), - children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { - align: "middle", - className: "mb20", + children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(Label/* default */.Z, { + name: "\u670D\u52A1\u914D\u7F6E", + align: "start", children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { align: "middle", - className: "mr60", - wrap: false, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-333 font14", - style: { - flexShrink: 0, - marginLeft: 27 - }, - children: "CPU" - }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { - style: { - width: 198 - }, - onClick: verifyModal, - value: cpu_limit, - addonAfter: "\u6838", - onChange: function onChange(v) { - return dealConfigs(i, 'cpu_limit', v.target.value); - } + className: "mb20", + children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { + align: "middle", + className: "mr60", + wrap: false, + children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-333 font14", + style: { + flexShrink: 0, + marginLeft: 27 + }, + children: "CPU" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + style: { + width: 198 + }, + onClick: verifyModal, + value: cpu_limit, + addonAfter: "\u6838", + onChange: function onChange(v) { + return dealConfigs(i, 'cpu_limit', v.target.value); + } + })] + }), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { + align: "middle", + wrap: false, + children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-333 font14", + style: { + flexShrink: 0 + }, + children: "\u6700\u4F4ECPU" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + onClick: verifyModal, + value: lower_cpu_limit, + onChange: function onChange(v) { + return dealConfigs(i, 'lower_cpu_limit', v.target.value); + }, + addonAfter: "\u6838" + })] })] }), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { align: "middle", - wrap: false, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-333 font14", - style: { - flexShrink: 0 - }, - children: "\u6700\u4F4ECPU" - }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { - onClick: verifyModal, - value: lower_cpu_limit, - onChange: function onChange(v) { - return dealConfigs(i, 'lower_cpu_limit', v.target.value); - }, - addonAfter: "\u6838" + children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { + align: "middle", + className: "mr60 mb20", + wrap: false, + children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-333 font14", + style: { + flexShrink: 0 + }, + children: "\u5185\u5B58\u9650\u5236" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + onClick: verifyModal, + value: memory_limit, + onChange: function onChange(v) { + return dealConfigs(i, 'memory_limit', v.target.value); + }, + addonAfter: "M" + })] + }), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { + align: "middle", + className: "mb20", + wrap: false, + children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-333 font14", + style: { + flexShrink: 0 + }, + children: "\u5185\u5B58\u8981\u6C42" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + onClick: verifyModal, + value: request_limit, + onChange: function onChange(v) { + return dealConfigs(i, 'request_limit', v.target.value); + }, + addonAfter: "M" + }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999 ml10", + style: { + flexShrink: 0 + }, + children: "\u6E29\u99A8\u63D0\u793A\uFF1A\u7EAF\u7F16\u7A0B\u7C7B\u578B\u5B9E\u8BAD\u5EFA\u8BAE\u4F7F\u7528\u9ED8\u8BA4\u503C\uFF0C\u5BF9\u4E8E\u5927\u6570\u636E\u7B49\u5EFA\u8BAE\u4F7F\u7528\u6700\u5927\u5185\u5B58\u768430%" + })] })] - })] - }), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { - align: "middle", - children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { + }), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, { align: "middle", - className: "mr60 mb20", - wrap: false, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-333 font14", - style: { - flexShrink: 0 - }, - children: "\u5185\u5B58\u9650\u5236" - }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { - onClick: verifyModal, - value: memory_limit, - onChange: function onChange(v) { - return dealConfigs(i, 'memory_limit', v.target.value); - }, - addonAfter: "M" + children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { + align: "middle", + wrap: false, + children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-333 font14", + style: { + flexShrink: 0 + }, + children: "\u78C1\u76D8\u9650\u5236" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + onClick: verifyModal, + value: resource_limit, + onChange: function onChange(v) { + return dealConfigs(i, 'resource_limit', v.target.value); + }, + addonAfter: "K" + })] + }) + })] + }), /*#__PURE__*/(0,jsx_runtime.jsxs)(Label/* default */.Z, { + name: "\u542F\u52A8\u8BBE\u7F6E", + align: "start", + required: e === null || e === void 0 ? void 0 : e.open_start_command, + errorKey: "start_command", + errorValue: error, + errorName: "\u8BF7\u8F93\u5165\u542F\u52A8\u547D\u4EE4", + children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { + className: "font14 mb5", + children: ["\u7528\u6237\u540D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999", + children: "\uFF08\u767B\u5F55\u5BB9\u5668\u65F6\u53EF\u4F7F\u7528\u7684\u7528\u6237\u540D\uFF09" })] - }), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { - align: "middle", + }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], { + getPopupContainer: function getPopupContainer(trigger) { + return trigger.parentNode; + }, + onClick: verifyModal, + bordered: false, + fieldNames: { + label: 'name', + value: 'id' + }, + options: data === null || data === void 0 || (_data$mirror_reposito2 = data.mirror_repository) === null || _data$mirror_reposito2 === void 0 ? void 0 : _data$mirror_reposito2.webssh_user_arr, + value: (e === null || e === void 0 ? void 0 : e.webssh_user) || 'root', + onChange: function onChange(v) { + return dealConfigs(i, 'webssh_user', v); + }, + style: { + minWidth: 400, + backgroundColor: '#f5f5f5', + height: 50, + borderRadius: 4, + paddingTop: 10, + marginBottom: 20 + } + }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { + className: "font14 mb5", + children: ["\u4E3B\u673A\u540D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999", + children: "\uFF08\u767B\u5F55\u5BB9\u5668\u65F6\u53EF\u6307\u5B9A\u4E3B\u673A\u540D\uFF09" + })] + }), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, { className: "mb20", - wrap: false, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-333 font14", - style: { - flexShrink: 0 - }, - children: "\u5185\u5B58\u8981\u6C42" - }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + bordered: false, onClick: verifyModal, - value: request_limit, - onChange: function onChange(v) { - return dealConfigs(i, 'request_limit', v.target.value); + value: e === null || e === void 0 ? void 0 : e.webssh_host, + maxLength: 255, + onChange: function onChange(e) { + dealConfigs(i, 'webssh_host', e.target.value); }, - addonAfter: "M" - }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999 ml10", style: { - flexShrink: 0 - }, - children: "\u6E29\u99A8\u63D0\u793A\uFF1A\u7EAF\u7F16\u7A0B\u7C7B\u578B\u5B9E\u8BAD\u5EFA\u8BAE\u4F7F\u7528\u9ED8\u8BA4\u503C\uFF0C\u5BF9\u4E8E\u5927\u6570\u636E\u7B49\u5EFA\u8BAE\u4F7F\u7528\u6700\u5927\u5185\u5B58\u768430%" + width: 400, + height: 50, + background: '#F5F5F5', + borderRadius: 4, + marginTop: 5 + } + }) + }), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, { + checked: e === null || e === void 0 ? void 0 : e.open_start_command, + onChange: function onChange(e) { + return dealConfigs(i, 'open_start_command', e.target.checked); + }, + style: { + marginTop: -4 + }, + className: "font14", + children: ["\u542F\u52A8\u547D\u4EE4", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999", + children: "\uFF08\u542F\u52A8\u5BB9\u5668\u65F6\u8FD0\u884C\u7684\u547D\u4EE4\u6216\u811A\u672C\uFF0C\u586B\u5199\u5C06\u8986\u76D6\u5BB9\u5668\u9ED8\u8BA4\u7684\u542F\u52A8\u6307\u4EE4\u3002\uFF09" })] + }), (e === null || e === void 0 ? void 0 : e.open_start_command) && /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, { + width: '90%', + height: 250, + placeholder: "\u4F8B\u5982\uFF1Aecho helloworld > /data/workspace/01.txt", + style: { + border: '1px solid #ccc', + background: '#dedede', + marginTop: '20px' + }, + value: e === null || e === void 0 ? void 0 : e.start_command, + language: "shell", + theme: "vs-light", + onChange: function onChange(e) { + return dealConfigs(i, 'start_command', e); + } })] - }), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, { - align: "middle", + }), /*#__PURE__*/(0,jsx_runtime.jsxs)(Label/* default */.Z, { + required: e === null || e === void 0 ? void 0 : e.open_envs, + name: "\u73AF\u5883\u53D8\u91CF", + align: "start", + errorKey: "envs", + errorValue: error, + errorName: "\u8BF7\u8F93\u5165\u73AF\u5883\u53D8\u91CF", + children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, { + checked: e === null || e === void 0 ? void 0 : e.open_envs, + onChange: function onChange(e) { + return dealConfigs(i, 'open_envs', e.target.checked); + }, + style: { + marginTop: -4 + }, + className: "font14", + children: ["\u73AF\u5883\u53D8\u91CF", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999", + children: "\uFF08\u4E3A\u5BB9\u5668\u6DFB\u52A0\u73AF\u5883\u53D8\u91CF\uFF09" + })] + }), (e === null || e === void 0 ? void 0 : e.open_envs) && /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, { + width: '90%', + height: 250, + placeholder: "\u4F8B\u5982\uFF1AMY_VARIABLE=my_value", + style: { + border: '1px solid #ccc', + background: '#dedede', + marginTop: '20px' + }, + language: "shell", + theme: "vs-light", + value: e === null || e === void 0 ? void 0 : e.envs, + onChange: function onChange(e) { + return dealConfigs(i, 'envs', e); + } + })] + }), /*#__PURE__*/(0,jsx_runtime.jsx)(Label/* default */.Z, { + name: "\u8BBF\u95EE\u6A21\u5F0F", children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { align: "middle", - wrap: false, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-333 font14", - style: { - flexShrink: 0 - }, - children: "\u78C1\u76D8\u9650\u5236" - }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { - onClick: verifyModal, - value: resource_limit, - onChange: function onChange(v) { - return dealConfigs(i, 'resource_limit', v.target.value); - }, - addonAfter: "K" + children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, { + checked: e === null || e === void 0 ? void 0 : e.privileged, + onChange: function onChange(e) { + return dealConfigs(i, 'privileged', e); + } + }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "ml10 c-grey-333 font14", + children: "\u7279\u6743\u6A21\u5F0F" + }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999 font14", + children: "\uFF08\u8D4B\u4E88\u5BB9\u5668\u8BBF\u95EE\u5BBF\u4E3B\u673A\u5185\u6838\u7279\u6027\u548C\u8BBE\u5907\u7684\u80FD\u529B\uFF09" })] }) + }), /*#__PURE__*/(0,jsx_runtime.jsxs)(Label/* default */.Z, { + name: "\u6743\u9650\u63A7\u5236", + align: "start", + children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { + className: "font14", + children: ["\u6DFB\u52A0\u6743\u9650", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999", + children: "\uFF08\u6DFB\u52A0\u591A\u4E2A\u6743\u9650\u7528\u82F1\u6587 , \u5206\u9694\uFF09" + })] + }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + onClick: verifyModal, + value: e === null || e === void 0 ? void 0 : e.add_cap, + onChange: function onChange(e) { + return dealConfigs(i, 'add_cap', e.target.value); + }, + bordered: false, + placeholder: "\u4F8B\u5982\uFF1ANET_ADMIN", + style: { + width: 400, + height: 50, + background: '#F5F5F5', + borderRadius: 4, + marginTop: 5 + } + }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { + className: "font14 mt20", + children: ["\u79FB\u9664\u6743\u9650", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { + className: "c-grey-999", + children: "\uFF08\u79FB\u9664\u591A\u4E2A\u6743\u9650\u7528\u82F1\u6587 , \u5206\u9694\uFF09" + })] + }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { + onClick: verifyModal, + value: e === null || e === void 0 ? void 0 : e.drop_cap, + onChange: function onChange(e) { + return dealConfigs(i, 'drop_cap', e.target.value); + }, + bordered: false, + placeholder: "\u4F8B\u5982\uFF1ASYS_PTRACE", + style: { + width: 400, + height: 50, + background: '#F5F5F5', + borderRadius: 4, + marginTop: 5 + } + })] })] }, i); }) })] }) - }), /*#__PURE__*/(0,jsx_runtime.jsxs)(Label/* default */.Z, { - name: "\u542F\u52A8\u8BBE\u7F6E", - align: "start", - required: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.open_start_command, - errorKey: "start_command", - errorValue: error, - errorName: "\u8BF7\u8F93\u5165\u542F\u52A8\u547D\u4EE4", - children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { - className: "font14 mb5", - children: ["\u7528\u6237\u540D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999", - children: "\uFF08\u767B\u5F55\u5BB9\u5668\u65F6\u53EF\u4F7F\u7528\u7684\u7528\u6237\u540D\uFF09" - })] - }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], { - getPopupContainer: function getPopupContainer(trigger) { - return trigger.parentNode; - }, - onClick: verifyModal, - bordered: false, - fieldNames: { - label: 'name', - value: 'id' - }, - options: data === null || data === void 0 || (_data$mirror_reposito2 = data.mirror_repository) === null || _data$mirror_reposito2 === void 0 ? void 0 : _data$mirror_reposito2.webssh_user_arr, - value: (shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.webssh_user) || 'root', - onChange: function onChange(v) { - return handleValueChange('shixun_environment', 'webssh_user', v); - }, - style: { - minWidth: 400, - backgroundColor: '#f5f5f5', - height: 50, - borderRadius: 4, - paddingTop: 10, - marginBottom: 20 - } - }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { - className: "font14 mb5", - children: ["\u4E3B\u673A\u540D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999", - children: "\uFF08\u767B\u5F55\u5BB9\u5668\u65F6\u53EF\u6307\u5B9A\u4E3B\u673A\u540D\uFF09" - })] - }), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, { - className: "mb20", - children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { - bordered: false, - onClick: verifyModal, - value: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.webssh_host, - maxLength: 255, - onChange: function onChange(e) { - handleValueChange('shixun_environment', 'webssh_host', e.target.value); - }, - style: { - width: 400, - height: 50, - background: '#F5F5F5', - borderRadius: 4, - marginTop: 5 - } - }) - }), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, { - checked: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.open_start_command, - onChange: function onChange(e) { - return handleValueChange('shixun_environment', 'open_start_command', e.target.checked); - }, - style: { - marginTop: -4 - }, - className: "font14", - children: ["\u542F\u52A8\u547D\u4EE4", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999", - children: "\uFF08\u542F\u52A8\u5BB9\u5668\u65F6\u8FD0\u884C\u7684\u547D\u4EE4\u6216\u811A\u672C\uFF0C\u586B\u5199\u5C06\u8986\u76D6\u5BB9\u5668\u9ED8\u8BA4\u7684\u542F\u52A8\u6307\u4EE4\u3002\uFF09" - })] - }), (shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.open_start_command) && /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, { - width: '90%', - height: 250, - style: { - border: '1px solid #ccc', - background: '#dedede', - marginTop: '20px' - }, - value: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.start_command, - language: "shell", - theme: "vs-light", - onChange: function onChange(e) { - return handleValueChange('shixun_environment', 'start_command', e); - } - })] - }), /*#__PURE__*/(0,jsx_runtime.jsxs)(Label/* default */.Z, { - required: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.open_envs, - name: "\u73AF\u5883\u53D8\u91CF", - align: "start", - errorKey: "envs", - errorValue: error, - errorName: "\u8BF7\u8F93\u5165\u73AF\u5883\u53D8\u91CF", - children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, { - checked: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.open_envs, - onChange: function onChange(e) { - return handleValueChange('shixun_environment', 'open_envs', e.target.checked); - }, - style: { - marginTop: -4 - }, - className: "font14", - children: ["\u73AF\u5883\u53D8\u91CF", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999", - children: "\uFF08\u4E3A\u5BB9\u5668\u6DFB\u52A0\u73AF\u5883\u53D8\u91CF\uFF09" - })] - }), (shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.open_envs) && /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, { - width: '90%', - height: 250, - style: { - border: '1px solid #ccc', - background: '#dedede', - marginTop: '20px' - }, - language: "shell", - theme: "vs-light", - value: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.envs, - onChange: function onChange(e) { - return handleValueChange('shixun_environment', 'envs', e); - } - })] - }), /*#__PURE__*/(0,jsx_runtime.jsx)(Label/* default */.Z, { - name: "\u8BBF\u95EE\u6A21\u5F0F", - children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { - align: "middle", - children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, { - checked: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.privileged, - onChange: function onChange(e) { - return handleValueChange('shixun_environment', 'privileged', e); - } - }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "ml10 c-grey-333 font14", - children: "\u7279\u6743\u6A21\u5F0F" - }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999 font14", - children: "\uFF08\u8D4B\u4E88\u5BB9\u5668\u8BBF\u95EE\u5BBF\u4E3B\u673A\u5185\u6838\u7279\u6027\u548C\u8BBE\u5907\u7684\u80FD\u529B\uFF09" - })] - }) - }), /*#__PURE__*/(0,jsx_runtime.jsxs)(Label/* default */.Z, { - name: "\u6743\u9650\u63A7\u5236", - align: "start", - children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { - className: "font14", - children: ["\u6DFB\u52A0\u6743\u9650", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999", - children: "\uFF08\u6DFB\u52A0\u591A\u4E2A\u6743\u9650\u7528\u82F1\u6587 , \u5206\u9694\uFF09" - })] - }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { - onClick: verifyModal, - value: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.add_cap, - onChange: function onChange(e) { - return handleValueChange('shixun_environment', 'add_cap', e.target.value); - }, - bordered: false, - style: { - width: 400, - height: 50, - background: '#F5F5F5', - borderRadius: 4, - marginTop: 5 - } - }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { - className: "font14 mt20", - children: ["\u79FB\u9664\u6743\u9650", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-grey-999", - children: "\uFF08\u79FB\u9664\u591A\u4E2A\u6743\u9650\u7528\u82F1\u6587 , \u5206\u9694\uFF09" - })] - }), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, { - onClick: verifyModal, - value: shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.drop_cap, - onChange: function onChange(e) { - return handleValueChange('shixun_environment', 'drop_cap', e.target.value); - }, - bordered: false, - style: { - width: 400, - height: 50, - background: '#F5F5F5', - borderRadius: 4, - marginTop: 5 - } - })] - })] + }) })] })] }), (shixun_environment === null || shixun_environment === void 0 ? void 0 : shixun_environment.resource_type) === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {