diff --git a/api/config/add.go b/api/config/add.go index c8fac389..ace2cf16 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 a19aac9b..2d47f621 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 31af2e62..56e532e8 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 b1cdb60f..dec01f86 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 b9bdcd4f..f028833f 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 76fb66be..f182b27c 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 e5eb000d..9bed1a9e 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 f4b8c354..fa2f9094 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 98af72b9..7503bcb0 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 aacd0289..60c71ad3 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 00000000..a8784a4d --- /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 00000000..0fad27d1 --- /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 6c056a11..4d90cc1d 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 7f0325b2..8f1c2966 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 449ebbc4..d79eba6d 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 8c025c93..d5a21a61 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 301785aa..643d53db 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 5ea650f7..29f58c54 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 43b0bfc3..22886512 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 36abf3a6..fda952cc 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 4bcfa4d0..60b20cf5 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 5daddcd1..73077a87 100644 Binary files a/app/src/language/zh_CN/app.mo and b/app/src/language/zh_CN/app.mo differ diff --git a/app/src/language/zh_CN/app.po b/app/src/language/zh_CN/app.po index 010e5f66..9b3737a0 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 982f313e..5ab91071 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 628af67c..a6ad4a7e 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 e29d5130..dcd79c83 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 f5fb0c53..06f31606 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 bfbeada5..f18e1776 100644 --- a/app/src/views/config/ConfigEditor.vue +++ b/app/src/views/config/ConfigEditor.vue @@ -1,8 +1,10 @@