From 0b66be7a3a24df7f1fac473c7f4c2016ad61829d Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:34:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=9A=84=E7=8A=B6=E6=80=81=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#4156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_install.go | 6 +- backend/constant/app.go | 1 + backend/i18n/lang/en.yaml | 4 +- backend/i18n/lang/zh-Hant.yaml | 2 + backend/i18n/lang/zh.yaml | 4 +- backend/utils/files/file_op.go | 15 ++ frontend/package-lock.json | 8 +- frontend/package.json | 2 +- frontend/src/components/status/index.vue | 2 +- frontend/src/lang/modules/en.ts | 247 +++++++++--------- frontend/src/lang/modules/tw.ts | 227 ++++++++-------- frontend/src/lang/modules/zh.ts | 8 + frontend/src/styles/common.scss | 8 + frontend/src/styles/element.scss | 3 - .../src/views/container/container/index.vue | 3 +- frontend/src/views/cronjob/record/index.vue | 6 +- .../file-management/code-editor/index.vue | 10 +- frontend/src/views/log/login/index.vue | 6 +- 18 files changed, 309 insertions(+), 253 deletions(-) diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index cd9df9764..ab5f06843 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -749,8 +749,10 @@ func syncAppInstallStatus(appInstall *model.AppInstall) error { switch { case count == 0: - appInstall.Status = constant.Error - appInstall.Message = buserr.WithName("ErrContainerNotFound", strings.Join(containerNames, ",")).Error() + if appInstall.Status != constant.Error { + appInstall.Status = constant.SyncErr + appInstall.Message = buserr.WithName("ErrContainerNotFound", strings.Join(containerNames, ",")).Error() + } case exitedCount == total: appInstall.Status = constant.Stopped case runningCount == total: diff --git a/backend/constant/app.go b/backend/constant/app.go index dc3d75e68..4e4f8d6e1 100644 --- a/backend/constant/app.go +++ b/backend/constant/app.go @@ -13,6 +13,7 @@ const ( Syncing = "Syncing" SyncSuccess = "SyncSuccess" Paused = "Paused" + SyncErr = "SyncErr" ContainerPrefix = "1Panel-" diff --git a/backend/i18n/lang/en.yaml b/backend/i18n/lang/en.yaml index a175e38da..4c24f45f9 100644 --- a/backend/i18n/lang/en.yaml +++ b/backend/i18n/lang/en.yaml @@ -169,4 +169,6 @@ ErrBanAction: "Setting failed, the current {{ .name }} service is unavailable, p #waf ErrScope: "Modification of this configuration is not supported" -ErrStateChange: "State modification failed" \ No newline at end of file +ErrStateChange: "State modification failed" +ErrRuleExist: "Rule is Exist" +ErrRuleNotExist: "Rule is not Exist" \ No newline at end of file diff --git a/backend/i18n/lang/zh-Hant.yaml b/backend/i18n/lang/zh-Hant.yaml index a5293e109..45c98a445 100644 --- a/backend/i18n/lang/zh-Hant.yaml +++ b/backend/i18n/lang/zh-Hant.yaml @@ -171,3 +171,5 @@ ErrBanAction: "設置失敗,當前 {{ .name }} 服務不可用,請檢查後 #waf ErrScope: "不支援修改此配置" ErrStateChange: "狀態修改失敗" +ErrRuleExist: "規則名稱已存在" +ErrRuleNotExist: "規則不存在" diff --git a/backend/i18n/lang/zh.yaml b/backend/i18n/lang/zh.yaml index 9594919cf..d489bba4f 100644 --- a/backend/i18n/lang/zh.yaml +++ b/backend/i18n/lang/zh.yaml @@ -169,4 +169,6 @@ ErrBanAction: "设置失败,当前 {{ .name }} 服务不可用,请检查后 #waf ErrScope: "不支持修改此配置" -ErrStateChange: "状态修改失败" \ No newline at end of file +ErrStateChange: "状态修改失败" +ErrRuleExist: "规则名称已存在" +ErrRuleNotExist: "规则不存在" \ No newline at end of file diff --git a/backend/utils/files/file_op.go b/backend/utils/files/file_op.go index 489c3f409..90586fa6d 100644 --- a/backend/utils/files/file_op.go +++ b/backend/utils/files/file_op.go @@ -126,6 +126,21 @@ func (f FileOp) SaveFile(dst string, content string, mode fs.FileMode) error { return nil } +func (f FileOp) SaveFileWithByte(dst string, content []byte, mode fs.FileMode) error { + if !f.Stat(path.Dir(dst)) { + _ = f.CreateDir(path.Dir(dst), mode.Perm()) + } + file, err := f.Fs.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, mode) + if err != nil { + return err + } + defer file.Close() + write := bufio.NewWriter(file) + _, _ = write.Write(content) + write.Flush() + return nil +} + func (f FileOp) ChownR(dst string, uid string, gid string, sub bool) error { cmdStr := fmt.Sprintf(`chown %s:%s "%s"`, uid, gid, dst) if sub { diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4a8e8bb9f..b9409d96e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -18,7 +18,7 @@ "echarts": "^5.3.0", "echarts-liquidfill": "^3.1.0", "element-plus": "^2.6.0", - "fit2cloud-ui-plus": "^1.0.9", + "fit2cloud-ui-plus": "^1.1.3", "js-base64": "^3.7.2", "js-md5": "^0.7.3", "md-editor-v3": "^2.7.2", @@ -5282,9 +5282,9 @@ } }, "node_modules/fit2cloud-ui-plus": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/fit2cloud-ui-plus/-/fit2cloud-ui-plus-1.0.9.tgz", - "integrity": "sha512-hsXJyR21RG07C/ghx1iQPzNoh6OE6uJvICeNY+8p5El4MG2Ji0j//gGKERdJwyH6H6MFkupMiPW7Z8uflnpSxw==", + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/fit2cloud-ui-plus/-/fit2cloud-ui-plus-1.1.3.tgz", + "integrity": "sha512-Zxp3gyzNxdsfQ6UjX8p1jmO5c++WU4l4A3OnLDseWqbuB1StR2sMfwg/Lh1yrmjBGHE5jLV5EttDcK+P/2LiIQ==", "dependencies": { "@element-plus/icons-vue": "^1.1.4", "element-plus": "^2.3.3", diff --git a/frontend/package.json b/frontend/package.json index 20020c6bd..941dbdd56 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -30,7 +30,7 @@ "echarts": "^5.3.0", "echarts-liquidfill": "^3.1.0", "element-plus": "^2.6.0", - "fit2cloud-ui-plus": "^1.0.9", + "fit2cloud-ui-plus": "^1.1.3", "js-base64": "^3.7.2", "js-md5": "^0.7.3", "md-editor-v3": "^2.7.2", diff --git a/frontend/src/components/status/index.vue b/frontend/src/components/status/index.vue index 0495b0f73..b130ff31c 100644 --- a/frontend/src/components/status/index.vue +++ b/frontend/src/components/status/index.vue @@ -36,7 +36,7 @@ const getType = (status: string) => { case 'removing': return 'warning'; default: - return 'info'; + return 'primary'; } }; diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 0190f28d1..d97bfa4a6 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -51,6 +51,7 @@ const message = { uninstall: 'Uninstall', fullscreen: 'Fullscreen', quitFullscreen: 'Quit Fullscreen', + update: 'Edit', }, search: { timeStart: 'Time start', @@ -246,6 +247,7 @@ const message = { ready: 'normal', applying: 'Applying', applyerror: 'Failure', + syncerr: 'Error', }, units: { second: 'Second', @@ -2144,125 +2146,132 @@ const message = { statusCode: 'Status code', manage: 'Management', }, - xpack: { - name: 'Professional Edition', - waf: { - name: 'WAF', - blackWhite: 'black and white list', - globalSetting: 'Global Setting', - websiteSetting: 'Website Settings', - blockRecords: 'Block records', - world: 'world', - china: 'China', - intercept: 'interception', - request: 'request', - count4xx: '4xx quantity', - count5xx: '5xx quantity', - todayStatus: 'Today Status', - reqMap: 'Request map (30 days)', - resource: 'source', - count: 'Quantity', - hight: 'high', - low: 'low', - reqCount: 'Number of requests', - interceptCount: 'Interception number', - requestTrends: 'Request Trends (7 days)', - interceptTrends: 'Intercept Trends (7 days)', - whiteList: 'whitelist', - blackList: 'blacklist', - ipBlackListHelper: 'IPs in the blacklist cannot access the website', - ipWhiteListHelper: 'IPs in the whitelist are not restricted by any rules', - uaBlackListHelper: 'Requests carrying User-Agent in the blacklist will be intercepted', - uaWhiteListHelper: 'Requests carrying User-Agent in the whitelist are not restricted by any rules', - urlBlackListHelper: 'Requests for URLs in the blacklist will be intercepted', - urlWhiteListHelper: 'Requests for URLs in the whitelist are not restricted by any rules', - ccHelper: - 'If any website has been requested more than {1} times in {0} seconds, this IP will be blocked for {2} seconds', - blockTime: 'Block time', - attackHelper: - 'The cumulative interception exceeds {1} times within {0} seconds, block this IP for {2} seconds', - notFoundHelper: - 'The cumulative request returned 404 more than {1} times within {0} seconds, block this IP for {2} seconds', - frequencyLimit: 'frequency limit', - regionLimit: 'region limit', - defaultRule: 'Default rule', - accessFrequencyLmit: 'Access frequency limit', - attackLimit: 'Attack frequency limit', - notFoundLimit: '404 frequency limit', - urlLimit: 'URL frequency limit', - urlLimitHelper: 'Set access frequency for a single URL', - sqliDefense: 'SQL injection defense', - sqliHelper: 'Identify SQL injection in requests and intercept', - xssHelper: 'Identify XSS in the request and intercept it', - xssDefense: 'XSS Defense', - uaDefense: 'Malicious User-Agent Rule', - uaHelper: 'Contains common malicious crawler rules', - argsDefense: 'Malicious parameter rules', - argsHelper: 'Prohibit malicious parameters in requests', - cookieDefense: 'Malicious Cookie Rule', - cookieHelper: 'Prohibit malicious cookies from being carried in requests', - headerDefense: 'Malicious Header Rule', - headerHelper: 'Prohibit requests from containing malicious headers', - httpRule: 'HTTP request method rules', - httpHelper: 'Restrict the request method type of the website', - geoRule: 'Regional access restrictions', - geoHelper: 'Restrict access to your website from certain regions', - ipLocation: 'IP home location', - action: 'action', - ruleType: 'attack type', - ipHelper: 'Please enter IP', - attackLog: 'Attack Log', - }, - monitor: { - name: 'Website Monitoring', - }, - tamper: { - tamperHelper1: - 'One-click deployment type of website, it is recommended to enable the application directory anti-tampering function;', - tamperHelper2: - 'If the website cannot be used normally or backup and restore fail after enabling the anti-tampering function, please disable the anti-tampering function first;', - tamperHelper3: - 'Enabling tamper-proofing will restrict reading, writing, deleting, permission, and owner modification operations of protected files under non-excluded directories. Please choose carefully when setting [Exclude Directory] and [Protect].', - op: 'Operation', - create: 'Create', - file: 'File', - tamperPath: 'Protection Directory', - tamperPathEdit: 'Modify Path', - log: 'Intercept Logs', - totalProtect: 'Total Protection', - todayProtect: 'Today’s Protection', - addRule: 'Add Rule', - ignore: 'Exclude Directory', - ignoreHelper: 'One per line, e.g., \ntmp\n./tmp', - ignoreHelper1: 'Add folder names or specific paths to ignore', - ignoreHelper2: 'To ignore specific folders, use relative paths starting with ./', - protect: 'Protect', - protectHelper: 'One per line, e.g., \npng\n./test.css', - protectHelper1: 'Specify file names, suffixes, or specific files for protection', - protectHelper2: 'To protect specific files, use relative paths starting with ./', - enableHelper: - 'The anti-tampering function of website {0} is about to be enabled to enhance website security. Do you want to continue?', - disableHelper: - 'The anti-tampering function of website {0} is about to be disabled. Do you want to continue?', - }, - setting: { - setting: 'Interface Settings', - title: 'Panel Description', - titleHelper: - 'Will be displayed on the user login page (e.g., Linux Server Operation and Maintenance Management Panel)', - logo: 'Logo', - logoHelper: - 'Will be displayed on the top left of the management page when the menu is collapsed (recommended image size: 82px*82px)', - logoWithText: 'Logo (with text)', - logoWithTextHelper: - 'Will be displayed on the top left of the management page when the menu is expanded (recommended image size: 185px*55px)', - favicon: 'Website Icon', - faviconHelper: 'Website icon (recommended image size: 16px*16px)', - reUpload: 'Re-upload', - supportType: 'Only jpg/png/jpeg files are allowed!', - setDefault: 'Restore Default', - reset: 'Reset', - }, + }, + xpack: { + name: 'Professional', + waf: { + name: 'WAF', + blackWhite: 'black and white list', + globalSetting: 'Global Setting', + websiteSetting: 'Website Settings', + blockRecords: 'Block records', + world: 'world', + china: 'China', + intercept: 'interception', + request: 'request', + count4xx: '4xx quantity', + count5xx: '5xx quantity', + todayStatus: 'Today Status', + reqMap: 'Request map (30 days)', + resource: 'source', + count: 'Quantity', + hight: 'high', + low: 'low', + reqCount: 'Number of requests', + interceptCount: 'Interception number', + requestTrends: 'Request Trends (7 days)', + interceptTrends: 'Intercept Trends (7 days)', + whiteList: 'whitelist', + blackList: 'blacklist', + ipBlackListHelper: 'IPs in the blacklist cannot access the website', + ipWhiteListHelper: 'IPs in the whitelist are not restricted by any rules', + uaBlackListHelper: 'Requests carrying User-Agent in the blacklist will be intercepted', + uaWhiteListHelper: 'Requests carrying User-Agent in the whitelist are not restricted by any rules', + urlBlackListHelper: 'Requests for URLs in the blacklist will be intercepted', + urlWhiteListHelper: 'Requests for URLs in the whitelist are not restricted by any rules', + ccHelper: + 'If any website has been requested more than {1} times in {0} seconds, this IP will be blocked for {2} seconds', + blockTime: 'Block time', + attackHelper: + 'The cumulative interception exceeds {1} times within {0} seconds, block this IP for {2} seconds', + notFoundHelper: + 'The cumulative request returned 404 more than {1} times within {0} seconds, block this IP for {2} seconds', + frequencyLimit: 'frequency limit', + regionLimit: 'region limit', + defaultRule: 'Default rule', + accessFrequencyLmit: 'Access frequency limit', + attackLimit: 'Attack frequency limit', + notFoundLimit: '404 frequency limit', + urlLimit: 'URL frequency limit', + urlLimitHelper: 'Set access frequency for a single URL', + sqliDefense: 'SQL injection defense', + sqliHelper: 'Identify SQL injection in requests and intercept', + xssHelper: 'Identify XSS in the request and intercept it', + xssDefense: 'XSS Defense', + uaDefense: 'Malicious User-Agent Rule', + uaHelper: 'Contains common malicious crawler rules', + argsDefense: 'Malicious parameter rules', + argsHelper: 'Prohibit malicious parameters in requests', + cookieDefense: 'Malicious Cookie Rule', + cookieHelper: 'Prohibit malicious cookies from being carried in requests', + headerDefense: 'Malicious Header Rule', + headerHelper: 'Prohibit requests from containing malicious headers', + httpRule: 'HTTP request method rules', + httpHelper: 'Restrict the request method type of the website', + geoRule: 'Regional access restrictions', + geoHelper: 'Restrict access to your website from certain regions', + ipLocation: 'IP home location', + action: 'action', + ruleType: 'attack type', + ipHelper: 'Please enter IP', + attackLog: 'Attack Log', + rule: 'Rule', + ipArr: 'IPV4 range', + ipStart: 'Start IP', + ipEnd: 'End IP', + ipv4: 'IPV4', + ipv6: 'IPV6', + }, + monitor: { + name: 'Website Monitor', + }, + tamper: { + tamper: 'Tamper', + tamperHelper1: + 'One-click deployment type of website, it is recommended to enable the application directory anti-tampering function;', + tamperHelper2: + 'If the website cannot be used normally or backup and restore fail after enabling the anti-tampering function, please disable the anti-tampering function first;', + tamperHelper3: + 'Enabling tamper-proofing will restrict reading, writing, deleting, permission, and owner modification operations of protected files under non-excluded directories. Please choose carefully when setting [Exclude Directory] and [Protect].', + op: 'Operation', + create: 'Create', + file: 'File', + tamperPath: 'Protection Directory', + tamperPathEdit: 'Modify Path', + log: 'Intercept Logs', + totalProtect: 'Total Protection', + todayProtect: 'Today’s Protection', + addRule: 'Add Rule', + ignore: 'Exclude Directory', + ignoreHelper: 'One per line, e.g., \ntmp\n./tmp', + ignoreHelper1: 'Add folder names or specific paths to ignore', + ignoreHelper2: 'To ignore specific folders, use relative paths starting with ./', + protect: 'Protect', + protectHelper: 'One per line, e.g., \npng\n./test.css', + protectHelper1: 'Specify file names, suffixes, or specific files for protection', + protectHelper2: 'To protect specific files, use relative paths starting with ./', + enableHelper: + 'The anti-tampering function of website {0} is about to be enabled to enhance website security. Do you want to continue?', + disableHelper: + 'The anti-tampering function of website {0} is about to be disabled. Do you want to continue?', + }, + setting: { + setting: 'Interface Settings', + title: 'Panel Description', + titleHelper: + 'Will be displayed on the user login page (e.g., Linux Server Operation and Maintenance Management Panel)', + logo: 'Logo', + logoHelper: + 'Will be displayed on the top left of the management page when the menu is collapsed (recommended image size: 82px*82px)', + logoWithText: 'Logo (with text)', + logoWithTextHelper: + 'Will be displayed on the top left of the management page when the menu is expanded (recommended image size: 185px*55px)', + favicon: 'Website Icon', + faviconHelper: 'Website icon (recommended image size: 16px*16px)', + reUpload: 'Re-upload', + supportType: 'Only jpg/png/jpeg files are allowed!', + setDefault: 'Restore Default', + reset: 'Reset', }, }, }; diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 866b8e84d..e8e291f36 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -51,6 +51,7 @@ const message = { uninstall: '卸載', fullscreen: '全屏', quitFullscreen: '退出全屏', + update: '編輯', }, search: { timeStart: '開始時間', @@ -244,6 +245,7 @@ const message = { ready: '正常', applying: '申請中', applyerror: '失敗', + syncerr: '失敗', }, units: { second: '秒', @@ -2002,115 +2004,122 @@ const message = { statusCode: '狀態碼', manage: '管理', }, - xpack: { - name: '專業版', - waf: { - name: 'WAF', - blackWhite: '黑白名單', - globalSetting: '全域設定', - websiteSetting: '網站設定', - blockRecords: '封鎖記錄', - world: '世界', - china: '中國', - intercept: '攔截', - request: '請求', - count4xx: '4xx 數量', - count5xx: '5xx 數量', - todayStatus: '今日狀態', - reqMap: '請求地圖(30日)', - resource: '來源', - count: '數量', - hight: '高', - low: '低', - reqCount: '請求數', - interceptCount: '攔截數', - requestTrends: '請求趨勢(7天)', - interceptTrends: '攔截趨勢(7天)', - whiteList: '白名單', - blackList: '黑名單', - ipBlackListHelper: '黑名單中的 IP 無法存取網站', - ipWhiteListHelper: '白名單中的 IP 不受任何規則限制', - uaBlackListHelper: '攜帶黑名單中的 User-Agent 的請求將被攔截', - uaWhiteListHelper: '攜帶白名單中的 User-Agent 的請求不受任何規則限制', - urlBlackListHelper: '請求黑名單中的 URL 將被攔截', - urlWhiteListHelper: '請求白名單中的 URL 請求不受任何規則限制', - ccHelper: '{0} 秒內累積請求任意網站超過 {1} 次,封鎖此 IP {2} 秒', - blockTime: '封鎖時間', - attackHelper: '{0} 秒內累計攔截超過 {1} 次,封鎖此 IP {2} 秒', - notFoundHelper: '{0} 秒內累計請求回傳 404 超過 {1} 次,封鎖此 IP {2} 秒', - frequencyLimit: '頻率限制', - regionLimit: '地區限制', - defaultRule: '預設規則', - accessFrequencyLmit: '存取頻率限制', - attackLimit: '攻擊頻率限制', - notFoundLimit: '404 頻率限制', - urlLimit: 'URL 頻率限制', - urlLimitHelper: '為單一 URL 設定存取頻率', - sqliDefense: 'SQL 注入防禦', - sqliHelper: '辨識請求中的 SQL 注入並攔截', - xssHelper: '辨識請求中的 XSS 並攔截', - xssDefense: 'XSS 防禦', - uaDefense: '惡意 User-Agent 規則', - uaHelper: '包含常見的惡意爬蟲規則', - argsDefense: '惡意參數規則', - argsHelper: '在禁止請求中攜帶惡意參數', - cookieDefense: '惡意 Cookie 規則', - cookieHelper: '禁止請求中攜帶惡意 Cookie', - headerDefense: '惡意 Header 規則', - headerHelper: '禁止請求中攜帶惡意 Header', - httpRule: 'HTTP 請求方法規則', - httpHelper: '限制網站的請求方法類型', - geoRule: '地區存取限制', - geoHelper: '限制某些地區造訪你的網站', - ipLocation: 'IP 歸屬地', - action: '動作', - ruleType: '攻擊類型', - ipHelper: '請輸入 IP', - attackLog: '攻擊日誌', - }, - monitor: { - name: '網站監控', - }, - tamper: { - tamperHelper1: '一鍵部署類型的網站,建議啟用應用目錄防篡改功能;', - tamperHelper2: '如果在啟用防篡改功能後出現網站無法正常使用或備份、恢復失敗的情況,請先關閉防篡改功能;', - tamperHelper3: - '啟用防篡改,將限制非排除目錄下受保護文件的讀寫、刪除、權限和所有者修改操作,請在設定 [排除目錄] 和 [保護] 時謹慎選擇。', - op: '操作', - create: '創建', - file: '文件', - tamperPath: '防護目錄', - tamperPathEdit: '修改路徑', - log: '攔截日誌', - totalProtect: '總防護', - todayProtect: '今日防護', - addRule: '添加規則', - ignore: '排除目錄', - ignoreHelper: '一行一個,例: \ntmp\n./tmp', - ignoreHelper1: '添加要忽略的文件夾名或特定路徑', - ignoreHelper2: '要忽略特定文件夾,請使用以 ./ 開頭的相對路徑', - protect: '保護', - protectHelper: '一行一個,例: \npng\n./test.css', - protectHelper1: '可指定文件名、後綴名或特定文件進行保護', - protectHelper2: '要保護特定文件,請使用以 ./ 開頭的相對路徑', - enableHelper: '即將啟用 {0} 網站的防窜改功能,以提升網站安全性,是否繼續?', - disableHelper: '即將關閉 {0} 網站的防窜改功能,是否繼續?', - }, - setting: { - setting: '界面設置', - title: '面板描述', - titleHelper: '將會顯示在使用者登錄頁面 (例: Linux 伺服器運維管理面板)', - logo: 'Logo', - logoHelper: '將會顯示在菜單收縮時管理頁面左上方 (建議圖片大小為: 82px*82px)', - logoWithText: 'Logo (帶文字)', - logoWithTextHelper: '將會顯示在菜單展開時管理頁面左上方 (建議圖片大小為: 185px*55px)', - favicon: '網站圖標', - faviconHelper: '網站圖標 (建議圖片大小為: 16px*16px)', - reUpload: '重新上傳', - supportType: '只能上傳 jpg/png/jpeg 檔案!', - setDefault: '恢復默認', - reset: '重置', - }, + }, + xpack: { + name: '專業版', + waf: { + name: 'WAF', + blackWhite: '黑白名單', + globalSetting: '全域設定', + websiteSetting: '網站設定', + blockRecords: '封鎖記錄', + world: '世界', + china: '中國', + intercept: '攔截', + request: '請求', + count4xx: '4xx 數量', + count5xx: '5xx 數量', + todayStatus: '今日狀態', + reqMap: '請求地圖(30日)', + resource: '來源', + count: '數量', + hight: '高', + low: '低', + reqCount: '請求數', + interceptCount: '攔截數', + requestTrends: '請求趨勢(7天)', + interceptTrends: '攔截趨勢(7天)', + whiteList: '白名單', + blackList: '黑名單', + ipBlackListHelper: '黑名單中的 IP 無法存取網站', + ipWhiteListHelper: '白名單中的 IP 不受任何規則限制', + uaBlackListHelper: '攜帶黑名單中的 User-Agent 的請求將被攔截', + uaWhiteListHelper: '攜帶白名單中的 User-Agent 的請求不受任何規則限制', + urlBlackListHelper: '請求黑名單中的 URL 將被攔截', + urlWhiteListHelper: '請求白名單中的 URL 請求不受任何規則限制', + ccHelper: '{0} 秒內累積請求任意網站超過 {1} 次,封鎖此 IP {2} 秒', + blockTime: '封鎖時間', + attackHelper: '{0} 秒內累計攔截超過 {1} 次,封鎖此 IP {2} 秒', + notFoundHelper: '{0} 秒內累計請求回傳 404 超過 {1} 次,封鎖此 IP {2} 秒', + frequencyLimit: '頻率限制', + regionLimit: '地區限制', + defaultRule: '預設規則', + accessFrequencyLmit: '存取頻率限制', + attackLimit: '攻擊頻率限制', + notFoundLimit: '404 頻率限制', + urlLimit: 'URL 頻率限制', + urlLimitHelper: '為單一 URL 設定存取頻率', + sqliDefense: 'SQL 注入防禦', + sqliHelper: '辨識請求中的 SQL 注入並攔截', + xssHelper: '辨識請求中的 XSS 並攔截', + xssDefense: 'XSS 防禦', + uaDefense: '惡意 User-Agent 規則', + uaHelper: '包含常見的惡意爬蟲規則', + argsDefense: '惡意參數規則', + argsHelper: '在禁止請求中攜帶惡意參數', + cookieDefense: '惡意 Cookie 規則', + cookieHelper: '禁止請求中攜帶惡意 Cookie', + headerDefense: '惡意 Header 規則', + headerHelper: '禁止請求中攜帶惡意 Header', + httpRule: 'HTTP 請求方法規則', + httpHelper: '限制網站的請求方法類型', + geoRule: '地區存取限制', + geoHelper: '限制某些地區造訪你的網站', + ipLocation: 'IP 歸屬地', + action: '動作', + ruleType: '攻擊類型', + ipHelper: '請輸入 IP', + attackLog: '攻擊日誌', + rule: '規則', + ipArr: 'IPV4 範圍', + ipStart: '起始 IP', + ipEnd: '結束 IP', + ipv4: 'IPV4', + ipv6: 'IPV6', + }, + monitor: { + name: '網站監控', + }, + tamper: { + tamper: '防篡改', + tamperHelper1: '一鍵部署類型的網站,建議啟用應用目錄防篡改功能;', + tamperHelper2: '如果在啟用防篡改功能後出現網站無法正常使用或備份、恢復失敗的情況,請先關閉防篡改功能;', + tamperHelper3: + '啟用防篡改,將限制非排除目錄下受保護文件的讀寫、刪除、權限和所有者修改操作,請在設定 [排除目錄] 和 [保護] 時謹慎選擇。', + op: '操作', + create: '創建', + file: '文件', + tamperPath: '防護目錄', + tamperPathEdit: '修改路徑', + log: '攔截日誌', + totalProtect: '總防護', + todayProtect: '今日防護', + addRule: '添加規則', + ignore: '排除目錄', + ignoreHelper: '一行一個,例: \ntmp\n./tmp', + ignoreHelper1: '添加要忽略的文件夾名或特定路徑', + ignoreHelper2: '要忽略特定文件夾,請使用以 ./ 開頭的相對路徑', + protect: '保護', + protectHelper: '一行一個,例: \npng\n./test.css', + protectHelper1: '可指定文件名、後綴名或特定文件進行保護', + protectHelper2: '要保護特定文件,請使用以 ./ 開頭的相對路徑', + enableHelper: '即將啟用 {0} 網站的防窜改功能,以提升網站安全性,是否繼續?', + disableHelper: '即將關閉 {0} 網站的防窜改功能,是否繼續?', + }, + setting: { + setting: '界面設置', + title: '面板描述', + titleHelper: '將會顯示在使用者登錄頁面 (例: Linux 伺服器運維管理面板)', + logo: 'Logo', + logoHelper: '將會顯示在菜單收縮時管理頁面左上方 (建議圖片大小為: 82px*82px)', + logoWithText: 'Logo (帶文字)', + logoWithTextHelper: '將會顯示在菜單展開時管理頁面左上方 (建議圖片大小為: 185px*55px)', + favicon: '網站圖標', + faviconHelper: '網站圖標 (建議圖片大小為: 16px*16px)', + reUpload: '重新上傳', + supportType: '只能上傳 jpg/png/jpeg 檔案!', + setDefault: '恢復默認', + reset: '重置', }, }, }; diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 95a31bc82..3b3238f31 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -51,6 +51,7 @@ const message = { uninstall: '卸载', fullscreen: '全屏', quitFullscreen: '退出全屏', + update: '编辑', }, search: { timeStart: '开始时间', @@ -244,6 +245,7 @@ const message = { ready: '正常', applying: '申请中', applyerror: '失败', + syncerr: '失败', }, units: { second: '秒', @@ -2068,6 +2070,12 @@ const message = { ruleType: '攻击类型', ipHelper: '请输入 IP', attackLog: '攻击日志', + rule: '规则', + ipArr: 'IPV4 范围', + ipStart: '起始 IP', + ipEnd: '结束 IP', + ipv4: 'IPV4', + ipv6: 'IPV6', }, monitor: { name: '网站监控', diff --git a/frontend/src/styles/common.scss b/frontend/src/styles/common.scss index 67ece2b9d..3e2eb45ac 100644 --- a/frontend/src/styles/common.scss +++ b/frontend/src/styles/common.scss @@ -418,3 +418,11 @@ html { .p-w-200 { width: 200px !important; } + +.p-ml-20 { + margin-left: 20px !important; +} + +.p-mt-20 { + margin-top: 20px !important; +} diff --git a/frontend/src/styles/element.scss b/frontend/src/styles/element.scss index 64dbe2438..fe08218b3 100644 --- a/frontend/src/styles/element.scss +++ b/frontend/src/styles/element.scss @@ -160,9 +160,6 @@ html { .el-dialog { .el-dialog__header { - padding: 15px 20px; - margin: 0; - border-bottom: 1px solid #f0f0f0; .el-dialog__title { font-size: 17px; } diff --git a/frontend/src/views/container/container/index.vue b/frontend/src/views/container/container/index.vue index f78bf855d..ff6de2007 100644 --- a/frontend/src/views/container/container/index.vue +++ b/frontend/src/views/container/container/index.vue @@ -195,7 +195,7 @@ - + diff --git a/frontend/src/views/cronjob/record/index.vue b/frontend/src/views/cronjob/record/index.vue index f8d73a682..307cf6191 100644 --- a/frontend/src/views/cronjob/record/index.vue +++ b/frontend/src/views/cronjob/record/index.vue @@ -1,6 +1,6 @@ - + {{ $t('cronjob.' + dialogData.rowData.type) }} - {{ dialogData.rowData.name }} @@ -73,7 +73,7 @@ > - + diff --git a/frontend/src/views/host/file-management/code-editor/index.vue b/frontend/src/views/host/file-management/code-editor/index.vue index ac1e58bf0..6e05b3f16 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -8,24 +8,24 @@ @opened="onOpen" :top="'5vh'" > - + - + - + - + - + diff --git a/frontend/src/views/log/login/index.vue b/frontend/src/views/log/login/index.vue index 77558999e..e63b6bd8e 100644 --- a/frontend/src/views/log/login/index.vue +++ b/frontend/src/views/log/login/index.vue @@ -15,7 +15,7 @@ -
+
@@ -25,14 +25,14 @@