常规更新
This commit is contained in:
@@ -24,6 +24,7 @@ json group_to_json(const Group_Switch_State& group) {
|
||||
json result;
|
||||
result["name"] = group.name;
|
||||
result["type"] = group.type;
|
||||
result["proxies"] = group.proxies;
|
||||
result["candidates"] = group.candidates;
|
||||
result["current"] = group.current;
|
||||
result["best_candidate"] = group.best_candidate;
|
||||
@@ -180,8 +181,8 @@ std::string enum_label(const json& options, std::string_view name, std::string_v
|
||||
}
|
||||
json enum_options_to_json() {
|
||||
json result;
|
||||
result["alive_category"] = json::array({enum_item("alive", "alive"), enum_item("dead", "dead")});
|
||||
result["stability_category"] = json::array({enum_item("excellent", "稳定 ≥ 80"), enum_item("normal", "稳定 50~80"), enum_item("poor", "稳定 < 50")});
|
||||
result["alive_category"] = json::array({enum_item("alive", "alive"), enum_item("dead", "dead"), enum_item("special", "特殊")});
|
||||
result["stability_category"] = json::array({enum_item("excellent", "稳定 ≥ 80"), enum_item("normal", "稳定 50~80"), enum_item("poor", "稳定 < 50"), enum_item("unknown", "特殊/未知")});
|
||||
result["rate_category"] = json::array({enum_item("excellent", "通过率 ≥ 95%"), enum_item("usable", "通过率 80~95%"), enum_item("poor", "通过率 < 80%"), enum_item("unknown", "未检测")});
|
||||
result["ai_category"] = json::array({enum_item("high", "AI 4~5 星"), enum_item("usable", "AI 3 星"), enum_item("weak", "AI < 3 星"), enum_item("unknown", "AI 未知")});
|
||||
result["ip_type_category"] = json::array({enum_item("idc", "IDC/机房"), enum_item("residential", "家庭宽带"), enum_item("mobile", "移动网络"), enum_item("education", "教育网络"), enum_item("other", "其他"), enum_item("unknown", "未知")});
|
||||
@@ -503,6 +504,7 @@ void reload_switch_groups_locked(Service_State& service) {
|
||||
}
|
||||
group.name = def.name;
|
||||
group.type = def.type;
|
||||
group.proxies = def.proxies;
|
||||
group.managed = should_manage_group(service.config.auto_switch, def);
|
||||
group.strategy = group_switch_strategy(service.config.auto_switch, group.name);
|
||||
group.candidates.clear();
|
||||
|
||||
Reference in New Issue
Block a user