fix(watch): 指标进度条 ≥80% 变红,到期倒计时归零加固
进度条阈值由 70/90 改为 80% 红色;remaining_sec≤0 时立即 refreshPins。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -41,3 +41,7 @@ bash scripts/local_verify.sh
|
||||
```
|
||||
|
||||
浏览器:监测槽选 30 分默认、切换时长、进度条与负载 chip 显示正常。
|
||||
|
||||
## 补充(进度条阈值)
|
||||
|
||||
- CPU/内存/硬盘进度条:**≥80% 变红**,低于 80% 为绿色(`WatchMetricBar.vue`)。
|
||||
|
||||
@@ -5,8 +5,7 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
function barColor(v: number): string {
|
||||
if (v >= 90) return 'error'
|
||||
if (v >= 70) return 'warning'
|
||||
if (v >= 80) return 'error'
|
||||
return 'success'
|
||||
}
|
||||
|
||||
|
||||
@@ -85,11 +85,14 @@ function tickCountdown() {
|
||||
let shouldRefresh = false
|
||||
for (const slot of slots.value) {
|
||||
if (slot.empty || slot.monitoring_enabled === false) continue
|
||||
if (slot.remaining_sec != null && slot.remaining_sec > 0) {
|
||||
slot.remaining_sec -= 1
|
||||
if (slot.remaining_sec <= 0) {
|
||||
shouldRefresh = true
|
||||
}
|
||||
if (slot.remaining_sec == null) continue
|
||||
if (slot.remaining_sec <= 0) {
|
||||
shouldRefresh = true
|
||||
continue
|
||||
}
|
||||
slot.remaining_sec -= 1
|
||||
if (slot.remaining_sec <= 0) {
|
||||
shouldRefresh = true
|
||||
}
|
||||
}
|
||||
if (shouldRefresh) {
|
||||
|
||||
Reference in New Issue
Block a user