diff --git a/.github/embed.go b/.github/embed.go new file mode 100644 index 00000000..943bef17 --- /dev/null +++ b/.github/embed.go @@ -0,0 +1,6 @@ +package _github + +import "embed" + +//go:embed build/build_info.json +var DistFS embed.FS diff --git a/frontend/package.json b/frontend/package.json index dedb6c8c..1da27e89 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "nginx-ui-frontend-next", "private": true, - "version": "1.7.1", + "version": "1.7.2", "type": "commonjs", "scripts": { "dev": "vite", @@ -12,25 +12,27 @@ }, "dependencies": { "@ant-design/icons-vue": "^6.1.0", + "@types/lodash": "^4.14.188", + "@types/marked": "^4.0.8", + "@types/sortablejs": "^1.15.0", "ant-design-vue": "^3.2.15", "apexcharts": "^3.36.3", "axios": "^1.2.2", "dayjs": "^1.11.7", + "marked": "^4.2.5", "pinia": "^2.0.28", "pinia-plugin-persistedstate": "^3.0.2", "reconnecting-websocket": "^4.4.0", - "vite-plugin-build-id": "^0.2.2", + "vite-plugin-build-id": "^0.2.3", "vue": "^3.2.45", "vue-router": "4", "vue3-ace-editor": "^2.2.2", "vue3-apexcharts": "^1.4.1", "vue3-gettext": "^2.3.4", + "vuedraggable": "^4.1.0", "xterm": "^5.0.0", "xterm-addon-attach": "^0.7.0", - "xterm-addon-fit": "^0.6.0", - "@types/lodash": "^4.14.188", - "vuedraggable": "^4.1.0", - "@types/sortablejs": "^1.15.0" + "xterm-addon-fit": "^0.6.0" }, "devDependencies": { "@vitejs/plugin-vue": "^4.0.0", @@ -41,6 +43,6 @@ "unplugin-vue-components": "^0.22.12", "vite": "^4.0.4", "vite-plugin-html": "^3.2.0", - "vue-tsc": "^1.0.22" + "vue-tsc": "^1.0.24" } } diff --git a/frontend/src/api/upgrade.ts b/frontend/src/api/upgrade.ts new file mode 100644 index 00000000..4cd95be0 --- /dev/null +++ b/frontend/src/api/upgrade.ts @@ -0,0 +1,12 @@ +import http from '@/lib/http' + +const upgrade = { + get_latest_release() { + return http.get('/upgrade/release') + }, + current_version() { + return http.get('/upgrade/current') + } +} + +export default upgrade diff --git a/frontend/src/language/en/app.po b/frontend/src/language/en/app.po index 4659b9d7..a602e92c 100644 --- a/frontend/src/language/en/app.po +++ b/frontend/src/language/en/app.po @@ -9,7 +9,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/routes/index.ts:134 +#: src/routes/index.ts:141 msgid "About" msgstr "About" @@ -50,6 +50,11 @@ msgstr "Add Site" msgid "Advance Mode" msgstr "Advance Mode" +#: src/views/system/Upgrade.vue:12 src/views/system/Upgrade.vue:13 +#: src/views/system/Upgrade.vue:17 src/views/system/Upgrade.vue:21 +msgid "Arch" +msgstr "" + #: src/components/StdDataDisplay/StdTable.vue:54 #: src/views/domain/DomainList.vue:26 #, fuzzy @@ -129,7 +134,7 @@ msgstr "Basic Mode" msgid "Batch Modify" msgstr "Modify Config" -#: src/views/other/About.vue:21 +#: src/views/system/About.vue:21 msgid "Build with" msgstr "Build with" @@ -163,6 +168,11 @@ msgstr "Certificate is valid" msgid "Change Certificate" msgstr "Certificate is valid" +#: src/views/system/Upgrade.vue:16 src/views/system/Upgrade.vue:17 +#: src/views/system/Upgrade.vue:21 src/views/system/Upgrade.vue:25 +msgid "Check again" +msgstr "" + #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:47 @@ -193,6 +203,10 @@ msgstr "Configure SSL" msgid "Content" msgstr "Content" +#: src/views/system/Upgrade.vue:3 +msgid "Core Upgrade" +msgstr "" + #: src/views/dashboard/DashBoard.vue:64 msgid "CPU Status" msgstr "CPU Status" @@ -213,6 +227,11 @@ msgstr "Created at" msgid "Creating client facilitates communication with the CA server" msgstr "" +#: src/views/system/Upgrade.vue:10 src/views/system/Upgrade.vue:11 +#: src/views/system/Upgrade.vue:15 src/views/system/Upgrade.vue:19 +msgid "Current Version" +msgstr "" + #: src/views/domain/ngx_conf/ConfigTemplate.vue:22 #: src/views/domain/ngx_conf/ConfigTemplate.vue:23 #: src/views/domain/ngx_conf/ConfigTemplate.vue:26 @@ -258,7 +277,7 @@ msgstr "" msgid "Description" msgstr "" -#: src/views/other/About.vue:7 src/views/other/About.vue:8 +#: src/views/system/About.vue:7 src/views/system/About.vue:8 msgid "Development Mode" msgstr "Development Mode" @@ -344,7 +363,7 @@ msgstr "Enabled" msgid "Enabled successfully" msgstr "Enabled successfully" -#: src/views/domain/cert/IssueCert.vue:18 +#: src/views/domain/cert/IssueCert.vue:17 msgid "Encrypt website with Let's Encrypt" msgstr "Encrypt website with Let's Encrypt" @@ -352,6 +371,11 @@ msgstr "Encrypt website with Let's Encrypt" msgid "Error Logs" msgstr "" +#: src/views/system/Upgrade.vue:13 src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 src/views/system/Upgrade.vue:22 +msgid "Executable Path" +msgstr "" + #: src/views/domain/cert/CertInfo.vue:12 msgid "Expiration Date: %{date}" msgstr "Expiration Date: %{date}" @@ -433,7 +457,7 @@ msgstr "" msgid "HTTP Port" msgstr "" -#: src/routes/index.ts:144 src/views/other/Install.vue:128 +#: src/routes/index.ts:153 src/views/other/Install.vue:128 msgid "Install" msgstr "Install" @@ -455,6 +479,11 @@ msgstr "Enabled successfully" msgid "Jwt Secret" msgstr "" +#: src/views/system/Upgrade.vue:14 src/views/system/Upgrade.vue:15 +#: src/views/system/Upgrade.vue:19 src/views/system/Upgrade.vue:23 +msgid "Last checked at" +msgstr "" + #: src/views/user/User.vue:26 msgid "Leave blank for no change" msgstr "Leave blank for no change" @@ -478,7 +507,7 @@ msgstr "Location" msgid "Locations" msgstr "Locations" -#: src/routes/index.ts:150 src/views/other/Login.vue:104 +#: src/routes/index.ts:159 src/views/other/Login.vue:104 msgid "Login" msgstr "Login" @@ -490,7 +519,7 @@ msgstr "Login successful" msgid "Logout successful" msgstr "Logout successful" -#: src/views/domain/cert/IssueCert.vue:211 +#: src/views/domain/cert/IssueCert.vue:210 msgid "" "Make sure you have configured a reverse proxy for .well-known directory to " "HTTPChallengePort (default: 9180) before getting the certificate." @@ -560,6 +589,10 @@ msgstr "Network Total Receive" msgid "Network Total Send" msgstr "Network Total Send" +#: src/views/system/Upgrade.vue:34 +msgid "New version released" +msgstr "" + #: src/views/domain/DomainAdd.vue:136 msgid "Next" msgstr "Next" @@ -588,7 +621,7 @@ msgstr "" msgid "No" msgstr "No" -#: src/routes/index.ts:156 src/routes/index.ts:158 +#: src/routes/index.ts:165 src/routes/index.ts:167 msgid "Not Found" msgstr "Not Found" @@ -596,7 +629,7 @@ msgstr "Not Found" msgid "Not Valid Before: %{date}" msgstr "Not Valid Before: %{date}" -#: src/views/domain/cert/IssueCert.vue:38 +#: src/views/domain/cert/IssueCert.vue:37 msgid "Note" msgstr "" @@ -612,6 +645,12 @@ msgstr "" msgid "OK" msgstr "" +#: src/views/system/Upgrade.vue:11 src/views/system/Upgrade.vue:12 +#: src/views/system/Upgrade.vue:16 src/views/system/Upgrade.vue:20 +#, fuzzy +msgid "OS" +msgstr "OS:" + #: src/views/dashboard/DashBoard.vue:147 msgid "OS:" msgstr "OS:" @@ -662,7 +701,7 @@ msgstr "" msgid "Prohibit deleting the default user" msgstr "" -#: src/views/other/About.vue:19 +#: src/views/system/About.vue:19 msgid "Project Team" msgstr "Project Team" @@ -678,6 +717,19 @@ msgstr "Receive" msgid "Registering user" msgstr "" +#: src/views/system/Upgrade.vue:24 src/views/system/Upgrade.vue:25 +#: src/views/system/Upgrade.vue:29 src/views/system/Upgrade.vue:33 +#: src/views/system/Upgrade.vue:36 src/views/system/Upgrade.vue:39 +#, fuzzy +msgid "Reinstall" +msgstr "Install" + +#: src/views/system/Upgrade.vue:31 src/views/system/Upgrade.vue:32 +#: src/views/system/Upgrade.vue:36 src/views/system/Upgrade.vue:40 +#: src/views/system/Upgrade.vue:43 src/views/system/Upgrade.vue:48 +msgid "Release Note" +msgstr "" + #: src/language/constants.ts:19 msgid "Reloading nginx" msgstr "" @@ -757,7 +809,7 @@ msgstr "Server Info" msgid "server_name not found in directives" msgstr "server_name not found in directives" -#: src/views/domain/cert/IssueCert.vue:195 src/views/domain/DomainAdd.vue:111 +#: src/views/domain/cert/IssueCert.vue:194 src/views/domain/DomainAdd.vue:111 msgid "server_name parameter is required" msgstr "server_name parameter is required" @@ -811,6 +863,10 @@ msgstr "Subject Name: %{name}" msgid "Swap" msgstr "Swap" +#: src/routes/index.ts:134 +msgid "System" +msgstr "" + #: src/components/StdDataDisplay/StdCurd.vue:3 #, fuzzy msgid "Table" @@ -824,7 +880,7 @@ msgstr "Terminal" msgid "Terminal Start Command" msgstr "" -#: src/views/domain/cert/IssueCert.vue:207 +#: src/views/domain/cert/IssueCert.vue:206 msgid "" "The certificate for the domain will be checked every hour, and will be " "renewed if it has been more than 1 month since it was last issued." @@ -836,7 +892,7 @@ msgstr "" msgid "The filename cannot contain the following characters: %{c}" msgstr "The filename cannot contain the following characters: %{c}" -#: src/views/domain/cert/IssueCert.vue:203 +#: src/views/domain/cert/IssueCert.vue:202 #, fuzzy msgid "" "The server_name in the current configuration must be the domain name you " @@ -867,6 +923,18 @@ msgstr "Updated at" msgid "Updated successfully" msgstr "Saved successfully" +#: src/routes/index.ts:145 src/views/system/Upgrade.vue:16 +#: src/views/system/Upgrade.vue:26 src/views/system/Upgrade.vue:27 +#: src/views/system/Upgrade.vue:31 src/views/system/Upgrade.vue:35 +#: src/views/system/Upgrade.vue:38 src/views/system/Upgrade.vue:41 +#: src/views/system/Upgrade.vue:42 +msgid "Upgrade" +msgstr "" + +#: src/views/system/Upgrade.vue:63 +msgid "Upgrading Nginx UI, please wait..." +msgstr "" + #: src/views/dashboard/DashBoard.vue:137 msgid "Uptime:" msgstr "Uptime:" @@ -889,7 +957,7 @@ msgstr "" msgid "View" msgstr "" -#: src/views/domain/cert/IssueCert.vue:27 src/views/domain/DomainAdd.vue:22 +#: src/views/domain/cert/IssueCert.vue:26 src/views/domain/DomainAdd.vue:22 msgid "Warning" msgstr "Warning" @@ -911,7 +979,16 @@ msgstr "" msgid "Yes" msgstr "Yes" -#: src/views/other/About.vue:27 +#: src/views/system/Upgrade.vue:30 +msgid "You are using the latest version" +msgstr "" + +#: src/views/system/Upgrade.vue:10 src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 src/views/system/Upgrade.vue:9 +msgid "You can check Nginx UI upgrade at this page." +msgstr "" + +#: src/views/system/About.vue:27 msgctxt "Project" msgid "License" msgstr "License" diff --git a/frontend/src/language/messages.pot b/frontend/src/language/messages.pot index ab50d1e4..3f2adc2e 100644 --- a/frontend/src/language/messages.pot +++ b/frontend/src/language/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" -#: src/routes/index.ts:134 +#: src/routes/index.ts:141 msgid "About" msgstr "" @@ -48,6 +48,13 @@ msgstr "" msgid "Advance Mode" msgstr "" +#: src/views/system/Upgrade.vue:12 +#: src/views/system/Upgrade.vue:13 +#: src/views/system/Upgrade.vue:17 +#: src/views/system/Upgrade.vue:21 +msgid "Arch" +msgstr "" + #: src/components/StdDataDisplay/StdTable.vue:54 #: src/views/domain/DomainList.vue:26 msgid "Are you sure you want to delete?" @@ -128,7 +135,7 @@ msgstr "" msgid "Batch Modify" msgstr "" -#: src/views/other/About.vue:21 +#: src/views/system/About.vue:21 msgid "Build with" msgstr "" @@ -162,6 +169,13 @@ msgstr "" msgid "Change Certificate" msgstr "" +#: src/views/system/Upgrade.vue:16 +#: src/views/system/Upgrade.vue:17 +#: src/views/system/Upgrade.vue:21 +#: src/views/system/Upgrade.vue:25 +msgid "Check again" +msgstr "" + #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:47 @@ -191,6 +205,10 @@ msgstr "" msgid "Content" msgstr "" +#: src/views/system/Upgrade.vue:3 +msgid "Core Upgrade" +msgstr "" + #: src/views/dashboard/DashBoard.vue:64 msgid "CPU Status" msgstr "" @@ -211,6 +229,13 @@ msgstr "" msgid "Creating client facilitates communication with the CA server" msgstr "" +#: src/views/system/Upgrade.vue:10 +#: src/views/system/Upgrade.vue:11 +#: src/views/system/Upgrade.vue:15 +#: src/views/system/Upgrade.vue:19 +msgid "Current Version" +msgstr "" + #: src/views/domain/ngx_conf/ConfigTemplate.vue:22 #: src/views/domain/ngx_conf/ConfigTemplate.vue:23 #: src/views/domain/ngx_conf/ConfigTemplate.vue:26 @@ -256,8 +281,8 @@ msgstr "" msgid "Description" msgstr "" -#: src/views/other/About.vue:7 -#: src/views/other/About.vue:8 +#: src/views/system/About.vue:7 +#: src/views/system/About.vue:8 msgid "Development Mode" msgstr "" @@ -356,7 +381,7 @@ msgstr "" msgid "Enabled successfully" msgstr "" -#: src/views/domain/cert/IssueCert.vue:18 +#: src/views/domain/cert/IssueCert.vue:17 msgid "Encrypt website with Let's Encrypt" msgstr "" @@ -365,6 +390,13 @@ msgstr "" msgid "Error Logs" msgstr "" +#: src/views/system/Upgrade.vue:13 +#: src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 +#: src/views/system/Upgrade.vue:22 +msgid "Executable Path" +msgstr "" + #: src/views/domain/cert/CertInfo.vue:12 msgid "Expiration Date: %{date}" msgstr "" @@ -448,7 +480,7 @@ msgstr "" msgid "HTTP Port" msgstr "" -#: src/routes/index.ts:144 +#: src/routes/index.ts:153 #: src/views/other/Install.vue:128 msgid "Install" msgstr "" @@ -469,6 +501,13 @@ msgstr "" msgid "Jwt Secret" msgstr "" +#: src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:15 +#: src/views/system/Upgrade.vue:19 +#: src/views/system/Upgrade.vue:23 +msgid "Last checked at" +msgstr "" + #: src/views/user/User.vue:26 msgid "Leave blank for no change" msgstr "" @@ -492,7 +531,7 @@ msgstr "" msgid "Locations" msgstr "" -#: src/routes/index.ts:150 +#: src/routes/index.ts:159 #: src/views/other/Login.vue:104 msgid "Login" msgstr "" @@ -505,7 +544,7 @@ msgstr "" msgid "Logout successful" msgstr "" -#: src/views/domain/cert/IssueCert.vue:211 +#: src/views/domain/cert/IssueCert.vue:210 msgid "Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate." msgstr "" @@ -573,6 +612,10 @@ msgstr "" msgid "Network Total Send" msgstr "" +#: src/views/system/Upgrade.vue:34 +msgid "New version released" +msgstr "" + #: src/views/domain/DomainAdd.vue:136 msgid "Next" msgstr "" @@ -601,8 +644,8 @@ msgstr "" msgid "No" msgstr "" -#: src/routes/index.ts:156 -#: src/routes/index.ts:158 +#: src/routes/index.ts:165 +#: src/routes/index.ts:167 msgid "Not Found" msgstr "" @@ -610,7 +653,7 @@ msgstr "" msgid "Not Valid Before: %{date}" msgstr "" -#: src/views/domain/cert/IssueCert.vue:38 +#: src/views/domain/cert/IssueCert.vue:37 msgid "Note" msgstr "" @@ -627,6 +670,13 @@ msgstr "" msgid "OK" msgstr "" +#: src/views/system/Upgrade.vue:11 +#: src/views/system/Upgrade.vue:12 +#: src/views/system/Upgrade.vue:16 +#: src/views/system/Upgrade.vue:20 +msgid "OS" +msgstr "" + #: src/views/dashboard/DashBoard.vue:147 msgid "OS:" msgstr "" @@ -680,7 +730,7 @@ msgstr "" msgid "Prohibit deleting the default user" msgstr "" -#: src/views/other/About.vue:19 +#: src/views/system/About.vue:19 msgid "Project Team" msgstr "" @@ -697,6 +747,24 @@ msgstr "" msgid "Registering user" msgstr "" +#: src/views/system/Upgrade.vue:24 +#: src/views/system/Upgrade.vue:25 +#: src/views/system/Upgrade.vue:29 +#: src/views/system/Upgrade.vue:33 +#: src/views/system/Upgrade.vue:36 +#: src/views/system/Upgrade.vue:39 +msgid "Reinstall" +msgstr "" + +#: src/views/system/Upgrade.vue:31 +#: src/views/system/Upgrade.vue:32 +#: src/views/system/Upgrade.vue:36 +#: src/views/system/Upgrade.vue:40 +#: src/views/system/Upgrade.vue:43 +#: src/views/system/Upgrade.vue:48 +msgid "Release Note" +msgstr "" + #: src/language/constants.ts:19 msgid "Reloading nginx" msgstr "" @@ -779,7 +847,7 @@ msgstr "" msgid "server_name not found in directives" msgstr "" -#: src/views/domain/cert/IssueCert.vue:195 +#: src/views/domain/cert/IssueCert.vue:194 #: src/views/domain/DomainAdd.vue:111 msgid "server_name parameter is required" msgstr "" @@ -829,6 +897,10 @@ msgstr "" msgid "Swap" msgstr "" +#: src/routes/index.ts:134 +msgid "System" +msgstr "" + #: src/components/StdDataDisplay/StdCurd.vue:3 msgid "Table" msgstr "" @@ -842,7 +914,7 @@ msgstr "" msgid "Terminal Start Command" msgstr "" -#: src/views/domain/cert/IssueCert.vue:207 +#: src/views/domain/cert/IssueCert.vue:206 msgid "The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued." msgstr "" @@ -850,7 +922,7 @@ msgstr "" msgid "The filename cannot contain the following characters: %{c}" msgstr "" -#: src/views/domain/cert/IssueCert.vue:203 +#: src/views/domain/cert/IssueCert.vue:202 msgid "The server_name in the current configuration must be the domain name you need to get the certificate." msgstr "" @@ -877,6 +949,22 @@ msgstr "" msgid "Updated successfully" msgstr "" +#: src/routes/index.ts:145 +#: src/views/system/Upgrade.vue:16 +#: src/views/system/Upgrade.vue:26 +#: src/views/system/Upgrade.vue:27 +#: src/views/system/Upgrade.vue:31 +#: src/views/system/Upgrade.vue:35 +#: src/views/system/Upgrade.vue:38 +#: src/views/system/Upgrade.vue:41 +#: src/views/system/Upgrade.vue:42 +msgid "Upgrade" +msgstr "" + +#: src/views/system/Upgrade.vue:63 +msgid "Upgrading Nginx UI, please wait..." +msgstr "" + #: src/views/dashboard/DashBoard.vue:137 msgid "Uptime:" msgstr "" @@ -900,7 +988,7 @@ msgstr "" msgid "View" msgstr "" -#: src/views/domain/cert/IssueCert.vue:27 +#: src/views/domain/cert/IssueCert.vue:26 #: src/views/domain/DomainAdd.vue:22 msgid "Warning" msgstr "" @@ -924,7 +1012,18 @@ msgstr "" msgid "Yes" msgstr "" -#: src/views/other/About.vue:27 +#: src/views/system/Upgrade.vue:30 +msgid "You are using the latest version" +msgstr "" + +#: src/views/system/Upgrade.vue:10 +#: src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 +#: src/views/system/Upgrade.vue:9 +msgid "You can check Nginx UI upgrade at this page." +msgstr "" + +#: src/views/system/About.vue:27 msgctxt "Project" msgid "License" msgstr "" diff --git a/frontend/src/language/translations.json b/frontend/src/language/translations.json index 55ad7cd0..812972f3 100644 --- a/frontend/src/language/translations.json +++ b/frontend/src/language/translations.json @@ -1 +1 @@ -{"zh_CN":{"About":"关于","Access Logs":"访问日志","Action":"操作","Add":"添加","Add Directive Below":"在下面添加指令","Add Location":"添加 Location","Add Site":"添加站点","Advance Mode":"高级模式","Are you sure you want to delete?":"您确定要删除吗?","Are you sure you want to remove this directive?":"您确定要删除这条指令?","Are you sure you want to remove this location?":"您确定要删除这个 Location?","Author":"作者","Auto":"自动","Auto Cert":"自动更新","Auto cert is enabled, please do not modify this certification.":"自动更新已启用,请勿修改此证书配置。","Auto Refresh":"自动刷新","Auto-renewal disabled for %{name}":"成功关闭 %{name} 自动续签","Auto-renewal enabled for %{name}":"成功启用 %{name} 自动续签","Back":"返回","Back Home":"返回首页","Base information":"基本信息","Basic Mode":"基本模式","Batch Modify":"批量修改","Build with":"构建基于","Cancel":"取消","Certificate has expired":"此证书已过期","Certificate is valid":"此证书有效","Certificate Status":"证书状态","Certification":"证书","Change Certificate":"更改证书","Comments":"注释","Config Templates":"配置","Configuration Name":"配置名称","Configurations":"配置","Configure SSL":"配置 SSL","Content":"内容","CPU Status":"CPU 状态","CPU:":"CPU:","Create Another":"再创建一个","Created at":"创建时间","Creating client facilitates communication with the CA server":"正在创建客户端用于与 CA 服务器通信","Custom":"自定义","Dark":"深色","Dashboard":"仪表盘","Database (Optional, default: database)":"数据库 (可选,默认: database)","Delete":"删除","Delete ID: %{id}":"删除 ID: %{id}","Delete site: %{site_name}":"删除站点: %{site_name}","Description":"描述","Development Mode":"开发模式","Dir":"目录","Directive":"指令","Directives":"指令","Disable auto-renewal failed for %{name}":"关闭 %{name} 自动续签失败","Disabled":"禁用","Disabled successfully":"禁用成功","Disk IO":"磁盘 IO","Domain":"域名","Domain Config Created Successfully":"域名配置文件创建成功","Edit %{n}":"编辑 %{n}","Edit Configuration":"编辑配置","Edit Site":"编辑站点","Email (*)":"邮箱 (*)","Enable auto-renewal failed for %{name}":"启用 %{name} 自动续签失败","Enable failed":"启用失败","Enable TLS":"启用 TLS","Enabled":"启用","Enabled successfully":"启用成功","Encrypt website with Let's Encrypt":"用 Let's Encrypt 对网站进行加密","Error Logs":"错误日志","Expiration Date: %{date}":"过期时间: %{date}","Export":"导出","Failed to disable %{msg}":"禁用失败 %{msg}","Failed to enable %{msg}":"启用失败 %{msg}","Failed to get certificate information":"获取证书信息失败","Failed to save, syntax error(s) was detected in the configuration.":"保存失败,在配置中检测到语法错误。","File":"文件","File Not Found":"未找到文件","Filter":"过滤","Finished":"完成","Format Code":"代码格式化","Format error %{msg}":"保存错误 %{msg}","Format successfully":"保存成功","Generate":"生成","Generating private key for registering account":"正在生成私钥用于注册账户","Getting the certificate, please wait...":"正在获取证书,请稍等...","Home":"首页","HTTP Challenge Port":"HTTP Challenge 监听端口","HTTP Port":"HTTP 监听端口","Install":"安装","Install successfully":"安装成功","Intermediate Certification Authorities: %{issuer}":"中级证书颁发机构: %{issuer}","Issued certificate successfully":"证书申请成功","Jwt Secret":"Jwt 密钥","Leave blank for no change":"留空表示不修改","Light":"浅色","Load Averages:":"系统负载:","Location":"Location","Locations":"Locations","Login":"登录","Login successful":"登录成功","Logout successful":"登出成功","Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.":"在获取签发证书前,请确保配置文件中已将 .well-known 目录反向代理到 HTTPChallengePort (默认: 9180)","Manage Configs":"配置管理","Manage Sites":"网站管理","Manage Users":"用户管理","Memory":"内存","Memory and Storage":"内存与存储","Modify":"修改","Modify Config":"修改配置文件","Multi-line Directive":"单行指令","Name":"名称","Network":"网络","Network Statistics":"流量统计","Network Total Receive":"下载流量","Network Total Send":"上传流量","Next":"下一步","Nginx Access Log Path":"Nginx 访问日志路径","Nginx Configuration Parse Error":"Nginx 配置解析错误","Nginx Error Log Path":"Nginx 错误日志路径","Nginx Log":"Nginx 日志","No":"取消","Not Found":"找不到页面","Not Valid Before: %{date}":"此前无效: %{date}","Note":"注意","Obtaining certificate":"正在获取证书","OK":"确定","OS:":"OS:","Params":"参数","Password":"密码","Password (*)":"密码 (*)","Path":"路径","Please input your E-mail!":"请输入您的邮箱!","Please input your password!":"请输入您的密码!","Please input your username!":"请输入您的用户名!","Preference":"偏好设置","Preparing lego configurations":"正在准备 Lego 的配置","Prohibit changing root password in demo":"禁止在演示模式下修改 root 账户的密码","Prohibit deleting the default user":"禁止删除默认用户","Project Team":"项目团队","Reads":"读","Receive":"下载","Registering user":"正在注册用户","Reloading nginx":"正在重载 Nginx","Reset":"重置","Run Mode":"运行模式","Save":"保存","Save Directive":"保存指令","Save error %{msg}":"保存错误 %{msg}","Save successfully":"保存成功","Save Successfully":"保存成功","Saved successfully":"保存成功","Selector":"选择器","Send":"上传","Server error":"服务器错误","Server Info":"服务器信息","server_name not found in directives":"未在指令集合中找到 server_name","server_name parameter is required":"必须为 server_name 指令指明参数","Single Directive":"单行指令","Site Logs":"站点列表","Sites List":"站点列表","SSL Certificate Key Path":"SSL证书密钥路径","SSL Certificate Path":"SSL证书路径","SSL Certification Content":"SSL证书内容","SSL Certification Key Content":"SSL证书密钥内容","Status":"状态","Storage":"存储","Subject Name: %{name}":"主体名称: %{name}","Swap":"Swap","Table":"列表","Terminal":"终端","Terminal Start Command":"终端启动命令","The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.":"系统将会每小时检测一次该域名证书,若距离上次签发已超过1个月,则将自动续签。","The filename cannot contain the following characters: %{c}":"文件名不能包含以下字符: %{c}","The server_name in the current configuration must be the domain name you need to get the certificate.":"当前配置中的 server_name 必须为需要申请证书的域名。","The username or password is incorrect":"用户名或密码错误","Theme":"主题","Type":"类型","Updated at":"修改时间","Updated successfully":"更新成功","Uptime:":"运行时间:","Username":"用户名","Username (*)":"用户名 (*)","Using HTTP01 challenge provider":"使用 HTTP01 challenge provider","View":"查看","Warning":"警告","Writes":"写","Writing certificate private key to disk":"正在将证书私钥写入磁盘","Writing certificate to disk":"正在将证书写入磁盘","Yes":"是的","License":{"Project":"开源许可"}},"en":{"About":"About","Action":"Action","Add Directive Below":"Add Directive Below","Add Location":"Add Location","Add Site":"Add Site","Advance Mode":"Advance Mode","Are you sure you want to remove this directive?":"Are you sure you want to remove this directive?","Auto-renewal disabled for %{name}":"Auto-renewal disabled for %{name}","Auto-renewal enabled for %{name}":"Auto-renewal enabled for %{name}","Back":"Back","Base information":"Base information","Basic Mode":"Basic Mode","Build with":"Build with","Cancel":"Cancel","Certificate has expired":"Certificate has expired","Certificate is valid":"Certificate is valid","Certificate Status":"Certificate Status","Comments":"Comments","Configuration Name":"Configuration Name","Configurations":"Configurations","Configure SSL":"Configure SSL","Content":"Content","CPU Status":"CPU Status","CPU:":"CPU:","Create Another":"Create Another","Created at":"Created at","Dashboard":"Dashboard","Database (Optional, default: database)":"Database (Optional, default: database)","Development Mode":"Development Mode","Directive":"Directive","Directives":"Directives","Disable auto-renewal failed for %{name}":"Disable auto-renewal failed for %{name}","Disabled":"Disabled","Disabled successfully":"Disabled successfully","Disk IO":"Disk IO","Domain Config Created Successfully":"Domain Config Created Successfully","Edit %{n}":"Edit %{n}","Edit Configuration":"Edit Configuration","Edit Site":"Edit Site","Email (*)":"Email (*)","Enable auto-renewal failed for %{name}":"Enable auto-renewal failed for %{name}","Enable failed":"Enable failed","Enable TLS":"Enable TLS","Enabled":"Enabled","Enabled successfully":"Enabled successfully","Encrypt website with Let's Encrypt":"Encrypt website with Let's Encrypt","Expiration Date: %{date}":"Expiration Date: %{date}","Failed to disable %{msg}":"Failed to disable %{msg}","Failed to enable %{msg}":"Failed to enable %{msg}","File Not Found":"File Not Found","Finished":"Finished","Getting the certificate, please wait...":"Getting the certificate, please wait...","Home":"Home","Install":"Install","Intermediate Certification Authorities: %{issuer}":"Intermediate Certification Authorities: %{issuer}","Leave blank for no change":"Leave blank for no change","Load Averages:":"Load Averages:","Location":"Location","Locations":"Locations","Login":"Login","Login successful":"Login successful","Logout successful":"Logout successful","Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.":"Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.","Manage Configs":"Manage Configs","Manage Sites":"Manage Sites","Manage Users":"Manage Users","Memory":"Memory","Memory and Storage":"Memory and Storage","Modify Config":"Modify Config","Name":"Name","Network":"Network","Network Statistics":"Network Statistics","Network Total Receive":"Network Total Receive","Network Total Send":"Network Total Send","Next":"Next","No":"No","Not Found":"Not Found","Not Valid Before: %{date}":"Not Valid Before: %{date}","OS:":"OS:","Params":"Params","Password":"Password","Password (*)":"Password (*)","Path":"Path","Please input your E-mail!":"Please input your E-mail!","Please input your password!":"Please input your password!","Please input your username!":"Please input your username!","Project Team":"Project Team","Reads":"Reads","Receive":"Receive","Save":"Save","Save Directive":"Save Directive","Save error %{msg}":"Save error %{msg}","Saved successfully":"Saved successfully","Send":"Send","Server error":"Server error","Server Info":"Server Info","server_name not found in directives":"server_name not found in directives","server_name parameter is required":"server_name parameter is required","Single Directive":"Single Directive","Sites List":"Sites List","Status":"Status","Storage":"Storage","Subject Name: %{name}":"Subject Name: %{name}","Swap":"Swap","Terminal":"Terminal","The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.":"The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.","The filename cannot contain the following characters: %{c}":"The filename cannot contain the following characters: %{c}","Updated at":"Updated at","Uptime:":"Uptime:","Username":"Username","Username (*)":"Username (*)","Warning":"Warning","Writes":"Writes","Yes":"Yes","License":{"Project":"License"}},"zh_TW":{"About":"關於","Access Logs":"訪問日誌","Action":"操作","Add":"新增","Add Directive Below":"在下面新增指令","Add Location":"新增 Location","Add Site":"新增站點","Advance Mode":"高階模式","Are you sure you want to delete?":"你確定你要刪除?","Are you sure you want to remove this directive?":"您確定要刪除這條指令?","Are you sure you want to remove this location?":"您確定要刪除此 Location 嗎?","Auto":"自動","Auto Refresh":"自動刷新","Auto-renewal disabled for %{name}":"已關閉 %{name} 自動續簽","Auto-renewal enabled for %{name}":"已啟用 %{name} 自動續簽","Back":"返回","Back Home":"回到首頁","Base information":"基本訊息","Basic Mode":"基本模式","Batch Modify":"批量修改","Build with":"構建基於","Cancel":"取消","Certificate has expired":"此憑證已過期","Certificate is valid":"此憑證有效","Certificate Status":"憑證狀態","Comments":"註釋","Configuration Name":"配置名稱","Configurations":"配置","Configure SSL":"配置 SSL","Content":"內容","CPU Status":"中央處理器狀態","CPU:":"中央處理器:","Create Another":"再創建一個","Created at":"建立時間","Creating client facilitates communication with the CA server":"創建客戶端方便與CA服務器通信","Dark":"深色","Dashboard":"儀表盤","Database (Optional, default: database)":"資料庫 (可選,預設: database)","Delete":"刪除","Delete ID: %{id}":"刪除 ID: %{id}","Delete site: %{site_name}":"刪除站點:%{site_name}","Development Mode":"開發模式","Directive":"指令","Directives":"指令","Disable auto-renewal failed for %{name}":"關閉 %{name} 自動續簽失敗","Disabled":"禁用","Disabled successfully":"禁用成功","Disk IO":"磁碟 IO","Domain Config Created Successfully":"域名配置文件創建成功","Edit %{n}":"編輯 %{n}","Edit Configuration":"編輯配置","Edit Site":"編輯站點","Email (*)":"郵箱 (*)","Enable auto-renewal failed for %{name}":"啟用 %{name} 自動續簽失敗","Enable failed":"啟用失敗","Enable TLS":"啟用 TLS","Enabled":"啟用","Enabled successfully":"啟用成功","Encrypt website with Let's Encrypt":"用 Let's Encrypt 對網站進行加密","Error Logs":"錯誤日志","Expiration Date: %{date}":"過期時間: %{date}","Export":"導出","Failed to disable %{msg}":"禁用失敗 %{msg}","Failed to enable %{msg}":"啟用失敗 %{msg}","Failed to get certificate information":"獲取證書信息失敗","File Not Found":"未找到檔案","Filter":"篩選","Finished":"完成","Generate":"生成","Generating private key for registering account":"生成註冊賬號私鑰","Getting the certificate, please wait...":"正在獲取憑證,請稍等...","Home":"首頁","Install":"安裝","Install successfully":"安裝成功","Intermediate Certification Authorities: %{issuer}":"中級憑證頒發機構: %{issuer}","Issued certificate successfully":"頒發證書成功","Leave blank for no change":"留空表示不修改","Light":"淺色","Load Averages:":"系統負載:","Location":"Location","Locations":"Locations","Login":"登入","Login successful":"登入成功","Logout successful":"登出成功","Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.":"在獲取證書前,請確保配置檔案中已將 .well-known 目錄反向代理到 HTTPChallengePort (預設: 9180)","Manage Configs":"配置管理","Manage Sites":"網站管理","Manage Users":"使用者管理","Memory":"記憶體","Memory and Storage":"記憶體和存儲","Modify":"修改","Modify Config":"修改配置","Name":"名稱","Network":"網路","Network Statistics":"網路統計","Network Total Receive":"下載流量","Network Total Send":"上傳流量","Next":"下一步","Nginx Log":"Nginx 日誌","No":"取消","Not Found":"找不到頁面","Not Valid Before: %{date}":"此前無效: %{date}","Obtaining certificate":"正在獲取證書,請稍等...","OK":"確定","OS:":"作業系統:","Params":"參數","Password":"密碼","Password (*)":"密碼 (*)","Path":"路徑","Please input your E-mail!":"請輸入您的郵箱!","Please input your password!":"請輸入您的密碼!","Please input your username!":"請輸入您的使用者名稱!","Preference":"設定","Preparing lego configurations":"準備 Lego 配置","Prohibit changing root password in demo":"禁止在demo中修改root密碼","Prohibit deleting the default user":"禁止刪除默認用戶","Project Team":"專案團隊","Reads":"讀","Receive":"下載","Registering user":"註冊用戶","Reloading nginx":"重载 Nginx","Reset":"重設","Save":"儲存","Save Directive":"儲存指令","Save error %{msg}":"儲存錯誤 %{msg}","Save successfully":"保存成功","Save Successfully":"保存成功","Saved successfully":"儲存成功","Selector":"選擇器","Send":"上傳","Server error":"伺服器錯誤","Server Info":"伺服器資訊","server_name not found in directives":"未在指令集合中找到 server_name","server_name parameter is required":"必須為 server_name 指令指明參數","Single Directive":"單行指令","Site Logs":"網站日誌","Sites List":"站點列表","Status":"狀態","Storage":"儲存","Subject Name: %{name}":"主體名稱: %{name}","Swap":"交換空間","Table":"表格","Terminal":"終端","The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.":"系統將會每小時檢測一次該域名證書,若距離上次簽發已超過1個月,則將自動續簽。
如果您之前沒有證書,請先點選「從 Let's Encrypt 獲取證書」。","The filename cannot contain the following characters: %{c}":"檔名不能包含以下字元: %{c}","The username or password is incorrect":"用戶名或密碼不正確","Theme":"外觀樣式","Updated at":"修改時間","Updated successfully":"已成功更新","Uptime:":"執行時間:","Username":"使用者名稱","Username (*)":"使用者名稱 (*)","Using HTTP01 challenge provider":"使用 HTTP01 挑戰提供者","Warning":"警告","Writes":"寫","Writing certificate private key to disk":"將證書私鑰寫入磁盤","Writing certificate to disk":"將證書寫入磁盤","Yes":"是的","License":{"Project":"開源軟體授權條款"}}} \ No newline at end of file +{"zh_CN":{"About":"关于","Access Logs":"访问日志","Action":"操作","Add":"添加","Add Directive Below":"在下面添加指令","Add Location":"添加 Location","Add Site":"添加站点","Advance Mode":"高级模式","Arch":"架构","Are you sure you want to delete?":"您确定要删除吗?","Are you sure you want to remove this directive?":"您确定要删除这条指令?","Are you sure you want to remove this location?":"您确定要删除这个 Location?","Author":"作者","Auto":"自动","Auto Cert":"自动更新","Auto cert is enabled, please do not modify this certification.":"自动更新已启用,请勿修改此证书配置。","Auto Refresh":"自动刷新","Auto-renewal disabled for %{name}":"成功关闭 %{name} 自动续签","Auto-renewal enabled for %{name}":"成功启用 %{name} 自动续签","Back":"返回","Back Home":"返回首页","Base information":"基本信息","Basic Mode":"基本模式","Batch Modify":"批量修改","Build with":"构建基于","Cancel":"取消","Certificate has expired":"此证书已过期","Certificate is valid":"此证书有效","Certificate Status":"证书状态","Certification":"证书","Change Certificate":"更改证书","Check again":"重新检查","Comments":"注释","Config Templates":"配置","Configuration Name":"配置名称","Configurations":"配置","Configure SSL":"配置 SSL","Content":"内容","CPU Status":"CPU 状态","CPU:":"CPU:","Create Another":"再创建一个","Created at":"创建时间","Creating client facilitates communication with the CA server":"正在创建客户端用于与 CA 服务器通信","Current Version":"当前版本","Custom":"自定义","Dark":"深色","Dashboard":"仪表盘","Database (Optional, default: database)":"数据库 (可选,默认: database)","Delete":"删除","Delete ID: %{id}":"删除 ID: %{id}","Delete site: %{site_name}":"删除站点: %{site_name}","Description":"描述","Development Mode":"开发模式","Dir":"目录","Directive":"指令","Directives":"指令","Disable auto-renewal failed for %{name}":"关闭 %{name} 自动续签失败","Disabled":"禁用","Disabled successfully":"禁用成功","Disk IO":"磁盘 IO","Domain":"域名","Domain Config Created Successfully":"域名配置文件创建成功","Edit %{n}":"编辑 %{n}","Edit Configuration":"编辑配置","Edit Site":"编辑站点","Email (*)":"邮箱 (*)","Enable auto-renewal failed for %{name}":"启用 %{name} 自动续签失败","Enable failed":"启用失败","Enable TLS":"启用 TLS","Enabled":"启用","Enabled successfully":"启用成功","Encrypt website with Let's Encrypt":"用 Let's Encrypt 对网站进行加密","Error Logs":"错误日志","Executable Path":"可执行文件路径","Expiration Date: %{date}":"过期时间: %{date}","Export":"导出","Failed to disable %{msg}":"禁用失败 %{msg}","Failed to enable %{msg}":"启用失败 %{msg}","Failed to get certificate information":"获取证书信息失败","Failed to save, syntax error(s) was detected in the configuration.":"保存失败,在配置中检测到语法错误。","File":"文件","File Not Found":"未找到文件","Filter":"过滤","Finished":"完成","Format Code":"代码格式化","Format error %{msg}":"保存错误 %{msg}","Format successfully":"保存成功","Generate":"生成","Generating private key for registering account":"正在生成私钥用于注册账户","Getting the certificate, please wait...":"正在获取证书,请稍等...","Home":"首页","HTTP Challenge Port":"HTTP Challenge 监听端口","HTTP Port":"HTTP 监听端口","Install":"安装","Install successfully":"安装成功","Intermediate Certification Authorities: %{issuer}":"中级证书颁发机构: %{issuer}","Issued certificate successfully":"证书申请成功","Jwt Secret":"Jwt 密钥","Last checked at":"最后检查时间","Leave blank for no change":"留空表示不修改","Light":"浅色","Load Averages:":"系统负载:","Location":"Location","Locations":"Locations","Login":"登录","Login successful":"登录成功","Logout successful":"登出成功","Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.":"在获取签发证书前,请确保配置文件中已将 .well-known 目录反向代理到 HTTPChallengePort (默认: 9180)","Manage Configs":"配置管理","Manage Sites":"网站管理","Manage Users":"用户管理","Memory":"内存","Memory and Storage":"内存与存储","Modify":"修改","Modify Config":"修改配置文件","Multi-line Directive":"单行指令","Name":"名称","Network":"网络","Network Statistics":"流量统计","Network Total Receive":"下载流量","Network Total Send":"上传流量","New version released":"新版本发布","Next":"下一步","Nginx Access Log Path":"Nginx 访问日志路径","Nginx Configuration Parse Error":"Nginx 配置解析错误","Nginx Error Log Path":"Nginx 错误日志路径","Nginx Log":"Nginx 日志","No":"取消","Not Found":"找不到页面","Not Valid Before: %{date}":"此前无效: %{date}","Note":"注意","Obtaining certificate":"正在获取证书","OK":"确定","OS":"OS","OS:":"OS:","Params":"参数","Password":"密码","Password (*)":"密码 (*)","Path":"路径","Please input your E-mail!":"请输入您的邮箱!","Please input your password!":"请输入您的密码!","Please input your username!":"请输入您的用户名!","Preference":"偏好设置","Preparing lego configurations":"正在准备 Lego 的配置","Prohibit changing root password in demo":"禁止在演示模式下修改 root 账户的密码","Prohibit deleting the default user":"禁止删除默认用户","Project Team":"项目团队","Reads":"读","Receive":"下载","Registering user":"正在注册用户","Reinstall":"重新安装","Release Note":"发行日志","Reloading nginx":"正在重载 Nginx","Reset":"重置","Run Mode":"运行模式","Save":"保存","Save Directive":"保存指令","Save error %{msg}":"保存错误 %{msg}","Save successfully":"保存成功","Save Successfully":"保存成功","Saved successfully":"保存成功","Selector":"选择器","Send":"上传","Server error":"服务器错误","Server Info":"服务器信息","server_name not found in directives":"未在指令集合中找到 server_name","server_name parameter is required":"必须为 server_name 指令指明参数","Single Directive":"单行指令","Site Logs":"站点列表","Sites List":"站点列表","SSL Certificate Key Path":"SSL证书密钥路径","SSL Certificate Path":"SSL证书路径","SSL Certification Content":"SSL证书内容","SSL Certification Key Content":"SSL证书密钥内容","Status":"状态","Storage":"存储","Subject Name: %{name}":"主体名称: %{name}","Swap":"Swap","System":"系统","Table":"列表","Terminal":"终端","Terminal Start Command":"终端启动命令","The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.":"系统将会每小时检测一次该域名证书,若距离上次签发已超过1个月,则将自动续签。","The filename cannot contain the following characters: %{c}":"文件名不能包含以下字符: %{c}","The server_name in the current configuration must be the domain name you need to get the certificate.":"当前配置中的 server_name 必须为需要申请证书的域名。","The username or password is incorrect":"用户名或密码错误","Theme":"主题","Type":"类型","Updated at":"修改时间","Updated successfully":"更新成功","Upgrade":"升级","Uptime:":"运行时间:","Username":"用户名","Username (*)":"用户名 (*)","Using HTTP01 challenge provider":"使用 HTTP01 challenge provider","View":"查看","Warning":"警告","Writes":"写","Writing certificate private key to disk":"正在将证书私钥写入磁盘","Writing certificate to disk":"正在将证书写入磁盘","Yes":"是的","You are using the latest version":"您使用的是最新版本","You can check Nginx UI upgrade at this page.":"你可以在这个页面检查Nginx UI的升级。","License":{"Project":"开源许可"}},"en":{"About":"About","Action":"Action","Add Directive Below":"Add Directive Below","Add Location":"Add Location","Add Site":"Add Site","Advance Mode":"Advance Mode","Are you sure you want to remove this directive?":"Are you sure you want to remove this directive?","Auto-renewal disabled for %{name}":"Auto-renewal disabled for %{name}","Auto-renewal enabled for %{name}":"Auto-renewal enabled for %{name}","Back":"Back","Base information":"Base information","Basic Mode":"Basic Mode","Build with":"Build with","Cancel":"Cancel","Certificate has expired":"Certificate has expired","Certificate is valid":"Certificate is valid","Certificate Status":"Certificate Status","Comments":"Comments","Configuration Name":"Configuration Name","Configurations":"Configurations","Configure SSL":"Configure SSL","Content":"Content","CPU Status":"CPU Status","CPU:":"CPU:","Create Another":"Create Another","Created at":"Created at","Dashboard":"Dashboard","Database (Optional, default: database)":"Database (Optional, default: database)","Development Mode":"Development Mode","Directive":"Directive","Directives":"Directives","Disable auto-renewal failed for %{name}":"Disable auto-renewal failed for %{name}","Disabled":"Disabled","Disabled successfully":"Disabled successfully","Disk IO":"Disk IO","Domain Config Created Successfully":"Domain Config Created Successfully","Edit %{n}":"Edit %{n}","Edit Configuration":"Edit Configuration","Edit Site":"Edit Site","Email (*)":"Email (*)","Enable auto-renewal failed for %{name}":"Enable auto-renewal failed for %{name}","Enable failed":"Enable failed","Enable TLS":"Enable TLS","Enabled":"Enabled","Enabled successfully":"Enabled successfully","Encrypt website with Let's Encrypt":"Encrypt website with Let's Encrypt","Expiration Date: %{date}":"Expiration Date: %{date}","Failed to disable %{msg}":"Failed to disable %{msg}","Failed to enable %{msg}":"Failed to enable %{msg}","File Not Found":"File Not Found","Finished":"Finished","Getting the certificate, please wait...":"Getting the certificate, please wait...","Home":"Home","Install":"Install","Intermediate Certification Authorities: %{issuer}":"Intermediate Certification Authorities: %{issuer}","Leave blank for no change":"Leave blank for no change","Load Averages:":"Load Averages:","Location":"Location","Locations":"Locations","Login":"Login","Login successful":"Login successful","Logout successful":"Logout successful","Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.":"Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.","Manage Configs":"Manage Configs","Manage Sites":"Manage Sites","Manage Users":"Manage Users","Memory":"Memory","Memory and Storage":"Memory and Storage","Modify Config":"Modify Config","Name":"Name","Network":"Network","Network Statistics":"Network Statistics","Network Total Receive":"Network Total Receive","Network Total Send":"Network Total Send","Next":"Next","No":"No","Not Found":"Not Found","Not Valid Before: %{date}":"Not Valid Before: %{date}","OS:":"OS:","Params":"Params","Password":"Password","Password (*)":"Password (*)","Path":"Path","Please input your E-mail!":"Please input your E-mail!","Please input your password!":"Please input your password!","Please input your username!":"Please input your username!","Project Team":"Project Team","Reads":"Reads","Receive":"Receive","Save":"Save","Save Directive":"Save Directive","Save error %{msg}":"Save error %{msg}","Saved successfully":"Saved successfully","Send":"Send","Server error":"Server error","Server Info":"Server Info","server_name not found in directives":"server_name not found in directives","server_name parameter is required":"server_name parameter is required","Single Directive":"Single Directive","Sites List":"Sites List","Status":"Status","Storage":"Storage","Subject Name: %{name}":"Subject Name: %{name}","Swap":"Swap","Terminal":"Terminal","The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.":"The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.","The filename cannot contain the following characters: %{c}":"The filename cannot contain the following characters: %{c}","Updated at":"Updated at","Uptime:":"Uptime:","Username":"Username","Username (*)":"Username (*)","Warning":"Warning","Writes":"Writes","Yes":"Yes","License":{"Project":"License"}},"zh_TW":{"About":"關於","Access Logs":"訪問日誌","Action":"操作","Add":"新增","Add Directive Below":"在下面新增指令","Add Location":"新增 Location","Add Site":"新增站點","Advance Mode":"高階模式","Are you sure you want to delete?":"你確定你要刪除?","Are you sure you want to remove this directive?":"您確定要刪除這條指令?","Are you sure you want to remove this location?":"您確定要刪除此 Location 嗎?","Auto":"自動","Auto Refresh":"自動刷新","Auto-renewal disabled for %{name}":"已關閉 %{name} 自動續簽","Auto-renewal enabled for %{name}":"已啟用 %{name} 自動續簽","Back":"返回","Back Home":"回到首頁","Base information":"基本訊息","Basic Mode":"基本模式","Batch Modify":"批量修改","Build with":"構建基於","Cancel":"取消","Certificate has expired":"此憑證已過期","Certificate is valid":"此憑證有效","Certificate Status":"憑證狀態","Comments":"註釋","Configuration Name":"配置名稱","Configurations":"配置","Configure SSL":"配置 SSL","Content":"內容","CPU Status":"中央處理器狀態","CPU:":"中央處理器:","Create Another":"再創建一個","Created at":"建立時間","Creating client facilitates communication with the CA server":"創建客戶端方便與CA服務器通信","Dark":"深色","Dashboard":"儀表盤","Database (Optional, default: database)":"資料庫 (可選,預設: database)","Delete":"刪除","Delete ID: %{id}":"刪除 ID: %{id}","Delete site: %{site_name}":"刪除站點:%{site_name}","Development Mode":"開發模式","Directive":"指令","Directives":"指令","Disable auto-renewal failed for %{name}":"關閉 %{name} 自動續簽失敗","Disabled":"禁用","Disabled successfully":"禁用成功","Disk IO":"磁碟 IO","Domain Config Created Successfully":"域名配置文件創建成功","Edit %{n}":"編輯 %{n}","Edit Configuration":"編輯配置","Edit Site":"編輯站點","Email (*)":"郵箱 (*)","Enable auto-renewal failed for %{name}":"啟用 %{name} 自動續簽失敗","Enable failed":"啟用失敗","Enable TLS":"啟用 TLS","Enabled":"啟用","Enabled successfully":"啟用成功","Encrypt website with Let's Encrypt":"用 Let's Encrypt 對網站進行加密","Error Logs":"錯誤日志","Expiration Date: %{date}":"過期時間: %{date}","Export":"導出","Failed to disable %{msg}":"禁用失敗 %{msg}","Failed to enable %{msg}":"啟用失敗 %{msg}","Failed to get certificate information":"獲取證書信息失敗","File Not Found":"未找到檔案","Filter":"篩選","Finished":"完成","Generate":"生成","Generating private key for registering account":"生成註冊賬號私鑰","Getting the certificate, please wait...":"正在獲取憑證,請稍等...","Home":"首頁","Install":"安裝","Install successfully":"安裝成功","Intermediate Certification Authorities: %{issuer}":"中級憑證頒發機構: %{issuer}","Issued certificate successfully":"頒發證書成功","Leave blank for no change":"留空表示不修改","Light":"淺色","Load Averages:":"系統負載:","Location":"Location","Locations":"Locations","Login":"登入","Login successful":"登入成功","Logout successful":"登出成功","Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate.":"在獲取證書前,請確保配置檔案中已將 .well-known 目錄反向代理到 HTTPChallengePort (預設: 9180)","Manage Configs":"配置管理","Manage Sites":"網站管理","Manage Users":"使用者管理","Memory":"記憶體","Memory and Storage":"記憶體和存儲","Modify":"修改","Modify Config":"修改配置","Name":"名稱","Network":"網路","Network Statistics":"網路統計","Network Total Receive":"下載流量","Network Total Send":"上傳流量","Next":"下一步","Nginx Log":"Nginx 日誌","No":"取消","Not Found":"找不到頁面","Not Valid Before: %{date}":"此前無效: %{date}","Obtaining certificate":"正在獲取證書,請稍等...","OK":"確定","OS:":"作業系統:","Params":"參數","Password":"密碼","Password (*)":"密碼 (*)","Path":"路徑","Please input your E-mail!":"請輸入您的郵箱!","Please input your password!":"請輸入您的密碼!","Please input your username!":"請輸入您的使用者名稱!","Preference":"設定","Preparing lego configurations":"準備 Lego 配置","Prohibit changing root password in demo":"禁止在demo中修改root密碼","Prohibit deleting the default user":"禁止刪除默認用戶","Project Team":"專案團隊","Reads":"讀","Receive":"下載","Registering user":"註冊用戶","Reloading nginx":"重载 Nginx","Reset":"重設","Save":"儲存","Save Directive":"儲存指令","Save error %{msg}":"儲存錯誤 %{msg}","Save successfully":"保存成功","Save Successfully":"保存成功","Saved successfully":"儲存成功","Selector":"選擇器","Send":"上傳","Server error":"伺服器錯誤","Server Info":"伺服器資訊","server_name not found in directives":"未在指令集合中找到 server_name","server_name parameter is required":"必須為 server_name 指令指明參數","Single Directive":"單行指令","Site Logs":"網站日誌","Sites List":"站點列表","Status":"狀態","Storage":"儲存","Subject Name: %{name}":"主體名稱: %{name}","Swap":"交換空間","Table":"表格","Terminal":"終端","The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued.":"系統將會每小時檢測一次該域名證書,若距離上次簽發已超過1個月,則將自動續簽。
如果您之前沒有證書,請先點選「從 Let's Encrypt 獲取證書」。","The filename cannot contain the following characters: %{c}":"檔名不能包含以下字元: %{c}","The username or password is incorrect":"用戶名或密碼不正確","Theme":"外觀樣式","Updated at":"修改時間","Updated successfully":"已成功更新","Uptime:":"執行時間:","Username":"使用者名稱","Username (*)":"使用者名稱 (*)","Using HTTP01 challenge provider":"使用 HTTP01 挑戰提供者","Warning":"警告","Writes":"寫","Writing certificate private key to disk":"將證書私鑰寫入磁盤","Writing certificate to disk":"將證書寫入磁盤","Yes":"是的","License":{"Project":"開源軟體授權條款"}}} \ No newline at end of file diff --git a/frontend/src/language/zh_CN/app.mo b/frontend/src/language/zh_CN/app.mo index b3f79b03..96d9c478 100644 Binary files a/frontend/src/language/zh_CN/app.mo and b/frontend/src/language/zh_CN/app.mo differ diff --git a/frontend/src/language/zh_CN/app.po b/frontend/src/language/zh_CN/app.po index 36dfcb3f..d0e5cf53 100644 --- a/frontend/src/language/zh_CN/app.po +++ b/frontend/src/language/zh_CN/app.po @@ -12,7 +12,7 @@ msgstr "" "Generated-By: easygettext\n" "X-Generator: Poedit 3.2.2\n" -#: src/routes/index.ts:134 +#: src/routes/index.ts:141 msgid "About" msgstr "关于" @@ -53,6 +53,11 @@ msgstr "添加站点" msgid "Advance Mode" msgstr "高级模式" +#: src/views/system/Upgrade.vue:12 src/views/system/Upgrade.vue:13 +#: src/views/system/Upgrade.vue:17 src/views/system/Upgrade.vue:21 +msgid "Arch" +msgstr "架构" + #: src/components/StdDataDisplay/StdTable.vue:54 #: src/views/domain/DomainList.vue:26 msgid "Are you sure you want to delete?" @@ -128,7 +133,7 @@ msgstr "基本模式" msgid "Batch Modify" msgstr "批量修改" -#: src/views/other/About.vue:21 +#: src/views/system/About.vue:21 msgid "Build with" msgstr "构建基于" @@ -160,6 +165,11 @@ msgstr "证书" msgid "Change Certificate" msgstr "更改证书" +#: src/views/system/Upgrade.vue:16 src/views/system/Upgrade.vue:17 +#: src/views/system/Upgrade.vue:21 src/views/system/Upgrade.vue:25 +msgid "Check again" +msgstr "重新检查" + #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:47 @@ -189,6 +199,11 @@ msgstr "配置 SSL" msgid "Content" msgstr "内容" +#: src/views/system/Upgrade.vue:3 +#, fuzzy +msgid "Core Upgrade" +msgstr "升级" + #: src/views/dashboard/DashBoard.vue:64 msgid "CPU Status" msgstr "CPU 状态" @@ -209,6 +224,11 @@ msgstr "创建时间" msgid "Creating client facilitates communication with the CA server" msgstr "正在创建客户端用于与 CA 服务器通信" +#: src/views/system/Upgrade.vue:10 src/views/system/Upgrade.vue:11 +#: src/views/system/Upgrade.vue:15 src/views/system/Upgrade.vue:19 +msgid "Current Version" +msgstr "当前版本" + #: src/views/domain/ngx_conf/ConfigTemplate.vue:22 #: src/views/domain/ngx_conf/ConfigTemplate.vue:23 #: src/views/domain/ngx_conf/ConfigTemplate.vue:26 @@ -254,7 +274,7 @@ msgstr "删除站点: %{site_name}" msgid "Description" msgstr "描述" -#: src/views/other/About.vue:7 src/views/other/About.vue:8 +#: src/views/system/About.vue:7 src/views/system/About.vue:8 msgid "Development Mode" msgstr "开发模式" @@ -340,7 +360,7 @@ msgstr "启用" msgid "Enabled successfully" msgstr "启用成功" -#: src/views/domain/cert/IssueCert.vue:18 +#: src/views/domain/cert/IssueCert.vue:17 msgid "Encrypt website with Let's Encrypt" msgstr "用 Let's Encrypt 对网站进行加密" @@ -348,6 +368,11 @@ msgstr "用 Let's Encrypt 对网站进行加密" msgid "Error Logs" msgstr "错误日志" +#: src/views/system/Upgrade.vue:13 src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 src/views/system/Upgrade.vue:22 +msgid "Executable Path" +msgstr "可执行文件路径" + #: src/views/domain/cert/CertInfo.vue:12 msgid "Expiration Date: %{date}" msgstr "过期时间: %{date}" @@ -427,7 +452,7 @@ msgstr "HTTP Challenge 监听端口" msgid "HTTP Port" msgstr "HTTP 监听端口" -#: src/routes/index.ts:144 src/views/other/Install.vue:128 +#: src/routes/index.ts:153 src/views/other/Install.vue:128 msgid "Install" msgstr "安装" @@ -447,6 +472,11 @@ msgstr "证书申请成功" msgid "Jwt Secret" msgstr "Jwt 密钥" +#: src/views/system/Upgrade.vue:14 src/views/system/Upgrade.vue:15 +#: src/views/system/Upgrade.vue:19 src/views/system/Upgrade.vue:23 +msgid "Last checked at" +msgstr "最后检查时间" + #: src/views/user/User.vue:26 msgid "Leave blank for no change" msgstr "留空表示不修改" @@ -470,7 +500,7 @@ msgstr "Location" msgid "Locations" msgstr "Locations" -#: src/routes/index.ts:150 src/views/other/Login.vue:104 +#: src/routes/index.ts:159 src/views/other/Login.vue:104 msgid "Login" msgstr "登录" @@ -482,7 +512,7 @@ msgstr "登录成功" msgid "Logout successful" msgstr "登出成功" -#: src/views/domain/cert/IssueCert.vue:211 +#: src/views/domain/cert/IssueCert.vue:210 msgid "" "Make sure you have configured a reverse proxy for .well-known directory to " "HTTPChallengePort (default: 9180) before getting the certificate." @@ -550,6 +580,10 @@ msgstr "下载流量" msgid "Network Total Send" msgstr "上传流量" +#: src/views/system/Upgrade.vue:34 +msgid "New version released" +msgstr "新版本发布" + #: src/views/domain/DomainAdd.vue:136 msgid "Next" msgstr "下一步" @@ -577,7 +611,7 @@ msgstr "Nginx 日志" msgid "No" msgstr "取消" -#: src/routes/index.ts:156 src/routes/index.ts:158 +#: src/routes/index.ts:165 src/routes/index.ts:167 msgid "Not Found" msgstr "找不到页面" @@ -585,7 +619,7 @@ msgstr "找不到页面" msgid "Not Valid Before: %{date}" msgstr "此前无效: %{date}" -#: src/views/domain/cert/IssueCert.vue:38 +#: src/views/domain/cert/IssueCert.vue:37 msgid "Note" msgstr "注意" @@ -601,6 +635,11 @@ msgstr "正在获取证书" msgid "OK" msgstr "确定" +#: src/views/system/Upgrade.vue:11 src/views/system/Upgrade.vue:12 +#: src/views/system/Upgrade.vue:16 src/views/system/Upgrade.vue:20 +msgid "OS" +msgstr "OS" + #: src/views/dashboard/DashBoard.vue:147 msgid "OS:" msgstr "OS:" @@ -650,7 +689,7 @@ msgstr "禁止在演示模式下修改 root 账户的密码" msgid "Prohibit deleting the default user" msgstr "禁止删除默认用户" -#: src/views/other/About.vue:19 +#: src/views/system/About.vue:19 msgid "Project Team" msgstr "项目团队" @@ -666,6 +705,18 @@ msgstr "下载" msgid "Registering user" msgstr "正在注册用户" +#: src/views/system/Upgrade.vue:24 src/views/system/Upgrade.vue:25 +#: src/views/system/Upgrade.vue:29 src/views/system/Upgrade.vue:33 +#: src/views/system/Upgrade.vue:36 src/views/system/Upgrade.vue:39 +msgid "Reinstall" +msgstr "重新安装" + +#: src/views/system/Upgrade.vue:31 src/views/system/Upgrade.vue:32 +#: src/views/system/Upgrade.vue:36 src/views/system/Upgrade.vue:40 +#: src/views/system/Upgrade.vue:43 src/views/system/Upgrade.vue:48 +msgid "Release Note" +msgstr "发行日志" + #: src/language/constants.ts:19 msgid "Reloading nginx" msgstr "正在重载 Nginx" @@ -742,7 +793,7 @@ msgstr "服务器信息" msgid "server_name not found in directives" msgstr "未在指令集合中找到 server_name" -#: src/views/domain/cert/IssueCert.vue:195 src/views/domain/DomainAdd.vue:111 +#: src/views/domain/cert/IssueCert.vue:194 src/views/domain/DomainAdd.vue:111 msgid "server_name parameter is required" msgstr "必须为 server_name 指令指明参数" @@ -791,6 +842,10 @@ msgstr "主体名称: %{name}" msgid "Swap" msgstr "Swap" +#: src/routes/index.ts:134 +msgid "System" +msgstr "系统" + #: src/components/StdDataDisplay/StdCurd.vue:3 msgid "Table" msgstr "列表" @@ -803,7 +858,7 @@ msgstr "终端" msgid "Terminal Start Command" msgstr "终端启动命令" -#: src/views/domain/cert/IssueCert.vue:207 +#: src/views/domain/cert/IssueCert.vue:206 msgid "" "The certificate for the domain will be checked every hour, and will be " "renewed if it has been more than 1 month since it was last issued." @@ -814,7 +869,7 @@ msgstr "" msgid "The filename cannot contain the following characters: %{c}" msgstr "文件名不能包含以下字符: %{c}" -#: src/views/domain/cert/IssueCert.vue:203 +#: src/views/domain/cert/IssueCert.vue:202 msgid "" "The server_name in the current configuration must be the domain name you " "need to get the certificate." @@ -841,6 +896,18 @@ msgstr "修改时间" msgid "Updated successfully" msgstr "更新成功" +#: src/routes/index.ts:145 src/views/system/Upgrade.vue:16 +#: src/views/system/Upgrade.vue:26 src/views/system/Upgrade.vue:27 +#: src/views/system/Upgrade.vue:31 src/views/system/Upgrade.vue:35 +#: src/views/system/Upgrade.vue:38 src/views/system/Upgrade.vue:41 +#: src/views/system/Upgrade.vue:42 +msgid "Upgrade" +msgstr "升级" + +#: src/views/system/Upgrade.vue:63 +msgid "Upgrading Nginx UI, please wait..." +msgstr "" + #: src/views/dashboard/DashBoard.vue:137 msgid "Uptime:" msgstr "运行时间:" @@ -863,7 +930,7 @@ msgstr "使用 HTTP01 challenge provider" msgid "View" msgstr "查看" -#: src/views/domain/cert/IssueCert.vue:27 src/views/domain/DomainAdd.vue:22 +#: src/views/domain/cert/IssueCert.vue:26 src/views/domain/DomainAdd.vue:22 msgid "Warning" msgstr "警告" @@ -885,7 +952,16 @@ msgstr "正在将证书写入磁盘" msgid "Yes" msgstr "是的" -#: src/views/other/About.vue:27 +#: src/views/system/Upgrade.vue:30 +msgid "You are using the latest version" +msgstr "您使用的是最新版本" + +#: src/views/system/Upgrade.vue:10 src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 src/views/system/Upgrade.vue:9 +msgid "You can check Nginx UI upgrade at this page." +msgstr "你可以在这个页面检查Nginx UI的升级。" + +#: src/views/system/About.vue:27 msgctxt "Project" msgid "License" msgstr "开源许可" @@ -929,9 +1005,6 @@ msgstr "开源许可" #~ msgid "Restore" #~ msgstr "反删除" -#~ msgid "System message" -#~ msgstr "系统消息" - #~ msgid "Yes, I'm sure" #~ msgstr "是的" diff --git a/frontend/src/language/zh_TW/app.po b/frontend/src/language/zh_TW/app.po index 8e61aa67..2b7b9439 100644 --- a/frontend/src/language/zh_TW/app.po +++ b/frontend/src/language/zh_TW/app.po @@ -13,7 +13,7 @@ msgstr "" "Generated-By: easygettext\n" "X-Generator: Poedit 3.2.2\n" -#: src/routes/index.ts:134 +#: src/routes/index.ts:141 msgid "About" msgstr "關於" @@ -54,6 +54,11 @@ msgstr "新增站點" msgid "Advance Mode" msgstr "高階模式" +#: src/views/system/Upgrade.vue:12 src/views/system/Upgrade.vue:13 +#: src/views/system/Upgrade.vue:17 src/views/system/Upgrade.vue:21 +msgid "Arch" +msgstr "" + #: src/components/StdDataDisplay/StdTable.vue:54 #: src/views/domain/DomainList.vue:26 msgid "Are you sure you want to delete?" @@ -130,7 +135,7 @@ msgstr "基本模式" msgid "Batch Modify" msgstr "批量修改" -#: src/views/other/About.vue:21 +#: src/views/system/About.vue:21 msgid "Build with" msgstr "構建基於" @@ -164,6 +169,11 @@ msgstr "此憑證有效" msgid "Change Certificate" msgstr "正在獲取證書,請稍等..." +#: src/views/system/Upgrade.vue:16 src/views/system/Upgrade.vue:17 +#: src/views/system/Upgrade.vue:21 src/views/system/Upgrade.vue:25 +msgid "Check again" +msgstr "" + #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:47 @@ -194,6 +204,10 @@ msgstr "配置 SSL" msgid "Content" msgstr "內容" +#: src/views/system/Upgrade.vue:3 +msgid "Core Upgrade" +msgstr "" + #: src/views/dashboard/DashBoard.vue:64 msgid "CPU Status" msgstr "中央處理器狀態" @@ -214,6 +228,11 @@ msgstr "建立時間" msgid "Creating client facilitates communication with the CA server" msgstr "創建客戶端方便與CA服務器通信" +#: src/views/system/Upgrade.vue:10 src/views/system/Upgrade.vue:11 +#: src/views/system/Upgrade.vue:15 src/views/system/Upgrade.vue:19 +msgid "Current Version" +msgstr "" + #: src/views/domain/ngx_conf/ConfigTemplate.vue:22 #: src/views/domain/ngx_conf/ConfigTemplate.vue:23 #: src/views/domain/ngx_conf/ConfigTemplate.vue:26 @@ -259,7 +278,7 @@ msgstr "刪除站點:%{site_name}" msgid "Description" msgstr "" -#: src/views/other/About.vue:7 src/views/other/About.vue:8 +#: src/views/system/About.vue:7 src/views/system/About.vue:8 msgid "Development Mode" msgstr "開發模式" @@ -345,7 +364,7 @@ msgstr "啟用" msgid "Enabled successfully" msgstr "啟用成功" -#: src/views/domain/cert/IssueCert.vue:18 +#: src/views/domain/cert/IssueCert.vue:17 msgid "Encrypt website with Let's Encrypt" msgstr "用 Let's Encrypt 對網站進行加密" @@ -353,6 +372,11 @@ msgstr "用 Let's Encrypt 對網站進行加密" msgid "Error Logs" msgstr "錯誤日志" +#: src/views/system/Upgrade.vue:13 src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 src/views/system/Upgrade.vue:22 +msgid "Executable Path" +msgstr "" + #: src/views/domain/cert/CertInfo.vue:12 msgid "Expiration Date: %{date}" msgstr "過期時間: %{date}" @@ -436,7 +460,7 @@ msgstr "HTTP 監聽埠" msgid "HTTP Port" msgstr "HTTP 監聽埠" -#: src/routes/index.ts:144 src/views/other/Install.vue:128 +#: src/routes/index.ts:153 src/views/other/Install.vue:128 msgid "Install" msgstr "安裝" @@ -456,6 +480,11 @@ msgstr "頒發證書成功" msgid "Jwt Secret" msgstr "" +#: src/views/system/Upgrade.vue:14 src/views/system/Upgrade.vue:15 +#: src/views/system/Upgrade.vue:19 src/views/system/Upgrade.vue:23 +msgid "Last checked at" +msgstr "" + #: src/views/user/User.vue:26 msgid "Leave blank for no change" msgstr "留空表示不修改" @@ -479,7 +508,7 @@ msgstr "Location" msgid "Locations" msgstr "Locations" -#: src/routes/index.ts:150 src/views/other/Login.vue:104 +#: src/routes/index.ts:159 src/views/other/Login.vue:104 msgid "Login" msgstr "登入" @@ -491,7 +520,7 @@ msgstr "登入成功" msgid "Logout successful" msgstr "登出成功" -#: src/views/domain/cert/IssueCert.vue:211 +#: src/views/domain/cert/IssueCert.vue:210 msgid "" "Make sure you have configured a reverse proxy for .well-known directory to " "HTTPChallengePort (default: 9180) before getting the certificate." @@ -560,6 +589,10 @@ msgstr "下載流量" msgid "Network Total Send" msgstr "上傳流量" +#: src/views/system/Upgrade.vue:34 +msgid "New version released" +msgstr "" + #: src/views/domain/DomainAdd.vue:136 msgid "Next" msgstr "下一步" @@ -590,7 +623,7 @@ msgstr "Nginx 日誌" msgid "No" msgstr "取消" -#: src/routes/index.ts:156 src/routes/index.ts:158 +#: src/routes/index.ts:165 src/routes/index.ts:167 msgid "Not Found" msgstr "找不到頁面" @@ -598,7 +631,7 @@ msgstr "找不到頁面" msgid "Not Valid Before: %{date}" msgstr "此前無效: %{date}" -#: src/views/domain/cert/IssueCert.vue:38 +#: src/views/domain/cert/IssueCert.vue:37 msgid "Note" msgstr "" @@ -614,6 +647,12 @@ msgstr "正在獲取證書,請稍等..." msgid "OK" msgstr "確定" +#: src/views/system/Upgrade.vue:11 src/views/system/Upgrade.vue:12 +#: src/views/system/Upgrade.vue:16 src/views/system/Upgrade.vue:20 +#, fuzzy +msgid "OS" +msgstr "作業系統:" + #: src/views/dashboard/DashBoard.vue:147 msgid "OS:" msgstr "作業系統:" @@ -663,7 +702,7 @@ msgstr "禁止在demo中修改root密碼" msgid "Prohibit deleting the default user" msgstr "禁止刪除默認用戶" -#: src/views/other/About.vue:19 +#: src/views/system/About.vue:19 msgid "Project Team" msgstr "專案團隊" @@ -679,6 +718,19 @@ msgstr "下載" msgid "Registering user" msgstr "註冊用戶" +#: src/views/system/Upgrade.vue:24 src/views/system/Upgrade.vue:25 +#: src/views/system/Upgrade.vue:29 src/views/system/Upgrade.vue:33 +#: src/views/system/Upgrade.vue:36 src/views/system/Upgrade.vue:39 +#, fuzzy +msgid "Reinstall" +msgstr "安裝" + +#: src/views/system/Upgrade.vue:31 src/views/system/Upgrade.vue:32 +#: src/views/system/Upgrade.vue:36 src/views/system/Upgrade.vue:40 +#: src/views/system/Upgrade.vue:43 src/views/system/Upgrade.vue:48 +msgid "Release Note" +msgstr "" + #: src/language/constants.ts:19 msgid "Reloading nginx" msgstr "重载 Nginx" @@ -756,7 +808,7 @@ msgstr "伺服器資訊" msgid "server_name not found in directives" msgstr "未在指令集合中找到 server_name" -#: src/views/domain/cert/IssueCert.vue:195 src/views/domain/DomainAdd.vue:111 +#: src/views/domain/cert/IssueCert.vue:194 src/views/domain/DomainAdd.vue:111 msgid "server_name parameter is required" msgstr "必須為 server_name 指令指明參數" @@ -809,6 +861,11 @@ msgstr "主體名稱: %{name}" msgid "Swap" msgstr "交換空間" +#: src/routes/index.ts:134 +#, fuzzy +msgid "System" +msgstr "系統訊息" + #: src/components/StdDataDisplay/StdCurd.vue:3 msgid "Table" msgstr "表格" @@ -821,7 +878,7 @@ msgstr "終端" msgid "Terminal Start Command" msgstr "" -#: src/views/domain/cert/IssueCert.vue:207 +#: src/views/domain/cert/IssueCert.vue:206 msgid "" "The certificate for the domain will be checked every hour, and will be " "renewed if it has been more than 1 month since it was last issued." @@ -833,7 +890,7 @@ msgstr "" msgid "The filename cannot contain the following characters: %{c}" msgstr "檔名不能包含以下字元: %{c}" -#: src/views/domain/cert/IssueCert.vue:203 +#: src/views/domain/cert/IssueCert.vue:202 #, fuzzy msgid "" "The server_name in the current configuration must be the domain name you " @@ -861,6 +918,18 @@ msgstr "修改時間" msgid "Updated successfully" msgstr "已成功更新" +#: src/routes/index.ts:145 src/views/system/Upgrade.vue:16 +#: src/views/system/Upgrade.vue:26 src/views/system/Upgrade.vue:27 +#: src/views/system/Upgrade.vue:31 src/views/system/Upgrade.vue:35 +#: src/views/system/Upgrade.vue:38 src/views/system/Upgrade.vue:41 +#: src/views/system/Upgrade.vue:42 +msgid "Upgrade" +msgstr "" + +#: src/views/system/Upgrade.vue:63 +msgid "Upgrading Nginx UI, please wait..." +msgstr "" + #: src/views/dashboard/DashBoard.vue:137 msgid "Uptime:" msgstr "執行時間:" @@ -883,7 +952,7 @@ msgstr "使用 HTTP01 挑戰提供者" msgid "View" msgstr "" -#: src/views/domain/cert/IssueCert.vue:27 src/views/domain/DomainAdd.vue:22 +#: src/views/domain/cert/IssueCert.vue:26 src/views/domain/DomainAdd.vue:22 msgid "Warning" msgstr "警告" @@ -905,7 +974,16 @@ msgstr "將證書寫入磁盤" msgid "Yes" msgstr "是的" -#: src/views/other/About.vue:27 +#: src/views/system/Upgrade.vue:30 +msgid "You are using the latest version" +msgstr "" + +#: src/views/system/Upgrade.vue:10 src/views/system/Upgrade.vue:14 +#: src/views/system/Upgrade.vue:18 src/views/system/Upgrade.vue:9 +msgid "You can check Nginx UI upgrade at this page." +msgstr "" + +#: src/views/system/About.vue:27 msgctxt "Project" msgid "License" msgstr "開源軟體授權條款" @@ -941,9 +1019,6 @@ msgstr "開源軟體授權條款" #~ msgid "Restore" #~ msgstr "恢復" -#~ msgid "System message" -#~ msgstr "系統訊息" - #~ msgid "Yes, I'm sure" #~ msgstr "是的" diff --git a/frontend/src/routes/index.ts b/frontend/src/routes/index.ts index d7ced1dc..8908eae7 100644 --- a/frontend/src/routes/index.ts +++ b/frontend/src/routes/index.ts @@ -130,12 +130,21 @@ export const routes = [ } }, { - path: 'about', - name: () => $gettext('About'), - component: () => import('@/views/other/About.vue'), + path: 'system', + name: () => $gettext('System'), + redirect: 'system/about', meta: { icon: InfoCircleOutlined - } + }, + children: [{ + path: 'about', + name: () => $gettext('About'), + component: () => import('@/views/system/About.vue') + }, { + path: 'upgrade', + name: () => $gettext('Upgrade'), + component: () => import('@/views/system/Upgrade.vue') + }] } ] }, diff --git a/frontend/src/version.json b/frontend/src/version.json index 11bdae54..33451b0e 100644 --- a/frontend/src/version.json +++ b/frontend/src/version.json @@ -1 +1 @@ -{"version":"1.7.1","build_id":65,"total_build":135} \ No newline at end of file +{"version":"1.7.2","build_id":67,"total_build":137} \ No newline at end of file diff --git a/frontend/src/views/domain/cert/IssueCert.vue b/frontend/src/views/domain/cert/IssueCert.vue index 285ba15b..00396548 100644 --- a/frontend/src/views/domain/cert/IssueCert.vue +++ b/frontend/src/views/domain/cert/IssueCert.vue @@ -173,8 +173,7 @@ const modalClosable = ref(false) :status="progressStatus" /> -
-
+
diff --git a/frontend/src/views/other/About.vue b/frontend/src/views/system/About.vue similarity index 100% rename from frontend/src/views/other/About.vue rename to frontend/src/views/system/About.vue diff --git a/frontend/src/views/system/Upgrade.vue b/frontend/src/views/system/Upgrade.vue new file mode 100644 index 00000000..b8245bfa --- /dev/null +++ b/frontend/src/views/system/Upgrade.vue @@ -0,0 +1,179 @@ + + + + + + + diff --git a/frontend/version.json b/frontend/version.json index 11bdae54..33451b0e 100644 --- a/frontend/version.json +++ b/frontend/version.json @@ -1 +1 @@ -{"version":"1.7.1","build_id":65,"total_build":135} \ No newline at end of file +{"version":"1.7.2","build_id":67,"total_build":137} \ No newline at end of file diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 186c5a99..089d2b8c 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -439,11 +439,6 @@ resolved "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.16.13.tgz#41ee9bd3b7161ab681fab6cb3990a3f5c08a9940" integrity sha512-2489Xad9sr+6GD7nB913fUqpCsSwVwgskkQTq4Or2mZntSPYPebyJm8l1YruHo7oqYMTGV6RiwGE4gRo3H+EPQ== -"@esbuild/linux-loong64@0.14.53": - version "0.14.53" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.53.tgz#251b4cd6760fadb4d68a05815e6dc5e432d69cd6" - integrity sha512-W2dAL6Bnyn4xa/QRSU3ilIK4EzD5wgYXKXJiS1HDF5vU3675qc2bvFyLwbUcdmssDveyndy7FbitrCoiV/eMLg== - "@esbuild/linux-loong64@0.16.13": version "0.16.13" resolved "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.16.13.tgz#e4a832708e0b47078b91413edcfdb6af88c854a3" @@ -621,16 +616,26 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.188.tgz#e4990c4c81f7c9b00c5ff8eae389c10f27980da5" integrity sha512-zmEmF5OIM3rb7SbLCFYoQhO4dGt2FRM9AMkxvA3LaADOF1n8in/zGJlWji9fmafLoNyz+FoL6FE0SLtGIArD7w== +"@types/marked@^4.0.8": + version "4.0.8" + resolved "https://registry.npmmirror.com/@types/marked/-/marked-4.0.8.tgz#b316887ab3499d0a8f4c70b7bd8508f92d477955" + integrity sha512-HVNzMT5QlWCOdeuBsgXP8EZzKUf0+AXzN+sLmjvaB3ZlLqO+e4u0uXrdw9ub69wBKFs+c6/pA4r9sy6cCDvImw== + "@types/minimatch@*": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== -"@types/node@*", "@types/node@^18.6.3": +"@types/node@*": version "18.6.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.3.tgz#4e4a95b6fe44014563ceb514b2598b3e623d1c98" integrity sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg== +"@types/node@^18.11.18": + version "18.11.18" + resolved "https://registry.npmmirror.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" + integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -660,35 +665,35 @@ resolved "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-4.0.0.tgz#93815beffd23db46288c787352a8ea31a0c03e5e" integrity sha512-e0X4jErIxAB5oLtDqbHvHpJe/uWNkdpYV83AOG2xo2tEVSzCzewgJMtREZM30wXnM5ls90hxiOtAuVU6H5JgbA== -"@volar/language-core@1.0.22": - version "1.0.22" - resolved "https://registry.npmmirror.com/@volar/language-core/-/language-core-1.0.22.tgz#e6bb399d95724ff918234f73fbda5f0a6cf357e5" - integrity sha512-hiJeCOqxNdtG/04FRGLGI9H9DVz2l6cTqPDBzwqplHXAWfMxjzUaGUrn9sfTG7YMFNZUgK4EYxJnRfhqdtbSFQ== +"@volar/language-core@1.0.24": + version "1.0.24" + resolved "https://registry.yarnpkg.com/@volar/language-core/-/language-core-1.0.24.tgz#5d767571e77728464635e61af1debca944811fe0" + integrity sha512-vTN+alJiWwK0Pax6POqrmevbtFW2dXhjwWiW/MW4f48eDYPLdyURWcr8TixO7EN/nHsUBj2udT7igFKPtjyAKg== dependencies: - "@volar/source-map" "1.0.22" + "@volar/source-map" "1.0.24" muggle-string "^0.1.0" -"@volar/source-map@1.0.22": - version "1.0.22" - resolved "https://registry.npmmirror.com/@volar/source-map/-/source-map-1.0.22.tgz#b877325a8b63c4abcad409774e0182607715ed3e" - integrity sha512-cv4gypHSP4MWVR82ed/+1IpI6794qAl0Q0+KJ+VGMVF8rVugsiF9QbyMCgjel9wNRsssQsazzsf6txOR9vHQiw== +"@volar/source-map@1.0.24": + version "1.0.24" + resolved "https://registry.yarnpkg.com/@volar/source-map/-/source-map-1.0.24.tgz#ad4c827fea5c26b4bf38a86d983e7deb65b1c61e" + integrity sha512-Qsv/tkplx18pgBr8lKAbM1vcDqgkGKQzbChg6NW+v0CZc3G7FLmK+WrqEPzKlN7Cwdc6XVL559Nod8WKAfKr4A== dependencies: muggle-string "^0.1.0" -"@volar/typescript@1.0.22": - version "1.0.22" - resolved "https://registry.npmmirror.com/@volar/typescript/-/typescript-1.0.22.tgz#2738b7dd803f836a7d67bbd26b043b64a7bf50de" - integrity sha512-VPyEicealSD4gqlE5/UQ1j3ietsO6Hfat40KtUEh/K+XEZ7h02b1KgFV64YEuBkBOaZ5hgvRW/WXKtQgXCl7Iw== +"@volar/typescript@1.0.24": + version "1.0.24" + resolved "https://registry.yarnpkg.com/@volar/typescript/-/typescript-1.0.24.tgz#f934eda9774b31abdff53efc56782cd2623723d5" + integrity sha512-f8hCSk+PfKR1/RQHxZ79V1NpDImHoivqoizK+mstphm25tn/YJ/JnKNjZHB+o21fuW0yKlI26NV3jkVb2Cc/7A== dependencies: - "@volar/language-core" "1.0.22" + "@volar/language-core" "1.0.24" -"@volar/vue-language-core@1.0.22": - version "1.0.22" - resolved "https://registry.npmmirror.com/@volar/vue-language-core/-/vue-language-core-1.0.22.tgz#676e56c41e36fd766a3b6a34753d296cbd6292b5" - integrity sha512-Ki0G/ZdBj2/GLw+/VVH3n9XR/JL6krMIth02EekFn6JV4PGN3mNxbvoh6lOPSDZLR6biOU5nJPnnjpKy8nuXhw== +"@volar/vue-language-core@1.0.24": + version "1.0.24" + resolved "https://registry.yarnpkg.com/@volar/vue-language-core/-/vue-language-core-1.0.24.tgz#81d180a8e09a53cb575e83acb79a31493891a1a4" + integrity sha512-2NTJzSgrwKu6uYwPqLiTMuAzi7fAY3yFy5PJ255bGJc82If0Xr+cW8pC80vpjG0D/aVLmlwAdO4+Ya2BI8GdDg== dependencies: - "@volar/language-core" "1.0.22" - "@volar/source-map" "1.0.22" + "@volar/language-core" "1.0.24" + "@volar/source-map" "1.0.24" "@vue/compiler-dom" "^3.2.45" "@vue/compiler-sfc" "^3.2.45" "@vue/reactivity" "^3.2.45" @@ -696,13 +701,13 @@ minimatch "^5.1.1" vue-template-compiler "^2.7.14" -"@volar/vue-typescript@1.0.22": - version "1.0.22" - resolved "https://registry.npmmirror.com/@volar/vue-typescript/-/vue-typescript-1.0.22.tgz#49db0b2c369491e278b8fc7ef711da121cd5968e" - integrity sha512-2T1o5z86PAev31OMtVOv/qp4P3ZVl9ln/2KTmykQE8Fh4A5F+868MW4nf5J7XQ6RNyx7RH9LhzgjvbqJpAfiYw== +"@volar/vue-typescript@1.0.24": + version "1.0.24" + resolved "https://registry.yarnpkg.com/@volar/vue-typescript/-/vue-typescript-1.0.24.tgz#bef9b2bfb1b108c0f6cb12ec6fbf449b43fc8257" + integrity sha512-9a25oHDvGaNC0okRS47uqJI6FxY4hUQZUsxeOUFHcqVxZEv8s17LPuP/pMMXyz7jPygrZubB/qXqHY5jEu/akA== dependencies: - "@volar/typescript" "1.0.22" - "@volar/vue-language-core" "1.0.22" + "@volar/typescript" "1.0.24" + "@volar/vue-language-core" "1.0.24" "@vue/babel-helper-vue-transform-on@^1.0.2": version "1.0.2" @@ -1564,133 +1569,6 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -esbuild-android-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.53.tgz#259bc3ef1399a3cad8f4f67c40ee20779c4de675" - integrity sha512-fIL93sOTnEU+NrTAVMIKiAw0YH22HWCAgg4N4Z6zov2t0kY9RAJ50zY9ZMCQ+RT6bnOfDt8gCTnt/RaSNA2yRA== - -esbuild-android-arm64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.53.tgz#2158253d4e8f9fdd2a081bbb4f73b8806178841e" - integrity sha512-PC7KaF1v0h/nWpvlU1UMN7dzB54cBH8qSsm7S9mkwFA1BXpaEOufCg8hdoEI1jep0KeO/rjZVWrsH8+q28T77A== - -esbuild-darwin-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.53.tgz#b4681831fd8f8d06feb5048acbe90d742074cc2a" - integrity sha512-gE7P5wlnkX4d4PKvLBUgmhZXvL7lzGRLri17/+CmmCzfncIgq8lOBvxGMiQ4xazplhxq+72TEohyFMZLFxuWvg== - -esbuild-darwin-arm64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.53.tgz#d267d957852d121b261b3f76ead86e5b5463acc9" - integrity sha512-otJwDU3hnI15Q98PX4MJbknSZ/WSR1I45il7gcxcECXzfN4Mrpft5hBDHXNRnCh+5858uPXBXA1Vaz2jVWLaIA== - -esbuild-freebsd-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.53.tgz#aca2af6d72b537fe66a38eb8f374fb66d4c98ca0" - integrity sha512-WkdJa8iyrGHyKiPF4lk0MiOF87Q2SkE+i+8D4Cazq3/iqmGPJ6u49je300MFi5I2eUsQCkaOWhpCVQMTKGww2w== - -esbuild-freebsd-arm64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.53.tgz#76282e19312d914c34343c8a7da6cc5f051580b9" - integrity sha512-9T7WwCuV30NAx0SyQpw8edbKvbKELnnm1FHg7gbSYaatH+c8WJW10g/OdM7JYnv7qkimw2ZTtSA+NokOLd2ydQ== - -esbuild-linux-32@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.53.tgz#1045d34cf7c5faaf2af3b29cc1573b06580c37e5" - integrity sha512-VGanLBg5en2LfGDgLEUxQko2lqsOS7MTEWUi8x91YmsHNyzJVT/WApbFFx3MQGhkf+XdimVhpyo5/G0PBY91zg== - -esbuild-linux-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.53.tgz#ab3f2ee2ebb5a6930c72d9539cb34b428808cbe4" - integrity sha512-pP/FA55j/fzAV7N9DF31meAyjOH6Bjuo3aSKPh26+RW85ZEtbJv9nhoxmGTd9FOqjx59Tc1ZbrJabuiXlMwuZQ== - -esbuild-linux-arm64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.53.tgz#1f5530412f6690949e78297122350488d3266cfe" - integrity sha512-GDmWITT+PMsjCA6/lByYk7NyFssW4Q6in32iPkpjZ/ytSyH+xeEx8q7HG3AhWH6heemEYEWpTll/eui3jwlSnw== - -esbuild-linux-arm@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.53.tgz#a44ec9b5b42007ab6c0d65a224ccc6bbd97c54cf" - integrity sha512-/u81NGAVZMopbmzd21Nu/wvnKQK3pT4CrvQ8BTje1STXcQAGnfyKgQlj3m0j2BzYbvQxSy+TMck4TNV2onvoPA== - -esbuild-linux-mips64le@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.53.tgz#a4d0b6b17cfdeea4e41b0b085a5f73d99311be9f" - integrity sha512-d6/XHIQW714gSSp6tOOX2UscedVobELvQlPMkInhx1NPz4ThZI9uNLQ4qQJHGBGKGfu+rtJsxM4NVHLhnNRdWQ== - -esbuild-linux-ppc64le@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.53.tgz#8c331822c85465434e086e3e6065863770c38139" - integrity sha512-ndnJmniKPCB52m+r6BtHHLAOXw+xBCWIxNnedbIpuREOcbSU/AlyM/2dA3BmUQhsHdb4w3amD5U2s91TJ3MzzA== - -esbuild-linux-riscv64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.53.tgz#36fd75543401304bea8a2d63bf8ea18aaa508e00" - integrity sha512-yG2sVH+QSix6ct4lIzJj329iJF3MhloLE6/vKMQAAd26UVPVkhMFqFopY+9kCgYsdeWvXdPgmyOuKa48Y7+/EQ== - -esbuild-linux-s390x@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.53.tgz#1622677ab6824123f48f75d3afc031cd41936129" - integrity sha512-OCJlgdkB+XPYndHmw6uZT7jcYgzmx9K+28PVdOa/eLjdoYkeAFvH5hTwX4AXGLZLH09tpl4bVsEtvuyUldaNCg== - -esbuild-netbsd-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.53.tgz#e86d0efd0116658be335492ed12e66b26b4baf52" - integrity sha512-gp2SB+Efc7MhMdWV2+pmIs/Ja/Mi5rjw+wlDmmbIn68VGXBleNgiEZG+eV2SRS0kJEUyHNedDtwRIMzaohWedQ== - -esbuild-openbsd-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.53.tgz#9bcbbe6f86304872c6e91f64c8eb73fc29c3588b" - integrity sha512-eKQ30ZWe+WTZmteDYg8S+YjHV5s4iTxeSGhJKJajFfQx9TLZJvsJX0/paqwP51GicOUruFpSUAs2NCc0a4ivQQ== - -esbuild-sunos-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.53.tgz#f7a872f7460bfb7b131f7188a95fbce3d1c577e8" - integrity sha512-OWLpS7a2FrIRukQqcgQqR1XKn0jSJoOdT+RlhAxUoEQM/IpytS3FXzCJM6xjUYtpO5GMY0EdZJp+ur2pYdm39g== - -esbuild-windows-32@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.53.tgz#c5e3ca50e2d1439cc2c9fe4defa63bcd474ce709" - integrity sha512-m14XyWQP5rwGW0tbEfp95U6A0wY0DYPInWBB7D69FAXUpBpBObRoGTKRv36lf2RWOdE4YO3TNvj37zhXjVL5xg== - -esbuild-windows-64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.53.tgz#ec2ab4a60c5215f092ffe1eab6d01319e88238af" - integrity sha512-s9skQFF0I7zqnQ2K8S1xdLSfZFsPLuOGmSx57h2btSEswv0N0YodYvqLcJMrNMXh6EynOmWD7rz+0rWWbFpIHQ== - -esbuild-windows-arm64@0.14.53: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.53.tgz#f71d403806bdf9f4a1f9d097db9aec949bd675c8" - integrity sha512-E+5Gvb+ZWts+00T9II6wp2L3KG2r3iGxByqd/a1RmLmYWVsSVUjkvIxZuJ3hYTIbhLkH5PRwpldGTKYqVz0nzQ== - -esbuild@^0.14.47: - version "0.14.53" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.53.tgz#20b1007f686e8584f2a01a1bec5a37aac9498ce4" - integrity sha512-ohO33pUBQ64q6mmheX1mZ8mIXj8ivQY/L4oVuAshr+aJI+zLl+amrp3EodrUNDNYVrKJXGPfIHFGhO8slGRjuw== - optionalDependencies: - "@esbuild/linux-loong64" "0.14.53" - esbuild-android-64 "0.14.53" - esbuild-android-arm64 "0.14.53" - esbuild-darwin-64 "0.14.53" - esbuild-darwin-arm64 "0.14.53" - esbuild-freebsd-64 "0.14.53" - esbuild-freebsd-arm64 "0.14.53" - esbuild-linux-32 "0.14.53" - esbuild-linux-64 "0.14.53" - esbuild-linux-arm "0.14.53" - esbuild-linux-arm64 "0.14.53" - esbuild-linux-mips64le "0.14.53" - esbuild-linux-ppc64le "0.14.53" - esbuild-linux-riscv64 "0.14.53" - esbuild-linux-s390x "0.14.53" - esbuild-netbsd-64 "0.14.53" - esbuild-openbsd-64 "0.14.53" - esbuild-sunos-64 "0.14.53" - esbuild-windows-32 "0.14.53" - esbuild-windows-64 "0.14.53" - esbuild-windows-arm64 "0.14.53" - esbuild@^0.16.3: version "0.16.13" resolved "https://registry.npmmirror.com/esbuild/-/esbuild-0.16.13.tgz#83cd347c28221268bbfa0425db532d7d05f85b48" @@ -2132,6 +2010,11 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" +marked@^4.2.5: + version "4.2.5" + resolved "https://registry.npmmirror.com/marked/-/marked-4.2.5.tgz#979813dfc1252cc123a79b71b095759a32f42a5d" + integrity sha512-jPueVhumq7idETHkb203WDD4fMA3yV9emQ5vLwop58lu8bTclMghBWcYAavlDqIEMaisADinV1TooIFCfqOsYQ== + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -2585,7 +2468,7 @@ postcss-value-parser@^4.2.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@^8.1.10, postcss@^8.2.9, postcss@^8.4.14: +postcss@^8.1.10, postcss@^8.2.9: version "8.4.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== @@ -2676,13 +2559,6 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup@^2.75.6: - version "2.77.2" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.77.2.tgz#6b6075c55f9cc2040a5912e6e062151e42e2c4e3" - integrity sha512-m/4YzYgLcpMQbxX3NmAqDvwLATZzxt8bIegO78FZLl+lAgKJBd1DRAOeEiZcKOIOPjxE6ewHWHNgGEalFXuz1g== - optionalDependencies: - fsevents "~2.3.2" - rollup@^3.7.0: version "3.9.1" resolved "https://registry.npmmirror.com/rollup/-/rollup-3.9.1.tgz#27501d3d026418765fe379d5620d25954ff2a011" @@ -2906,7 +2782,7 @@ tslib@^2.0.3, tslib@^2.3.0, tslib@^2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== -"typescript@2 - 4", typescript@^4.7.4: +"typescript@2 - 4": version "4.7.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== @@ -2978,15 +2854,15 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -vite-plugin-build-id@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/vite-plugin-build-id/-/vite-plugin-build-id-0.2.2.tgz#733df3d7fe50469a9470824d049ba307c5ef3601" - integrity sha512-fviPYIrMFXKkHBJLzKAA6w0OvWgkezhOCsNIZ3WkRq942/++a2ZNKe1GWTxtspQ7HHQvwE4Qqjytt04jAIHOOw== +vite-plugin-build-id@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/vite-plugin-build-id/-/vite-plugin-build-id-0.2.3.tgz#559de58cacb4d50818c549fc9b3f22016c813de2" + integrity sha512-PJf7cOpmAcW4KXh7NlqLAp9/7KxeaoQSXEBFmSkN460w70VGVCJfCcSy7IWpyyiKMbbm2VkTTUBwxrBnDv/YgQ== dependencies: - "@types/node" "^18.6.3" + "@types/node" "^18.11.18" rimraf "^3.0.2" - typescript "^4.7.4" - vite "^3.0.4" + typescript "^4.9.4" + vite "^4.0.4" vite-plugin-html@^3.2.0: version "3.2.0" @@ -3006,18 +2882,6 @@ vite-plugin-html@^3.2.0: node-html-parser "^5.3.3" pathe "^0.2.0" -vite@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/vite/-/vite-3.0.4.tgz#c61688d6b97573e96cf5ac25f2d68597b5ce68e8" - integrity sha512-NU304nqnBeOx2MkQnskBQxVsa0pRAH5FphokTGmyy8M3oxbvw7qAXts2GORxs+h/2vKsD+osMhZ7An6yK6F1dA== - dependencies: - esbuild "^0.14.47" - postcss "^8.4.14" - resolve "^1.22.1" - rollup "^2.75.6" - optionalDependencies: - fsevents "~2.3.2" - vite@^4.0.4: version "4.0.4" resolved "https://registry.npmmirror.com/vite/-/vite-4.0.4.tgz#4612ce0b47bbb233a887a54a4ae0c6e240a0da31" @@ -3050,13 +2914,13 @@ vue-template-compiler@^2.7.14: de-indent "^1.0.2" he "^1.2.0" -vue-tsc@^1.0.22: - version "1.0.22" - resolved "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-1.0.22.tgz#555d0fa9bb5f7b4009e45059d0db5a8c2bef18bb" - integrity sha512-xSxwgWR3czhv7sLKHWu6lzj9Xq6AtsCURVL45AY4TLGFszv2L2YlMgygXvqslyCM5bz9cyoIKSaZnzHqHTHjzA== +vue-tsc@^1.0.24: + version "1.0.24" + resolved "https://registry.yarnpkg.com/vue-tsc/-/vue-tsc-1.0.24.tgz#c0b270a7c8422408d3b6694fee61b39a4b9e4740" + integrity sha512-mmU1s5SAqE1nByQAiQnao9oU4vX+mSdsgI8H57SfKH6UVzq/jP9+Dbi2GaV+0b4Cn361d2ln8m6xeU60ApiEXg== dependencies: - "@volar/vue-language-core" "1.0.22" - "@volar/vue-typescript" "1.0.22" + "@volar/vue-language-core" "1.0.24" + "@volar/vue-typescript" "1.0.24" vue-types@^3.0.0: version "3.0.2" diff --git a/go.mod b/go.mod index 722eefd3..1b348243 100644 --- a/go.mod +++ b/go.mod @@ -30,11 +30,14 @@ require ( require ( github.com/StackExchange/wmi v1.2.1 // indirect github.com/cenkalti/backoff/v4 v4.1.0 // indirect + github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-ole/go-ole v1.2.5 // indirect github.com/golang/protobuf v1.3.4 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.2 // indirect + github.com/jpillora/overseer v1.1.6 // indirect + github.com/jpillora/s3 v1.1.4 // indirect github.com/json-iterator/go v1.1.9 // indirect github.com/leodido/go-urn v1.2.0 // indirect github.com/mattn/go-isatty v0.0.12 // indirect diff --git a/go.sum b/go.sum index d8d0a3d9..7cd00fb1 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,7 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/akamai/AkamaiOPEN-edgegrid-golang v1.1.0/go.mod h1:kX6YddBkXqqywAe8c9LyvgTCyFuZCTMF4cRPQhc3Fy8= @@ -107,6 +108,8 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 h1:6VSn3hB5U5GeA6kQw4TwWIWbOhtvR2hmbBJnTOtqTWc= +github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6/go.mod h1:YxOVT5+yHzKvwhsiSIWmbAYM3Dr9AEEbER2dVayfBkg= github.com/getkin/kin-openapi v0.13.0/go.mod h1:WGRs2ZMM1Q8LR1QBEwUxC6RJEfaBcD0s+pcEVXFuAjw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -129,6 +132,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= @@ -246,6 +250,10 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/overseer v1.1.6 h1:3ygYfNcR3FfOr22miu3vR1iQcXKMHbmULBh98rbkIyo= +github.com/jpillora/overseer v1.1.6/go.mod h1:aPXQtxuVb9PVWRWTXpo+LdnC/YXQ0IBLNXqKMJmgk88= +github.com/jpillora/s3 v1.1.4 h1:YCCKDWzb/Ye9EBNd83ATRF/8wPEy0xd43Rezb6u6fzc= +github.com/jpillora/s3 v1.1.4/go.mod h1:yedE603V+crlFi1Kl/5vZJaBu9pUzE9wvKegU/lF2zs= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -401,6 +409,7 @@ github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:s github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/gunit v1.0.4/go.mod h1:EH5qMBab2UclzXUcpR8b93eHsIlp9u+pDQIRp5DZNzQ= +github.com/smartystreets/gunit v1.1.3/go.mod h1:EH5qMBab2UclzXUcpR8b93eHsIlp9u+pDQIRp5DZNzQ= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= diff --git a/main.go b/main.go index 8957755d..c87fd2fa 100644 --- a/main.go +++ b/main.go @@ -1,84 +1,72 @@ package main import ( - "context" - "flag" - "github.com/0xJacky/Nginx-UI/server/analytic" - "github.com/0xJacky/Nginx-UI/server/model" - "github.com/0xJacky/Nginx-UI/server/pkg/cert" - "github.com/0xJacky/Nginx-UI/server/pkg/nginx" - "github.com/0xJacky/Nginx-UI/server/router" - "github.com/0xJacky/Nginx-UI/server/settings" - "github.com/gin-gonic/gin" - "github.com/go-co-op/gocron" - "log" - "mime" - "net/http" - "os/signal" - "syscall" - "time" + "flag" + "fmt" + "github.com/0xJacky/Nginx-UI/server/analytic" + "github.com/0xJacky/Nginx-UI/server/model" + "github.com/0xJacky/Nginx-UI/server/pkg/cert" + "github.com/0xJacky/Nginx-UI/server/pkg/nginx" + "github.com/0xJacky/Nginx-UI/server/router" + "github.com/0xJacky/Nginx-UI/server/service" + "github.com/0xJacky/Nginx-UI/server/settings" + "github.com/gin-gonic/gin" + "github.com/go-co-op/gocron" + "github.com/jpillora/overseer" + "github.com/jpillora/overseer/fetcher" + "log" + "mime" + "net/http" + "time" ) func main() { - // Create context that listens for the interrupt signal from the OS. - ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) - defer stop() + r, err := service.GetRuntimeInfo() - // Hack: fix wrong Content Type of .js file on some OS platforms - // See https://github.com/golang/go/issues/32350 - _ = mime.AddExtensionType(".js", "text/javascript; charset=utf-8") + if err != nil { + log.Fatalln(err) + } - var confPath string - flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file") - flag.Parse() - - gin.SetMode(settings.ServerSettings.RunMode) - - settings.Init(confPath) - log.Printf("nginx config dir path: %s", nginx.GetNginxConfPath("")) - if "" != settings.ServerSettings.JwtSecret { - model.Init() - - s := gocron.NewScheduler(time.UTC) - job, err := s.Every(1).Hour().SingletonMode().Do(cert.AutoCert) - - if err != nil { - log.Fatalf("AutoCert Job: %v, Err: %v\n", job, err) - } - - s.StartAsync() - - go analytic.RecordServerAnalytic() - } - - srv := &http.Server{ - Addr: ":" + settings.ServerSettings.HttpPort, - Handler: router.InitRouter(), - } - - // Initializing the server in a goroutine so that - // it won't block the graceful shutdown handling below - go func() { - if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed { - log.Fatalf("listen: %s\n", err) - } - }() - - // Listen for the interrupt signal. - <-ctx.Done() - - // Restore default behavior on the interrupt signal and notify user of shutdown. - stop() - log.Println("shutting down gracefully, press Ctrl+C again to force") - - // The context is used to inform the server it has 5 seconds to finish - // the request it is currently handling - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - if err := srv.Shutdown(ctx); err != nil { - log.Fatal("Server forced to shutdown: ", err) - } - - log.Println("Server exiting") + overseer.Run(overseer.Config{ + Program: prog, + Address: fmt.Sprintf(":%s", settings.ServerSettings.HttpPort), + Fetcher: &fetcher.File{Path: r.ExPath}, + Debug: gin.IsDebugging(), + TerminateTimeout: 0, + }) } + +func prog(state overseer.State) { + // Hack: fix wrong Content Type of .js file on some OS platforms + // See https://github.com/golang/go/issues/32350 + _ = mime.AddExtensionType(".js", "text/javascript; charset=utf-8") + + var confPath string + flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file") + flag.Parse() + + gin.SetMode(settings.ServerSettings.RunMode) + + settings.Init(confPath) + log.Printf("Nginx config dir path: %s", nginx.GetNginxConfPath("")) + if "" != settings.ServerSettings.JwtSecret { + model.Init() + + s := gocron.NewScheduler(time.UTC) + job, err := s.Every(1).Hour().SingletonMode().Do(cert.AutoCert) + + if err != nil { + log.Fatalf("AutoCert Job: %v, Err: %v\n", job, err) + } + + s.StartAsync() + + go analytic.RecordServerAnalytic() + } + err := http.Serve(state.Listener, router.InitRouter()) + if err != nil { + log.Fatalln(err) + } + log.Println("[Nginx UI] server exiting") +} diff --git a/server/api/upgrade.go b/server/api/upgrade.go new file mode 100644 index 00000000..4d7e7932 --- /dev/null +++ b/server/api/upgrade.go @@ -0,0 +1,90 @@ +package api + +import ( + "github.com/0xJacky/Nginx-UI/server/service" + "github.com/gin-gonic/gin" + "github.com/gorilla/websocket" + "log" + "net/http" + "os" + "path/filepath" +) + +func GetRelease(c *gin.Context) { + data, err := service.GetRelease() + if err != nil { + ErrHandler(c, err) + return + } + + c.JSON(http.StatusOK, data) +} + +func GetCurrentVersion(c *gin.Context) { + curVer, err := service.GetCurrentVersion() + if err != nil { + ErrHandler(c, err) + return + } + + c.JSON(http.StatusOK, curVer) +} + +func PerformCoreUpgrade(c *gin.Context) { + var upGrader = websocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { + return true + }, + } + // upgrade http to websocket + ws, err := upGrader.Upgrade(c.Writer, c.Request, nil) + if err != nil { + log.Println("[Error] PerformCoreUpgrade Upgrade", err) + return + } + defer ws.Close() + + _ = ws.WriteJSON(gin.H{ + "status": "info", + "message": "Initialing Core Upgrader", + }) + + u, err := service.NewUpgrader() + + if err != nil { + _ = ws.WriteJSON(gin.H{ + "status": "error", + "message": "Initialing core upgrader error", + }) + log.Println("[Error] PerformCoreUpgrade service.NewUpgrader()", err) + return + } + _ = ws.WriteJSON(gin.H{ + "status": "info", + "message": "Downloading latest release", + }) + tarName, err := u.DownloadLatestRelease() + if err != nil { + _ = ws.WriteJSON(gin.H{ + "status": "error", + "message": "Download latest release error", + }) + log.Println("[Error] PerformCoreUpgrade DownloadLatestRelease", err) + return + } + _ = ws.WriteJSON(gin.H{ + "status": "info", + "message": "Performing core upgrade", + }) + _ = os.Remove(u.Release.ExPath) + // bye, overseer will restart nginx-ui + err = u.PerformCoreUpgrade(filepath.Dir(u.Release.ExPath), tarName) + if err != nil { + _ = ws.WriteJSON(gin.H{ + "status": "error", + "message": "Perform core upgrade error", + }) + log.Println("[Error] PerformCoreUpgrade PerformCoreUpgrade", err) + return + } +} diff --git a/server/pkg/helper/tar.go b/server/pkg/helper/tar.go new file mode 100644 index 00000000..f1c15eed --- /dev/null +++ b/server/pkg/helper/tar.go @@ -0,0 +1,81 @@ +package helper + +import ( + "archive/tar" + "compress/gzip" + "github.com/pkg/errors" + "io" + "os" + "path/filepath" +) + +func UnTar(dst, src string) (err error) { + fr, err := os.Open(src) + if err != nil { + err = errors.Wrap(err, "unTar open src error") + return + } + defer fr.Close() + + gr, err := gzip.NewReader(fr) + if err != nil { + err = errors.Wrap(err, "unTar gzip.NewReader error") + return + } + defer gr.Close() + + tr := tar.NewReader(gr) + + for { + err = func() (err error) { + hdr, err := tr.Next() + + switch { + case err == io.EOF: + return + case err != nil: + return errors.Wrap(err, "unTar tr.Next() error") + case hdr == nil: + return + } + + dstFileDir := filepath.Join(dst, hdr.Name) + + switch hdr.Typeflag { + case tar.TypeDir: + if b := ExistDir(dstFileDir); !b { + if err = os.MkdirAll(dstFileDir, 0755); err != nil { + return errors.Wrap(err, "unTar os.MkdirAll error") + } + } + case tar.TypeReg: + file, err := os.OpenFile(dstFileDir, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, os.ModePerm) + if err != nil { + return errors.Wrap(err, "unTar os.OpenFile error") + } + defer file.Close() + _, err = file.Seek(0, os.SEEK_END) + if err != nil { + return errors.Wrap(err, "unTar file.Truncate(0) error") + } + _, err = io.Copy(file, tr) + if err != nil { + return errors.Wrap(err, "unTar io.Copy error") + } + } + return + }() + if err == io.EOF { + break + } + } + if err == io.EOF { + err = nil + } + return +} + +func ExistDir(dirname string) bool { + fi, err := os.Stat(dirname) + return (err == nil || os.IsExist(err)) && fi.IsDir() +} diff --git a/server/router/routers.go b/server/router/routers.go index 67c3f3c6..8fecada5 100644 --- a/server/router/routers.go +++ b/server/router/routers.go @@ -102,6 +102,11 @@ func InitRouter() *gin.Engine { // Settings g.GET("settings", api.GetSettings) g.POST("settings", api.SaveSettings) + + // Upgrade + g.GET("upgrade/release", api.GetRelease) + g.GET("upgrade/current", api.GetCurrentVersion) + g.GET("upgrade/perform", api.PerformCoreUpgrade) } } diff --git a/server/service/upgrade.go b/server/service/upgrade.go new file mode 100644 index 00000000..5a16111c --- /dev/null +++ b/server/service/upgrade.go @@ -0,0 +1,197 @@ +package service + +import ( + "encoding/json" + "fmt" + _github "github.com/0xJacky/Nginx-UI/.github" + "github.com/0xJacky/Nginx-UI/frontend" + "github.com/0xJacky/Nginx-UI/server/settings" + "github.com/pkg/errors" + "io" + "net/http" + "net/url" + "os" + "path/filepath" + "runtime" + "time" +) + +const GithubLatestReleaseAPI = "https://api.github.com/repos/0xJacky/nginx-ui/releases/latest" + +type RuntimeInfo struct { + OS string `json:"os"` + Arch string `json:"arch"` + ExPath string `json:"ex_path"` +} + +func GetRuntimeInfo() (r RuntimeInfo, err error) { + ex, err := os.Executable() + if err != nil { + err = errors.Wrap(err, "service.GetRuntimeInfo os.Executable() err") + return + } + realPath, err := filepath.EvalSymlinks(ex) + if err != nil { + err = errors.Wrap(err, "service.GetRuntimeInfo filepath.EvalSymlinks() err") + return + } + + r = RuntimeInfo{ + OS: runtime.GOOS, + Arch: runtime.GOARCH, + ExPath: realPath, + } + + return +} + +type TReleaseAsset struct { + Name string `json:"name"` + BrowserDownloadUrl string `json:"browser_download_url"` + Size uint `json:"size"` +} + +type TRelease struct { + TagName string `json:"tag_name"` + Name string `json:"name"` + PublishedAt time.Time `json:"published_at"` + Body string `json:"body"` + Assets []TReleaseAsset `json:"assets"` + RuntimeInfo +} + +func GetRelease() (data TRelease, err error) { + resp, err := http.Get(GithubLatestReleaseAPI) + if err != nil { + err = errors.Wrap(err, "service.GetReleaseList http.Get err") + return + } + body, err := io.ReadAll(resp.Body) + if err != nil { + err = errors.Wrap(err, "service.GetReleaseList io.ReadAll err") + return + } + err = json.Unmarshal(body, &data) + if err != nil { + err = errors.Wrap(err, "service.GetReleaseList json.Unmarshal err") + return + } + data.RuntimeInfo, err = GetRuntimeInfo() + return +} + +type CurVersion struct { + Version string `json:"version"` + BuildID int `json:"build_id"` + TotalBuild int `json:"total_build"` +} + +func GetCurrentVersion() (c CurVersion, err error) { + verJson, err := frontend.DistFS.ReadFile("dist/version.json") + if err != nil { + err = errors.Wrap(err, "service.GetCurrentVersion ReadFile err") + return + } + + err = json.Unmarshal(verJson, &c) + if err != nil { + err = errors.Wrap(err, "service.GetCurrentVersion json.Unmarshal err") + return + } + + return +} + +type Upgrader struct { + Release TRelease +} + +func NewUpgrader() (u *Upgrader, err error) { + data, err := GetRelease() + if err != nil { + return + } + u = &Upgrader{ + Release: data, + } + return +} + +func (u *Upgrader) DownloadLatestRelease() (tarName string, err error) { + bytes, err := _github.DistFS.ReadFile("build/build_info.json") + if err != nil { + err = errors.Wrap(err, "service.DownloadLatestRelease Read build_info.json error") + return + } + type buildArch struct { + Arch string `json:"arch"` + Name string `json:"name"` + } + var buildJson map[string]map[string]buildArch + + _ = json.Unmarshal(bytes, &buildJson) + + build, ok := buildJson[u.Release.OS] + if !ok { + err = errors.Wrap(err, "os not support upgrade") + return + } + arch, ok := build[u.Release.Arch] + if !ok { + err = errors.Wrap(err, "arch not support upgrade") + return + } + var downloadUrl string + for _, v := range u.Release.Assets { + if fmt.Sprintf("nginx-ui-%s.tar.gz", arch.Name) == v.Name { + downloadUrl = v.BrowserDownloadUrl + break + } + } + + if downloadUrl == "" { + err = errors.Wrap(err, "Nginx UI core downloadUrl is empty") + return + } + + dir := filepath.Dir(u.Release.ExPath) + file, err := os.CreateTemp(dir, "nginx-ui-temp-*.tar.gz") + if err != nil { + err = errors.Wrap(err, "service.DownloadLatestRelease CreateTemp error") + return + } + defer file.Close() + if settings.ServerSettings.GithubProxy != "" { + downloadUrl, err = url.JoinPath(settings.ServerSettings.GithubProxy, downloadUrl) + if err != nil { + err = errors.Wrap(err, "service.DownloadLatestRelease url.JoinPath error") + return + } + } + client := &http.Client{} + resp, err := client.Get(downloadUrl) + if err != nil { + err = errors.Wrap(err, "service.DownloadLatestRelease client.Get() error") + return + } + defer resp.Body.Close() + _, err = io.Copy(file, resp.Body) + if err != nil { + err = errors.Wrap(err, "service.DownloadLatestRelease io.Copy error") + return + } + tarName = file.Name() + return +} + +func (u *Upgrader) PerformCoreUpgrade(dir, tarPath string) (err error) { + //err = helper.UnTar(dir, tarPath) + //if err != nil { + // err = errors.Wrap(err, "PerformCoreUpgrade unTar error") + // return + //} + + _ = os.Remove(tarPath) + + return +} diff --git a/server/settings/settings.go b/server/settings/settings.go index 2b4c5359..059f3915 100644 --- a/server/settings/settings.go +++ b/server/settings/settings.go @@ -26,6 +26,7 @@ type Server struct { CADir string `json:"ca_dir"` Demo bool `json:"demo"` PageSize int `json:"page_size"` + GithubProxy string `json:"github_proxy"` } type NginxLog struct { @@ -42,6 +43,7 @@ var ServerSettings = &Server{ Demo: false, PageSize: 10, CADir: "", + GithubProxy: "", } var NginxLogSettings = &NginxLog{