remember latency

This commit is contained in:
arm64v8a
2022-09-11 11:48:38 +08:00
parent a7fe8de6a5
commit fd13c92739
4 changed files with 30 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
#include "fmt/includes.h"
#include <QFile>
#include <QColor>
namespace NekoRay {
@@ -99,6 +100,7 @@ namespace NekoRay {
_add(new configItem("type", &type, itemType::string));
_add(new configItem("id", &id, itemType::integer));
_add(new configItem("gid", &gid, itemType::integer));
_add(new configItem("yc", &latency, itemType::integer));
// 可以不关联 bean只加载 ProxyEntity 的信息
if (bean != nullptr) {
@@ -119,6 +121,22 @@ namespace NekoRay {
}
}
QColor ProxyEntity::DisplayLatencyColor() const {
if (latency < 0) {
return Qt::red;
} else if (latency > 0) {
if (latency < 100) {
return Qt::darkGreen;
} else if (latency < 200) {
return Qt::darkYellow;
} else {
return Qt::darkRed;
}
} else {
return {};
}
}
// Profile
int ProfileManager::NewProfileID() const {