fix: Add cn_SITE to bypass chinese and sort rule-set suggestions in routing section

This commit is contained in:
unknown 2024-07-09 11:20:26 +03:30
parent 17484cddcd
commit d447a6dceb
No known key found for this signature in database
GPG Key ID: C2CA486E4F771093
2 changed files with 6 additions and 1 deletions

View File

@ -442,7 +442,7 @@ namespace NekoGui {
auto rule1 = std::make_shared<RouteRule>();
rule1->name = "Bypass Chinese IPs and Domains";
rule1->rule_set << QString("cn_IP") << QString("geolocation-cn_SITE");
rule1->rule_set << QString("cn_IP") << QString("geolocation-cn_SITE") << QString("cn_SITE");
rule1->outboundID = -2;
chain->Rules << rule1;

View File

@ -345,6 +345,11 @@ void RouteItem::updateHelperItems(const QString& base) {
for (const auto& item: geo_items) {
if (item.contains(base)) current_helper_items << item;
}
for (int i=0;i<current_helper_items.size();i++) {
for (int j=i+1;j<current_helper_items.size();j++) {
if (current_helper_items[i].length() > current_helper_items[j].length()) current_helper_items.swapItemsAt(i, j);
}
}
helperModel->setStringList(current_helper_items);
ui->rule_set_helper->setModel(helperModel);
}