mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
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:
commit
818bf9bcf6
31 changed files with 230 additions and 58 deletions
|
@ -76,9 +76,7 @@ func AddConfig(c *gin.Context) {
|
||||||
|
|
||||||
output := nginx.Reload()
|
output := nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) >= nginx.Warn {
|
if nginx.GetLogLevel(output) >= nginx.Warn {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
cosy.ErrHandler(c, cosy.WrapErrorWithParams(config.ErrNginxReloadFailed, output))
|
||||||
"message": output,
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
export default {
|
export default {
|
||||||
50006: () => $gettext('Path: {0} is not under the nginx conf dir: {1}'),
|
50006: () => $gettext('Path: {0} is not under the nginx conf dir: {1}'),
|
||||||
50007: () => $gettext('Destination file: {0} already exists'),
|
50007: () => $gettext('Destination file: {0} already exists'),
|
||||||
|
50008: () => $gettext('Nginx test failed: {0}'),
|
||||||
|
50009: () => $gettext('Nginx reload failed: {0}'),
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,4 +3,6 @@ export default {
|
||||||
50001: () => $gettext('Destination file already exists'),
|
50001: () => $gettext('Destination file already exists'),
|
||||||
50002: () => $gettext('Site is enabled'),
|
50002: () => $gettext('Site is enabled'),
|
||||||
50003: () => $gettext('Site is in maintenance mode'),
|
50003: () => $gettext('Site is in maintenance mode'),
|
||||||
|
50004: () => $gettext('Nginx test failed: {0}'),
|
||||||
|
50005: () => $gettext('Nginx reload failed: {0}'),
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,6 @@ export default {
|
||||||
40401: () => $gettext('Stream not found'),
|
40401: () => $gettext('Stream not found'),
|
||||||
50001: () => $gettext('Destination file already exists'),
|
50001: () => $gettext('Destination file already exists'),
|
||||||
50002: () => $gettext('Stream is enabled'),
|
50002: () => $gettext('Stream is enabled'),
|
||||||
|
50003: () => $gettext('Nginx test failed: {0}'),
|
||||||
|
50004: () => $gettext('Nginx reload failed: {0}'),
|
||||||
}
|
}
|
||||||
|
|
|
@ -2689,6 +2689,12 @@ msgstr "مسار PID لـ Nginx"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr "أمر إعادة تحميل Nginx"
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2714,6 +2720,12 @@ msgstr "تم إعادة تشغيل Nginx بنجاح"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "أمر إعادة تشغيل Nginx"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4728,7 +4740,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2765,6 +2765,12 @@ msgstr "Nginx PID-Pfad"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr "Befehl zum Neuladen von Nginx"
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2792,6 +2798,12 @@ msgstr "Speichern erfolgreich"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "Beffehl zum Neustarten von Nginx"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4873,7 +4885,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2735,6 +2735,12 @@ msgstr ""
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr ""
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2761,6 +2767,12 @@ msgstr "Saved successfully"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr ""
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4780,7 +4792,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2694,6 +2694,12 @@ msgstr "Ruta de registro de errores de Nginx"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr "Comando de recarga de Nginx"
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2720,6 +2726,12 @@ msgstr "Nginx reiniciado con éxito"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "Comando de inicio de terminal"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4774,7 +4786,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2780,6 +2780,12 @@ msgstr "Chemin du journal des erreurs Nginx"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr "Commande de démarrage du terminal"
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2806,6 +2812,12 @@ msgstr "Nginx a redémarré avec succès"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "Commande de démarrage du terminal"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4838,7 +4850,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2696,6 +2696,12 @@ msgstr "Nginx 오류 로그 경로"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr ""
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2724,6 +2730,12 @@ msgstr "Nginx가 성공적으로 재시작됨"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "터미널 시작 명령"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4753,7 +4765,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2500,6 +2500,12 @@ msgstr ""
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr ""
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2524,6 +2530,12 @@ msgstr ""
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr ""
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4312,7 +4324,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/layouts/HeaderLayout.vue:40
|
#: src/layouts/HeaderLayout.vue:49
|
||||||
#: src/routes/index.ts:56
|
#: src/routes/index.ts:56
|
||||||
#: src/views/workspace/WorkSpace.vue:52
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
|
|
|
@ -2674,6 +2674,12 @@ msgstr "Путь для Nginx Error Log"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr "Команда перезагрузки Nginx"
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2700,6 +2706,12 @@ msgstr "Nginx успешно перезапущен"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "Терминальная команда запуска"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4720,7 +4732,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2741,6 +2741,12 @@ msgstr "Nginx Hata Günlüğü Yolu"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr ""
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2769,6 +2775,12 @@ msgstr "Nginx başarıyla yeniden başlatıldı"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "Terminal Başlatma Komutu"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4997,7 +5009,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2516,6 +2516,11 @@ msgstr ""
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr ""
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2540,6 +2545,11 @@ msgstr ""
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr ""
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4413,7 +4423,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -2730,6 +2730,12 @@ msgstr "Vị trí lưu log lỗi (Error log) của Nginx"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr ""
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2756,6 +2762,12 @@ msgstr "Restart Nginx thành công"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr ""
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4776,7 +4788,7 @@ msgstr ""
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr ""
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -3,7 +3,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"POT-Creation-Date: \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"
|
"Last-Translator: 0xJacky <me@jackyu.cn>\n"
|
||||||
"Language-Team: Chinese (Simplified Han script) <https://weblate.nginxui.com/"
|
"Language-Team: Chinese (Simplified Han script) <https://weblate.nginxui.com/"
|
||||||
"projects/nginx-ui/frontend/zh_Hans/>\n"
|
"projects/nginx-ui/frontend/zh_Hans/>\n"
|
||||||
|
@ -2526,6 +2526,11 @@ msgstr "Nginx PID 路径"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr "Nginx 重载命令"
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr "Nginx 重载操作已发送到远程节点"
|
msgstr "Nginx 重载操作已发送到远程节点"
|
||||||
|
@ -2550,6 +2555,11 @@ msgstr "Nginx 重启成功"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "Nginx 测试配置命令"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr "Nginx 理论最高性能"
|
msgstr "Nginx 理论最高性能"
|
||||||
|
@ -4458,7 +4468,7 @@ msgstr "工作进程"
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr "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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
msgstr "工作区"
|
msgstr "工作区"
|
||||||
|
|
|
@ -2538,6 +2538,12 @@ msgstr "Nginx PID 路徑"
|
||||||
msgid "Nginx Reload Command"
|
msgid "Nginx Reload Command"
|
||||||
msgstr "Nginx 重新載入指令"
|
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
|
#: src/views/environments/list/Environment.vue:41
|
||||||
msgid "Nginx reload operations have been dispatched to remote nodes"
|
msgid "Nginx reload operations have been dispatched to remote nodes"
|
||||||
msgstr "Nginx 重新載入操作已分發至遠端節點"
|
msgstr "Nginx 重新載入操作已分發至遠端節點"
|
||||||
|
@ -2562,6 +2568,12 @@ msgstr "Nginx 重啟成功"
|
||||||
msgid "Nginx Test Config Command"
|
msgid "Nginx Test Config Command"
|
||||||
msgstr "Nginx 測試設定指令"
|
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
|
#: src/views/dashboard/components/PerformanceTablesCard.vue:180
|
||||||
msgid "Nginx theoretical maximum performance"
|
msgid "Nginx theoretical maximum performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -4471,7 +4483,7 @@ msgstr "worker 行程"
|
||||||
msgid "Workers"
|
msgid "Workers"
|
||||||
msgstr "worker"
|
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
|
#: src/views/workspace/WorkSpace.vue:52
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Workspace"
|
msgid "Workspace"
|
||||||
|
|
|
@ -35,13 +35,6 @@ const isWorkspace = computed(() => {
|
||||||
<div class="tool">
|
<div class="tool">
|
||||||
<MenuUnfoldOutlined @click="emit('clickUnFold')" />
|
<MenuUnfoldOutlined @click="emit('clickUnFold')" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!isWorkspace" class="workspace-entry">
|
|
||||||
<RouterLink to="/workspace">
|
|
||||||
<ATooltip :title="$gettext('Workspace')">
|
|
||||||
<DesktopOutlined />
|
|
||||||
</ATooltip>
|
|
||||||
</RouterLink>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ASpace
|
<ASpace
|
||||||
class="user-wrapper"
|
class="user-wrapper"
|
||||||
|
@ -51,6 +44,14 @@ const isWorkspace = computed(() => {
|
||||||
|
|
||||||
<SwitchAppearance />
|
<SwitchAppearance />
|
||||||
|
|
||||||
|
<div v-if="!isWorkspace" class="workspace-entry">
|
||||||
|
<RouterLink to="/workspace">
|
||||||
|
<ATooltip :title="$gettext('Workspace')">
|
||||||
|
<DesktopOutlined />
|
||||||
|
</ATooltip>
|
||||||
|
</RouterLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Notification :header-ref="headerRef" />
|
<Notification :header-ref="headerRef" />
|
||||||
|
|
||||||
<NginxControl />
|
<NginxControl />
|
||||||
|
@ -98,8 +99,6 @@ const isWorkspace = computed(() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-entry {
|
.workspace-entry {
|
||||||
position: absolute;
|
|
||||||
left: 20px;
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//go:generate go run . -project . -type ts -output ../../app/src/constants/errors -ignore-dirs .devcontainer,app,.github
|
//go:generate go run . -project ../../ -type ts -output ../../app/src/constants/errors -ignore-dirs .devcontainer,app,.github,cmd
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "github.com/uozi-tech/cosy/errdef"
|
import "github.com/uozi-tech/cosy/errdef"
|
||||||
|
|
|
@ -6,4 +6,6 @@ var (
|
||||||
e = cosy.NewErrorScope("config")
|
e = cosy.NewErrorScope("config")
|
||||||
ErrPathIsNotUnderTheNginxConfDir = e.New(50006, "path: {0} is not under the nginx conf dir: {1}")
|
ErrPathIsNotUnderTheNginxConfDir = e.New(50006, "path: {0} is not under the nginx conf dir: {1}")
|
||||||
ErrDstFileExists = e.New(50007, "destination file: {0} already exists")
|
ErrDstFileExists = e.New(50007, "destination file: {0} already exists")
|
||||||
|
ErrNginxTestFailed = e.New(50008, "nginx test failed: {0}")
|
||||||
|
ErrNginxReloadFailed = e.New(50009, "nginx reload failed: {0}")
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/0xJacky/Nginx-UI/internal/helper"
|
"github.com/0xJacky/Nginx-UI/internal/helper"
|
||||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||||
"github.com/0xJacky/Nginx-UI/model"
|
"github.com/0xJacky/Nginx-UI/model"
|
||||||
"github.com/0xJacky/Nginx-UI/query"
|
"github.com/0xJacky/Nginx-UI/query"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
"gorm.io/gen/field"
|
"gorm.io/gen/field"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ func Save(absPath string, content string, cfg *model.Config) (err error) {
|
||||||
|
|
||||||
output := nginx.Reload()
|
output := nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) >= nginx.Warn {
|
if nginx.GetLogLevel(output) >= nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = SyncToRemoteServer(cfg)
|
err = SyncToRemoteServer(cfg)
|
||||||
|
|
|
@ -2,15 +2,17 @@ package site
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
|
||||||
"github.com/0xJacky/Nginx-UI/internal/notification"
|
|
||||||
"github.com/0xJacky/Nginx-UI/model"
|
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
"github.com/uozi-tech/cosy/logger"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||||
|
"github.com/0xJacky/Nginx-UI/internal/notification"
|
||||||
|
"github.com/0xJacky/Nginx-UI/model"
|
||||||
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
|
"github.com/uozi-tech/cosy/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Disable disables a site by removing the symlink in sites-enabled
|
// Disable disables a site by removing the symlink in sites-enabled
|
||||||
|
@ -35,7 +37,7 @@ func Disable(name string) (err error) {
|
||||||
|
|
||||||
output := nginx.Reload()
|
output := nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
go syncDisable(name)
|
go syncDisable(name)
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||||
"github.com/0xJacky/Nginx-UI/internal/notification"
|
"github.com/0xJacky/Nginx-UI/internal/notification"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
"github.com/uozi-tech/cosy/logger"
|
"github.com/uozi-tech/cosy/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,12 +38,12 @@ func Enable(name string) (err error) {
|
||||||
output := nginx.TestConf()
|
output := nginx.TestConf()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
_ = os.Remove(enabledConfigFilePath)
|
_ = os.Remove(enabledConfigFilePath)
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxTestFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
output = nginx.Reload()
|
output = nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
go syncEnable(name)
|
go syncEnable(name)
|
||||||
|
|
|
@ -8,4 +8,6 @@ var (
|
||||||
ErrDstFileExists = e.New(50001, "destination file already exists")
|
ErrDstFileExists = e.New(50001, "destination file already exists")
|
||||||
ErrSiteIsEnabled = e.New(50002, "site is enabled")
|
ErrSiteIsEnabled = e.New(50002, "site is enabled")
|
||||||
ErrSiteIsInMaintenance = e.New(50003, "site is in maintenance mode")
|
ErrSiteIsInMaintenance = e.New(50003, "site is in maintenance mode")
|
||||||
|
ErrNginxTestFailed = e.New(50004, "nginx test failed: {0}")
|
||||||
|
ErrNginxReloadFailed = e.New(50005, "nginx reload failed: {0}")
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,6 +16,7 @@ import (
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
"github.com/tufanbarisyildirim/gonginx/config"
|
"github.com/tufanbarisyildirim/gonginx/config"
|
||||||
"github.com/tufanbarisyildirim/gonginx/parser"
|
"github.com/tufanbarisyildirim/gonginx/parser"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
"github.com/uozi-tech/cosy/logger"
|
"github.com/uozi-tech/cosy/logger"
|
||||||
cSettings "github.com/uozi-tech/cosy/settings"
|
cSettings "github.com/uozi-tech/cosy/settings"
|
||||||
)
|
)
|
||||||
|
@ -82,13 +83,13 @@ func EnableMaintenance(name string) (err error) {
|
||||||
if helper.FileExists(originalEnabledPath + "_backup") {
|
if helper.FileExists(originalEnabledPath + "_backup") {
|
||||||
_ = os.Rename(originalEnabledPath+"_backup", originalEnabledPath)
|
_ = os.Rename(originalEnabledPath+"_backup", originalEnabledPath)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxTestFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reload nginx
|
// Reload nginx
|
||||||
output = nginx.Reload()
|
output = nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Synchronize with other nodes
|
// Synchronize with other nodes
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"github.com/0xJacky/Nginx-UI/model"
|
"github.com/0xJacky/Nginx-UI/model"
|
||||||
"github.com/0xJacky/Nginx-UI/query"
|
"github.com/0xJacky/Nginx-UI/query"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
"github.com/uozi-tech/cosy/logger"
|
"github.com/uozi-tech/cosy/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -40,13 +41,13 @@ func Save(name string, content string, overwrite bool, envGroupId uint64, syncNo
|
||||||
output := nginx.TestConf()
|
output := nginx.TestConf()
|
||||||
|
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxTestFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
if postAction == model.PostSyncActionReloadNginx {
|
if postAction == model.PostSyncActionReloadNginx {
|
||||||
output = nginx.Reload()
|
output = nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,17 @@ package stream
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
|
||||||
"github.com/0xJacky/Nginx-UI/internal/notification"
|
|
||||||
"github.com/0xJacky/Nginx-UI/model"
|
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
"github.com/uozi-tech/cosy/logger"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||||
|
"github.com/0xJacky/Nginx-UI/internal/notification"
|
||||||
|
"github.com/0xJacky/Nginx-UI/model"
|
||||||
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
|
"github.com/uozi-tech/cosy/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Disable disables a site by removing the symlink in sites-enabled
|
// Disable disables a site by removing the symlink in sites-enabled
|
||||||
|
@ -35,7 +37,7 @@ func Disable(name string) (err error) {
|
||||||
|
|
||||||
output := nginx.Reload()
|
output := nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
go syncDisable(name)
|
go syncDisable(name)
|
||||||
|
|
|
@ -2,15 +2,17 @@ package stream
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/0xJacky/Nginx-UI/internal/helper"
|
|
||||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
|
||||||
"github.com/0xJacky/Nginx-UI/internal/notification"
|
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
"github.com/uozi-tech/cosy/logger"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/0xJacky/Nginx-UI/internal/helper"
|
||||||
|
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||||
|
"github.com/0xJacky/Nginx-UI/internal/notification"
|
||||||
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
|
"github.com/uozi-tech/cosy/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Enable enables a site by creating a symlink in sites-enabled
|
// Enable enables a site by creating a symlink in sites-enabled
|
||||||
|
@ -36,12 +38,12 @@ func Enable(name string) (err error) {
|
||||||
output := nginx.TestConf()
|
output := nginx.TestConf()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
_ = os.Remove(enabledConfigFilePath)
|
_ = os.Remove(enabledConfigFilePath)
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxTestFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
output = nginx.Reload()
|
output = nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
go syncEnable(name)
|
go syncEnable(name)
|
||||||
|
|
|
@ -7,4 +7,6 @@ var (
|
||||||
ErrStreamNotFound = e.New(40401, "stream not found")
|
ErrStreamNotFound = e.New(40401, "stream not found")
|
||||||
ErrDstFileExists = e.New(50001, "destination file already exists")
|
ErrDstFileExists = e.New(50001, "destination file already exists")
|
||||||
ErrStreamIsEnabled = e.New(50002, "stream is enabled")
|
ErrStreamIsEnabled = e.New(50002, "stream is enabled")
|
||||||
|
ErrNginxTestFailed = e.New(50003, "nginx test failed: {0}")
|
||||||
|
ErrNginxReloadFailed = e.New(50004, "nginx reload failed: {0}")
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"github.com/0xJacky/Nginx-UI/internal/notification"
|
"github.com/0xJacky/Nginx-UI/internal/notification"
|
||||||
"github.com/0xJacky/Nginx-UI/query"
|
"github.com/0xJacky/Nginx-UI/query"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
"github.com/uozi-tech/cosy/logger"
|
"github.com/uozi-tech/cosy/logger"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
@ -49,13 +50,13 @@ func Rename(oldName string, newName string) (err error) {
|
||||||
// test nginx configuration
|
// test nginx configuration
|
||||||
output := nginx.TestConf()
|
output := nginx.TestConf()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxTestFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// reload nginx
|
// reload nginx
|
||||||
output = nginx.Reload()
|
output = nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
go syncRename(oldName, newName)
|
go syncRename(oldName, newName)
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"github.com/0xJacky/Nginx-UI/model"
|
"github.com/0xJacky/Nginx-UI/model"
|
||||||
"github.com/0xJacky/Nginx-UI/query"
|
"github.com/0xJacky/Nginx-UI/query"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/uozi-tech/cosy"
|
||||||
"github.com/uozi-tech/cosy/logger"
|
"github.com/uozi-tech/cosy/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -40,13 +41,13 @@ func Save(name string, content string, overwrite bool, syncNodeIds []uint64, pos
|
||||||
output := nginx.TestConf()
|
output := nginx.TestConf()
|
||||||
|
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxTestFailed, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
if postAction == model.PostSyncActionReloadNginx {
|
if postAction == model.PostSyncActionReloadNginx {
|
||||||
output = nginx.Reload()
|
output = nginx.Reload()
|
||||||
if nginx.GetLogLevel(output) > nginx.Warn {
|
if nginx.GetLogLevel(output) > nginx.Warn {
|
||||||
return fmt.Errorf("%s", output)
|
return cosy.WrapErrorWithParams(ErrNginxReloadFailed, output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue