|
|
|
|
@ -239,9 +239,7 @@ var ModifyMirrorModal = function ModifyMirrorModal(_ref) {
|
|
|
|
|
mirrorId = _ref.mirrorId,
|
|
|
|
|
mirrorInfo = _ref.mirrorInfo,
|
|
|
|
|
setVisible = _ref.setVisible,
|
|
|
|
|
getData = _ref.getData,
|
|
|
|
|
_ref$tagsList = _ref.tagsList,
|
|
|
|
|
tagsList = _ref$tagsList === void 0 ? [] : _ref$tagsList;
|
|
|
|
|
getData = _ref.getData;
|
|
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
|
|
form = _Form$useForm2[0];
|
|
|
|
|
@ -253,33 +251,64 @@ var ModifyMirrorModal = function ModifyMirrorModal(_ref) {
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
btnLoading = _useState4[0],
|
|
|
|
|
setBtnLoading = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
tagsList = _useState6[0],
|
|
|
|
|
setTagsList = _useState6[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (mirrorId != undefined && visible) {
|
|
|
|
|
gettags();
|
|
|
|
|
console.log(mirrorInfo);
|
|
|
|
|
form.setFieldsValue(objectSpread2_default()({}, mirrorInfo));
|
|
|
|
|
setFormValue(objectSpread2_default()({}, mirrorInfo));
|
|
|
|
|
}
|
|
|
|
|
}, [mirrorId, visible]);
|
|
|
|
|
var gettags = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/tyimages/tags_list.json", {
|
|
|
|
|
method: 'post'
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
setTagsList(res === null || res === void 0 ? void 0 : res.tags);
|
|
|
|
|
}
|
|
|
|
|
// setDataSource(res?.data?.results)
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
return function gettags() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var onCancel = function onCancel() {
|
|
|
|
|
setVisible(false);
|
|
|
|
|
setFormValue({});
|
|
|
|
|
form.setFieldsValue({});
|
|
|
|
|
};
|
|
|
|
|
var onOk = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var formValue, res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context.t0 = (objectSpread2_default());
|
|
|
|
|
_context.t1 = {};
|
|
|
|
|
_context.next = 4;
|
|
|
|
|
_context2.t0 = (objectSpread2_default());
|
|
|
|
|
_context2.t1 = {};
|
|
|
|
|
_context2.next = 4;
|
|
|
|
|
return form.validateFields();
|
|
|
|
|
case 4:
|
|
|
|
|
_context.t2 = _context.sent;
|
|
|
|
|
formValue = (0, _context.t0)(_context.t1, _context.t2);
|
|
|
|
|
_context2.t2 = _context2.sent;
|
|
|
|
|
formValue = (0, _context2.t0)(_context2.t1, _context2.t2);
|
|
|
|
|
setBtnLoading(true);
|
|
|
|
|
_context.next = 9;
|
|
|
|
|
_context2.next = 9;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/tyimages/image_update.json", {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: {
|
|
|
|
|
@ -290,7 +319,7 @@ var ModifyMirrorModal = function ModifyMirrorModal(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 9:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
message/* default */.ZP.success('修改成功');
|
|
|
|
|
getData();
|
|
|
|
|
@ -299,12 +328,12 @@ var ModifyMirrorModal = function ModifyMirrorModal(_ref) {
|
|
|
|
|
setBtnLoading(false);
|
|
|
|
|
case 12:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
return function onOk() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
|
|
@ -425,17 +454,17 @@ var ModifyMirrorModal = function ModifyMirrorModal(_ref) {
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
|
|
|
|
|
type: "primary",
|
|
|
|
|
className: ModifyMirrorModalmodules.confirm,
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
return onOk();
|
|
|
|
|
case 2:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}, _callee3);
|
|
|
|
|
})),
|
|
|
|
|
children: "\u786E\u8BA4"
|
|
|
|
|
})]
|
|
|
|
|
@ -558,47 +587,43 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
list = _useState4[0],
|
|
|
|
|
setList = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
tagsList = _useState6[0],
|
|
|
|
|
setTagsList = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
count = _useState6[0],
|
|
|
|
|
setCount = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
count = _useState8[0],
|
|
|
|
|
setCount = _useState8[1];
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
total = _useState8[0],
|
|
|
|
|
setTotal = _useState8[1];
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
|
|
total = _useState10[0],
|
|
|
|
|
setTotal = _useState10[1];
|
|
|
|
|
isLoading = _useState10[0],
|
|
|
|
|
setIsLoading = _useState10[1];
|
|
|
|
|
var routeParams = (0,_umi_production_exports.useParams)();
|
|
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
|
|
isLoading = _useState12[0],
|
|
|
|
|
setIsLoading = _useState12[1];
|
|
|
|
|
var routeParams = (0,_umi_production_exports.useParams)();
|
|
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
deleteModal = _useState12[0],
|
|
|
|
|
setDeleteModal = _useState12[1];
|
|
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
|
|
deleteModal = _useState14[0],
|
|
|
|
|
setDeleteModal = _useState14[1];
|
|
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
practiceCount = _useState14[0],
|
|
|
|
|
setPracticeCount = _useState14[1];
|
|
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
|
|
practiceCount = _useState16[0],
|
|
|
|
|
setPracticeCount = _useState16[1];
|
|
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
isModifyMirror = _useState16[0],
|
|
|
|
|
setIsModifyMirror = _useState16[1];
|
|
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
|
|
isModifyMirror = _useState18[0],
|
|
|
|
|
setIsModifyMirror = _useState18[1];
|
|
|
|
|
selectedId = _useState18[0],
|
|
|
|
|
setSelectedId = _useState18[1];
|
|
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
|
|
selectedId = _useState20[0],
|
|
|
|
|
setSelectedId = _useState20[1];
|
|
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
selectedInfo = _useState20[0],
|
|
|
|
|
setSelectedInfo = _useState20[1];
|
|
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
|
|
selectedInfo = _useState22[0],
|
|
|
|
|
setSelectedInfo = _useState22[1];
|
|
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
|
|
btnLoading = _useState24[0],
|
|
|
|
|
setBtnLoading = _useState24[1];
|
|
|
|
|
btnLoading = _useState22[0],
|
|
|
|
|
setBtnLoading = _useState22[1];
|
|
|
|
|
var status = {
|
|
|
|
|
'accepted': '已接受共享镜像',
|
|
|
|
|
'active': '正常',
|
|
|
|
|
@ -628,14 +653,14 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
'full_ecs_image': '整机镜像',
|
|
|
|
|
'iso_image': 'ISO 镜像'
|
|
|
|
|
};
|
|
|
|
|
var _useState25 = (0,_react_17_0_2_react.useState)({
|
|
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
queryContent: ''
|
|
|
|
|
}),
|
|
|
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
|
|
|
params = _useState26[0],
|
|
|
|
|
setParams = _useState26[1];
|
|
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
|
|
params = _useState24[0],
|
|
|
|
|
setParams = _useState24[1];
|
|
|
|
|
var tabs = [{
|
|
|
|
|
id: 0,
|
|
|
|
|
name: '全部',
|
|
|
|
|
@ -646,7 +671,6 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
|
|
|
|
|
// 获取镜像列表数据
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
gettags();
|
|
|
|
|
getData();
|
|
|
|
|
}, [ListType]);
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
@ -682,32 +706,6 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var gettags = /*#__PURE__*/function () {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/tyimages/tags_list.json", {
|
|
|
|
|
method: 'post'
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
setTagsList(res === null || res === void 0 ? void 0 : res.tags);
|
|
|
|
|
}
|
|
|
|
|
// setDataSource(res?.data?.results)
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
return function gettags() {
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleFilter = function handleFilter(v, k) {
|
|
|
|
|
params.pageNo = 1;
|
|
|
|
|
params.queryContent = v;
|
|
|
|
|
@ -831,17 +829,17 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
color: '#9096A3',
|
|
|
|
|
height: 22
|
|
|
|
|
},
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setSelectedId(record === null || record === void 0 ? void 0 : record.imageID);
|
|
|
|
|
setDeleteModal(true);
|
|
|
|
|
case 2:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}, _callee2);
|
|
|
|
|
})),
|
|
|
|
|
children: "\u5220\u9664"
|
|
|
|
|
})
|
|
|
|
|
@ -986,8 +984,7 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
setVisible: setIsModifyMirror,
|
|
|
|
|
mirrorId: selectedId,
|
|
|
|
|
mirrorInfo: selectedInfo,
|
|
|
|
|
getData: getData,
|
|
|
|
|
tagsList: tagsList
|
|
|
|
|
getData: getData
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
|
|
centered: true,
|
|
|
|
|
title: "\u5220\u9664\u955C\u50CF",
|
|
|
|
|
@ -1000,13 +997,13 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
onCancel: function onCancel() {
|
|
|
|
|
setDeleteModal(false);
|
|
|
|
|
},
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setBtnLoading(true);
|
|
|
|
|
_context4.next = 3;
|
|
|
|
|
_context3.next = 3;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/tyimages/image_delete.json", {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: {
|
|
|
|
|
@ -1014,7 +1011,7 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 3:
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
message/* default */.ZP.success('删除成功');
|
|
|
|
|
getData();
|
|
|
|
|
@ -1023,9 +1020,9 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
setDeleteModal(false);
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}, _callee3);
|
|
|
|
|
})),
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: "\u955C\u50CF\u5220\u9664\u4E4B\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u955C\u50CF\u5417\uFF1F"
|
|
|
|
|
@ -1034,12 +1031,12 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var ExperImentMirror = ((0,_umi_production_exports.connect)(function (_ref6) {
|
|
|
|
|
var user = _ref6.user,
|
|
|
|
|
newShixuns = _ref6.newShixuns,
|
|
|
|
|
classroomList = _ref6.classroomList,
|
|
|
|
|
loading = _ref6.loading,
|
|
|
|
|
globalSetting = _ref6.globalSetting;
|
|
|
|
|
/* harmony default export */ var ExperImentMirror = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
|
|
var user = _ref5.user,
|
|
|
|
|
newShixuns = _ref5.newShixuns,
|
|
|
|
|
classroomList = _ref5.classroomList,
|
|
|
|
|
loading = _ref5.loading,
|
|
|
|
|
globalSetting = _ref5.globalSetting;
|
|
|
|
|
return {
|
|
|
|
|
user: user,
|
|
|
|
|
newShixuns: newShixuns,
|