mirror of
https://github.com/CrazyJasonwell/clash-verge-rev.git
synced 2026-10-20 10:18:32 +08:00
feat: adjust the delay display interval and color, close #836
This commit is contained in:
1 parent
9888f2a322
commit
fbf230cd01
3 files changed
+19
-16
No files matched your search
@@ -107,6 +107,21 @@ class DelayManager {
|
||||
for (let i = 0; i < concurrency; ++i) help();
|
||||
});
|
||||
}
|
||||
|
||||
formatDelay(delay: number) {
|
||||
if (delay < 0) return "-";
|
||||
if (delay > 1e5) return "Error";
|
||||
if (delay >= 10000) return "Timeout"; // 10s
|
||||
return `${delay}`;
|
||||
}
|
||||
|
||||
formatDelayColor(delay: number) {
|
||||
if (delay <= 0) return "text.secondary";
|
||||
if (delay >= 10000) return "error.main";
|
||||
if (delay > 500) return "warning.main";
|
||||
if (delay > 100) return "text.secondary";
|
||||
return "success.main";
|
||||
}
|
||||
}
|
||||
|
||||
export default new DelayManager();
|
||||
Reference in new issue
Block a user