Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3d6edd602c | ||
|
2590815a6c | ||
|
c20dfdc7a3 | ||
|
96c3fd433f |
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
goarch: s390x
|
||||
- goos: linux
|
||||
goarch: arm64
|
||||
|
||||
|
||||
name: Build artifacts
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
@ -44,12 +44,12 @@ jobs:
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.23.x"
|
||||
|
||||
|
||||
- name: Build
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: '~> v2'
|
||||
version: "~> v2"
|
||||
args: build --single-target --clean --skip=validate
|
||||
|
||||
- name: Upload artifacts
|
||||
@ -72,12 +72,12 @@ jobs:
|
||||
|
||||
- name: Archive and compress binaries
|
||||
run: |
|
||||
for file in assets/*/*/*; do
|
||||
if [ -f "$file" ]; then
|
||||
chmod +x "$file"
|
||||
export fileWithoutExt=${file%.*}
|
||||
zip -jr "$fileWithoutExt.zip" "$file"
|
||||
fi
|
||||
find assets/*/*/* -type f | while read -r file; do
|
||||
chmod +x $file
|
||||
dir=$(dirname "$file")
|
||||
filename=$(basename "$file")
|
||||
fileWithoutExt="${filename%.*}"
|
||||
zip -jr "$dir/$fileWithoutExt.zip" "$file"
|
||||
done
|
||||
|
||||
- name: Release
|
||||
@ -113,7 +113,7 @@ jobs:
|
||||
name: Release Docker images
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@ -130,7 +130,7 @@ jobs:
|
||||
export TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})
|
||||
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
|
||||
id: extract_branch
|
||||
|
||||
|
||||
- name: Log into GHCR
|
||||
uses: docker/login-action@master
|
||||
with:
|
||||
|
1
.github/workflows/sync-release.yml
vendored
1
.github/workflows/sync-release.yml
vendored
@ -6,6 +6,7 @@ on:
|
||||
jobs:
|
||||
sync-release-to-gitee:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
|
||||
steps:
|
||||
|
@ -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"> <img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge"> <img src="https://img.shields.io/badge/Installer-v0.20.2-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"> <img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge">
|
||||
<br>
|
||||
<br>
|
||||
<p>:trollface: <b>Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.</b></p>
|
||||
|
3
resource/l10n/en-US.toml
vendored
3
resource/l10n/en-US.toml
vendored
@ -750,3 +750,6 @@ other = "d"
|
||||
|
||||
[CustomNameservers]
|
||||
other = "Custom Public DNS Nameservers for DDNS (separate with comma)"
|
||||
|
||||
[Plan]
|
||||
other = "Plan"
|
||||
|
3
resource/l10n/es-ES.toml
vendored
3
resource/l10n/es-ES.toml
vendored
@ -750,3 +750,6 @@ other = "d"
|
||||
|
||||
[CustomNameservers]
|
||||
other = "Servidores DNS públicos personalizados para DDNS (separar con coma)"
|
||||
|
||||
[Plan]
|
||||
other = "Plan"
|
||||
|
3
resource/l10n/zh-CN.toml
vendored
3
resource/l10n/zh-CN.toml
vendored
@ -750,3 +750,6 @@ other = "天"
|
||||
|
||||
[CustomNameservers]
|
||||
other = "自定义DDNS使用的公共DNS服务器(逗号分隔)"
|
||||
|
||||
[Plan]
|
||||
other = "套餐"
|
||||
|
3
resource/l10n/zh-TW.toml
vendored
3
resource/l10n/zh-TW.toml
vendored
@ -750,3 +750,6 @@ other = "天"
|
||||
|
||||
[CustomNameservers]
|
||||
other = "自訂DDNS使用的公共DNS伺服器(逗號分隔)"
|
||||
|
||||
[Plan]
|
||||
other = "套餐"
|
||||
|
@ -46,8 +46,6 @@ body[theme="dark"] .content {
|
||||
background-color: rgba(28, 29, 38, 1);
|
||||
border: none;
|
||||
box-shadow: rgba(0, 0, 0, 0.5) 0 0.625em 2em;
|
||||
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 0.625em 2em;
|
||||
box-shadow: rgba(0, 0, 0, 0.5) 0 0.625em 2em;
|
||||
}
|
||||
|
||||
body[theme="dark"] .table {
|
||||
@ -90,6 +88,11 @@ body[theme="dark"] .table > tbody > tr.expandRow.odd > td:before {
|
||||
body[theme="dark"] .table > tbody > tr.expandRow.even > td:before {
|
||||
background-color: rgba(28, 29, 38, 1);
|
||||
}
|
||||
|
||||
body[theme="dark"] .plan {
|
||||
background-image: none;
|
||||
background-color: rgba(255, 255, 255, 0.075);
|
||||
}
|
||||
/* expandRow展开部分样式结束 */
|
||||
|
||||
body[theme="dark"] .progress {
|
||||
|
@ -74,8 +74,6 @@ body[theme="dark"] .content {
|
||||
background-color: rgba(28, 29, 38, 0.8);
|
||||
border: none;
|
||||
box-shadow: rgba(0, 0, 0, 0.5) 0 0.625em 2em;
|
||||
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 0.625em 2em;
|
||||
box-shadow: rgba(0, 0, 0, 0.5) 0 0.625em 2em;
|
||||
}
|
||||
|
||||
body[theme="dark"] .table > thead > tr.node-group-tag > th,
|
||||
|
@ -69,8 +69,6 @@ body[theme="light"] .content {
|
||||
background: rgba(255, 255, 255, 1);
|
||||
color: rgba(0, 0, 0, 0.87);
|
||||
border: 1px #cecece solid;
|
||||
-webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, .1);
|
||||
-moz-box-shadow: 0 1px 10px rgba(0, 0, 0, .1);
|
||||
box-shadow: 0 1px 10px rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
@ -116,6 +114,12 @@ body[theme="light"] tr.odd.expandRow > :hover {
|
||||
background: #ffffff !important;
|
||||
}
|
||||
|
||||
body[theme="light"] .plan {
|
||||
color: #000000;
|
||||
background-color: #f5f5f5;
|
||||
box-shadow: inset 0 -0.5px 2px rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
body[theme="light"] .progress-bar {
|
||||
color: #000000;
|
||||
}
|
||||
|
@ -104,6 +104,11 @@ body[theme="light"] .table > tbody > tr.expandRow.odd > td:before {
|
||||
body[theme="light"] .table > tbody > tr.expandRow.even > td:before {
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
body[theme="light"] .plan {
|
||||
background-image: none;
|
||||
background-color: rgba(0, 0, 0, 0.015);
|
||||
}
|
||||
/* expandRow展开部分样式结束 */
|
||||
|
||||
body[theme="light"] .progress {
|
||||
|
23
resource/static/theme-server-status/css/main.css
vendored
23
resource/static/theme-server-status/css/main.css
vendored
@ -237,8 +237,8 @@ tr.accordion-toggle{
|
||||
}
|
||||
|
||||
.node-cell.network {
|
||||
min-width: 100px;
|
||||
max-width: 100px;
|
||||
min-width: 110px;
|
||||
max-width: 110px;
|
||||
}
|
||||
|
||||
.node-cell.traffic {
|
||||
@ -268,6 +268,22 @@ tr.accordion-toggle{
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.plan {
|
||||
display: inline-block;
|
||||
font-size: 85%;
|
||||
margin-right: 2px;
|
||||
padding: 2px 5px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.network-route, .extra {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.last {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.temp-detail {
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -557,6 +573,9 @@ footer p {
|
||||
min-width: 75px;
|
||||
max-width: 75px;
|
||||
}
|
||||
.plan {
|
||||
display: inline;
|
||||
}
|
||||
.accordian-body {
|
||||
margin: 5px 0px 5px 10px;
|
||||
}
|
||||
|
2
resource/template/component/server.html
vendored
2
resource/template/component/server.html
vendored
@ -53,7 +53,7 @@
|
||||
<label>{{tr "LinuxOneKeyInstall"}}</label>
|
||||
<div class="ui message">
|
||||
{{if .Conf.GRPCHost}}
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod
|
||||
curl -L https://raw.githubusercontent.com/nezhahq/scripts/main/install.sh -o nezha.sh && chmod
|
||||
+x nezha.sh && ./nezha.sh install_agent <code class="command">{{.Conf.GRPCHost}}</code> <code
|
||||
class="command">{{if .Conf.ProxyGRPCPort}}{{.Conf.ProxyGRPCPort}}{{else}}{{.Conf.GRPCPort}}{{end}}</code> <code
|
||||
class="command hostSecret"></code> <code class="command">{{if .Conf.TLS}}--tls{{end}}</code>
|
||||
|
@ -55,17 +55,17 @@
|
||||
</td>
|
||||
<td>
|
||||
<button class="ui icon green mini button"
|
||||
data-clipboard-text="{{if $.Conf.GRPCHost}}{{if eq $.Conf.Language "zh-CN"}}curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh{{else}}curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh{{end}} -o nezha.sh && chmod +x nezha.sh && ./nezha.sh install_agent {{$.Conf.GRPCHost}} {{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"
|
||||
data-clipboard-text="{{if $.Conf.GRPCHost}}{{if eq $.Conf.Language "zh-CN"}}curl -L https://raw.githubusercontent.com/nezhahq/scripts/main/install.sh{{else}}curl -L https://raw.githubusercontent.com/nezhahq/scripts/main/install_en.sh{{end}} -o nezha.sh && chmod +x nezha.sh && ./nezha.sh install_agent {{$.Conf.GRPCHost}} {{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"
|
||||
data-tooltip="{{tr "ClickToCopy"}}">
|
||||
<i class="linux icon"></i>
|
||||
</button>
|
||||
<button class="ui icon green mini button"
|
||||
data-clipboard-text="{{if $.Conf.GRPCHost}}[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12;set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/naiba/nezha/master/script/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1 {{$.Conf.GRPCHost}}:{{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"
|
||||
data-clipboard-text="{{if $.Conf.GRPCHost}}[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12;set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/nezhahq/scripts/main/extras/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1 {{$.Conf.GRPCHost}}:{{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"
|
||||
data-tooltip="{{tr "ClickToCopy"}}">
|
||||
<i class="windows icon"></i>
|
||||
</button>
|
||||
<button class="ui icon green mini button"
|
||||
data-clipboard-text="{{if $.Conf.GRPCHost}}curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.command -o nezha.command && chmod +x nezha.command && sudo ./nezha.command install_agent {{$.Conf.GRPCHost}} {{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"
|
||||
data-clipboard-text="{{if $.Conf.GRPCHost}}curl -L https://raw.githubusercontent.com/nezhahq/scripts/main/extras/install.command -o nezha.command && chmod +x nezha.command && sudo ./nezha.command install_agent {{$.Conf.GRPCHost}} {{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"
|
||||
data-tooltip="{{tr "ClickToCopy"}}">
|
||||
<i class="apple icon"></i>
|
||||
</button>
|
||||
|
@ -28,8 +28,8 @@
|
||||
</span>
|
||||
</aside>
|
||||
<template v-if="semiTransparent">
|
||||
<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">
|
||||
<link rel="stylesheet" href="/static/theme-server-status/css/light.plus.css?v20241103">
|
||||
<link rel="stylesheet" href="/static/theme-server-status/css/dark.plus.css?v20241103">
|
||||
</template>
|
||||
</div>
|
||||
{{if ts .CustomCode}}{{.CustomCode|safe}}{{end}}
|
||||
|
@ -26,9 +26,9 @@
|
||||
<script src="https://unpkg.com/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
|
||||
<script src="https://unpkg.com/vue@2.6.14/dist/vue.min.js"></script>
|
||||
<script src="https://unpkg.com/echarts@5.5.0/dist/echarts.min.js"></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">
|
||||
<link rel="stylesheet" href="/static/theme-server-status/css/main.css?v20241103">
|
||||
<link rel="stylesheet" href="/static/theme-server-status/css/dark.css?v20241103">
|
||||
<link rel="stylesheet" href="/static/theme-server-status/css/light.css?v20241103">
|
||||
<script src="/static/theme-server-status/js/mixin.js?v20240915"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -35,8 +35,8 @@
|
||||
<span class="node-cell-os-text">@#getPlatformName(node.os) === '' && node.stateuptime > 0 ? 'linux' : getPlatformName(node.os)#@</span>
|
||||
</td>
|
||||
<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>
|
||||
<i :class="'fi fi-' + (node.stateuptime > 0 ? (node.location || 'un') : '')"></i>
|
||||
<span class="node-cell-location-text text-uppercase">@#node.stateuptime > 0 ? (node.location || 'UN') : ''#@</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">
|
||||
@ -88,6 +88,45 @@
|
||||
<td colspan="16">
|
||||
<div class="accordian-body collapse" :id="'rt'+node.ID">
|
||||
<div style="display: flex;left-items: center;justify-content: center;flex-direction: column; max-width: 89vw">
|
||||
<span v-if="node.additional && Object.keys(node.additional.plan).length > 0" class="node-cell-expand">
|
||||
<span class="node-cell-expand-label">{{tr "Plan"}}:</span>
|
||||
<span v-if="node.additional && Object.keys(node.additional.price).length > 0" class="plan price">
|
||||
<span v-if="node.additional.price.amount == 0">FREE</span>
|
||||
<span v-else-if="node.additional.price.amount == -1">PAYG</span>
|
||||
<span v-else><i class="bi bi-cash-stack"></i> @#node.additional.price.amount#@@#(node.additional.price.cycle ? '/' + node.additional.price.cycle : '')#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.remaining.endDate" class="plan enddate">
|
||||
<span v-if="node.additional.remaining.days == 'lifetime'">{{tr "Lifetime"}}</span>
|
||||
<span v-else-if="node.additional.remaining.days < 0">{{tr "Expired"}}</span>
|
||||
<span v-else><i class="bi bi-clock-history"></i> @#node.additional.remaining.endDate.toISOString().split('T')[0]#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.bandwidth" class="plan bandwidth">
|
||||
<i class="bi bi-speedometer2"></i>
|
||||
<span>@#node.additional.plan.bandwidth#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.trafficVol" class="plan traffics">
|
||||
<i v-if="node.additional && node.additional.plan.trafficType == 1" class="bi bi-arrow-up"></i>
|
||||
<i v-else-if="node.additional && node.additional.plan.trafficType == 3" class="bi bi-arrows-collapse"></i>
|
||||
<i v-else class="bi bi-arrow-down-up"></i>
|
||||
<span>@#node.additional.plan.trafficVol#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.ipv4" class="plan ipv4">
|
||||
<span>IPv4</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.ipv6" class="plan ipv6">
|
||||
<span>IPv6</span>
|
||||
</span>
|
||||
<template v-if="node.additional && node.additional.plan.networkRoute.length>0" v-for="(item, index) in node.additional.plan.networkRoute" :key="index">
|
||||
<span class="plan network-route" :class="{ last: index === node.additional.plan.networkRoute.length - 1 }">
|
||||
<span>@#item#@</span>
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="node.additional && node.additional.plan.extra.length>0" v-for="(item, index) in node.additional.plan.extra" :key="index">
|
||||
<span class="plan extra" :class="{ last: index === node.additional.plan.extra.length - 1 }">
|
||||
<span>@#item#@</span>
|
||||
</span>
|
||||
</template>
|
||||
</span>
|
||||
<span class="node-cell-expand">
|
||||
<span class="node-cell-expand-label">{{tr "Platform"}}:</span>
|
||||
<span v-if="node.host.Platform">@#node.host.Platform#@@#node.host.PlatformVersion ? '-' + node.host.PlatformVersion : ''#@</span>
|
||||
@ -120,10 +159,7 @@
|
||||
</span>
|
||||
<span class="node-cell-expand">
|
||||
<span class="node-cell-expand-label">{{tr "NetTransfer"}}:</span>
|
||||
<i class="arrow alternate circle down outline icon"
|
||||
style="margin: 0"></i>@#formatByteSize(node.state.NetInTransfer)#@
|
||||
<i class="arrow alternate circle up outline icon"
|
||||
style="margin: 0"></i>@#formatByteSize(node.state.NetOutTransfer)#@
|
||||
IN @#formatByteSize(node.state.NetInTransfer)#@ / OUT @#formatByteSize(node.state.NetOutTransfer)#@
|
||||
</span>
|
||||
<span class="node-cell-expand load">
|
||||
<span class="node-cell-expand-label">{{tr "Load"}}:</span>
|
||||
|
@ -38,8 +38,8 @@
|
||||
<span class="node-cell-os-text">@#getPlatformName(node.os) === '' && node.stateuptime > 0 ? 'linux' : getPlatformName(node.os)#@</span>
|
||||
</td>
|
||||
<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>
|
||||
<i :class="'fi fi-' + (node.stateuptime > 0 ? (node.location || 'un') : '')"></i>
|
||||
<span class="node-cell-location-text text-uppercase">@#node.stateuptime > 0 ? (node.location || 'UN') : ''#@</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">
|
||||
@ -91,6 +91,45 @@
|
||||
<td colspan="16">
|
||||
<div class="accordian-body collapse" :id="'rt'+node.ID">
|
||||
<div style="display: flex;left-items: center;justify-content: center;flex-direction: column; max-width: 89vw">
|
||||
<span v-if="node.additional && Object.keys(node.additional.plan).length > 0" class="node-cell-expand">
|
||||
<span class="node-cell-expand-label">{{tr "Plan"}}:</span>
|
||||
<span v-if="node.additional && Object.keys(node.additional.price).length > 0" class="plan price">
|
||||
<span v-if="node.additional.price.amount == 0">FREE</span>
|
||||
<span v-else-if="node.additional.price.amount == -1">PAYG</span>
|
||||
<span v-else><i class="bi bi-cash-stack"></i> @#node.additional.price.amount#@@#(node.additional.price.cycle ? '/' + node.additional.price.cycle : '')#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.remaining.endDate" class="plan enddate">
|
||||
<span v-if="node.additional.remaining.days == 'lifetime'">{{tr "Lifetime"}}</span>
|
||||
<span v-else-if="node.additional.remaining.days < 0">{{tr "Expired"}}</span>
|
||||
<span v-else><i class="bi bi-clock-history"></i> @#node.additional.remaining.endDate.toISOString().split('T')[0]#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.bandwidth" class="plan bandwidth">
|
||||
<i class="bi bi-speedometer2"></i>
|
||||
<span>@#node.additional.plan.bandwidth#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.trafficVol" class="plan traffics">
|
||||
<i v-if="node.additional && node.additional.plan.trafficType == 1" class="bi bi-arrow-up"></i>
|
||||
<i v-else-if="node.additional && node.additional.plan.trafficType == 3" class="bi bi-arrows-collapse"></i>
|
||||
<i v-else class="bi bi-arrow-down-up"></i>
|
||||
<span>@#node.additional.plan.trafficVol#@</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.ipv4" class="plan ipv4">
|
||||
<span>IPv4</span>
|
||||
</span>
|
||||
<span v-if="node.additional && node.additional.plan.ipv6" class="plan ipv6">
|
||||
<span>IPv6</span>
|
||||
</span>
|
||||
<template v-if="node.additional && node.additional.plan.networkRoute.length>0" v-for="(item, index) in node.additional.plan.networkRoute" :key="index">
|
||||
<span class="plan network-route" :class="{ last: index === node.additional.plan.networkRoute.length - 1 }">
|
||||
<span>@#item#@</span>
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="node.additional && node.additional.plan.extra.length>0" v-for="(item, index) in node.additional.plan.extra" :key="index">
|
||||
<span class="plan extra" :class="{ last: index === node.additional.plan.extra.length - 1 }">
|
||||
<span>@#item#@</span>
|
||||
</span>
|
||||
</template>
|
||||
</span>
|
||||
<span class="node-cell-expand">
|
||||
<span class="node-cell-expand-label">{{tr "Platform"}}:</span>
|
||||
<span v-if="node.host.Platform">@#node.host.Platform#@@#node.host.PlatformVersion ? '-' + node.host.PlatformVersion : ''#@</span>
|
||||
@ -123,10 +162,7 @@
|
||||
</span>
|
||||
<span class="node-cell-expand">
|
||||
<span class="node-cell-expand-label">{{tr "NetTransfer"}}:</span>
|
||||
<i class="arrow alternate circle down outline icon"
|
||||
style="margin: 0"></i>@#formatByteSize(node.state.NetInTransfer)#@
|
||||
<i class="arrow alternate circle up outline icon"
|
||||
style="margin: 0"></i>@#formatByteSize(node.state.NetOutTransfer)#@
|
||||
IN @#formatByteSize(node.state.NetInTransfer)#@ / OUT @#formatByteSize(node.state.NetOutTransfer)#@
|
||||
</span>
|
||||
<span class="node-cell-expand load">
|
||||
<span class="node-cell-expand-label">{{tr "Load"}}:</span>
|
||||
|
90
resource/template/theme-server-status/home.html
vendored
90
resource/template/theme-server-status/home.html
vendored
@ -117,43 +117,54 @@
|
||||
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");
|
||||
//处理异常
|
||||
if (!server.PublicNote) return;
|
||||
|
||||
// 初始化节点
|
||||
nodes[server.ID] = {
|
||||
"remaining": {},
|
||||
"price": {}
|
||||
};
|
||||
// 初始化节点
|
||||
nodes[server.ID] = {
|
||||
"remaining": {},
|
||||
"price": {},
|
||||
"plan": {}
|
||||
};
|
||||
|
||||
if (remainingFormat) {
|
||||
nodes[server.ID].remaining.format = remainingFormat;
|
||||
}
|
||||
// 处理 billingDataMod 的 remaining 配置
|
||||
const remainingEndDate = this.getRemainingDays(this.getNoteElementValue(server.PublicNote, "billingDataMod", "endDate"), server.PublicNote, 1);
|
||||
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
|
||||
);
|
||||
// 设置 remaining 属性
|
||||
if (remainingEndDate) nodes[server.ID].remaining.endDate = remainingEndDate;
|
||||
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 (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;
|
||||
}
|
||||
}
|
||||
// 处理 billingDataMod 的 price 配置
|
||||
const priceAmount = this.getNoteElementValue(server.PublicNote, "billingDataMod", "amount");
|
||||
const priceCycle = this.getNoteElementValue(server.PublicNote, "billingDataMod", "cycle");
|
||||
// 设置 price 属性
|
||||
if (priceAmount) nodes[server.ID].price.amount = priceAmount;
|
||||
if (priceCycle && priceAmount) nodes[server.ID].price.cycle = priceCycle;
|
||||
|
||||
// 处理 planDataMod 配置
|
||||
const planBandwidth = this.getNoteElementValue(server.PublicNote, "planDataMod", "bandwidth");
|
||||
const planTrafficVol = this.getNoteElementValue(server.PublicNote, "planDataMod", "trafficVol");
|
||||
const planTrafficType = this.getNoteElementValue(server.PublicNote, "planDataMod", "trafficType");
|
||||
const planIPv4 = this.getNoteElementValue(server.PublicNote, "planDataMod", "IPv4");
|
||||
const planIPv6 = this.getNoteElementValue(server.PublicNote, "planDataMod", "IPv6");
|
||||
const planNetworkRoute = this.getNoteElementValue(server.PublicNote, "planDataMod", "networkRoute");
|
||||
const planExtra = this.getNoteElementValue(server.PublicNote, "planDataMod", "extra");
|
||||
// 设置 plan 属性
|
||||
if (planBandwidth) nodes[server.ID].plan.bandwidth = planBandwidth;
|
||||
if (planTrafficVol) nodes[server.ID].plan.trafficVol = planTrafficVol;
|
||||
if (planTrafficType) nodes[server.ID].plan.trafficType = planTrafficType;
|
||||
if (planIPv4) nodes[server.ID].plan.ipv4 = planIPv4 >= 1;
|
||||
if (planIPv6) nodes[server.ID].plan.ipv6 = planIPv6 >= 1;
|
||||
if (planNetworkRoute) nodes[server.ID].plan.networkRoute = planNetworkRoute.split(',');
|
||||
if (planExtra) nodes[server.ID].plan.extra = planExtra.split(',');
|
||||
});
|
||||
return nodes;
|
||||
},
|
||||
@ -859,7 +870,7 @@
|
||||
const expiration = new Date(endDate);
|
||||
const current = this.getAdjustTimezone(new Date(endDate), new Date());
|
||||
|
||||
// 如果 expiration 无效,返回 null 并记录日志
|
||||
// 如果 expiration 无效,记录日志
|
||||
if (isNaN(expiration.getTime())) {
|
||||
console.log("getAutoRenewalEndDate: Invalid expiration format");
|
||||
}
|
||||
@ -1055,7 +1066,7 @@
|
||||
return this.formatPercents(online, this.toFixed2(percent));
|
||||
|
||||
},
|
||||
getRemainingDays(endDate, note) {
|
||||
getRemainingDays(endDate, note, type) {
|
||||
// 检查 endDate 是否有效
|
||||
if (!endDate || typeof endDate !== 'string') {
|
||||
return null;
|
||||
@ -1066,9 +1077,9 @@
|
||||
return "lifetime";
|
||||
}
|
||||
|
||||
// 检查 startDate 和 endDate 是否为合法的Date
|
||||
// 检查 endDate 是否为合法的Date
|
||||
if (isNaN(new Date(endDate).getTime())) {
|
||||
return "NaN";
|
||||
return type === 1 ? null : "NaN";
|
||||
}
|
||||
|
||||
// 获取当前时间,并调整时区
|
||||
@ -1087,6 +1098,9 @@
|
||||
// 确定到期时间
|
||||
const end = autoRenewal ? autoEndDate.date : new Date(endDate);
|
||||
|
||||
// 直接返回处理后的到期时间
|
||||
if (type === 1) return end;
|
||||
|
||||
// 计算剩余天数
|
||||
const timeDiff = end - currentTime;
|
||||
const daysDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
|
||||
|
@ -11,11 +11,11 @@
|
||||
<input type="text" id="dropdown-search" class="form-control" placeholder="Search...">
|
||||
</li>
|
||||
<li class="dropdown-item" v-for="server in servers" @click="showCharts(server.ID)">
|
||||
<a><i :class="'fi fi-' + (server.Host.CountryCode || 'rb')"></i> @#server.Name#@ <i v-if="server.ID == currentServerId" class="check icon"></i></a>
|
||||
<a><i :class="'fi fi-' + (server.Host.CountryCode || 'un')"></i> @#server.Name#@ <i v-if="server.ID == currentServerId" class="check icon"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="chartTitle" @click="showCharts(nextServerId)"><i class="chartCountryCode" :class="'fi fi-' + chartCountryCode"></i> @#chartTitle#@</div>
|
||||
<div v-if="chartTitle" class="chartTitle" @click="showCharts(nextServerId)"><i class="chartCountryCode" :class="'fi fi-' + chartCountryCode"></i> @#chartTitle#@</div>
|
||||
<div id="chartbox" style="width:100%;height:auto;"></div>
|
||||
</div>
|
||||
{{template "theme-server-status/footer" .}}
|
||||
@ -332,7 +332,7 @@
|
||||
},
|
||||
getServerCountryCode(id){
|
||||
const result = this.servers.find(item => item.ID == id);
|
||||
return result.Host.CountryCode ? result.Host.CountryCode : 'rb';
|
||||
return result.Host.CountryCode ? result.Host.CountryCode : 'un';
|
||||
},
|
||||
getNextServerId(id) {
|
||||
const currentIndex = this.servers.findIndex(item => item.ID === id);
|
||||
|
@ -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.20.2"
|
||||
NZ_VERSION="v0.20.3"
|
||||
|
||||
red='\033[0;31m'
|
||||
green='\033[0;32m'
|
||||
@ -214,13 +214,18 @@ select_version() {
|
||||
update_script() {
|
||||
echo "> 更新脚本"
|
||||
|
||||
curl -sL https://${GITHUB_RAW_URL}/script/install.sh -o /tmp/nezha.sh
|
||||
new_version=$(grep "NZ_VERSION" /tmp/nezha.sh | head -n 1 | awk -F "=" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
||||
if [ -z "$new_version" ]; then
|
||||
echo "脚本获取失败,请检查本机能否链接 https://${GITHUB_RAW_URL}/script/install.sh"
|
||||
return 1
|
||||
#curl -sL https://${GITHUB_RAW_URL}/script/install.sh -o /tmp/nezha.sh
|
||||
#new_version=$(grep "NZ_VERSION" /tmp/nezha.sh | head -n 1 | awk -F "=" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
||||
#if [ -z "$new_version" ]; then
|
||||
# echo "脚本获取失败,请检查本机能否链接 https://${GITHUB_RAW_URL}/script/install.sh"
|
||||
# return 1
|
||||
#fi
|
||||
#echo "当前最新版本为: ${new_version}"
|
||||
if [ -z "$CN" ]; then
|
||||
curl -sL https://raw.githubusercontent.com/nezhahq/scripts/main/install.sh -o /tmp/nezha.sh
|
||||
else
|
||||
curl -sL https://gitee.com/naibahq/scripts/raw/main/install.sh -o /tmp/nezha.sh
|
||||
fi
|
||||
echo "当前最新版本为: ${new_version}"
|
||||
mv -f /tmp/nezha.sh ./nezha.sh && chmod a+x ./nezha.sh
|
||||
|
||||
echo "3s后执行新脚本"
|
||||
@ -621,6 +626,7 @@ restart_and_update_standalone() {
|
||||
fi
|
||||
|
||||
sudo wget -qO $NZ_DASHBOARD_PATH/app.zip "$NZ_DASHBOARD_URL" >/dev/null 2>&1 && sudo unzip -qq -o $NZ_DASHBOARD_PATH/app.zip -d $NZ_DASHBOARD_PATH && sudo mv $NZ_DASHBOARD_PATH/dashboard-linux-$os_arch $NZ_DASHBOARD_PATH/app && sudo rm $NZ_DASHBOARD_PATH/app.zip
|
||||
sudo chmod +x $NZ_DASHBOARD_PATH/app
|
||||
|
||||
if [ "$os_alpine" != 1 ]; then
|
||||
sudo systemctl enable nezha-dashboard
|
||||
|
@ -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.20.2"
|
||||
NZ_VERSION="v0.20.3"
|
||||
|
||||
red='\033[0;31m'
|
||||
green='\033[0;32m'
|
||||
@ -213,13 +213,18 @@ select_version() {
|
||||
update_script() {
|
||||
echo "> Update Script"
|
||||
|
||||
curl -sL https://${GITHUB_RAW_URL}/script/install_en.sh -o /tmp/nezha.sh
|
||||
new_version=$(grep "NZ_VERSION" /tmp/nezha.sh | head -n 1 | awk -F "=" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
||||
if [ -z "$new_version" ]; then
|
||||
echo "Script failed to get, please check if the network can link https://${GITHUB_RAW_URL}/script/install.sh"
|
||||
return 1
|
||||
#curl -sL https://${GITHUB_RAW_URL}/script/install_en.sh -o /tmp/nezha.sh
|
||||
#new_version=$(grep "NZ_VERSION" /tmp/nezha.sh | head -n 1 | awk -F "=" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
||||
#if [ -z "$new_version" ]; then
|
||||
# echo "Script failed to get, please check if the network can link https://${GITHUB_RAW_URL}/script/install.sh"
|
||||
# return 1
|
||||
#fi
|
||||
#echo "The current latest version is: ${new_version}"
|
||||
if [ -z "$CN" ]; then
|
||||
curl -sL https://raw.githubusercontent.com/nezhahq/scripts/main/install_en.sh -o /tmp/nezha.sh
|
||||
else
|
||||
curl -sL https://gitee.com/naibahq/scripts/raw/main/install_en.sh -o /tmp/nezha.sh
|
||||
fi
|
||||
echo "The current latest version is: ${new_version}"
|
||||
mv -f /tmp/nezha.sh ./nezha.sh && chmod a+x ./nezha.sh
|
||||
|
||||
echo "Execute new script after 3s"
|
||||
@ -620,6 +625,7 @@ restart_and_update_standalone() {
|
||||
fi
|
||||
|
||||
sudo wget -qO $NZ_DASHBOARD_PATH/app.zip "$NZ_DASHBOARD_URL" >/dev/null 2>&1 && sudo unzip -qq -o $NZ_DASHBOARD_PATH/app.zip -d $NZ_DASHBOARD_PATH && sudo mv $NZ_DASHBOARD_PATH/dashboard-linux-$os_arch $NZ_DASHBOARD_PATH/app && sudo rm $NZ_DASHBOARD_PATH/app.zip
|
||||
sudo chmod +x $NZ_DASHBOARD_PATH/app
|
||||
|
||||
if [ "$os_alpine" != 1 ]; then
|
||||
sudo systemctl enable nezha-dashboard
|
||||
|
Loading…
x
Reference in New Issue
Block a user