From e7124b26df069340a237b5b6a87dc35d25f1bb46 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 18 Mar 2025 11:12:26 +0800 Subject: [PATCH] feat(supervisor): fix issue with open supervisor failed (#8176) --- agent/app/service/host_tool.go | 5 + frontend/src/assets/json/china/en.json | 36 ---- frontend/src/assets/json/china/zh.json | 36 ---- frontend/src/assets/json/world-name.json | 194 ------------------ frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/ja.ts | 1 + frontend/src/lang/modules/ko.ts | 1 + frontend/src/lang/modules/ms.ts | 1 + frontend/src/lang/modules/pt-br.ts | 1 + frontend/src/lang/modules/ru.ts | 1 + frontend/src/lang/modules/zh-Hant.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + .../src/layout/components/Sidebar/index.vue | 6 +- .../src/views/toolbox/supervisor/index.vue | 4 +- .../views/toolbox/supervisor/status/index.vue | 4 +- 15 files changed, 21 insertions(+), 272 deletions(-) delete mode 100644 frontend/src/assets/json/china/en.json delete mode 100644 frontend/src/assets/json/china/zh.json delete mode 100644 frontend/src/assets/json/world-name.json diff --git a/agent/app/service/host_tool.go b/agent/app/service/host_tool.go index a0e883883..04cf4c911 100644 --- a/agent/app/service/host_tool.go +++ b/agent/app/service/host_tool.go @@ -433,6 +433,11 @@ func handleProcessConfig(configDir, containerName string) ([]response.Supervisor func (h *HostToolService) GetSupervisorProcessConfig() ([]response.SupervisorProcessConfig, error) { configDir := path.Join(global.Dir.DataDir, "tools", "supervisord", "supervisor.d") + fileOp := files.NewFileOp() + if !fileOp.Stat(configDir) { + _ = fileOp.CreateDir(configDir, constant.DirPerm) + return []response.SupervisorProcessConfig{}, nil + } return handleProcessConfig(configDir, "") } diff --git a/frontend/src/assets/json/china/en.json b/frontend/src/assets/json/china/en.json deleted file mode 100644 index 20627cdfd..000000000 --- a/frontend/src/assets/json/china/en.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Anhui": "Anhui", - "Beijing": "Beijing", - "Fujian": "Fujian", - "Gansu": "Gansu", - "Guangdong": "Guangdong", - "Guangxi": "Guangxi", - "Guizhou": "Guizhou", - "Hainan": "Hainan", - "Hebei": "Hebei", - "Henan": "Henan", - "Heilongjiang": "Heilongjiang", - "Hubei": "Hubei", - "Hunan": "Hunan", - "Jilin": "Jilin", - "Jiangsu": "Jiangsu", - "Jiangxi": "Jiangxi", - "Liaoning": "Liaoning", - "Inner Mongolia": "Inner Mongolia", - "Ningxia": "Ningxia", - "Qinghai": "Qinghai", - "Shandong": "Shandong", - "Shanxi": "Shanxi", - "Shaanxi": "Shaanxi", - "Shanghai": "Shanghai", - "Sichuan": "Sichuan", - "Tianjin": "Tianjin", - "Tibet": "Tibet", - "Xinjiang": "Xinjiang", - "Yunnan": "Yunnan", - "Zhejiang": "Zhejiang", - "Chongqing": "Chongqing", - "HongKong": "Hong Kong", - "Macao": "Macau", - "Taiwan": "Taiwan" -} diff --git a/frontend/src/assets/json/china/zh.json b/frontend/src/assets/json/china/zh.json deleted file mode 100644 index 1eb67cb33..000000000 --- a/frontend/src/assets/json/china/zh.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Anhui": "安徽", - "Beijing": "北京", - "Fujian": "福建", - "Gansu": "甘肃", - "Guangdong": "广东", - "Guangxi": "广西", - "Guizhou": "贵州", - "Hainan": "海南", - "Hebei": "河北", - "Henan": "河南", - "Heilongjiang": "黑龙江", - "Hubei": "湖北", - "Hunan": "湖南", - "Jilin": "吉林", - "Jiangsu": "江苏", - "Jiangxi": "江西", - "Liaoning": "辽宁", - "Inner Mongolia": "内蒙古", - "Ningxia": "宁夏", - "Qinghai": "青海", - "Shandong": "山东", - "Shanxi": "山西", - "Shaanxi": "陕西", - "Shanghai": "上海", - "Sichuan": "四川", - "Tianjin": "天津", - "Tibet": "西藏", - "Xinjiang": "新疆", - "Yunnan": "云南", - "Zhejiang": "浙江", - "Chongqing": "重庆", - "HongKong": "香港", - "Macao": "澳门", - "Taiwan": "台湾" -} diff --git a/frontend/src/assets/json/world-name.json b/frontend/src/assets/json/world-name.json deleted file mode 100644 index d6e5360e7..000000000 --- a/frontend/src/assets/json/world-name.json +++ /dev/null @@ -1,194 +0,0 @@ -{ - "Afghanistan": "阿富汗", - "Albania": "阿尔巴尼亚", - "Algeria": "阿尔及利亚", - "Angola": "安哥拉", - "Argentina": "阿根廷", - "Armenia": "亚美尼亚", - "Australia": "澳大利亚", - "Austria": "奥地利", - "Azerbaijan": "阿塞拜疆", - "Bahamas": "巴哈马", - "Bahrain": "巴林", - "Bangladesh": "孟加拉国", - "Belarus": "白俄罗斯", - "Belgium": "比利时", - "Belize": "伯利兹", - "Benin": "贝宁", - "Bhutan": "不丹", - "Bolivia": "玻利维亚", - "Bosnia and Herz.": "波斯尼亚和黑塞哥维那", - "Botswana": "博茨瓦纳", - "Brazil": "巴西", - "British Virgin Islands": "英属维京群岛", - "Brunei": "文莱", - "Bulgaria": "保加利亚", - "Burkina Faso": "布基纳法索", - "Burundi": "布隆迪", - "Cambodia": "柬埔寨", - "Cameroon": "喀麦隆", - "Canada": "加拿大", - "Cape Verde": "佛得角", - "Cayman Islands": "开曼群岛", - "Central African Rep.": "中非共和国", - "Chad": "乍得", - "Chile": "智利", - "China": "中国", - "Colombia": "哥伦比亚", - "Comoros": "科摩罗", - "Congo": "刚果", - "Costa Rica": "哥斯达黎加", - "Croatia": "克罗地亚", - "Cuba": "古巴", - "Cyprus": "塞浦路斯", - "Czech Rep.": "捷克共和国", - "Côte d'Ivoire": "科特迪瓦", - "Dem. Rep. Congo": "刚果民主共和国", - "Dem. Rep. Korea": "朝鲜", - "Denmark": "丹麦", - "Djibouti": "吉布提", - "Dominican Rep.": "多米尼加共和国", - "Ecuador": "厄瓜多尔", - "Egypt": "埃及", - "El Salvador": "萨尔瓦多", - "Equatorial Guinea": "赤道几内亚", - "Eritrea": "厄立特里亚", - "Estonia": "爱沙尼亚", - "Ethiopia": "埃塞俄比亚", - "Falkland Is.": "福克兰群岛", - "Fiji": "斐济", - "Finland": "芬兰", - "Fr. S. Antarctic Lands": "所罗门群岛", - "France": "法国", - "Gabon": "加蓬", - "Gambia": "冈比亚", - "Georgia": "格鲁吉亚", - "Germany": "德国", - "Ghana": "加纳", - "Greece": "希腊", - "Greenland": "格陵兰", - "Guatemala": "危地马拉", - "Guinea": "几内亚", - "Guinea-Bissau": "几内亚比绍", - "Guyana": "圭亚那", - "Haiti": "海地", - "Honduras": "洪都拉斯", - "Hungary": "匈牙利", - "Iceland": "冰岛", - "India": "印度", - "Indonesia": "印度尼西亚", - "Iran": "伊朗", - "Iraq": "伊拉克", - "Ireland": "爱尔兰", - "Isle of Man": "马恩岛", - "Israel": "以色列", - "Italy": "意大利", - "Jamaica": "牙买加", - "Japan": "日本", - "Jordan": "约旦", - "Kazakhstan": "哈萨克斯坦", - "Kenya": "肯尼亚", - "Korea": "韩国", - "Kuwait": "科威特", - "Kyrgyzstan": "吉尔吉斯斯坦", - "Lao PDR": "老挝", - "Latvia": "拉脱维亚", - "Lebanon": "黎巴嫩", - "Lesotho": "莱索托", - "Liberia": "利比里亚", - "Libya": "利比亚", - "Lithuania": "立陶宛", - "Luxembourg": "卢森堡", - "Macedonia": "马其顿", - "Madagascar": "马达加斯加", - "Malawi": "马拉维", - "Malaysia": "马来西亚", - "Maldives": "马尔代夫", - "Mali": "马里", - "Malta": "马耳他", - "Mauritania": "毛利塔尼亚", - "Mauritius": "毛里求斯", - "Mexico": "墨西哥", - "Moldova": "摩尔多瓦", - "Monaco": "摩纳哥", - "Mongolia": "蒙古", - "Montenegro": "黑山共和国", - "Morocco": "摩洛哥", - "Mozambique": "莫桑比克", - "Myanmar": "缅甸", - "Namibia": "纳米比亚", - "Nepal": "尼泊尔", - "Netherlands": "荷兰", - "New Caledonia": "新喀里多尼亚", - "New Zealand": "新西兰", - "Nicaragua": "尼加拉瓜", - "Niger": "尼日尔", - "Nigeria": "尼日利亚", - "Norway": "挪威", - "Oman": "阿曼", - "Pakistan": "巴基斯坦", - "Panama": "巴拿马", - "Papua New Guinea": "巴布亚新几内亚", - "Paraguay": "巴拉圭", - "Peru": "秘鲁", - "Philippines": "菲律宾", - "Poland": "波兰", - "Portugal": "葡萄牙", - "Puerto Rico": "波多黎各", - "Qatar": "卡塔尔", - "Reunion": "留尼旺", - "Romania": "罗马尼亚", - "Russia": "俄罗斯", - "Rwanda": "卢旺达", - "S. Geo. and S. Sandw. Is.": "南乔治亚和南桑威奇群岛", - "S. Sudan": "南苏丹", - "San Marino": "圣马力诺", - "Saudi Arabia": "沙特阿拉伯", - "Senegal": "塞内加尔", - "Serbia": "塞尔维亚", - "Sierra Leone": "塞拉利昂", - "Singapore": "新加坡", - "Slovakia": "斯洛伐克", - "Slovenia": "斯洛文尼亚", - "Solomon Is.": "所罗门群岛", - "Somalia": "索马里", - "South Africa": "南非", - "Spain": "西班牙", - "Sri Lanka": "斯里兰卡", - "Sudan": "苏丹", - "Suriname": "苏里南", - "Swaziland": "斯威士兰", - "Sweden": "瑞典", - "Switzerland": "瑞士", - "Syria": "叙利亚", - "Taiwan": "中国台湾", - "Tajikistan": "塔吉克斯坦", - "Tanzania": "坦桑尼亚", - "Thailand": "泰国", - "Togo": "多哥", - "Tonga": "汤加", - "Trinidad and Tobago": "特立尼达和多巴哥", - "Tunisia": "突尼斯", - "Turkey": "土耳其", - "Turkmenistan": "土库曼斯坦", - "U.S. Virgin Islands": "美属维尔京群岛", - "Uganda": "乌干达", - "Ukraine": "乌克兰", - "United Arab Emirates": "阿拉伯联合酋长国", - "United Kingdom": "英国", - "United States": "美国", - "Uruguay": "乌拉圭", - "Uzbekistan": "乌兹别克斯坦", - "Vanuatu": "瓦努阿图", - "Vatican City": "梵蒂冈城", - "Venezuela": "委内瑞拉", - "Vietnam": "越南", - "W. Sahara": "西撒哈拉", - "Yemen": "也门", - "Yugoslavia": "南斯拉夫", - "Zaire": "扎伊尔", - "Zambia": "赞比亚", - "Zimbabwe": "津巴布韦", - "Hong Kong": "中国香港", - "Macau": "中国澳门" -} diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 3562753dd..a15a0b3f0 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -86,6 +86,7 @@ const message = { sync: 'Sync', up: 'Up', down: 'Down', + delete: 'Delete', }, search: { timeStart: 'Time start', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index 9e3aa72dc..412cd3574 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -83,6 +83,7 @@ const message = { sync: '同期', up: '起動', down: '停止', + delete: '削除', }, search: { timeStart: '時間開始', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index ffe120c00..a9add6095 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -83,6 +83,7 @@ const message = { sync: '동기화', up: '실행', down: '중지', + delete: '삭제', }, search: { timeStart: '시작 시간', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index 285fa2e32..d8e511b0a 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -83,6 +83,7 @@ const message = { sync: 'Segerakkan', up: 'Naik', down: 'Turun', + delete: 'Padam', }, search: { timeStart: 'Masa mula', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index f24745bf1..28cbb6edf 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -83,6 +83,7 @@ const message = { sync: 'Sincronizar', up: 'Iniciar', down: 'Parar', + delete: 'Excluir', }, search: { timeStart: 'Hora inicial', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index 43b20da2b..5e1c05147 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -83,6 +83,7 @@ const message = { sync: 'Синхронизировать', up: 'Запустить', down: 'Остановить', + delete: 'Удалить', }, search: { timeStart: 'Время начала', diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index f15bf0918..30d1e0c18 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -86,6 +86,7 @@ const message = { sync: '同步', up: '啟動', down: '停止', + delete: '刪除', }, search: { timeStart: '開始時間', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 82282b3b4..dc189eb1e 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -86,6 +86,7 @@ const message = { sync: '同步', up: '启动', down: '停止', + delete: '删除', }, search: { timeStart: '开始时间', diff --git a/frontend/src/layout/components/Sidebar/index.vue b/frontend/src/layout/components/Sidebar/index.vue index f7f691f00..f4800ffe7 100644 --- a/frontend/src/layout/components/Sidebar/index.vue +++ b/frontend/src/layout/components/Sidebar/index.vue @@ -11,7 +11,7 @@ { const operate = async (operation: string, name: string) => { try { ElMessageBox.confirm( - i18n.global.t('tool.supervisor.operatorHelper', [name, i18n.global.t('app.' + operation)]), - i18n.global.t('app.' + operation), + i18n.global.t('tool.supervisor.operatorHelper', [name, i18n.global.t('commons.operate.' + operation)]), + i18n.global.t('commons.operate.' + operation), { confirmButtonText: i18n.global.t('commons.button.confirm'), cancelButtonText: i18n.global.t('commons.button.cancel'), diff --git a/frontend/src/views/toolbox/supervisor/status/index.vue b/frontend/src/views/toolbox/supervisor/status/index.vue index d68077a62..0e0f12260 100644 --- a/frontend/src/views/toolbox/supervisor/status/index.vue +++ b/frontend/src/views/toolbox/supervisor/status/index.vue @@ -108,8 +108,8 @@ const onOperate = async (operation: string) => { em('update:maskShow', false); operateReq.operate = operation; ElMessageBox.confirm( - i18n.global.t('tool.supervisor.operatorHelper', ['Supervisor', i18n.global.t('app.' + operation)]), - i18n.global.t('app.' + operation), + i18n.global.t('tool.supervisor.operatorHelper', ['Supervisor', i18n.global.t('commons.operate.' + operation)]), + i18n.global.t('commons.operate.' + operation), { confirmButtonText: i18n.global.t('commons.button.confirm'), cancelButtonText: i18n.global.t('commons.button.cancel'),