From 1c1da923639b3dca80a3d3d85f9332e16c99ddfb Mon Sep 17 00:00:00 2001 From: Jacky Date: Fri, 26 Jul 2024 13:53:38 +0800 Subject: [PATCH] feat: deploy config to remote nodes #359 --- api/config/add.go | 136 ++++--- api/config/get.go | 30 +- api/config/{folder.go => mkdir.go} | 1 + api/config/modify.go | 28 +- api/config/rename.go | 41 +- api/config/router.go | 13 +- api/user/otp.go | 7 + api/user/router.go | 8 +- app/src/api/config.ts | 11 +- app/src/api/otp.ts | 3 + app/src/components/Notification/cert.ts | 18 + app/src/components/Notification/config.ts | 37 ++ .../components/Notification/detailRender.ts | 34 +- app/src/components/OTP/useOTPModal.ts | 113 +++--- app/src/language/en/app.po | 28 +- app/src/language/es/app.po | 28 +- app/src/language/fr_FR/app.po | 28 +- app/src/language/ko_KR/app.po | 29 +- app/src/language/messages.pot | 20 +- app/src/language/ru_RU/app.po | 28 +- app/src/language/vi_VN/app.po | 28 +- app/src/language/zh_CN/app.mo | Bin 32165 -> 32194 bytes app/src/language/zh_CN/app.po | 28 +- app/src/language/zh_TW/app.po | 28 +- app/src/lib/http/index.ts | 8 + app/src/routes/index.ts | 2 +- app/src/version.json | 2 +- app/src/views/config/ConfigEditor.vue | 51 ++- .../config/{Config.vue => ConfigList.vue} | 68 +++- app/src/views/config/components/Mkdir.vue | 18 +- app/src/views/config/components/Rename.vue | 36 +- app/src/views/pty/Terminal.vue | 44 +-- app/version.json | 2 +- internal/config/sync.go | 292 ++++++++++++++ .../middleware/ip_whitelist.go | 4 +- {router => internal/middleware}/middleware.go | 52 +-- {router => internal/middleware}/proxy.go | 4 +- {router => internal/middleware}/proxy_ws.go | 4 +- internal/middleware/secure_session.go | 43 ++ model/config.go | 9 + model/model.go | 1 + query/certs.gen.go | 48 ++- query/configs.gen.go | 370 ++++++++++++++++++ query/gen.go | 8 + router/operation_sync.go | 154 -------- router/routers.go | 142 +++---- 46 files changed, 1481 insertions(+), 606 deletions(-) rename api/config/{folder.go => mkdir.go} (99%) create mode 100644 app/src/components/Notification/cert.ts create mode 100644 app/src/components/Notification/config.ts rename app/src/views/config/{Config.vue => ConfigList.vue} (71%) create mode 100644 internal/config/sync.go rename router/ip.go => internal/middleware/ip_whitelist.go (88%) rename {router => internal/middleware}/middleware.go (68%) rename {router => internal/middleware}/proxy.go (97%) rename {router => internal/middleware}/proxy_ws.go (94%) create mode 100644 internal/middleware/secure_session.go create mode 100644 model/config.go create mode 100644 query/configs.gen.go delete mode 100644 router/operation_sync.go diff --git a/api/config/add.go b/api/config/add.go index c8fac38..ace2cf1 100644 --- a/api/config/add.go +++ b/api/config/add.go @@ -1,65 +1,97 @@ package config import ( - "github.com/0xJacky/Nginx-UI/api" - "github.com/0xJacky/Nginx-UI/internal/config" - "github.com/0xJacky/Nginx-UI/internal/helper" - "github.com/0xJacky/Nginx-UI/internal/nginx" - "github.com/gin-gonic/gin" - "github.com/sashabaranov/go-openai" - "net/http" - "os" - "time" + "github.com/0xJacky/Nginx-UI/api" + "github.com/0xJacky/Nginx-UI/internal/config" + "github.com/0xJacky/Nginx-UI/internal/helper" + "github.com/0xJacky/Nginx-UI/internal/nginx" + "github.com/0xJacky/Nginx-UI/model" + "github.com/0xJacky/Nginx-UI/query" + "github.com/gin-gonic/gin" + "github.com/sashabaranov/go-openai" + "net/http" + "os" + "path/filepath" + "time" ) func AddConfig(c *gin.Context) { - var json struct { - Name string `json:"name" binding:"required"` - NewFilepath string `json:"new_filepath" binding:"required"` - Content string `json:"content"` - Overwrite bool `json:"overwrite"` - } + var json struct { + Name string `json:"name" binding:"required"` + NewFilepath string `json:"new_filepath" binding:"required"` + Content string `json:"content"` + Overwrite bool `json:"overwrite"` + SyncNodeIds []int `json:"sync_node_ids"` + } - if !api.BindAndValid(c, &json) { - return - } + if !api.BindAndValid(c, &json) { + return + } - name := json.Name - content := json.Content - path := json.NewFilepath - if !helper.IsUnderDirectory(path, nginx.GetConfPath()) { - c.JSON(http.StatusForbidden, gin.H{ - "message": "new filepath is not under the nginx conf path", - }) - return - } + name := json.Name + content := json.Content + path := json.NewFilepath + if !helper.IsUnderDirectory(path, nginx.GetConfPath()) { + c.JSON(http.StatusForbidden, gin.H{ + "message": "new filepath is not under the nginx conf path", + }) + return + } - if !json.Overwrite && helper.FileExists(path) { - c.JSON(http.StatusNotAcceptable, gin.H{ - "message": "File exists", - }) - return - } + if !json.Overwrite && helper.FileExists(path) { + c.JSON(http.StatusNotAcceptable, gin.H{ + "message": "File exists", + }) + return + } - err := os.WriteFile(path, []byte(content), 0644) - if err != nil { - api.ErrHandler(c, err) - return - } + // check if the dir exists, if not, use mkdirAll to create the dir + dir := filepath.Dir(path) + if !helper.FileExists(dir) { + err := os.MkdirAll(dir, 0755) + if err != nil { + api.ErrHandler(c, err) + return + } + } - output := nginx.Reload() - if nginx.GetLogLevel(output) >= nginx.Warn { - c.JSON(http.StatusInternalServerError, gin.H{ - "message": output, - }) - return - } + err := os.WriteFile(path, []byte(content), 0644) + if err != nil { + api.ErrHandler(c, err) + return + } - c.JSON(http.StatusOK, config.Config{ - Name: name, - Content: content, - ChatGPTMessages: make([]openai.ChatCompletionMessage, 0), - FilePath: path, - ModifiedAt: time.Now(), - }) + output := nginx.Reload() + if nginx.GetLogLevel(output) >= nginx.Warn { + c.JSON(http.StatusInternalServerError, gin.H{ + "message": output, + }) + return + } + + q := query.Config + _, err = q.Where(q.Filepath.Eq(path)).Delete() + if err != nil { + api.ErrHandler(c, err) + return + } + + err = q.Create(&model.Config{ + Name: name, + Filepath: path, + SyncNodeIds: json.SyncNodeIds, + SyncOverwrite: json.Overwrite, + }) + if err != nil { + api.ErrHandler(c, err) + return + } + + c.JSON(http.StatusOK, config.Config{ + Name: name, + Content: content, + ChatGPTMessages: make([]openai.ChatCompletionMessage, 0), + FilePath: path, + ModifiedAt: time.Now(), + }) } diff --git a/api/config/get.go b/api/config/get.go index a19aac9..2d47f62 100644 --- a/api/config/get.go +++ b/api/config/get.go @@ -12,6 +12,12 @@ import ( "os" ) +type APIConfigResp struct { + config.Config + SyncNodeIds []int `json:"sync_node_ids" gorm:"serializer:json"` + SyncOverwrite bool `json:"sync_overwrite"` +} + func GetConfig(c *gin.Context) { name := c.Param("name") @@ -34,7 +40,7 @@ func GetConfig(c *gin.Context) { api.ErrHandler(c, err) return } - + q := query.Config g := query.ChatGPTLog chatgpt, err := g.Where(g.Name.Eq(path)).FirstOrCreate() if err != nil { @@ -46,11 +52,21 @@ func GetConfig(c *gin.Context) { chatgpt.Content = make([]openai.ChatCompletionMessage, 0) } - c.JSON(http.StatusOK, config.Config{ - Name: stat.Name(), - Content: string(content), - ChatGPTMessages: chatgpt.Content, - FilePath: path, - ModifiedAt: stat.ModTime(), + cfg, err := q.Where(q.Filepath.Eq(path)).FirstOrInit() + if err != nil { + api.ErrHandler(c, err) + return + } + + c.JSON(http.StatusOK, APIConfigResp{ + Config: config.Config{ + Name: stat.Name(), + Content: string(content), + ChatGPTMessages: chatgpt.Content, + FilePath: path, + ModifiedAt: stat.ModTime(), + }, + SyncNodeIds: cfg.SyncNodeIds, + SyncOverwrite: cfg.SyncOverwrite, }) } diff --git a/api/config/folder.go b/api/config/mkdir.go similarity index 99% rename from api/config/folder.go rename to api/config/mkdir.go index 31af2e6..56e532e 100644 --- a/api/config/folder.go +++ b/api/config/mkdir.go @@ -30,6 +30,7 @@ func Mkdir(c *gin.Context) { api.ErrHandler(c, err) return } + c.JSON(http.StatusOK, gin.H{ "message": "ok", }) diff --git a/api/config/modify.go b/api/config/modify.go index b1cdb60..dec01f8 100644 --- a/api/config/modify.go +++ b/api/config/modify.go @@ -5,6 +5,7 @@ import ( "github.com/0xJacky/Nginx-UI/internal/config" "github.com/0xJacky/Nginx-UI/internal/helper" "github.com/0xJacky/Nginx-UI/internal/nginx" + "github.com/0xJacky/Nginx-UI/model" "github.com/0xJacky/Nginx-UI/query" "github.com/gin-gonic/gin" "github.com/sashabaranov/go-openai" @@ -24,6 +25,8 @@ func EditConfig(c *gin.Context) { Filepath string `json:"filepath" binding:"required"` NewFilepath string `json:"new_filepath" binding:"required"` Content string `json:"content"` + Overwrite bool `json:"overwrite"` + SyncNodeIds []int `json:"sync_node_ids"` } if !api.BindAndValid(c, &json) { return @@ -66,8 +69,25 @@ func EditConfig(c *gin.Context) { } } - g := query.ChatGPTLog + q := query.Config + cfg, err := q.Where(q.Filepath.Eq(json.Filepath)).FirstOrCreate() + if err != nil { + api.ErrHandler(c, err) + return + } + _, err = q.Where(q.Filepath.Eq(json.Filepath)).Updates(&model.Config{ + Name: json.Name, + Filepath: json.NewFilepath, + SyncNodeIds: json.SyncNodeIds, + SyncOverwrite: json.Overwrite, + }) + + if err != nil { + api.ErrHandler(c, err) + return + } + g := query.ChatGPTLog // handle rename if path != json.NewFilepath { if helper.FileExists(json.NewFilepath) { @@ -87,6 +107,12 @@ func EditConfig(c *gin.Context) { _, _ = g.Where(g.Name.Eq(path)).Update(g.Name, json.NewFilepath) } + err = config.SyncToRemoteServer(cfg, json.NewFilepath) + if err != nil { + api.ErrHandler(c, err) + return + } + output := nginx.Reload() if nginx.GetLogLevel(output) >= nginx.Warn { c.JSON(http.StatusInternalServerError, gin.H{ diff --git a/api/config/rename.go b/api/config/rename.go index b9bdcd4..f028833 100644 --- a/api/config/rename.go +++ b/api/config/rename.go @@ -2,7 +2,9 @@ package config import ( "github.com/0xJacky/Nginx-UI/api" + "github.com/0xJacky/Nginx-UI/internal/config" "github.com/0xJacky/Nginx-UI/internal/helper" + "github.com/0xJacky/Nginx-UI/internal/logger" "github.com/0xJacky/Nginx-UI/internal/nginx" "github.com/0xJacky/Nginx-UI/query" "github.com/gin-gonic/gin" @@ -12,14 +14,16 @@ import ( func Rename(c *gin.Context) { var json struct { - BasePath string `json:"base_path"` - OrigName string `json:"orig_name"` - NewName string `json:"new_name"` + BasePath string `json:"base_path"` + OrigName string `json:"orig_name"` + NewName string `json:"new_name"` + SyncNodeIds []int `json:"sync_node_ids" gorm:"serializer:json"` } if !api.BindAndValid(c, &json) { return } - if json.OrigName == json.OrigName { + logger.Debug(json) + if json.OrigName == json.NewName { c.JSON(http.StatusOK, gin.H{ "message": "ok", }) @@ -55,11 +59,36 @@ func Rename(c *gin.Context) { return } + // update ChatGPT records + g := query.ChatGPTLog + q := query.Config + cfg, err := q.Where(q.Filepath.Eq(origFullPath)).FirstOrInit() + if err != nil { + api.ErrHandler(c, err) + return + } if !stat.IsDir() { - // update ChatGPT records - g := query.ChatGPTLog _, _ = g.Where(g.Name.Eq(newFullPath)).Delete() _, _ = g.Where(g.Name.Eq(origFullPath)).Update(g.Name, newFullPath) + // for file, the sync policy for this file is used + json.SyncNodeIds = cfg.SyncNodeIds + } else { + // is directory, update all records under the directory + _, _ = g.Where(g.Name.Like(origFullPath+"%")).Update(g.Name, g.Name.Replace(origFullPath, newFullPath)) + } + + _, err = q.Where(q.Filepath.Eq(origFullPath)).Update(q.Filepath, newFullPath) + if err != nil { + api.ErrHandler(c, err) + return + } + + if len(json.SyncNodeIds) > 0 { + err = config.SyncRenameOnRemoteServer(origFullPath, newFullPath, json.SyncNodeIds) + if err != nil { + api.ErrHandler(c, err) + return + } } c.JSON(http.StatusOK, gin.H{ diff --git a/api/config/router.go b/api/config/router.go index 76fb66b..f182b27 100644 --- a/api/config/router.go +++ b/api/config/router.go @@ -1,6 +1,9 @@ package config -import "github.com/gin-gonic/gin" +import ( + "github.com/0xJacky/Nginx-UI/internal/middleware" + "github.com/gin-gonic/gin" +) func InitRouter(r *gin.RouterGroup) { r.GET("config_base_path", GetBasePath) @@ -9,6 +12,10 @@ func InitRouter(r *gin.RouterGroup) { r.GET("config/*name", GetConfig) r.POST("config", AddConfig) r.POST("config/*name", EditConfig) - r.POST("config_mkdir", Mkdir) - r.POST("config_rename", Rename) + + o := r.Group("", middleware.RequireSecureSession()) + { + o.POST("config_mkdir", Mkdir) + o.POST("config_rename", Rename) + } } diff --git a/api/user/otp.go b/api/user/otp.go index e5eb000..9bed1a9 100644 --- a/api/user/otp.go +++ b/api/user/otp.go @@ -170,6 +170,13 @@ func OTPStatus(c *gin.Context) { }) } +func SecureSessionStatus(c *gin.Context) { + // if you can visit this endpoint, you are already in a secure session + c.JSON(http.StatusOK, gin.H{ + "status": true, + }) +} + func StartSecure2FASession(c *gin.Context) { var json struct { OTP string `json:"otp"` diff --git a/api/user/router.go b/api/user/router.go index f4b8c35..fa2f909 100644 --- a/api/user/router.go +++ b/api/user/router.go @@ -1,6 +1,9 @@ package user -import "github.com/gin-gonic/gin" +import ( + "github.com/0xJacky/Nginx-UI/internal/middleware" + "github.com/gin-gonic/gin" +) func InitAuthRouter(r *gin.RouterGroup) { r.POST("/login", Login) @@ -23,5 +26,8 @@ func InitUserRouter(r *gin.RouterGroup) { r.GET("/otp_secret", GenerateTOTP) r.POST("/otp_enroll", EnrollTOTP) r.POST("/otp_reset", ResetOTP) + + r.GET("/otp_secure_session_status", + middleware.RequireSecureSession(), SecureSessionStatus) r.POST("/otp_secure_session", StartSecure2FASession) } diff --git a/app/src/api/config.ts b/app/src/api/config.ts index 98af72b..7503bcb 100644 --- a/app/src/api/config.ts +++ b/app/src/api/config.ts @@ -8,6 +8,8 @@ export interface Config { chatgpt_messages: ChatComplicationMessage[] filepath: string modified_at: string + sync_node_ids?: number[] + sync_overwrite?: false } class ConfigCurd extends Curd { @@ -23,8 +25,13 @@ class ConfigCurd extends Curd { return http.post('/config_mkdir', { base_path: basePath, folder_name: name }) } - rename(basePath: string, origName: string, newName: string) { - return http.post('/config_rename', { base_path: basePath, orig_name: origName, new_name: newName }) + rename(basePath: string, origName: string, newName: string, syncNodeIds: number[]) { + return http.post('/config_rename', { + base_path: basePath, + orig_name: origName, + new_name: newName, + sync_node_ids: syncNodeIds, + }) } } diff --git a/app/src/api/otp.ts b/app/src/api/otp.ts index aacd028..60c71ad 100644 --- a/app/src/api/otp.ts +++ b/app/src/api/otp.ts @@ -24,6 +24,9 @@ const otp = { recovery_code, }) }, + secure_session_status() { + return http.get('/otp_secure_session_status') + }, } export default otp diff --git a/app/src/components/Notification/cert.ts b/app/src/components/Notification/cert.ts new file mode 100644 index 0000000..a8784a4 --- /dev/null +++ b/app/src/components/Notification/cert.ts @@ -0,0 +1,18 @@ +export function syncCertificateSuccess(text: string) { + const data = JSON.parse(text) + + return $gettext('Sync Certificate %{cert_name} to %{env_name} successfully', + { cert_name: data.cert_name, env_name: data.env_name }) +} + +export function syncCertificateError(text: string) { + const data = JSON.parse(text) + + if (data.status_code === 404) { + return $gettext('Sync Certificate %{cert_name} to %{env_name} failed, please upgrade the remote Nginx UI to the latest version', + { cert_name: data.cert_name, env_name: data.env_name }, true) + } + + return $gettext('Sync Certificate %{cert_name} to %{env_name} failed, response: %{resp}', + { cert_name: data.cert_name, env_name: data.env_name, resp: data.resp_body }, true) +} diff --git a/app/src/components/Notification/config.ts b/app/src/components/Notification/config.ts new file mode 100644 index 0000000..0fad27d --- /dev/null +++ b/app/src/components/Notification/config.ts @@ -0,0 +1,37 @@ +export function syncConfigSuccess(text: string) { + const data = JSON.parse(text) + + return $gettext('Sync Config %{config_name} to %{env_name} successfully', + { config_name: data.config_name, env_name: data.env_name }) +} + +export function syncConfigError(text: string) { + const data = JSON.parse(text) + + if (data.status_code === 404) { + return $gettext('Sync config %{cert_name} to %{env_name} failed, please upgrade the remote Nginx UI to the latest version', + { config_name: data.config_name, env_name: data.env_name }, true) + } + + return $gettext('Sync config %{config_name} to %{env_name} failed, response: %{resp}', + { cert_name: data.cert_name, env_name: data.env_name, resp: data.resp_body }, true) +} + +export function syncRenameConfigSuccess(text: string) { + const data = JSON.parse(text) + + return $gettext('Rename %{orig_path} to %{new_path} on %{env_name} successfully', + { orig_path: data.orig_path, new_path: data.orig_path, env_name: data.env_name }) +} + +export function syncRenameConfigError(text: string) { + const data = JSON.parse(text) + + if (data.status_code === 404) { + return $gettext('Rename %{orig_path} to %{new_path} on %{env_name} failed, please upgrade the remote Nginx UI to the latest version', + { orig_path: data.orig_path, new_path: data.orig_path, env_name: data.env_name }, true) + } + + return $gettext('Rename %{orig_path} to %{new_path} on %{env_name} failed, response: %{resp}', + { orig_path: data.orig_path, new_path: data.orig_path, resp: data.resp_body, env_name: data.env_name }, true) +} diff --git a/app/src/components/Notification/detailRender.ts b/app/src/components/Notification/detailRender.ts index 6c056a1..4d90cc1 100644 --- a/app/src/components/Notification/detailRender.ts +++ b/app/src/components/Notification/detailRender.ts @@ -1,4 +1,11 @@ import type { customRender } from '@/components/StdDesign/StdDataDisplay/StdTableTransformer' +import { syncCertificateError, syncCertificateSuccess } from '@/components/Notification/cert' +import { + syncConfigError, + syncConfigSuccess, + syncRenameConfigError, + syncRenameConfigSuccess, +} from '@/components/Notification/config' export const detailRender = (args: customRender) => { switch (args.record.title) { @@ -6,26 +13,15 @@ export const detailRender = (args: customRender) => { return syncCertificateSuccess(args.text) case 'Sync Certificate Error': return syncCertificateError(args.text) + case 'Sync Rename Configuration Success': + return syncRenameConfigSuccess(args.text) + case 'Sync Rename Configuration Error': + return syncRenameConfigError(args.text) + case 'Sync Configuration Success': + return syncConfigSuccess(args.text) + case 'Sync Configuration Error': + return syncConfigError(args.text) default: return args.text } } - -function syncCertificateSuccess(text: string) { - const data = JSON.parse(text) - - return $gettext('Sync Certificate %{cert_name} to %{env_name} successfully', - { cert_name: data.cert_name, env_name: data.env_name }) -} - -function syncCertificateError(text: string) { - const data = JSON.parse(text) - - if (data.status_code === 404) { - return $gettext('Sync Certificate %{cert_name} to %{env_name} failed, please upgrade the remote Nginx UI to the latest version', - { cert_name: data.cert_name, env_name: data.env_name }, true) - } - - return $gettext('Sync Certificate %{cert_name} to %{env_name} failed, response: %{resp}', - { cert_name: data.cert_name, env_name: data.env_name, resp: data.resp_body }, true) -} diff --git a/app/src/components/OTP/useOTPModal.ts b/app/src/components/OTP/useOTPModal.ts index 7f0325b..8f1c296 100644 --- a/app/src/components/OTP/useOTPModal.ts +++ b/app/src/components/OTP/useOTPModal.ts @@ -5,11 +5,6 @@ import OTPAuthorization from '@/components/OTP/OTPAuthorization.vue' import otp from '@/api/otp' import { useUserStore } from '@/pinia' -export interface OTPModalProps { - onOk?: (secureSessionId: string) => void - onCancel?: () => void -} - const useOTPModal = () => { const refOTPAuthorization = ref() const randomId = Math.random().toString(36).substring(2, 8) @@ -26,68 +21,72 @@ const useOTPModal = () => { document.head.appendChild(style) } - const open = async ({ onOk, onCancel }: OTPModalProps) => { + const open = async (): Promise => { const { status } = await otp.status() - if (!status) { - onOk?.('') - return - } + return new Promise((resolve, reject) => { + if (!status) { + resolve('') - const cookies = useCookies(['nginx-ui-2fa']) - const ssid = cookies.get('secure_session_id') - if (ssid) { - onOk?.(ssid) - secureSessionId.value = ssid + return + } - return - } + const cookies = useCookies(['nginx-ui-2fa']) + const ssid = cookies.get('secure_session_id') + if (ssid) { + resolve(ssid) + secureSessionId.value = ssid - injectStyles() - let container: HTMLDivElement | null = document.createElement('div') - document.body.appendChild(container) + return + } - const close = () => { - render(null, container!) - document.body.removeChild(container!) - container = null - } + injectStyles() + let container: HTMLDivElement | null = document.createElement('div') + document.body.appendChild(container) - const verify = (passcode: string, recovery: string) => { - otp.start_secure_session(passcode, recovery).then(r => { - cookies.set('secure_session_id', r.session_id, { maxAge: 60 * 3 }) - onOk?.(r.session_id) - close() - secureSessionId.value = r.session_id - }).catch(async () => { - refOTPAuthorization.value?.clearInput() - await message.error($gettext('Invalid passcode or recovery code')) - }) - } + const close = () => { + render(null, container!) + document.body.removeChild(container!) + container = null + } - const vnode = createVNode(Modal, { - open: true, - title: $gettext('Two-factor authentication required'), - centered: true, - maskClosable: false, - class: randomId, - footer: false, - onCancel: () => { - close() - onCancel?.() - }, - }, { - default: () => h( - OTPAuthorization, - { - ref: refOTPAuthorization, - class: 'mt-3', - onOnSubmit: verify, + const verify = (passcode: string, recovery: string) => { + otp.start_secure_session(passcode, recovery).then(r => { + cookies.set('secure_session_id', r.session_id, { maxAge: 60 * 3 }) + resolve(r.session_id) + close() + secureSessionId.value = r.session_id + }).catch(async () => { + refOTPAuthorization.value?.clearInput() + await message.error($gettext('Invalid passcode or recovery code')) + }) + } + + const vnode = createVNode(Modal, { + open: true, + title: $gettext('Two-factor authentication required'), + centered: true, + maskClosable: false, + class: randomId, + footer: false, + onCancel: () => { + close() + // eslint-disable-next-line prefer-promise-reject-errors + reject() }, - ), - }) + }, { + default: () => h( + OTPAuthorization, + { + ref: refOTPAuthorization, + class: 'mt-3', + onOnSubmit: verify, + }, + ), + }) - render(vnode, container) + render(vnode, container!) + }) } return { open } diff --git a/app/src/language/en/app.po b/app/src/language/en/app.po index 449ebbc..d79eba6 100644 --- a/app/src/language/en/app.po +++ b/app/src/language/en/app.po @@ -194,9 +194,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "Auto-renewal enabled for %{name}" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "Back" @@ -369,7 +369,7 @@ msgstr "" msgid "Configuration Name" msgstr "Configuration Name" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "Configurations" @@ -420,12 +420,12 @@ msgstr "Created at" msgid "Create Another" msgstr "Create Another" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 #, fuzzy msgid "Create File" msgstr "Created at" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 #, fuzzy msgid "Create Folder" msgstr "Create Another" @@ -474,8 +474,8 @@ msgid "" "indicator." msgstr "" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "Dashboard" @@ -803,6 +803,10 @@ msgstr "Enabled successfully" msgid "Encrypt website with Let's Encrypt" msgstr "Encrypt website with Let's Encrypt" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "" @@ -1191,8 +1195,8 @@ msgstr "" "Make sure you have configured a reverse proxy for .well-known directory to " "HTTPChallengePort (default: 9180) before getting the certificate." -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "Manage Configs" @@ -1239,6 +1243,7 @@ msgstr "Advance Mode" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 #, fuzzy msgid "Modify" msgstr "Modify Config" @@ -1703,7 +1708,8 @@ msgstr "Saved successfully" msgid "Removed successfully" msgstr "Saved successfully" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 #, fuzzy msgid "Rename" diff --git a/app/src/language/es/app.po b/app/src/language/es/app.po index 8c025c9..d5a21a6 100644 --- a/app/src/language/es/app.po +++ b/app/src/language/es/app.po @@ -194,9 +194,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "Renovación automática habilitada por %{name}" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "Volver" @@ -362,7 +362,7 @@ msgstr "El archivo de configuración se probó exitosamente" msgid "Configuration Name" msgstr "Nombre de la configuración" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "Configuraciones" @@ -412,12 +412,12 @@ msgstr "Crear" msgid "Create Another" msgstr "Crear otro" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 #, fuzzy msgid "Create File" msgstr "Crear" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 #, fuzzy msgid "Create Folder" msgstr "Crear otro" @@ -466,8 +466,8 @@ msgid "" "indicator." msgstr "" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "Panel" @@ -778,6 +778,10 @@ msgstr "Habilitado con éxito" msgid "Encrypt website with Let's Encrypt" msgstr "Encriptar sitio web con Let's Encrypt" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "Entorno" @@ -1152,8 +1156,8 @@ msgstr "" "Asegúrese de haber configurado un proxy reverso para el directorio .well-" "known en HTTPChallengePort antes de obtener el certificado." -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "Administrar configuraciones" @@ -1198,6 +1202,7 @@ msgstr "Modo de ejecución" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 msgid "Modify" msgstr "Modificar" @@ -1660,7 +1665,8 @@ msgstr "Eliminado con éxito" msgid "Removed successfully" msgstr "Eliminado con éxito" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 msgid "Rename" msgstr "Renombrar" diff --git a/app/src/language/fr_FR/app.po b/app/src/language/fr_FR/app.po index 301785a..643d53d 100644 --- a/app/src/language/fr_FR/app.po +++ b/app/src/language/fr_FR/app.po @@ -197,9 +197,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "Renouvellement automatique activé pour %{name}" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "Retour" @@ -369,7 +369,7 @@ msgstr "Le fichier de configuration est testé avec succès" msgid "Configuration Name" msgstr "Nom de la configuration" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "Configurations" @@ -420,12 +420,12 @@ msgstr "Créé le" msgid "Create Another" msgstr "Créer un autre" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 #, fuzzy msgid "Create File" msgstr "Créé le" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 #, fuzzy msgid "Create Folder" msgstr "Créer un autre" @@ -474,8 +474,8 @@ msgid "" "indicator." msgstr "" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "Dashboard" @@ -803,6 +803,10 @@ msgstr "Activé avec succès" msgid "Encrypt website with Let's Encrypt" msgstr "Crypter le site Web avec Let's Encrypt" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "" @@ -1193,8 +1197,8 @@ msgstr "" "Assurez vous d'avoir configuré un reverse proxy pour le répertoire .well-" "known vers HTTPChallengePort avant d'obtenir le certificat." -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "Gérer les configurations" @@ -1241,6 +1245,7 @@ msgstr "Mode d'exécution" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 msgid "Modify" msgstr "Modifier" @@ -1710,7 +1715,8 @@ msgstr "Enregistré avec succès" msgid "Removed successfully" msgstr "Enregistré avec succès" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 #, fuzzy msgid "Rename" diff --git a/app/src/language/ko_KR/app.po b/app/src/language/ko_KR/app.po index 5ea650f..29f58c5 100644 --- a/app/src/language/ko_KR/app.po +++ b/app/src/language/ko_KR/app.po @@ -193,9 +193,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "%{name}에 대한 자동 갱신 활성화됨" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "뒤로" @@ -360,7 +360,7 @@ msgstr "구성 파일 테스트 성공" msgid "Configuration Name" msgstr "구성 이름" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "구성들" @@ -410,12 +410,12 @@ msgstr "생성" msgid "Create Another" msgstr "다른 것 생성하기" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 #, fuzzy msgid "Create File" msgstr "생성" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 #, fuzzy msgid "Create Folder" msgstr "다른 것 생성하기" @@ -464,8 +464,8 @@ msgid "" "indicator." msgstr "" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "대시보드" @@ -776,6 +776,11 @@ msgstr "성공적으로 활성화됨" msgid "Encrypt website with Let's Encrypt" msgstr "Let's Encrypt로 웹사이트 암호화" +#: src/views/config/ConfigList.vue:151 +#, fuzzy +msgid "Enter" +msgstr "간격" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "환경" @@ -1170,8 +1175,8 @@ msgstr "" "인증서를 획득하기 전에 .well-known 디렉토리에 대한역방향 프록시를 " "HTTPChallengePort(기본값: 9180)로 구성했는지 확인하세요." -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "구성 관리" @@ -1218,6 +1223,7 @@ msgstr "실행 모드" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 #, fuzzy msgid "Modify" msgstr "설정 수정" @@ -1686,7 +1692,8 @@ msgstr "성공적으로 제거됨" msgid "Removed successfully" msgstr "성공적으로 제거됨" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 #, fuzzy msgid "Rename" diff --git a/app/src/language/messages.pot b/app/src/language/messages.pot index 43b0bfc..2288651 100644 --- a/app/src/language/messages.pot +++ b/app/src/language/messages.pot @@ -181,8 +181,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 #: src/views/config/ConfigEditor.vue:196 +#: src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 #: src/views/domain/DomainEdit.vue:253 #: src/views/nginx_log/NginxLog.vue:168 #: src/views/stream/StreamEdit.vue:245 @@ -347,7 +348,7 @@ msgstr "" msgid "Configuration Name" msgstr "" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "" @@ -397,12 +398,12 @@ msgstr "" msgid "Create Another" msgstr "" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 msgid "Create File" msgstr "" #: src/views/config/components/Mkdir.vue:50 -#: src/views/config/Config.vue:100 +#: src/views/config/ConfigList.vue:116 msgid "Create Folder" msgstr "" @@ -449,9 +450,9 @@ msgid "Customize the name of local server to be displayed in the environment ind msgstr "" #: src/routes/index.ts:39 -#: src/views/config/Config.vue:57 #: src/views/config/ConfigEditor.vue:118 #: src/views/config/ConfigEditor.vue:79 +#: src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "" @@ -768,6 +769,10 @@ msgstr "" msgid "Encrypt website with Let's Encrypt" msgstr "" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "" + #: src/routes/index.ts:228 #: src/views/environment/Environment.vue:34 msgid "Environment" @@ -1129,9 +1134,9 @@ msgid "Make sure you have configured a reverse proxy for .well-known directory t msgstr "" #: src/routes/index.ts:102 -#: src/views/config/Config.vue:62 #: src/views/config/ConfigEditor.vue:123 #: src/views/config/ConfigEditor.vue:84 +#: src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "" @@ -1178,6 +1183,7 @@ msgstr "" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 msgid "Modify" msgstr "" @@ -1623,7 +1629,7 @@ msgid "Removed successfully" msgstr "" #: src/views/config/components/Rename.vue:52 -#: src/views/config/Config.vue:130 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 msgid "Rename" msgstr "" diff --git a/app/src/language/ru_RU/app.po b/app/src/language/ru_RU/app.po index 36abf3a..fda952c 100644 --- a/app/src/language/ru_RU/app.po +++ b/app/src/language/ru_RU/app.po @@ -195,9 +195,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "Автообновление включено для %{name}" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "Назад" @@ -371,7 +371,7 @@ msgstr "Проверка конфигурации успешна" msgid "Configuration Name" msgstr "Название конфигурации" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "Конфигурации" @@ -422,12 +422,12 @@ msgstr "Создан в" msgid "Create Another" msgstr "Создать еще" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 #, fuzzy msgid "Create File" msgstr "Создан в" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 #, fuzzy msgid "Create Folder" msgstr "Создать еще" @@ -476,8 +476,8 @@ msgid "" "indicator." msgstr "" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "Доска" @@ -807,6 +807,10 @@ msgstr "Активировано успешно" msgid "Encrypt website with Let's Encrypt" msgstr "Использовать для сайта Let's Encrypt" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "Окружение" @@ -1199,8 +1203,8 @@ msgstr "" "Убедитесь, что вы настроили обратный прокси-сервер для каталога .well-known " "на HTTPChallengePort перед получением сертификата»." -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "Конфигурации" @@ -1247,6 +1251,7 @@ msgstr "Расширенный режим" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 #, fuzzy msgid "Modify" msgstr "Изменить" @@ -1716,7 +1721,8 @@ msgstr "Успешно сохранено" msgid "Removed successfully" msgstr "Успешно сохранено" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 #, fuzzy msgid "Rename" diff --git a/app/src/language/vi_VN/app.po b/app/src/language/vi_VN/app.po index 4bcfa4d..60b20cf 100644 --- a/app/src/language/vi_VN/app.po +++ b/app/src/language/vi_VN/app.po @@ -195,9 +195,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "Đã bật tự động gia hạn SSL cho %{name}" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "Quay lại" @@ -371,7 +371,7 @@ msgstr "Tệp cấu hình được kiểm tra thành công" msgid "Configuration Name" msgstr "Tên cấu hình" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "Cấu hình" @@ -422,12 +422,12 @@ msgstr "Ngày tạo" msgid "Create Another" msgstr "Tạo thêm" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 #, fuzzy msgid "Create File" msgstr "Ngày tạo" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 #, fuzzy msgid "Create Folder" msgstr "Tạo thêm" @@ -476,8 +476,8 @@ msgid "" "indicator." msgstr "" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "Bảng điều khiển" @@ -808,6 +808,10 @@ msgstr "Đã bật" msgid "Encrypt website with Let's Encrypt" msgstr "Bảo mật trang web với Let's Encrypt" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "Environment" @@ -1201,8 +1205,8 @@ msgstr "" "Đảm bảo rằng bạn đã định cấu hình proxy ngược (reverse proxy) thư mục .well-" "known tới HTTPChallengePort (default: 9180) trước khi ký chứng chỉ SSL." -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "Quản lý cấu hình" @@ -1248,6 +1252,7 @@ msgstr "Run Mode" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 #, fuzzy msgid "Modify" msgstr "Sửa" @@ -1718,7 +1723,8 @@ msgstr "Xoá thành công" msgid "Removed successfully" msgstr "Xoá thành công" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 #, fuzzy msgid "Rename" diff --git a/app/src/language/zh_CN/app.mo b/app/src/language/zh_CN/app.mo index 5daddcd110677bcf7306fa0745fd98370b447eba..73077a87299ca7ab4572772060a57f35ec86525d 100644 GIT binary patch delta 9926 zcmYkCcX(Gt*2h01O+mVX(yM_~NC6T|fpkhRfj}UEkOUGTp@bTm*8(bnqDEa6kwrlP z8^VHuf+#A*f}$e6h_EW^vNl+E*9Pn}`5vFw`Qvwf=iD==Pq{O9!*A}j-(2untNQl? zeCVJ9@NzSle+d+I^i&uS0`-9S5V#yj41vplA%>4KSYq_)25Ul~0dR8&Gy!f8frh|+ zCU12Jw1j}QAaA$9b1YYb7R{&r4mZ!h>mO%|erLcLZJh>uN z5osR^U4dSqQZU5$Dnr$OrtvKdg)4#ELgm;RPY-~Nq0j=@9;%SNX$)^$$B#pyDe$Gy z&zS+|jlX`F1U3$nfmepfz;?xiUe=!sWrKaC!7~xGewH=)agCB4k+e2nlQ-p-A+OkYTYAaILQiqu*-$_e4N* zU`<2-oq=Z}pgZtRgcP5Rfa`#tjWIh?28@lA=jD;gZB?W~J1=9XkCUP$rzl#U&ySV^E2AOCkN*dv<=LTVXyeCwv{G`;7+b|C zlpSK!F)BupiH}h#(v3beMuz0aD56C%is)@IiqwlS&=%Nd`0*H@x&Xe4QSmg5Rp{Ht zD&$eIvbcY&JRcS-g)?Ghz}#4QcvGxuW34@ZI#vp|#;VA6o4j{S{ztJg^dGU%&X4~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+5y?xUm4({=@FYurGDcw5-uQl|!wunp+s zV7=4IPnCn*zZl`4-KNz47&F-3w*njdSq1RCwf*`0(?K%_FIYq1mknT{|F!{c^vUuo sw?9nriE_}>`TKofw1XOB^w%W-v9sr diff --git a/app/src/language/zh_CN/app.po b/app/src/language/zh_CN/app.po index 010e5f6..9b3737a 100644 --- a/app/src/language/zh_CN/app.po +++ b/app/src/language/zh_CN/app.po @@ -184,9 +184,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "成功启用 %{name} 自动续签" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "返回" @@ -344,7 +344,7 @@ msgstr "配置文件测试成功" msgid "Configuration Name" msgstr "配置名称" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "配置" @@ -394,11 +394,11 @@ msgstr "创建" msgid "Create Another" msgstr "再创建一个" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 msgid "Create File" msgstr "创建文件" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 msgid "Create Folder" msgstr "创建文件夹" @@ -445,8 +445,8 @@ msgid "" "indicator." msgstr "自定义显示在环境指示器中的本地服务器名称。" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "仪表盘" @@ -751,6 +751,10 @@ msgstr "启用成功" msgid "Encrypt website with Let's Encrypt" msgstr "用 Let's Encrypt 对网站进行加密" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "进入" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "环境" @@ -1123,8 +1127,8 @@ msgstr "" "在获取签发证书前,请确保配置文件中已将 .well-known 目录反向代理到 " "HTTPChallengePort。" -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "配置管理" @@ -1168,6 +1172,7 @@ msgstr "模型" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 msgid "Modify" msgstr "修改" @@ -1612,7 +1617,8 @@ msgstr "移除成功" msgid "Removed successfully" msgstr "删除成功" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 msgid "Rename" msgstr "重命名" diff --git a/app/src/language/zh_TW/app.po b/app/src/language/zh_TW/app.po index 982f313..5ab9107 100644 --- a/app/src/language/zh_TW/app.po +++ b/app/src/language/zh_TW/app.po @@ -197,9 +197,9 @@ msgid "Auto-renewal enabled for %{name}" msgstr "已啟用 %{name} 的自動續簽" #: src/views/certificate/CertificateEditor.vue:247 -#: src/views/config/Config.vue:143 src/views/config/ConfigEditor.vue:196 -#: src/views/domain/DomainEdit.vue:253 src/views/nginx_log/NginxLog.vue:168 -#: src/views/stream/StreamEdit.vue:245 +#: src/views/config/ConfigEditor.vue:196 src/views/config/ConfigList.vue:173 +#: src/views/config/ConfigList.vue:99 src/views/domain/DomainEdit.vue:253 +#: src/views/nginx_log/NginxLog.vue:168 src/views/stream/StreamEdit.vue:245 msgid "Back" msgstr "返回" @@ -366,7 +366,7 @@ msgstr "設定檔案測試成功" msgid "Configuration Name" msgstr "設定名稱" -#: src/views/config/Config.vue:91 +#: src/views/config/ConfigList.vue:91 msgid "Configurations" msgstr "設定" @@ -417,12 +417,12 @@ msgstr "建立時間" msgid "Create Another" msgstr "再建立一個" -#: src/views/config/Config.vue:99 +#: src/views/config/ConfigList.vue:109 #, fuzzy msgid "Create File" msgstr "建立時間" -#: src/views/config/components/Mkdir.vue:50 src/views/config/Config.vue:100 +#: src/views/config/components/Mkdir.vue:50 src/views/config/ConfigList.vue:116 #, fuzzy msgid "Create Folder" msgstr "再建立一個" @@ -471,8 +471,8 @@ msgid "" "indicator." msgstr "" -#: src/routes/index.ts:39 src/views/config/Config.vue:57 -#: src/views/config/ConfigEditor.vue:118 src/views/config/ConfigEditor.vue:79 +#: src/routes/index.ts:39 src/views/config/ConfigEditor.vue:118 +#: src/views/config/ConfigEditor.vue:79 src/views/config/ConfigList.vue:57 msgid "Dashboard" msgstr "儀表板" @@ -788,6 +788,10 @@ msgstr "成功啟用" msgid "Encrypt website with Let's Encrypt" msgstr "用 Let's Encrypt 對網站進行加密" +#: src/views/config/ConfigList.vue:151 +msgid "Enter" +msgstr "" + #: src/routes/index.ts:228 src/views/environment/Environment.vue:34 msgid "Environment" msgstr "環境" @@ -1172,8 +1176,8 @@ msgid "" msgstr "" "在取得憑證前,請確保您已將 .well-known 目錄反向代理到 HTTPChallengePort。" -#: src/routes/index.ts:102 src/views/config/Config.vue:62 -#: src/views/config/ConfigEditor.vue:123 src/views/config/ConfigEditor.vue:84 +#: src/routes/index.ts:102 src/views/config/ConfigEditor.vue:123 +#: src/views/config/ConfigEditor.vue:84 src/views/config/ConfigList.vue:62 msgid "Manage Configs" msgstr "管理設定" @@ -1220,6 +1224,7 @@ msgstr "執行模式" #: src/components/ChatGPT/ChatGPT.vue:248 #: src/components/StdDesign/StdDataDisplay/StdCurd.vue:181 #: src/components/StdDesign/StdDataDisplay/StdTable.vue:532 +#: src/views/config/ConfigList.vue:151 msgid "Modify" msgstr "修改" @@ -1681,7 +1686,8 @@ msgstr "儲存成功" msgid "Removed successfully" msgstr "儲存成功" -#: src/views/config/components/Rename.vue:52 src/views/config/Config.vue:130 +#: src/views/config/components/Rename.vue:52 +#: src/views/config/ConfigList.vue:159 #: src/views/domain/ngx_conf/NgxUpstream.vue:123 #, fuzzy msgid "Rename" diff --git a/app/src/lib/http/index.ts b/app/src/lib/http/index.ts index 628af67..a6ad4a7 100644 --- a/app/src/lib/http/index.ts +++ b/app/src/lib/http/index.ts @@ -1,11 +1,13 @@ import type { AxiosRequestConfig } from 'axios' import axios from 'axios' +import { useCookies } from '@vueuse/integrations/useCookies' import { storeToRefs } from 'pinia' import NProgress from 'nprogress' import { useSettingsStore, useUserStore } from '@/pinia' import 'nprogress/nprogress.css' import router from '@/routes' +import useOTPModal from '@/components/OTP/useOTPModal' const user = useUserStore() const settings = useSettingsStore() @@ -58,8 +60,14 @@ instance.interceptors.response.use( }, async error => { NProgress.done() + + const otpModal = useOTPModal() + const cookies = useCookies(['nginx-ui-2fa']) switch (error.response.status) { case 401: + cookies.remove('secure_session_id') + await otpModal.open() + break case 403: user.logout() await router.push('/login') diff --git a/app/src/routes/index.ts b/app/src/routes/index.ts index e29d513..dcd79c8 100644 --- a/app/src/routes/index.ts +++ b/app/src/routes/index.ts @@ -97,7 +97,7 @@ export const routes: RouteRecordRaw[] = [ { path: 'config', name: 'Manage Configs', - component: () => import('@/views/config/Config.vue'), + component: () => import('@/views/config/ConfigList.vue'), meta: { name: () => $gettext('Manage Configs'), icon: FileOutlined, diff --git a/app/src/version.json b/app/src/version.json index f5fb0c5..06f3160 100644 --- a/app/src/version.json +++ b/app/src/version.json @@ -1 +1 @@ -{"version":"2.0.0-beta.28","build_id":147,"total_build":351} \ No newline at end of file +{"version":"2.0.0-beta.28","build_id":149,"total_build":353} \ No newline at end of file diff --git a/app/src/views/config/ConfigEditor.vue b/app/src/views/config/ConfigEditor.vue index bfbeada..f18e177 100644 --- a/app/src/views/config/ConfigEditor.vue +++ b/app/src/views/config/ConfigEditor.vue @@ -1,8 +1,10 @@