feat: 启动中的 node.js 运行环境放开编辑、停止等操作 (#2466)

This commit is contained in:
zhengkunwang 2023-10-08 04:54:15 -05:00 committed by GitHub
parent fefb312f50
commit 124d1e8884
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,7 @@ const buttons = [
operateRuntime('down', row.id); operateRuntime('down', row.id);
}, },
disabled: function (row: Runtime.Runtime) { disabled: function (row: Runtime.Runtime) {
return disabledRuntime(row) || row.status === 'stopped'; return row.status === 'recreating' || row.status === 'stopped';
}, },
}, },
{ {
@ -137,7 +137,7 @@ const buttons = [
operateRuntime('up', row.id); operateRuntime('up', row.id);
}, },
disabled: function (row: Runtime.Runtime) { disabled: function (row: Runtime.Runtime) {
return disabledRuntime(row) || row.status === 'running'; return row.status === 'starting' || row.status === 'recreating' || row.status === 'running';
}, },
}, },
{ {
@ -146,7 +146,7 @@ const buttons = [
operateRuntime('restart', row.id); operateRuntime('restart', row.id);
}, },
disabled: function (row: Runtime.Runtime) { disabled: function (row: Runtime.Runtime) {
return disabledRuntime(row); return row.status === 'recreating';
}, },
}, },
{ {
@ -155,7 +155,7 @@ const buttons = [
openDetail(row); openDetail(row);
}, },
disabled: function (row: Runtime.Runtime) { disabled: function (row: Runtime.Runtime) {
return disabledRuntime(row); return row.status === 'recreating';
}, },
}, },
{ {
@ -166,10 +166,6 @@ const buttons = [
}, },
]; ];
const disabledRuntime = (row: Runtime.Runtime) => {
return row.status === 'starting' || row.status === 'recreating';
};
const search = async () => { const search = async () => {
req.page = paginationConfig.currentPage; req.page = paginationConfig.currentPage;
req.pageSize = paginationConfig.pageSize; req.pageSize = paginationConfig.pageSize;