Merge pull request #974 from 0xJacky/feat/workspace

enhance: replace error handling with cosy wrapper for nginx reload and test
This commit is contained in:
Jacky 2025-04-18 16:41:44 +08:00
commit 818bf9bcf6
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
31 changed files with 230 additions and 58 deletions

View file

@ -1,4 +1,6 @@
export default {
50006: () => $gettext('Path: {0} is not under the nginx conf dir: {1}'),
50007: () => $gettext('Destination file: {0} already exists'),
50008: () => $gettext('Nginx test failed: {0}'),
50009: () => $gettext('Nginx reload failed: {0}'),
}

View file

@ -3,4 +3,6 @@ export default {
50001: () => $gettext('Destination file already exists'),
50002: () => $gettext('Site is enabled'),
50003: () => $gettext('Site is in maintenance mode'),
50004: () => $gettext('Nginx test failed: {0}'),
50005: () => $gettext('Nginx reload failed: {0}'),
}

View file

@ -2,4 +2,6 @@ export default {
40401: () => $gettext('Stream not found'),
50001: () => $gettext('Destination file already exists'),
50002: () => $gettext('Stream is enabled'),
50003: () => $gettext('Nginx test failed: {0}'),
50004: () => $gettext('Nginx reload failed: {0}'),
}

View file

@ -2689,6 +2689,12 @@ msgstr "مسار PID لـ Nginx"
msgid "Nginx Reload Command"
msgstr "أمر إعادة تحميل Nginx"
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "فشل في التفعيل %{msg}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2714,6 +2720,12 @@ msgstr "تم إعادة تشغيل Nginx بنجاح"
msgid "Nginx Test Config Command"
msgstr "أمر إعادة تشغيل Nginx"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "فشل في التفعيل %{msg}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4728,7 +4740,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2765,6 +2765,12 @@ msgstr "Nginx PID-Pfad"
msgid "Nginx Reload Command"
msgstr "Befehl zum Neuladen von Nginx"
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "Aktiviern von %{msg} fehlgeschlagen"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2792,6 +2798,12 @@ msgstr "Speichern erfolgreich"
msgid "Nginx Test Config Command"
msgstr "Beffehl zum Neustarten von Nginx"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "Aktiviern von %{msg} fehlgeschlagen"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4873,7 +4885,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2735,6 +2735,12 @@ msgstr ""
msgid "Nginx Reload Command"
msgstr ""
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "Failed to enable %{msg}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2761,6 +2767,12 @@ msgstr "Saved successfully"
msgid "Nginx Test Config Command"
msgstr ""
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "Failed to enable %{msg}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4780,7 +4792,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2694,6 +2694,12 @@ msgstr "Ruta de registro de errores de Nginx"
msgid "Nginx Reload Command"
msgstr "Comando de recarga de Nginx"
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "Error al habilitar %{msg}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2720,6 +2726,12 @@ msgstr "Nginx reiniciado con éxito"
msgid "Nginx Test Config Command"
msgstr "Comando de inicio de terminal"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "Error al habilitar %{msg}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4774,7 +4786,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2780,6 +2780,12 @@ msgstr "Chemin du journal des erreurs Nginx"
msgid "Nginx Reload Command"
msgstr "Commande de démarrage du terminal"
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "Impossible d'activer %{msg}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2806,6 +2812,12 @@ msgstr "Nginx a redémarré avec succès"
msgid "Nginx Test Config Command"
msgstr "Commande de démarrage du terminal"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "Impossible d'activer %{msg}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4838,7 +4850,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2696,6 +2696,12 @@ msgstr "Nginx 오류 로그 경로"
msgid "Nginx Reload Command"
msgstr ""
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "%{msg} 활성화 실패"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2724,6 +2730,12 @@ msgstr "Nginx가 성공적으로 재시작됨"
msgid "Nginx Test Config Command"
msgstr "터미널 시작 명령"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "%{msg} 활성화 실패"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4753,7 +4765,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2500,6 +2500,12 @@ msgstr ""
msgid "Nginx Reload Command"
msgstr ""
#: src/constants/errors/config.ts:5
#: src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
msgid "Nginx reload failed: {0}"
msgstr ""
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2524,6 +2530,12 @@ msgstr ""
msgid "Nginx Test Config Command"
msgstr ""
#: src/constants/errors/config.ts:4
#: src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
msgid "Nginx test failed: {0}"
msgstr ""
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4312,7 +4324,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40
#: src/layouts/HeaderLayout.vue:49
#: src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"

View file

@ -2674,6 +2674,12 @@ msgstr "Путь для Nginx Error Log"
msgid "Nginx Reload Command"
msgstr "Команда перезагрузки Nginx"
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "Не удалось включить %{msg}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2700,6 +2706,12 @@ msgstr "Nginx успешно перезапущен"
msgid "Nginx Test Config Command"
msgstr "Терминальная команда запуска"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "Не удалось включить %{msg}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4720,7 +4732,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2741,6 +2741,12 @@ msgstr "Nginx Hata Günlüğü Yolu"
msgid "Nginx Reload Command"
msgstr ""
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "Etkinleştirilemedi %{msg}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2769,6 +2775,12 @@ msgstr "Nginx başarıyla yeniden başlatıldı"
msgid "Nginx Test Config Command"
msgstr "Terminal Başlatma Komutu"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "Etkinleştirilemedi %{msg}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4997,7 +5009,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2516,6 +2516,11 @@ msgstr ""
msgid "Nginx Reload Command"
msgstr ""
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
msgid "Nginx reload failed: {0}"
msgstr ""
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2540,6 +2545,11 @@ msgstr ""
msgid "Nginx Test Config Command"
msgstr ""
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
msgid "Nginx test failed: {0}"
msgstr ""
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4413,7 +4423,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -2730,6 +2730,12 @@ msgstr "Vị trí lưu log lỗi (Error log) của Nginx"
msgid "Nginx Reload Command"
msgstr ""
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "Không thể bật %{msg}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr ""
@ -2756,6 +2762,12 @@ msgstr "Restart Nginx thành công"
msgid "Nginx Test Config Command"
msgstr ""
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "Không thể bật %{msg}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4776,7 +4788,7 @@ msgstr ""
msgid "Workers"
msgstr ""
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr ""

View file

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2025-04-18 14:05+0800\n"
"PO-Revision-Date: 2025-04-18 16:49+0800\n"
"Last-Translator: 0xJacky <me@jackyu.cn>\n"
"Language-Team: Chinese (Simplified Han script) <https://weblate.nginxui.com/"
"projects/nginx-ui/frontend/zh_Hans/>\n"
@ -2526,6 +2526,11 @@ msgstr "Nginx PID 路径"
msgid "Nginx Reload Command"
msgstr "Nginx 重载命令"
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
msgid "Nginx reload failed: {0}"
msgstr "Nginx 重载失败:{0}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr "Nginx 重载操作已发送到远程节点"
@ -2550,6 +2555,11 @@ msgstr "Nginx 重启成功"
msgid "Nginx Test Config Command"
msgstr "Nginx 测试配置命令"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
msgid "Nginx test failed: {0}"
msgstr "Nginx 测试失败:{0}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr "Nginx 理论最高性能"
@ -4458,7 +4468,7 @@ msgstr "工作进程"
msgid "Workers"
msgstr "Workers"
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
msgid "Workspace"
msgstr "工作区"

View file

@ -2538,6 +2538,12 @@ msgstr "Nginx PID 路徑"
msgid "Nginx Reload Command"
msgstr "Nginx 重新載入指令"
#: src/constants/errors/config.ts:5 src/constants/errors/site.ts:7
#: src/constants/errors/stream.ts:6
#, fuzzy
msgid "Nginx reload failed: {0}"
msgstr "讀取檔案失敗:{0}"
#: src/views/environments/list/Environment.vue:41
msgid "Nginx reload operations have been dispatched to remote nodes"
msgstr "Nginx 重新載入操作已分發至遠端節點"
@ -2562,6 +2568,12 @@ msgstr "Nginx 重啟成功"
msgid "Nginx Test Config Command"
msgstr "Nginx 測試設定指令"
#: src/constants/errors/config.ts:4 src/constants/errors/site.ts:6
#: src/constants/errors/stream.ts:5
#, fuzzy
msgid "Nginx test failed: {0}"
msgstr "無法建立檔案:{0}"
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
msgid "Nginx theoretical maximum performance"
msgstr ""
@ -4471,7 +4483,7 @@ msgstr "worker 行程"
msgid "Workers"
msgstr "worker"
#: src/layouts/HeaderLayout.vue:40 src/routes/index.ts:56
#: src/layouts/HeaderLayout.vue:49 src/routes/index.ts:56
#: src/views/workspace/WorkSpace.vue:52
#, fuzzy
msgid "Workspace"

View file

@ -35,13 +35,6 @@ const isWorkspace = computed(() => {
<div class="tool">
<MenuUnfoldOutlined @click="emit('clickUnFold')" />
</div>
<div v-if="!isWorkspace" class="workspace-entry">
<RouterLink to="/workspace">
<ATooltip :title="$gettext('Workspace')">
<DesktopOutlined />
</ATooltip>
</RouterLink>
</div>
<ASpace
class="user-wrapper"
@ -51,6 +44,14 @@ const isWorkspace = computed(() => {
<SwitchAppearance />
<div v-if="!isWorkspace" class="workspace-entry">
<RouterLink to="/workspace">
<ATooltip :title="$gettext('Workspace')">
<DesktopOutlined />
</ATooltip>
</RouterLink>
</div>
<Notification :header-ref="headerRef" />
<NginxControl />
@ -98,8 +99,6 @@ const isWorkspace = computed(() => {
}
.workspace-entry {
position: absolute;
left: 20px;
@media (max-width: 600px) {
display: none;
}