Compare commits

...
12 Commits
Author SHA1 Message Date
nap0o 937696c26d improve: status-server主题日常优化 (#432)
* improve: status-server主题日常优化
1. 首页账单信息:价格设置成“-1”前台展示为”PAYG“,自动续期(autoRenewal)功能增加支持付费周期yr,mo;
2. 当未获取到国旗图标时,默认彩虹旗;
3. 当未获取到os(操作系统)信息时,默认linux
4. 一些其他优化

* 修改表达不准确的语言文件
2024-10-08 11:39:44 +08:00
github-actions[bot] 08aaea8244 update contributors[no ci] 2024-10-06 12:54:13 +00:00
UUBulbandnaiba b886f70e48 chore: l10n: improve translation (#431)
* l10n: improve translation

* refine

---------

Co-authored-by: naiba <[email protected]>
2024-10-06 20:53:55 +08:00
zhucaidanandnaiba 12c6b8a6f6 Update en-US.toml (#429)
* Update en-US.toml

Optimize translation

* refine

---------

Co-authored-by: naiba <[email protected]>
2024-10-06 11:41:19 +08:00
UUBulb ebcc8a6efb installer: fix docker-compose detection logic (#428) 2024-10-06 09:35:12 +08:00
UUBulb c4d8b63d32 installer: fix docker-compose detection (#427) 2024-10-05 23:43:16 +08:00
nap0o 318da135b9 improve: status-server主题agent账单信息展示 (#425)
1. 支持价格和期限单独设置
2. 账单信息附加到group分组控制
3. 一些其他优化
2024-10-04 23:35:44 +08:00
github-actions[bot] da74bf4749 update contributors[no ci] 2024-10-04 15:33:58 +00:00
lyjandnaiba 3250283ef9 fix: 允许更新默认分组 (#426)
* fix: 允许更新默认分组

* improve: check null

---------

Co-authored-by: naiba <[email protected]>
2024-10-04 23:33:40 +08:00
naiba 2b40040ec5 chore: ignore gosec errors 2024-10-02 10:10:06 +08:00
nap0o 60ada33ee9 feat: status-server主题增加agent账单信息展示 (#424)
1. 首页通过在后台配置PublicNote字段,实现agent账单信息展示
2. 优化顶部导航,增加当前位置标识
3. 优化network页移动端样式
4. 优化后台server页展示,隐藏掉一些不重要的信息
5. 一些其他小优化
使用说明:https://github.com/naiba/nezha/pull/424#issuecomment-2386837658
2024-10-02 10:05:53 +08:00
naiba 7940e010e0 Refactor file compression logic in release workflow 2024-09-30 20:49:51 +08:00
22 changed files with 762 additions and 186 deletions
+2 -1
View File
@@ -75,7 +75,8 @@ jobs:
for file in assets/*/*/*; do
if [ -f "$file" ]; then
chmod +x "$file"
zip -jr "$file.zip" "$file"
export fileWithoutExt=${file%.*}
zip -jr "$fileWithoutExt.zip" "$file"
fi
done
+1 -1
View File
@@ -42,4 +42,4 @@ jobs:
if: runner.os == 'Linux'
uses: securego/gosec@master
with:
args: --exclude=G104,G402 ./...
args: --exclude=G104,G402,G115,G203 ./...
+3 -2
View File
@@ -4,7 +4,7 @@
<br>
<small><i>LOGO designed by <a href="https://xio.ng" target="_blank">熊大</a> .</i></small>
<br><br>
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&style=for-the-badge&logo=github&label=Dashboard">&nbsp;<img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.19.0-brightgreen?style=for-the-badge&logo=linux">
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&style=for-the-badge&logo=github&label=Dashboard">&nbsp;<img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.19.2-brightgreen?style=for-the-badge&logo=linux">
<br>
<br>
<p>:trollface: <b>Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.</b></p>
@@ -59,6 +59,7 @@ You can change the dashboard language in the settings page (`/setting`) after th
<a href="https://github.com/1ridic" title="1ridic"><img src="https://avatars.githubusercontent.com/u/88495501?v=4" width="50;" alt="1ridic"/></a>
<a href="https://github.com/Mmx233" title="Mmx"><img src="https://avatars.githubusercontent.com/u/36563672?v=4" width="50;" alt="Mmx"/></a>
<a href="https://github.com/rootmelo92118" title="rootmelo92118"><img src="https://avatars.githubusercontent.com/u/32770959?v=4" width="50;" alt="rootmelo92118"/></a>
<a href="https://github.com/zhucaidan" title="zhucaidan"><img src="https://avatars.githubusercontent.com/u/47970938?v=4" width="50;" alt="zhucaidan"/></a>
<a href="https://github.com/iilemon" title="Sean"><img src="https://avatars.githubusercontent.com/u/33201711?v=4" width="50;" alt="Sean"/></a>
<a href="https://github.com/fscarmen" title="fscarmen"><img src="https://avatars.githubusercontent.com/u/62703343?v=4" width="50;" alt="fscarmen"/></a>
<a href="https://github.com/ch8o" title="no-name-now"><img src="https://avatars.githubusercontent.com/u/9103372?v=4" width="50;" alt="no-name-now"/></a>
@@ -75,9 +76,9 @@ You can change the dashboard language in the settings page (`/setting`) after th
<a href="https://github.com/hiDandelion" title="hiDandelion"><img src="https://avatars.githubusercontent.com/u/77157418?v=4" width="50;" alt="hiDandelion"/></a>
<a href="https://github.com/yuanweize" title="I"><img src="https://avatars.githubusercontent.com/u/30067203?v=4" width="50;" alt="I"/></a>
<a href="https://github.com/lvyaoting" title="lvyaoting"><img src="https://avatars.githubusercontent.com/u/166296299?v=4" width="50;" alt="lvyaoting"/></a>
<a href="https://github.com/lyj0309" title="lyj"><img src="https://avatars.githubusercontent.com/u/50474995?v=4" width="50;" alt="lyj"/></a>
<a href="https://github.com/unclezs" title="unclezs"><img src="https://avatars.githubusercontent.com/u/42318775?v=4" width="50;" alt="unclezs"/></a>
<a href="https://github.com/ysicing" title="缘生"><img src="https://avatars.githubusercontent.com/u/8605565?v=4" width="50;" alt="缘生"/></a>
<a href="https://github.com/zhucaidan" title="zhucaidan"><img src="https://avatars.githubusercontent.com/u/47970938?v=4" width="50;" alt="zhucaidan"/></a>
<a href="https://github.com/arkylin" title="凌"><img src="https://avatars.githubusercontent.com/u/35104502?v=4" width="50;" alt="凌"/></a>
<a href="https://github.com/colour93" title="玖叁"><img src="https://avatars.githubusercontent.com/u/64313711?v=4" width="50;" alt="玖叁"/></a>
<a href="https://github.com/IamTaoChen" title="Tao Chen"><img src="https://avatars.githubusercontent.com/u/42793494?v=4" width="50;" alt="Tao Chen"/></a>
+47 -32
View File
@@ -23,19 +23,19 @@ other = "Home"
other = "Back to Homepage"
[AdminPanel]
other = "Admin Panel"
other = "Dashboard"
[Logout]
other = "Logout"
other = "Log out"
[Login]
other = "Login"
other = "Log in"
[ConfirmLogout]
other = "Do you want to Logout?"
other = "Confirm Logging Out?"
[AfterLoggingOutYouHaveToLoginAgain]
other = "You need to Login again to continue"
other = "You will need to log in again to continue"
[Cancel]
other = "Cancel"
@@ -56,7 +56,7 @@ other = "Cron Expression"
other = "Backup"
[3amDaily]
other = "(Daily at 3 AM)"
other = "(At 3 AM)"
[Command]
other = "Command"
@@ -71,7 +71,7 @@ other = "Ignore All, Execute Only on Specific Servers"
other = "Cover All, Except Specific Servers"
[ExecuteByTriggerServer]
other = "Execute on Trigger Server"
other = "Execute on Alarmed Servers"
[SpecificServers]
other = "Specific Servers"
@@ -95,7 +95,7 @@ other = "Cron Task"
other = "Trigger Task"
[TheFormaOfTheScheduleIs]
other = "The Cron Expression is like:"
other = "The Cron Expression format is:"
[SecondsMinutesHoursDaysMonthsWeeksSeeDetails]
other = "Sec Min Hour Day Month Week, see details in "
@@ -104,7 +104,7 @@ other = "Sec Min Hour Day Month Week, see details in "
other = "CRON Expression Format"
[IntroductionOfCommands]
other = "Introduction of Commands: Writing commands is similar to shell/bat scripts. It's advised not to break lines, and multiple commands can be connected with <code>&&</code> or <code>&</code>. If a command cannot be found, it might be due to <code>PATH</code> environment variable configuration issues. On <code>Linux</code> servers, you can add <code>source ~/.bashrc</code> at the beginning of the command, or use the command's absolute path."
other = "Note on writing commands: It is similar to shell/bat scripts. but it's advised not to start a newline, and connect multiple commands with <code>&&</code> or <code>;</code>. If a command cannot be found, it is possibly due to <code>PATH</code> environment variable issues. On <code>Linux</code> servers, you can add <code>source ~/.bashrc</code> at the beginning of the command, or just use the absolute path."
[AddMonitor]
other = "Add Service Monitor"
@@ -119,7 +119,7 @@ other = "Target"
other = "Type"
[SslExpirationOrChange]
other = "(SSL Expiration or Change)"
other = "(Certificate Expiration and Changes)"
[Duration]
other = "Interval"
@@ -134,10 +134,10 @@ other = "Enable Failure Notification"
other = "Failure Notification"
[MaxLatency]
other = "Max Latency (ms)"
other = "Maximum Latency (ms)"
[MinLatency]
other = "Min Latency (ms)"
other = "Minimum Latency (ms)"
[EnableLatencyNotification]
other = "Enable Latency Notification"
@@ -147,7 +147,7 @@ other = "Latency Notification"
[IntroductionOfMonitor]
other = """
For type <b>HTTP-GET</b>, enter URL (with http/https, HTTPS protocol will also monitor SSL certificate);<br>
For type <b>HTTP-GET</b>, enter URL (with http/https scheme, HTTPS protocol will also monitor SSL certificate);<br>
For type <b>ICMP-Ping</b>, enter domain/IP without port: example.com;<br>
For type <b>TCP-Ping</b>, enter domain/IP + port number: example.com:22"""
@@ -182,16 +182,16 @@ other = "Notification Trigger Mode"
other = "Always Trigger"
[ModeOnetimeTrigger]
other = "Always Trigger"
other = "Trigger Once"
[EnableTriggerTask]
other = "Enable Trigger Task"
[FailTriggerTasks]
other = "Tasks triggered during an alarm"
other = "Tasks to trigger on an alarm"
[RecoverTriggerTasks]
other = "Tasks triggered during recovery"
other = "Tasks to trigger after recovery"
[Enable]
other = "Enable"
@@ -218,7 +218,7 @@ other = "Einstein Lightspeed 1"
other = "Display Index"
[TheLargerTheNumberTheHigherThePriority]
other = "Higher Number, Higher Priority"
other = "Greater Number, Higher Priority"
[Secret]
other = "Secret"
@@ -230,10 +230,10 @@ other = "Note"
other = "Public Note"
[LinuxOneKeyInstall]
other = "Linux One-Command Install"
other = "Linux Installation Command"
[NoDomainAlert]
other = "Set CDN bypassed Domain/IP in setting before using this function"
other = "Please set the IP (or a domain pointed to it) of the original server in settings"
[PushSuccessfully]
other = "Send Success Notification"
@@ -254,13 +254,13 @@ other = "Cover All"
other = "Ignore All"
[ByTrigger]
other = "Execute by Trigger"
other = "Alarmed Servers"
[DeleteScheduledTask]
other = "Delete Scheduled Task"
[ConfirmToDeleteThisScheduledTask]
other = "Are you sure you want to Delete?"
other = "Confirm deletion?"
[AccessDenied]
other = "Access Denied"
@@ -281,22 +281,22 @@ other = "Don't Have an Account?"
other = "HTTP(S)/SSL Certificate"
[TCPPort]
other = "TCP Port"
other = "TCPing"
[DeleteService]
other = "Remove Service Monitor"
[ConfirmToDeleteThisService]
other = "Confirm to Delete This Service?"
other = "Confirm Deleting This Service?"
[DeleteNotificationMethod]
other = "Delete Notification Method"
[ConfirmToDeleteThisNotificationMethod]
other = "Confirm to Delete This Notification Method?"
other = "Confirm Deleting This Notification Method?"
[ForceUpdate]
other = "Force to Update"
other = "Trigger Agent Update"
[SelectAll]
other = "Select All"
@@ -305,7 +305,7 @@ other = "Select All"
other = "Version"
[OneKeyInstall]
other = "One-Command Install"
other = "Installation commands"
[ClickToCopy]
other = "Click To Copy"
@@ -314,7 +314,7 @@ other = "Click To Copy"
other = "Delete Server"
[ConfirmToDeleteServer]
other = "Confirm to Delete Server?"
other = "Confirm Deleting This Server?"
[NoServerSelected]
other = "No Server Selected"
@@ -545,7 +545,7 @@ other = "Scheduled Tasks"
other = "API Management"
[IssueNewApiToken]
other = "Issue New API Token"
other = "Generate New API Token"
[Token]
other = "Token"
@@ -554,10 +554,10 @@ other = "Token"
other = "Delete Token"
[ConfirmToDeleteThisToken]
other = "Confirm to Delete This Token?"
other = "Confirm Deleting This Token?"
[YouAreNotAuthorized]
other = "Not Authorized for This Page"
other = "This Page needs Authorization"
[WrongAccessPassword]
other = "Wrong Access Password"
@@ -605,13 +605,13 @@ other = "IP Changed"
other = "Remaining Data"
[DashboardTheme]
other = "Admin Panel Theme"
other = "Dashboard Theme"
[Info]
other = "Info"
[HideForGuest]
other = "Hide for Guest"
other = "Hide from Guest"
[Menu]
other = "Menu"
@@ -690,3 +690,18 @@ other = "Cancel"
[FMError]
other = "Agent returned an error, please view the console for details. To open a new connection, reopen the FM again."
[Remaining]
other = "Remaining"
[Lifetime]
other = "Lifetime"
[Price]
other = "Price"
[Expired]
other = "Expired"
[Days]
other = "d"
+19 -4
View File
@@ -71,7 +71,7 @@ other = "Ignorar todo, ejecutar solo a través de servidores específicos"
other = "Incluir todo, excepto servidores específicos"
[ExecuteByTriggerServer]
other = "Ejecutar por servidor disparador"
other = "Ejecutar en servidores con alarma"
[SpecificServers]
other = "Servidores Específicos"
@@ -104,7 +104,7 @@ other = "Segundos, Minutos, Horas, Días, Meses, Semanas - Ver detalles a"
other = "Formato de Expresión de Cron"
[IntroductionOfCommands]
other = "Introducción de Comandos: Escriba comandos como en scripts shell/bat. Evite saltos de línea; conecte múltiples comandos con <code>&&</code> o <code>&</code>. Si no se encuentra un comando, verifique la variable de entorno <code>PATH</code>. En servidores <code>Linux</code>, antepóngale <code>source ~/.bashrc</code> a los comandos, o use rutas absolutas."
other = "Introducción de Comandos: Escriba comandos como en scripts shell/bat. Evite saltos de línea; conecte múltiples comandos con <code>&&</code> o <code>;</code>. Si no se encuentra un comando, verifique la variable de entorno <code>PATH</code>. En servidores <code>Linux</code>, antepóngale <code>source ~/.bashrc</code> a los comandos, o use rutas absolutas."
[AddMonitor]
other = "Agregar Monitor de Servicio"
@@ -254,7 +254,7 @@ other = "Cubrir Todo"
other = "Ignorar Todo"
[ByTrigger]
other = "Ejecutar por Disparador"
other = "Servidores con alarma"
[DeleteScheduledTask]
other = "Eliminar Tarea Programada"
@@ -281,7 +281,7 @@ other = "¿No tiene una cuenta?"
other = "Certificados HTTP(S)/SSL"
[TCPPort]
other = "Puerto TCP"
other = "TCPing"
[DeleteService]
other = "Eliminar Servicio"
@@ -690,3 +690,18 @@ other = "Cancelar"
[FMError]
other = "Agent devolvió un error, consulte la consola para obtener más detalles. Para abrir una nueva conexión, vuelva a abrir el FM."
[Remaining]
other = "Remaining"
[Lifetime]
other = "Lifetime"
[Price]
other = "Price"
[Expired]
other = "Expired"
[Days]
other = "d"
+20 -5
View File
@@ -71,7 +71,7 @@ other = "忽略所有,仅通过特定服务器执行"
other = "覆盖所有,仅特定服务器不执行"
[ExecuteByTriggerServer]
other = "由触发的服务器执行"
other = "由触发告警的服务器执行"
[SpecificServers]
other = "特定服务器"
@@ -104,7 +104,7 @@ other = "秒 分 时 天 月 星期,详情见"
other = "计划表达式格式"
[IntroductionOfCommands]
other = "命令说明:编写命令时类似于 shell/bat 脚本。建议不要换行,多个命令可用 <code>&&</code> 或 <code>&</code> 连接,若出现命令无法找到的情况,可能是由于 <code>PATH</code> 环境变量配置问题。在 <code>Linux</code> 服务器上,可在命令开头加入 <code>source ~/.bashrc</code>,或使用命令的绝对路径执行。"
other = "命令说明:编写命令时类似于 shell/bat 脚本。建议不要换行,多个命令可用 <code>&&</code> 或 <code>;</code> 连接,若出现命令无法找到的情况,可能是由于 <code>PATH</code> 环境变量配置问题。在 <code>Linux</code> 服务器上,可在命令开头加入 <code>source ~/.bashrc</code>,或使用命令的绝对路径执行。"
[AddMonitor]
other = "新增监控"
@@ -254,7 +254,7 @@ other = "覆盖所有"
other = "忽略所有"
[ByTrigger]
other = "触发执行"
other = "触发告警的服务器"
[DeleteScheduledTask]
other = "删除计划任务"
@@ -281,7 +281,7 @@ other = "没有账号?"
other = "HTTP(S)/SSL证书"
[TCPPort]
other = "TCP 端口"
other = "TCPing"
[DeleteService]
other = "移除服务"
@@ -425,7 +425,7 @@ other = "活动"
other = "版本"
[NetSpeed]
other = "网"
other = "网"
[Uptime]
other = "在线"
@@ -690,3 +690,18 @@ other = "取消"
[FMError]
other = "Agent 返回了错误,请查看控制台获取详细信息。要建立新连接,请重新打开 FM。"
[Remaining]
other = "剩余"
[Lifetime]
other = "永续"
[Price]
other = "价格"
[Expired]
other = "已到期"
[Days]
other = "天"
+20 -5
View File
@@ -71,7 +71,7 @@ other = "忽略所有,僅通過特定伺服器執行"
other = "覆蓋所有,僅特定伺服器不執行"
[ExecuteByTriggerServer]
other = "由觸發的伺服器執行"
other = "由觸發告警的伺服器執行"
[SpecificServers]
other = "特定伺服器"
@@ -104,7 +104,7 @@ other = "秒 分 時 天 月 星期,詳情見"
other = "排程表達式格式"
[IntroductionOfCommands]
other = "命令說明:編寫命令時類似於 shell/bat 腳本。建議不要換行,多個命令可用 <code>&&</code> 或 <code>&</code> 連接,若出現命令無法找到的情況,可能是由於 <code>PATH</code> 環境變數配置問題。在 <code>Linux</code> 伺服器上,可在命令開頭加入 <code>source ~/.bashrc</code>,或使用命令的絕對路徑執行。"
other = "命令說明:編寫命令時類似於 shell/bat 腳本。建議不要換行,多個命令可用 <code>&&</code> 或 <code>;</code> 連接,若出現命令無法找到的情況,可能是由於 <code>PATH</code> 環境變數配置問題。在 <code>Linux</code> 伺服器上,可在命令開頭加入 <code>source ~/.bashrc</code>,或使用命令的絕對路徑執行。"
[AddMonitor]
other = "新增監控"
@@ -254,7 +254,7 @@ other = "覆蓋所有"
other = "忽略所有"
[ByTrigger]
other = "觸發執行"
other = "觸發告警的伺服器"
[DeleteScheduledTask]
other = "刪除排程任務"
@@ -281,7 +281,7 @@ other = "沒有帳號?"
other = "HTTP(S)/SSL證書"
[TCPPort]
other = "TCP 端口"
other = "TCPing"
[DeleteService]
other = "移除服務"
@@ -425,7 +425,7 @@ other = "活動"
other = "版本"
[NetSpeed]
other = "網"
other = "網"
[Uptime]
other = "在線"
@@ -690,3 +690,18 @@ other = "取消"
[FMError]
other = "Agent 回傳了錯誤,請查看主控台獲取詳細資訊。要建立新連線,請重新開啟 FM。"
[Remaining]
other = "剩餘"
[Lifetime]
other = "永續"
[Price]
other = "價格"
[Expired]
other = "已到期"
[Days]
other = "天"
+19 -14
View File
@@ -8,6 +8,11 @@ body[theme="dark"] .navbar .navbar-brand {
color: #ffffff;
}
body[theme="dark"] .navbar .navbar-nav li.pc-active a,
body[theme="dark"] .navbar .navbar-nav li.m-active a {
color: rgba(73, 146, 255, 1);
}
body[theme="dark"] .navbar .dropdown-menu {
background-color: rgba(23, 26, 30, 1);
border-color: rgba(49, 54, 59, 1);
@@ -27,7 +32,7 @@ body[theme="dark"] .navbar .dropdown-menu > li > a:hover {
body[theme="dark"] .navbar .navbar-nav > .open > a:focus,
body[theme="dark"] .navbar .navbar-nav > .open > a:hover,
body[theme="dark"] .navbar .navbar-nav > .active > a,
body[theme="dark"] .navbar .navbar-nav > .open > a{
body[theme="dark"] .navbar .navbar-nav > .open > a {
background-image: none;
box-shadow: none;
background-color: transparent;
@@ -53,7 +58,7 @@ body[theme="dark"] .table {
body[theme="dark"] .table > tbody > tr > td:before,
body[theme="dark"] .table > tfoot > tr > td:before,
body[theme="dark"] .table > thead > tr > td:before,
body[theme="dark"] .table > thead > tr.node-group-cell > th:before{
body[theme="dark"] .table > thead > tr.node-group-cell > th:before {
background-color: rgba(58, 62, 65, 1);
}
@@ -69,7 +74,7 @@ body[theme="dark"] .table-striped tbody > tr.odd > th {
background-color: rgba(34, 35, 46, 1);
}
body[theme="dark"] .table-hover > tbody > tr:hover{
body[theme="dark"] .table-hover > tbody > tr:hover {
background-color: unset;
}
@@ -78,18 +83,18 @@ body[theme="dark"] .table-hover > tbody > tr:not(.expandRow):hover > td {
}
/* expandRow展开部分样式 */
body[theme="dark"] .table > tbody > tr.expandRow.odd > td:before{
body[theme="dark"] .table > tbody > tr.expandRow.odd > td:before {
background-color: rgba(34, 35, 46, 1);
}
body[theme="dark"] .table > tbody > tr.expandRow.even > td:before{
body[theme="dark"] .table > tbody > tr.expandRow.even > td:before {
background-color: rgba(28, 29, 38, 1);
}
/* expandRow展开部分样式结束 */
body[theme="dark"] .progress {
background-image: linear-gradient(#2c2c2c 0,rgba(28, 29, 38, 1) 100%);
background-color: rgba(28, 29, 38, 1);
background-image: none;
background-color: rgba(255, 255, 255, 0.075);
}
body[theme="dark"] .progress-bar {
@@ -150,29 +155,29 @@ body[theme="dark"] footer p a:hover {
text-decoration: none;
}
body[theme="dark"] .modal-content{
body[theme="dark"] .modal-content {
background-color: rgba(28, 29, 38, 1);
color: #f1f1f1;
}
body[theme="dark"] #earthChartBox .modal-content{
body[theme="dark"] #earthChartBox .modal-content {
background-color: rgba(0, 0, 0, 1);
color: #f1f1f1;
}
body[theme="dark"] .modal-header{
body[theme="dark"] .modal-header {
border-bottom-color:#080808;
}
body[theme="dark"] .modal-header i.xclose{
body[theme="dark"] .modal-header i.xclose {
color: #f1f1f1;
}
body[theme="dark"] .toolbox i{
body[theme="dark"] .toolbox i {
color: rgba(241, 241, 241, 1);
background-color: rgba(0, 0, 0, 0.5);
}
body[theme="dark"] .network-box .network-box-header{
border-bottom: 1px solid rgba(110, 112, 121, 0.25);
body[theme="dark"] .network-box .network-box-header {
border-bottom-color: rgba(110, 112, 121, 0.25);
}
+3 -3
View File
@@ -86,7 +86,7 @@ body[theme="dark"] .table > thead > tr.node-group-tag > th:before {
body[theme="dark"] .table > tbody > tr > td:before,
body[theme="dark"] .table > tfoot > tr > td:before,
body[theme="dark"] .table > thead > tr > td:before,
body[theme="dark"] .table > thead > tr.node-group-cell > th:before{
body[theme="dark"] .table > thead > tr.node-group-cell > th:before {
/** border-bottom 颜色 **/
background-color: rgba(155, 155, 155, 0.1);
}
@@ -96,11 +96,11 @@ body[theme="dark"] .table-hover > tbody > tr:not(.expandRow):hover > td {
}
/* expandRow展开部分样式 */
body[theme="dark"] .table > tbody > tr.expandRow.odd > td:before{
body[theme="dark"] .table > tbody > tr.expandRow.odd > td:before {
background-color: unset;
}
body[theme="dark"] .table > tbody > tr.expandRow.even > td:before{
body[theme="dark"] .table > tbody > tr.expandRow.even > td:before {
background-color: unset;
}
/* expandRow展开部分样式结束 */
+19 -14
View File
@@ -16,10 +16,15 @@ body[theme="light"] .navbar .navbar-brand {
color: rgba(0, 0, 0, 0.87);
}
body[theme="light"] .navbar .navbar-nav > li > a{
body[theme="light"] .navbar .navbar-nav > li > a {
color: rgba(0, 0, 0, 0.87);
}
body[theme="light"] .navbar .navbar-nav li.pc-active a,
body[theme="light"] .navbar .navbar-nav li.m-active a {
color: rgba(73, 146, 255, 1);
}
body[theme="light"] .navbar .navbar-nav > .open > a:focus,
body[theme="light"] .navbar .navbar-nav > .open > a:hover,
body[theme="light"] .navbar .navbar-nav > .active > a,
@@ -42,16 +47,16 @@ body[theme="light"] .navbar .navbar-nav .open .dropdown-menu > li > a {
color: rgba(0, 0, 0, 0.87);
}
body[theme="light"] .navbar .navbar-toggle{
body[theme="light"] .navbar .navbar-toggle {
border:none;
padding:9px 12px;
}
body[theme="light"] .navbar .navbar-collapse{
body[theme="light"] .navbar .navbar-collapse {
border-color:rgba(0, 0, 0, 0.085);
}
body[theme="light"] .navbar .navbar-toggle .icon-bar{
body[theme="light"] .navbar .navbar-toggle .icon-bar {
background-color: rgba(0, 0, 0, 0.87);
}
@@ -90,12 +95,12 @@ body[theme="light"] .table-striped tbody > tr.odd > th {
body[theme="light"] .table > tbody > tr > td:before,
body[theme="light"] .table > tfoot > tr > td:before,
body[theme="light"] .table > thead > tr > td:before,
body[theme="light"] .table > thead > tr.node-group-cell > th:before{
body[theme="light"] .table > thead > tr.node-group-cell > th:before {
background-color: rgba(221, 221, 221, 1);
}
body[theme="light"] .table > tbody > tr.expandRow > td:before,
body[theme="light"] .table > thead > tr.node-group-tag > th:before{
body[theme="light"] .table > thead > tr.node-group-tag > th:before {
background-color: rgba(255, 255, 255, 1);
}
@@ -169,36 +174,36 @@ body[theme="light"] footer p a:hover {
text-decoration: none;
}
body[theme="light"] .toolbox i{
body[theme="light"] .toolbox i {
color: rgba(94, 114, 228, .9);
background-color: rgba(255, 255, 255, .5);
box-shadow:0 .125rem .25rem rgba(0, 0, 0, .15) !important;
}
body[theme="light"] .toolbox .mytoggle .tooltip-inner{
body[theme="light"] .toolbox .mytoggle .tooltip-inner {
background: #ffffff;
box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .15) !important;
}
body[theme="light"] .toolbox .mytoggle li:hover{
body[theme="light"] .toolbox .mytoggle li:hover {
background-color:#e6e6e6;
}
body[theme="light"] .modal-content{
body[theme="light"] .modal-content {
background-color: rgba(249, 249, 249, 1);
color: rgba(0, 0, 0, 0.87);
}
body[theme="light"] .modal-header{
body[theme="light"] .modal-header {
border-bottom-color:#f1f1f1;
}
body[theme="light"] .modal-header i.xclose{
body[theme="light"] .modal-header i.xclose {
color: rgba(0, 0, 0, 0.87);
}
body[theme="light"] .network-box .network-box-header{
border-bottom: 1px solid rgba(224, 230, 241, 0.6);
body[theme="light"] .network-box .network-box-header {
border-bottom-color: rgba(224, 230, 241, 0.6);
}
@media only screen and (max-width: 767px) {
+7 -7
View File
@@ -36,16 +36,16 @@ body[theme="light"] .navbar .dropdown-menu {
body[theme="light"] .navbar .dropdown-menu > li > a:focus,
body[theme="light"] .navbar .dropdown-menu > li > a:hover{
body[theme="light"] .navbar .dropdown-menu > li > a:hover {
/** 二级导航鼠标悬停选中背景 **/
background-color: rgba(0, 0, 0, .05);
}
body[theme="light"] .navbar .navbar-collapse{
body[theme="light"] .navbar .navbar-collapse {
border-color:rgba(0, 0, 0, 0.085);
}
body[theme="light"] .navbar .navbar-toggle .icon-bar{
body[theme="light"] .navbar .navbar-toggle .icon-bar {
background-color: rgba(0, 0, 0, 0.9);
}
@@ -87,7 +87,7 @@ body[theme="light"] .table > thead > tr.node-group-tag > th:before {
body[theme="light"] .table > tbody > tr > td:before,
body[theme="light"] .table > tfoot > tr > td:before,
body[theme="light"] .table > thead > tr > td:before,
body[theme="light"] .table > thead > tr.node-group-cell > th:before{
body[theme="light"] .table > thead > tr.node-group-cell > th:before {
/** border-bottom 颜色 **/
background-color: rgba(0, 0, 0, 0.075);
}
@@ -97,11 +97,11 @@ body[theme="light"] .table-hover > tbody > tr:not(.expandRow):hover > td {
}
/* expandRow展开部分样式 */
body[theme="light"] .table > tbody > tr.expandRow.odd > td:before{
body[theme="light"] .table > tbody > tr.expandRow.odd > td:before {
background-color: unset;
}
body[theme="light"] .table > tbody > tr.expandRow.even > td:before{
body[theme="light"] .table > tbody > tr.expandRow.even > td:before {
background-color: unset;
}
/* expandRow展开部分样式结束 */
@@ -123,7 +123,7 @@ body[theme="light"] .progress-bar-danger {
background-image: linear-gradient(to right, rgba(255, 70, 0, 0.6) 0, rgba(201, 48, 44,0.6) 100%);
}
body[theme="light"] .toolbox i{
body[theme="light"] .toolbox i {
background-color: rgba(255, 255, 255, .55);
}
+65 -36
View File
@@ -250,6 +250,24 @@ tr.accordion-toggle{
max-width: 50px;
}
.node-cell.remaining {
min-width: 65px;
max-width: 65px;
}
.node-cell.remaining .additional {
position: absolute;
left: 0;
font-size: 12px;
text-align: center;
width: 100%;
}
.node-cell.remaining .additional small{
white-space: nowrap;
font-size: 80%;
}
.temp-detail {
cursor: pointer;
}
@@ -322,15 +340,17 @@ td.ping-network-quality {
/* 服务页 正文结束 */
/* 网络页 正文*/
.network-box .btn-group.open .dropdown-toggle{
.network-box .btn-group.open .dropdown-toggle {
box-shadow:unset;
}
.network-box .network-box-header{
.network-box .network-box-header {
font-size: 18px;
padding: 5px 0px 15px 5px;
cursor: pointer;
width: 100%;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.network-box .network-box-header .dropdown-menu {
@@ -345,12 +365,12 @@ td.ping-network-quality {
display: none;
}
.network-box .network-box-header .dropdown-menu li{
.network-box .network-box-header .dropdown-menu li {
height: 2em;
cursor: pointer;
}
.network-box .network-box-header .dropdown-menu li.input-group{
.network-box .network-box-header .dropdown-menu li.input-group {
margin: 0 auto;
display: flex;
position: sticky;
@@ -358,7 +378,7 @@ td.ping-network-quality {
z-index: 99999997;
}
.network-box .network-box-header .dropdown-menu li.input-group input{
.network-box .network-box-header .dropdown-menu li.input-group input {
width: 100%;
height: 2em;
border-top: none;
@@ -387,7 +407,7 @@ td.ping-network-quality {
margin: 18px 0px 15px 0px;
}
.network-box .chartTitle i.chartCountryCode{
.network-box .chartTitle i.chartCountryCode {
font-size: 16px;
border-radius: 12.5%;
}
@@ -395,17 +415,17 @@ td.ping-network-quality {
/* 网络页 正文结束 */
/* 地图版服务器分布图 */
#mapChartBox{
#mapChartBox {
z-index: 999999999;
padding-left: 0 !important;
}
.modal-open .modal{
.modal-open .modal {
overflow-x: hidden;
overflow-y: hidden;
}
.modal-dialog-centered{
.modal-dialog-centered {
margin: 0 auto;
width: 100%;
max-width: 100%;
@@ -415,7 +435,7 @@ td.ping-network-quality {
min-height: calc(100%) /* 确保模态框占据整个视口高度 */
}
.modal-content{
.modal-content {
display: flex;
flex-direction: column;
pointer-events: auto;
@@ -423,15 +443,15 @@ td.ping-network-quality {
border: none;
}
.modal-header{
.modal-header {
position: relative;
}
.modal-header h4{
.modal-header h4 {
cursor: pointer;
}
.modal-header i.xclose{
.modal-header i.xclose {
cursor: pointer;
position: absolute;
font-size: 30px;
@@ -439,32 +459,32 @@ td.ping-network-quality {
right: 10px;
}
.modal-body{
.modal-body {
padding: 0px;
}
a.template-item, a.cdn-item{
a.template-item, a.cdn-item {
display: block;
}
footer{
footer {
padding-bottom: 20px;
}
footer p{
footer p {
text-align: center;
font-size: 10px;
}
@media only screen and (max-width: 1200px) {
.accordian-body{
.accordian-body {
margin: 5px 0px 5px 10px;
}
table.monitor-detail{
table.monitor-detail {
margin:0px 0px 2px 0px;
}
.table .network-thead-tr th,
.table .node-group-tag th{
.table .node-group-tag th {
font-size:16px;
padding-bottom:6px;
}
@@ -492,10 +512,10 @@ footer p{
padding: 0;
margin-bottom: 10px;
}
footer{
footer {
padding-bottom: 10px;
}
.cycle-transfer-stats .dataTables_wrapper{
.cycle-transfer-stats .dataTables_wrapper {
margin-bottom: -10px;
}
.navbar .navbar-nav .open .dropdown-menu>li>a {
@@ -517,50 +537,58 @@ footer p{
}
.node-cell.os,
.node-cell.uptime,
.node-cell.traffic{
.node-cell.traffic {
display: none;
visibility: hidden;
}
.node-cell.location{
.node-cell.location {
display: table-cell;
visibility: visible;
}
.node-cell-os-text,.node-cell-location-text{
.node-cell-os-text,.node-cell-location-text {
display: none;
visibility: hidden;
}
.accordian-body{
.node-cell.network {
min-width: 95px;
max-width: 95px;
}
.node-cell.remaining {
min-width: 75px;
max-width: 75px;
}
.accordian-body {
margin: 5px 0px 5px 10px;
}
table.monitor-detail{
table.monitor-detail {
margin:0px 0px 2px 0px;
}
.table .network-thead-tr th,
.table .node-group-tag th{
.table .node-group-tag th {
font-size:14px;
padding-bottom:6px;
}
.table tr.network td{
.table tr.network td {
font-size: 12px;
}
.service-status .service-status-th{
.service-status .service-status-th {
min-width:30px;
}
.service-status .delay-today{
.service-status .delay-today {
margin-top:4px;
justify-content: center;
}
.service-status .delay-today i{
.service-status .delay-today i {
margin-right:0px;
}
.service-status .delay-today-text{
.service-status .delay-today-text {
display: none;
visibility: hidden;
}
.service-status .service-averagelatency-th{
.service-status .service-averagelatency-th {
min-width:70px;
}
.service-status .service-30daysonline-th{
.service-status .service-30daysonline-th {
min-width:75px;
}
.toolbox {
@@ -572,12 +600,13 @@ footer p{
.network-box .network-box-header {
margin: 8px 0px 0px 8px;
font-size: 16px;
border-bottom: none;
}
.network-box .chartTitle {
font-size: 16px;
margin: 10px 0px 10px 0px;
}
.network-box .chartTitle i.chartCountryCode{
.network-box .chartTitle i.chartCountryCode {
font-size: 15px;
border-radius: 12.5%;
}
+5
View File
@@ -155,6 +155,11 @@ const mixinsVue = {
checkIsMobile() { // 检测设备类型,页面宽度小于768px认为是移动设备
return window.innerWidth <= 768;
},
isMenuActive(page){
if(page == this.$root.page) {
return this.isMobile ? 'm-active' : 'pc-active';
}
},
setBenchmarkHeight() {
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
+12 -10
View File
@@ -30,9 +30,6 @@
<th>{{tr "VersionNumber"}}</th>
<th>{{tr "HideForGuest"}}</th>
<th>{{tr "EnableDDNS"}}</th>
<th>{{tr "EnableIPv4"}}</th>
<th>{{tr "EnableIpv6"}}</th>
<th>{{tr "DDNSDomain"}}</th>
<th>{{tr "Secret"}}</th>
<th>{{tr "OneKeyInstall"}}</th>
<th>{{tr "Note"}}</th>
@@ -51,9 +48,6 @@
<td>{{$server.Host.Version}}</td>
<td>{{$server.HideForGuest}}</td>
<td>{{$server.EnableDDNS}}</td>
<td>{{$server.EnableIPv4}}</td>
<td>{{$server.EnableIpv6}}</td>
<td>{{$server.DDNSDomain}}</td>
<td>
<button class="ui icon green mini button" data-clipboard-text="{{$server.Secret}}" data-tooltip="{{tr "ClickToCopy"}}">
<i class="copy icon"></i>
@@ -76,8 +70,16 @@
<i class="apple icon"></i>
</button>
</td>
<td style="word-break: break-word;white-space: pre-wrap;">{{$server.Note}}</td>
<td style="word-break: break-word;white-space: pre-wrap;">{{$server.PublicNote}}</td>
<td>
{{if $server.Note}}
<button class="ui icon green mini button" title="{{ $server.Note }}" onclick="addOrEditServer({{$server.MarshalForDashboard}})"><i class="sticky note icon"></i></button>
{{end}}
</td>
<td>
{{if $server.PublicNote}}
<button class="ui icon green mini button" title="{{$server.PublicNote}}" onclick="addOrEditServer({{$server.MarshalForDashboard}})"><i class="sticky clipboard icon"></i></button>
{{end}}
</td>
<td>
<div class="ui mini icon buttons">
<button class="ui button" onclick="connectToServer({{$server.ID}})">
@@ -157,8 +159,8 @@
}
function batchEditServerGroup() {
let groupName = prompt('{{tr "InputServerGroupName"}}')
if (!groupName) {
return;
if (groupName === null) {
return
}
const servers = []
checkBoxList.forEach(cb => {
+2 -2
View File
@@ -28,8 +28,8 @@
</span>
</aside>
<template v-if="semiTransparent">
<link rel="stylesheet" href="/static/theme-server-status/css/light.plus.css?v20240807">
<link rel="stylesheet" href="/static/theme-server-status/css/dark.plus.css?v20240807">
<link rel="stylesheet" href="/static/theme-server-status/css/light.plus.css?v20241008">
<link rel="stylesheet" href="/static/theme-server-status/css/dark.plus.css?v20241008">
</template>
</div>
{{if ts .CustomCode}}{{.CustomCode|safe}}{{end}}
+4 -4
View File
@@ -26,10 +26,10 @@
<script src="https://unpkg.com/[email protected]/dist/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/echarts.min.js"></script>
<link rel="stylesheet" href="/static/theme-server-status/css/main.css?v20240909">
<link rel="stylesheet" href="/static/theme-server-status/css/dark.css?v202408011">
<link rel="stylesheet" href="/static/theme-server-status/css/light.css?v20240811">
<script src="/static/theme-server-status/js/mixin.js?v20240907"></script>
<link rel="stylesheet" href="/static/theme-server-status/css/main.css?v20241008">
<link rel="stylesheet" href="/static/theme-server-status/css/dark.css?v20241008">
<link rel="stylesheet" href="/static/theme-server-status/css/light.css?v20241008">
<script src="/static/theme-server-status/js/mixin.js?v20240915"></script>
</head>
<body>
<div id="app">
+30 -6
View File
@@ -6,6 +6,7 @@
<th class="node-cell name center">{{tr "Name"}}</th>
<th class="node-cell os center">{{tr "Platform"}}</th>
<th class="node-cell location center">{{tr "Location"}}</th>
<th v-if="nodesNoTag.some(item => item.additional && item.additional.price && Object.keys(item.additional.price).length > 0)" class="node-cell price center">{{tr "Price"}}</th>
<th class="node-cell uptime center">{{tr "Uptime"}}</th>
<th class="node-cell load center">{{tr "Load"}}</th>
<th class="node-cell network center">{{tr "NetSpeed"}}↓|↑</th>
@@ -13,6 +14,7 @@
<th class="node-cell cpu center">{{tr "CpuUsed"}}</th>
<th class="node-cell memory center">{{tr "MemUsed"}}</th>
<th class="node-cell hdd center">{{tr "DiskUsed"}}</th>
<th v-if="nodesNoTag.some(item => item.additional && item.additional.remaining && Object.keys(item.additional.remaining).length > 0)" class="node-cell remaining center">{{tr "Remaining"}}</th>
</tr>
</thead>
<tbody id="servers">
@@ -30,11 +32,18 @@
<i v-if='isWindowsPlatform(node.host.Platform)' class="windows icon"></i>
<i v-else-if='getFontLogoClass(node.host.Platform) == "" && node.stateuptime > 0' class="fl-tux"></i>
<i v-else :class="'fl-' + getFontLogoClass(node.host.Platform)"></i>
<span class="node-cell-os-text">@#getPlatformName(node.os)#@</span>
<span class="node-cell-os-text">@#getPlatformName(node.os) === '' && node.stateuptime > 0 ? 'linux' : getPlatformName(node.os)#@</span>
</td>
<td style="text-align: center;" class="node-cell location">
<i :class="'fi fi-' + node.location"></i>
<span class="node-cell-location-text text-uppercase">@#node.location#@</span>
<td class="node-cell location center">
<i :class="'fi fi-' + (node.stateuptime > 0 ? (node.location || 'rb') : '')"></i>
<span class="node-cell-location-text text-uppercase">@#node.stateuptime > 0 ? (node.location || 'RB') : ''#@</span>
</td>
<td v-if="nodesNoTag.some(item => item.additional && item.additional.price && Object.keys(item.additional.price).length > 0)" class="node-cell price center">
<template v-if="node.additional && node.additional.price">
<span v-if="node.additional.price.amount == 0" class="node-cell-price-text">FREE</span>
<span v-else-if="node.additional.price.amount == -1" class="node-cell-price-text">PAYG</span>
<span v-else class="node-cell-price-text">@#node.additional.price.amount#@@#(node.additional.price.cycle ? '/' + node.additional.price.cycle : '')#@</span>
</template>
</td>
<td style="text-align: center;" class="node-cell uptime">@#node.uptime#@</td>
<td style="text-align: center;" class="node-cell load">@#node.load#@</td>
@@ -59,6 +68,21 @@
</div>
</div>
</td>
<td v-if="nodesNoTag.some(item => item.additional && item.additional.remaining && Object.keys(item.additional.remaining).length > 0)" class="node-cell remaining">
<div :class="['progress', node.online ? 'progress-online' : 'progress-offline']">
<template v-if="node.additional && node.additional.remaining.format">
<div :style="node.additional.remaining.format.style" :class="node.additional.remaining.days == 'lifetime' ? '' : node.additional.remaining.format.class"></div>
<div class="additional">
<small v-if="node.additional.remaining.days == 'lifetime'">{{tr "Lifetime"}}</small>
<small v-else-if="node.additional.remaining.days < 0">{{tr "Expired"}}</small>
<small v-else>
<span class="node-cell-remaining-days">@#node.additional.remaining.days#@{{tr "Days"}}</span>
<span class="node-cell-remaining-percent">@#node.additional.remaining.percent#@%</span>
</small>
</div>
</template>
</div>
</td>
</tr>
<tr class="expandRow" :class="index % 2 === 0 ? 'odd': 'even'">
<td colspan="16">
@@ -66,8 +90,8 @@
<div style="display: flex;left-items: center;justify-content: center;flex-direction: column; max-width: 89vw">
<span class="node-cell-expand">
<span class="node-cell-expand-label">{{tr "Platform"}}:</span>
@#node.host.Platform#@-@#node.host.PlatformVersion#@
[<span v-if="node.host.Virtualization">@#node.host.Virtualization#@:</span>@#node.host.Arch#@]
<span v-if="node.host.Platform">@#node.host.Platform#@@#node.host.PlatformVersion ? '-' + node.host.PlatformVersion : ''#@</span>
<span v-if="node.host.Arch">[@#node.host.Virtualization ? node.host.Virtualization + ':' : ''#@@#node.host.Arch#@]</span>
</span>
<span class="node-cell-expand" v-if="node.host.CPU">
<span class="node-cell-expand-label">CPU:</span>
+30 -6
View File
@@ -9,6 +9,7 @@
<th class="node-cell name center">{{tr "Name"}}</th>
<th class="node-cell os center">{{tr "Platform"}}</th>
<th class="node-cell location center">{{tr "Location"}}</th>
<th v-if="group.data.some(item => item.additional && item.additional.price && Object.keys(item.additional.price).length > 0)" class="node-cell price center">{{tr "Price"}}</th>
<th class="node-cell uptime center">{{tr "Uptime"}}</th>
<th class="node-cell load center">{{tr "Load"}}</th>
<th class="node-cell network center">{{tr "NetSpeed"}}↓|↑</th>
@@ -16,6 +17,7 @@
<th class="node-cell cpu center">{{tr "CpuUsed"}}</th>
<th class="node-cell memory center">{{tr "MemUsed"}}</th>
<th class="node-cell hdd center">{{tr "DiskUsed"}}</th>
<th v-if="group.data.some(item => item.additional && item.additional.remaining && Object.keys(item.additional.remaining).length > 0)" class="node-cell remaining center">{{tr "Remaining"}}</th>
</tr>
</thead>
<tbody id="servers">
@@ -33,11 +35,18 @@
<i v-if='isWindowsPlatform(node.host.Platform)' class="windows icon"></i>
<i v-else-if='getFontLogoClass(node.host.Platform) == "" && node.stateuptime > 0' class="fl-tux"></i>
<i v-else :class="'fl-' + getFontLogoClass(node.host.Platform)"></i>
<span class="node-cell-os-text">@#getPlatformName(node.os)#@</span>
<span class="node-cell-os-text">@#getPlatformName(node.os) === '' && node.stateuptime > 0 ? 'linux' : getPlatformName(node.os)#@</span>
</td>
<td style="text-align: center;" class="node-cell location">
<i :class="'fi fi-' + node.location"></i>
<span class="node-cell-location-text text-uppercase">&nbsp;@#node.location#@</span>
<td class="node-cell location center">
<i :class="'fi fi-' + (node.stateuptime > 0 ? (node.location || 'rb') : '')"></i>
<span class="node-cell-location-text text-uppercase">@#node.stateuptime > 0 ? (node.location || 'RB') : ''#@</span>
</td>
<td v-if="group.data.some(item => item.additional && item.additional.price && Object.keys(item.additional.price).length > 0)" class="node-cell price center">
<template v-if="node.additional && node.additional.price">
<span v-if="node.additional.price.amount == 0" class="node-cell-price-text">FREE</span>
<span v-else-if="node.additional.price.amount == -1" class="node-cell-price-text">PAYG</span>
<span v-else class="node-cell-price-text">@#node.additional.price.amount#@@#(node.additional.price.cycle ? '/' + node.additional.price.cycle : '')#@</span>
</template>
</td>
<td style="text-align: center;" class="node-cell uptime">@#node.uptime#@</td>
<td style="text-align: center;" class="node-cell load">@#node.load#@</td>
@@ -62,6 +71,21 @@
</div>
</div>
</td>
<td v-if="group.data.some(item => item.additional && item.additional.remaining && Object.keys(item.additional.remaining).length > 0)" class="node-cell remaining">
<div :class="['progress', node.online ? 'progress-online' : 'progress-offline']">
<template v-if="node.additional && node.additional.remaining.format">
<div :style="node.additional.remaining.format.style" :class="node.additional.remaining.days == 'lifetime' ? '' : node.additional.remaining.format.class"></div>
<div class="additional">
<small v-if="node.additional.remaining.days == 'lifetime'">{{tr "Lifetime"}}</small>
<small v-else-if="node.additional.remaining.days < 0">{{tr "Expired"}}</small>
<small v-else>
<span class="node-cell-remaining-days">@#node.additional.remaining.days#@{{tr "Days"}}</span>
<span class="node-cell-remaining-percent">@#node.additional.remaining.percent#@%</span>
</small>
</div>
</template>
</div>
</td>
</tr>
<tr class="expandRow" :class="index % 2 === 0 ? 'odd': 'even'">
<td colspan="16">
@@ -69,8 +93,8 @@
<div style="display: flex;left-items: center;justify-content: center;flex-direction: column; max-width: 89vw">
<span class="node-cell-expand">
<span class="node-cell-expand-label">{{tr "Platform"}}:</span>
@#node.host.Platform#@-@#node.host.PlatformVersion#@
[<span v-if="node.host.Virtualization">@#node.host.Virtualization#@:</span>@#node.host.Arch#@]
<span v-if="node.host.Platform">@#node.host.Platform#@@#node.host.PlatformVersion ? '-' + node.host.PlatformVersion : ''#@</span>
<span v-if="node.host.Arch">[@#node.host.Virtualization ? node.host.Virtualization + ':' : ''#@@#node.host.Arch#@]</span>
</span>
<span class="node-cell-expand" v-if="node.host.CPU">
<span class="node-cell-expand-label">CPU:</span>
+425 -2
View File
@@ -42,6 +42,7 @@
servers: [],
nodesTag: [],
nodesNoTag: [],
additional: {},
chartDataList: [],
ws: null,
language: {{.Conf.Language}},
@@ -71,17 +72,32 @@
mixins: [mixinsVue],
created() {
this.servers = JSON.parse('{{.Servers}}').servers;
this.additional = this.initAdditional(this.servers);
if(this.showGroup) {
this.nodesTag = this.groupingData(this.handleNodes(this.servers),"Tag");
this.nodesTag.forEach(group => {
group.data.forEach(item => {
const additionalData = this.additional[item.ID];
if (additionalData) {
item.additional = additionalData; // 添加 additional 属性
}
});
});
} else {
this.nodesNoTag = this.handleNodes(this.servers);
this.nodesNoTag.forEach(item => {
const additionalData = this.additional[item.ID];
if (additionalData) {
item.additional = additionalData; // 添加 additional 属性
}
});
}
this.initCountryMap().then(countryMap => {
this.countryMap = countryMap;
this.countryNameMap = this.initCountryNameMap();
this.countryServer = this.initCountryServer();
this.countryMapChartData = this.initCountryMapChartData();
})
});
},
mounted() {
// 初始化时建立WebSocket连接
@@ -98,6 +114,49 @@
});
},
methods: {
initAdditional(servers) {
let nodes = {};
servers?.forEach(server => {
if (server.PublicNote) {
const remainingFormat = this.getRemainingFormat(server.live, server.PublicNote);
const remainingDays = this.getRemainingDays(this.getNoteElementValue(server.PublicNote, "billingDataMod", "endDate"), server.PublicNote);
const remainingPercent = this.getRemainingPercent(
this.getNoteElementValue(server.PublicNote, "billingDataMod", "startDate"),
this.getNoteElementValue(server.PublicNote, "billingDataMod", "endDate"),
server.PublicNote
);
const priceAmount = this.getNoteElementValue(server.PublicNote, "billingDataMod", "amount");
const priceCycle = this.getNoteElementValue(server.PublicNote, "billingDataMod", "cycle");
// 初始化节点
nodes[server.ID] = {
"remaining": {},
"price": {}
};
if (remainingFormat) {
nodes[server.ID].remaining.format = remainingFormat;
}
if (remainingDays) {
nodes[server.ID].remaining.days = remainingDays;
}
if (remainingPercent) {
nodes[server.ID].remaining.percent = this.toFixed2(100 - remainingPercent);
}
if (priceAmount) {
nodes[server.ID].price.amount = priceAmount;
}
if (priceCycle && priceAmount) {
nodes[server.ID].price.cycle = priceCycle;
}
}
});
return nodes;
},
initCountryMap() {
return fetch(this.staticUrl + '/maps/nezha.countrymap.json')
.then(response => response.json())
@@ -395,8 +454,22 @@
}
if(this.showGroup) {
this.nodesTag = this.groupingData(this.handleNodes(data.servers),"Tag");
this.nodesTag.forEach(group => {
group.data.forEach(item => {
const additionalData = this.additional[item.ID];
if (additionalData) {
item.additional = additionalData; // 添加 additional 属性
}
});
});
} else {
this.nodesNoTag = this.handleNodes(data.servers);
this.nodesNoTag.forEach(item => {
const additionalData = this.additional[item.ID];
if (additionalData) {
item.additional = additionalData; // 添加 additional 属性
}
});
}
}
this.ws.onclose = () => {
@@ -507,7 +580,7 @@
}
})
.catch(error => {
console.error('Error fetching data:', error);
console.log('Error fetching data:', error);
});
},
renderCharts(id, reload = false) {
@@ -722,6 +795,356 @@
this.renderCharts(id,true);
}
});
},
getNoteElementValue(string, elementName, childElementName) {
let obj;
try {
obj = JSON.parse(string);
} catch (e) {
return null;
}
if (!elementName) return null;
if (childElementName) {
return obj[elementName] && childElementName in obj[elementName] ? obj[elementName][childElementName] : null;
} else {
return elementName in obj ? obj[elementName] : null;
}
},
getBillingCycle(billingCycle) {
// 统一转换为小写进行比较
const cycle = billingCycle.toLowerCase();
switch (cycle) {
case '月':
case 'mo':
case 'month':
case 'monthly':
case 'm':
return "M";
case '季':
case 'quarterly':
case 'q':
return "Q";
case '半':
case '半年':
case 'half':
case 'semi-annually':
case 'h':
return "H";
case '年':
case 'yr':
case 'year':
case 'annually':
case 'y':
return "Y";
default:
return null;
}
},
getAdjustTimezone(reference, target) {
// 获取时区
const referenceTimezoneOffset = reference.getTimezoneOffset();
const targetTimezoneOffset = target.getTimezoneOffset();
// 计算时区差异
const timezoneDifference = (referenceTimezoneOffset - targetTimezoneOffset) * 60 * 1000;
// 将 target 日期调整到 reference 时区
return new Date(target.getTime() + timezoneDifference);
},
getAutoRenewalEndDate(endDate, billingCycle) {
const expiration = new Date(endDate);
const current = this.getAdjustTimezone(new Date(endDate), new Date());
// 如果 expiration 无效,返回 null 并记录日志
if (isNaN(expiration.getTime())) {
console.log("getAutoRenewalEndDate: Invalid expiration format");
}
const result = {
flag: 1, // 1表示需要更新
check: 0, // 判断逻辑标记
count: 0 // 周期累计计数
};
// 如果当前时间还没到到期时间,直接返回到期时间
if (current < expiration) {
result.flag = 0;
result.date = expiration;
return result;
}
let nextExpiration = new Date(expiration); // 初始化为原到期时间
let newExpirationMonth = expiration.getMonth(); // 获取expiration初始月份
switch (billingCycle.toUpperCase()) {
case 'M': // 月度
nextExpiration.setFullYear(current.getFullYear());
const monthCheck = current < new Date(current.getFullYear(), current.getMonth(), expiration.getDate());
// 检查当前月是否在有效期内
if (monthCheck) {
nextExpiration.setMonth(current.getMonth());
result.check = 1;
} else {
nextExpiration.setMonth(current.getMonth() + 1);
result.check = 2;
}
break;
case 'Q': // 季度
nextExpiration.setFullYear(current.getFullYear());
// 每次增加 3 个月,直到新的月份大于当前月份
while (newExpirationMonth < current.getMonth()) {
newExpirationMonth += 3;
result.count += 1;
}
// nextExpiration设置获取到的新月份
nextExpiration.setMonth(newExpirationMonth);
const quarterlyCheck = current < nextExpiration;
// 检查新月份是否在有效期内
if (quarterlyCheck) {
result.check = 3;
} else {
nextExpiration.setMonth(current.getMonth() + 3);
result.check = 4;
result.count += 1;
}
break;
case 'H': // 半年
nextExpiration.setFullYear(current.getFullYear());
// 每次增加 6 个月,直到新的月份大于当前月份
while (newExpirationMonth < current.getMonth()) {
newExpirationMonth += 6;
result.count += 1;
}
// nextExpiration设置获取到的新月份
nextExpiration.setMonth(newExpirationMonth);
const halfCheck = current < nextExpiration;
// 检查新月份是否在有效期内
if (halfCheck) {
result.check = 5;
} else {
nextExpiration.setMonth(current.getMonth() + 6);
result.check = 6;
result.count += 1;
}
break;
case 'Y': // 年度
const yearCheck = current < new Date(current.getFullYear(), expiration.getMonth(), expiration.getDate());
// 如果当前时间比这一年有效期早,则到期为本年
if (yearCheck) {
nextExpiration.setFullYear(current.getFullYear());
result.check = 7;
} else {
// 否则推到下一年
nextExpiration.setFullYear(current.getFullYear() + 1);
result.check = 8;
}
break;
default:
throw new Error("Invalid billing cycle");
}
// 保持原到期时间的时分秒
nextExpiration.setHours(expiration.getHours());
nextExpiration.setMinutes(expiration.getMinutes());
nextExpiration.setSeconds(expiration.getSeconds());
result.date = nextExpiration;
return result;
},
getAutoRenewalStartDate(flag, startDate, check, count) {
//1.判断什么时候改变 2.如何改变
const start = new Date(startDate);
const current = this.getAdjustTimezone(start, new Date());
// 检查 startDate 格式是否有效,若无效返回 null
if (isNaN(start.getTime())) {
console.log("getAutoRenewalStartDate: Invalid startDate format");
}
// 如果 flag 为 0,直接返回开始日期
if (flag === 0) {
return start;
}
// 初始化新的开始日期
const newStart = new Date(start);
switch (check) {
case 1: // 处理月份:设置为上个月
newStart.setFullYear(current.getFullYear());
newStart.setMonth(current.getMonth() - 1);
break;
case 2: // 处理月份:设置为当前月
newStart.setFullYear(current.getFullYear());
newStart.setMonth(current.getMonth());
break;
case 3:
case 4: // 处理季度
newStart.setFullYear(current.getFullYear());
newStart.setMonth(start.getMonth() + 3 * count);
break;
case 5:
case 6: // 处理半年
newStart.setFullYear(current.getFullYear());
newStart.setMonth(start.getMonth() + 6 * count);
break;
case 7: // 处理年份:设置为上一年
newStart.setFullYear(current.getFullYear() - 1);
break;
case 8: // 处理年份:保持当前年份
newStart.setFullYear(current.getFullYear());
break;
default: // 默认处理:直接返回
return;
}
return newStart;
},
getRemainingFormat(online, note) {
if (!note) return null;
const startDate = this.getNoteElementValue(note, "billingDataMod", "startDate");
const endDate = this.getNoteElementValue(note, "billingDataMod", "endDate");
// 检查 startDate 和 endDate 是否有效
if (!startDate || !endDate || typeof startDate !== 'string' || typeof endDate !== 'string') {
return null; // 如果无效,返回 null 或其他错误处理逻辑
}
// 处理特殊时间格式
if (startDate.includes('0000-00-00') || endDate.includes("0000-00-00")) {
return this.formatPercents(online, this.toFixed2(100));
}
// 检查 startDate 和 endDate 是否为合法的Date
if (isNaN(new Date(startDate).getTime()) || isNaN(new Date(endDate).getTime())) {
return {
"class": "",
"style": "width: 0%",
"percent": "0"
}
}
//处理特殊时间格式
const percent = this.getRemainingPercent(startDate, endDate, note);
return this.formatPercents(online, this.toFixed2(percent));
},
getRemainingDays(endDate, note) {
// 检查 endDate 是否有效
if (!endDate || typeof endDate !== 'string') {
return null;
}
// 处理特殊时间格式
if (endDate.includes("0000-00-00")) {
return "lifetime";
}
// 检查 startDate 和 endDate 是否为合法的Date
if (isNaN(new Date(endDate).getTime())) {
return "NaN";
}
// 获取当前时间,并调整时区
const currentTime = this.getAdjustTimezone(new Date(endDate), new Date());
// 获取计费周期和自动续订日期
const billingCycle = this.getNoteElementValue(note, "billingDataMod", "cycle") || "月";
const autoEndDate = this.getAutoRenewalEndDate(
this.getNoteElementValue(note, "billingDataMod", "endDate"),
this.getBillingCycle(billingCycle)
);
// 检查 autoRenewal 状态
const autoRenewal = this.getNoteElementValue(note, "billingDataMod", "autoRenewal") == 1;
// 确定到期时间
const end = autoRenewal ? autoEndDate.date : new Date(endDate);
// 计算剩余天数
const timeDiff = end - currentTime;
const daysDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
return daysDiff;
},
getRemainingPercent(startDate, endDate, note) {
// 检查 startDate 和 endDate 是否为有效字符串并处理特殊格式
if (!startDate || !endDate || typeof startDate !== 'string' || typeof endDate !== 'string') {
return null;
}
// 处理特殊时间格式
if (startDate.includes("0000-00-00") || endDate.includes("0000-00-00")) {
return 100;
}
// 检查 startDate 和 endDate 是否为合法的Date
if (isNaN(new Date(startDate).getTime()) || isNaN(new Date(endDate).getTime())) {
return "NaN";
}
// 获取当前时间并调整时区
const now = this.getAdjustTimezone(new Date(endDate), new Date());
// 获取计费周期
const billingCycle = this.getNoteElementValue(note, "billingDataMod", "cycle") || "月";
// 自动获取结束日期
const autoEndDate = this.getAutoRenewalEndDate(
this.getNoteElementValue(note, "billingDataMod", "endDate"),
this.getBillingCycle(billingCycle)
);
// 自动获取开始日期
const autoStartDate = autoEndDate.flag == 1
? this.getAutoRenewalStartDate(autoEndDate.flag, this.getNoteElementValue(note, "billingDataMod", "startDate"), autoEndDate.check, autoEndDate.count)
: new Date(startDate);
// 计算开始和结束时间
const autoRenewal = this.getNoteElementValue(note, "billingDataMod", "autoRenewal") == 1;
const start = autoRenewal ? autoStartDate : new Date(startDate);
const end = autoRenewal ? autoEndDate.date : new Date(endDate);
// 计算剩余百分比
if (now < start) {
return 0.01; //避免当条件判断!percent被过滤
}
if (now >= end) {
return 100;
}
const totalDuration = end - start;
const elapsedDuration = now - start;
const percent = (elapsedDuration / totalDuration) * 100;
// 确保百分比在 0-100 之间
return Math.min(Math.max(percent, 0), 100);
}
}
})
+3 -14
View File
@@ -15,20 +15,9 @@
</div>
<nav id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="/"><i class="home icon"></i>{{tr "Home" }}</a></li>
<template v-if="isMobile">
<li class="dropdown">
<a data-toggle="dropdown"><i class="bi bi-gear-wide-connected" style="position:relative;top:1px;margin-right:3px;font-size:1.1rem;"></i>{{tr "Feature" }}<b class="caret"></b></a>
<ul class="dropdown-menu" style="min-width:100px;">
<li><a href="/service"><i class="rss icon"></i>{{tr "Services" }}</a></li>
<li><a href="/network"><i class="bi bi-hdd-network icon"></i>{{tr "NetworkSpiter"}}</a></li>
</ul>
</li>
</template>
<template v-else>
<li><a href="/service"><i class="rss icon"></i>{{tr "Services" }}</a></li>
<li><a href="/network"><i class="bi bi-hdd-network icon"></i>{{tr "NetworkSpiter"}}</a></li>
</template>
<li :class="isMenuActive('index')"><a href="/"><i class="home icon"></i>{{tr "Home" }}</a></li>
<li :class="isMenuActive('service')"><a href="/service"><i class="rss icon"></i>{{tr "Services" }}</a></li>
<li :class="isMenuActive('network')"><a href="/network"><i class="bi bi-hdd-network icon"></i>{{tr "NetworkSpiter"}}</a></li>
{{ if not .Conf.DisableSwitchTemplateInFrontend }}
<li class="dropdown">
<a data-toggle="dropdown"><i class="bi bi-incognito" style="position:relative;top:1px;margin-right:3px;font-size:1.2rem;vertical-align:top;"></i>{{tr "Template" }}<b class="caret"></b></a>
+13 -9
View File
@@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard"
NZ_AGENT_PATH="${NZ_BASE_PATH}/agent"
NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service"
NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard"
NZ_VERSION="v0.19.0"
NZ_VERSION="v0.19.2"
red='\033[0;31m'
green='\033[0;32m'
@@ -65,6 +65,8 @@ geo_check() {
}
pre_check() {
umask 077
## os_arch
if uname -m | grep -q 'x86_64'; then
os_arch="amd64"
@@ -288,8 +290,6 @@ install_dashboard() {
esac
fi
sudo chmod -R 700 $NZ_DASHBOARD_PATH
if [ "$IS_DOCKER_NEZHA" = 1 ]; then
install_dashboard_docker
elif [ "$IS_DOCKER_NEZHA" = 0 ]; then
@@ -375,7 +375,6 @@ install_agent() {
# 哪吒监控文件夹
sudo mkdir -p $NZ_AGENT_PATH
sudo chmod -R 700 $NZ_AGENT_PATH
echo "正在下载监控端"
if [ -z "$CN" ]; then
@@ -454,11 +453,16 @@ modify_dashboard_config() {
echo "> 修改面板配置"
if [ "$IS_DOCKER_NEZHA" = 1 ]; then
echo "正在下载 Docker 脚本"
wget -t 2 -T 60 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1
if [ $? != 0 ]; then
err "下载脚本失败,请检查本机能否连接 ${GITHUB_RAW_URL}"
return 0
if [ ! -z "$DOCKER_COMPOSE_COMMAND" ]; then
echo "正在下载 Docker 脚本"
wget -t 2 -T 60 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1
if [ $? != 0 ]; then
err "下载脚本失败,请检查本机能否连接 ${GITHUB_RAW_URL}"
return 0
fi
else
err "请手动安装 docker-compose。https://docs.docker.com/compose/install/linux/"
before_show_menu
fi
fi
+13 -9
View File
@@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard"
NZ_AGENT_PATH="${NZ_BASE_PATH}/agent"
NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service"
NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard"
NZ_VERSION="v0.19.0"
NZ_VERSION="v0.19.2"
red='\033[0;31m'
green='\033[0;32m'
@@ -65,6 +65,8 @@ geo_check() {
}
pre_check() {
umask 077
## os_arch
if uname -m | grep -q 'x86_64'; then
os_arch="amd64"
@@ -287,8 +289,6 @@ install_dashboard() {
esac
fi
sudo chmod -R 700 $NZ_DASHBOARD_PATH
if [ "$IS_DOCKER_NEZHA" = 1 ]; then
install_dashboard_docker
elif [ "$IS_DOCKER_NEZHA" = 0 ]; then
@@ -374,7 +374,6 @@ install_agent() {
# Nezha Monitoring Folder
sudo mkdir -p $NZ_AGENT_PATH
sudo chmod -R 700 $NZ_AGENT_PATH
echo "Downloading Agent"
wget -t 2 -T 60 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1
@@ -448,11 +447,16 @@ modify_dashboard_config() {
echo "> Modify Dashboard Configuration"
if [ "$IS_DOCKER_NEZHA" = 1 ]; then
echo "Download Docker Script"
wget -t 2 -T 60 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1
if [ $? != 0 ]; then
err "Script failed to get, please check if the network can link ${GITHUB_RAW_URL}"
return 0
if [ ! -z "$DOCKER_COMPOSE_COMMAND" ]; then
echo "Download Docker Script"
wget -t 2 -T 60 -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1
if [ $? != 0 ]; then
err "Script failed to get, please check if the network can link ${GITHUB_RAW_URL}"
return 0
fi
else
err "请手动安装 docker-compose。https://docs.docker.com/compose/install/linux/"
before_show_menu
fi
fi