mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-05 21:20:06 +00:00
💄 improve(ui): hotaru 主题底部进度条数据融合
This commit is contained in:
@@ -98,7 +98,6 @@
|
||||
delimiters: ['@#', '#@'],
|
||||
data: {
|
||||
servers: initData,
|
||||
pulled: false,
|
||||
cache: [],
|
||||
},
|
||||
mounted() {
|
||||
@@ -168,14 +167,13 @@
|
||||
ws.onmessage = function (evt) {
|
||||
const oldServers = statusCards.servers
|
||||
statusCards.servers = JSON.parse(evt.data)
|
||||
statusCards.pulled++
|
||||
const keys = Object.keys(statusCards.servers)
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const ns = statusCards.servers[keys[i]];
|
||||
if (!ns.Host) ns.live = false
|
||||
else {
|
||||
const lastActive = new Date(ns.LastActive).getTime()
|
||||
if (statusCards.pulled > 3 && Date.now() - lastActive > 5 * 1000) {
|
||||
if (Date.now() - lastActive > 5 * 1000) {
|
||||
ns.live = false
|
||||
} else {
|
||||
ns.live = true
|
||||
|
||||
Reference in New Issue
Block a user