v1.5.1 增强程序稳定性

This commit is contained in:
robin
2026-03-22 17:37:40 +08:00
parent afbaaa869c
commit 17e182b413
652 changed files with 22949 additions and 34397 deletions

View File

@@ -126,8 +126,8 @@
<!-- 模块 -->
<div v-for="module in teaModules">
<a class="item" :href="Tea.url(module.code)"
:class="{active:teaMenu == module.code && teaSubMenu.length == 0, separator:module.code.length == 0, expend: teaMenu == module.code}"
:style="(teaMenu == module.code && teaSubMenu.length == 0) ? 'background: rgba(230, 230, 230, 0.45) !important;' : ''"
:class="{active:teaMenu == module.code, separator:module.code.length == 0, expend: teaMenu == module.code}"
:style="(teaMenu == module.code) ? 'background: rgba(230, 230, 230, 0.45) !important;' : ''"
v-if="module.isOn !== false">
<span v-if="module.code.length > 0">
<i class="window restore outline icon" v-if="module.icon == null"></i>

View File

@@ -37,6 +37,7 @@ Tea.context(function () {
this.reloadHourlyTrafficChart = function () {
let stats = this.hourlyStats
if (stats == null || stats.length == 0) {
this.renderEmptyBarChart("hourly-traffic-chart", "暂无请求趋势数据")
return
}
this.reloadTrafficChart("hourly-traffic-chart", stats, function (args) {
@@ -47,6 +48,7 @@ Tea.context(function () {
this.reloadDailyTrafficChart = function () {
let stats = this.dailyStats
if (stats == null || stats.length == 0) {
this.renderEmptyBarChart("daily-traffic-chart", "暂无请求趋势数据")
return
}
this.reloadTrafficChart("daily-traffic-chart", stats, function (args) {
@@ -116,6 +118,7 @@ Tea.context(function () {
this.reloadTopAppsChart = function () {
if (this.topAppStats == null || this.topAppStats.length == 0) {
this.renderEmptyBarChart("top-apps-chart", "暂无应用请求数据")
return
}
let axis = teaweb.countAxis(this.topAppStats, function (v) {
@@ -140,6 +143,7 @@ Tea.context(function () {
this.reloadTopDomainsChart = function () {
if (this.topDomainStats == null || this.topDomainStats.length == 0) {
this.renderEmptyBarChart("top-domains-chart", "暂无域名请求数据")
return
}
let axis = teaweb.countAxis(this.topDomainStats, function (v) {
@@ -164,6 +168,7 @@ Tea.context(function () {
this.reloadTopNodesChart = function () {
if (this.topNodeStats == null || this.topNodeStats.length == 0) {
this.renderEmptyBarChart("top-nodes-chart", "暂无节点访问数据")
return
}
let axis = teaweb.countAxis(this.topNodeStats, function (v) {
@@ -189,4 +194,39 @@ Tea.context(function () {
})
}
this.renderEmptyBarChart = function (chartId, message) {
let chartBox = document.getElementById(chartId)
if (chartBox == null) {
return
}
let chart = teaweb.initChart(chartBox)
chart.setOption({
xAxis: {
data: [],
axisLabel: { show: false }
},
yAxis: {
axisLabel: { show: false },
splitLine: { show: true }
},
grid: {
left: 50,
top: 40,
right: 20,
bottom: 20
},
graphic: [{
type: "text",
left: "center",
top: "middle",
style: {
text: message,
fontSize: 13,
fill: "#999"
}
}],
series: []
})
chart.resize()
}
})

View File

@@ -37,6 +37,7 @@ Tea.context(function () {
this.reloadHourlyTrafficChart = function () {
let stats = this.hourlyStats
if (stats == null || stats.length == 0) {
this.renderEmptyBarChart("hourly-traffic-chart", "暂无请求趋势数据")
return
}
this.reloadTrafficChart("hourly-traffic-chart", stats, function (args) {
@@ -47,6 +48,7 @@ Tea.context(function () {
this.reloadDailyTrafficChart = function () {
let stats = this.dailyStats
if (stats == null || stats.length == 0) {
this.renderEmptyBarChart("daily-traffic-chart", "暂无请求趋势数据")
return
}
this.reloadTrafficChart("daily-traffic-chart", stats, function (args) {
@@ -116,6 +118,7 @@ Tea.context(function () {
this.reloadTopAppsChart = function () {
if (this.topAppStats == null || this.topAppStats.length == 0) {
this.renderEmptyBarChart("top-apps-chart", "暂无应用请求数据")
return
}
let axis = teaweb.countAxis(this.topAppStats, function (v) {
@@ -140,6 +143,7 @@ Tea.context(function () {
this.reloadTopDomainsChart = function () {
if (this.topDomainStats == null || this.topDomainStats.length == 0) {
this.renderEmptyBarChart("top-domains-chart", "暂无域名请求数据")
return
}
let axis = teaweb.countAxis(this.topDomainStats, function (v) {
@@ -164,6 +168,7 @@ Tea.context(function () {
this.reloadTopNodesChart = function () {
if (this.topNodeStats == null || this.topNodeStats.length == 0) {
this.renderEmptyBarChart("top-nodes-chart", "暂无节点访问数据")
return
}
let axis = teaweb.countAxis(this.topNodeStats, function (v) {
@@ -188,4 +193,40 @@ Tea.context(function () {
}
})
}
this.renderEmptyBarChart = function (chartId, message) {
let chartBox = document.getElementById(chartId)
if (chartBox == null) {
return
}
let chart = teaweb.initChart(chartBox)
chart.setOption({
xAxis: {
data: [],
axisLabel: { show: false }
},
yAxis: {
axisLabel: { show: false },
splitLine: { show: true }
},
grid: {
left: 50,
top: 40,
right: 20,
bottom: 20
},
graphic: [{
type: "text",
left: "center",
top: "middle",
style: {
text: message,
fontSize: 13,
fill: "#999"
}
}],
series: []
})
chart.resize()
}
})

View File

@@ -355,7 +355,8 @@ Tea.context(function () {
cluster.nodes.forEach(function (node) {
if (node.id == nodeId && installStatus != null) {
node.installStatus = installStatus
// 升级完成移除跟踪
// 仅在升级完成isFinished时才移除跟踪
// 不要仅凭 !isRunning 就移除,因为批量升级时排队的节点尚未开始
if (installStatus.isFinished) {
node.isUpgrading = false
let idx = that.upgradingNodeIds[moduleCode].indexOf(nodeId)