@@ -48,7 +81,7 @@
{{ $t('website.check') }}
- {{ row.status[0].status }}
+ {{ $t('tool.supervisor.' + row.status[0].status) }}
@@ -60,7 +93,7 @@
/>
@@ -85,7 +118,7 @@
:buttons="buttons"
:label="$t('commons.table.operate')"
:fixed="mobile ? false : 'right'"
- width="350px"
+ width="250px"
fix
/>
@@ -110,6 +143,7 @@ import { GlobalStore } from '@/store';
import i18n from '@/lang';
import { HostTool } from '@/api/interface/host-tool';
import { MsgSuccess } from '@/utils/message';
+import { VideoPlay, VideoPause, RefreshRight } from '@element-plus/icons-vue';
const globalStore = GlobalStore();
const loading = ref(false);
@@ -170,6 +204,20 @@ const mobile = computed(() => {
return globalStore.isMobile();
});
+const checkStatus = (status: HostTool.ProcessStatus[]): string => {
+ if (!status || status.length === 0) return 'STOPPED';
+
+ const statusCounts = status.reduce((acc, curr) => {
+ acc[curr.status] = (acc[curr.status] || 0) + 1;
+ return acc;
+ }, {} as Record);
+
+ if (statusCounts['STARTING']) return 'STARTING';
+ if (statusCounts['RUNNING'] === status.length) return 'RUNNING';
+ if (statusCounts['RUNNING'] > 0) return 'WARNING';
+ return 'STOPPED';
+};
+
const operate = async (operation: string, name: string) => {
try {
ElMessageBox.confirm(
@@ -224,42 +272,11 @@ const buttons = [
getFile(row.name, 'out.log');
},
},
- {
- label: i18n.global.t('app.start'),
- click: function (row: HostTool.SupersivorProcess) {
- operate('start', row.name);
- },
- disabled: (row: any) => {
- if (row.status == undefined) {
- return true;
- } else {
- return row.status && row.status[0].status == 'RUNNING';
- }
- },
- },
- {
- label: i18n.global.t('app.stop'),
- click: function (row: HostTool.SupersivorProcess) {
- operate('stop', row.name);
- },
- disabled: (row: any) => {
- if (row.status == undefined) {
- return true;
- }
- return row.status && row.status[0].status != 'RUNNING';
- },
- },
{
label: i18n.global.t('commons.button.restart'),
click: function (row: HostTool.SupersivorProcess) {
operate('restart', row.name);
},
- disabled: (row: any): boolean => {
- if (row.status == undefined) {
- return true;
- }
- return row.status && row.status[0].status != 'RUNNING';
- },
},
{
label: i18n.global.t('commons.button.delete'),