feat: add more jsDelivr mirrors

This commit is contained in:
parhelia512 2025-08-16 14:02:42 +08:00
parent ee2e5c4e87
commit cc8f110a30
4 changed files with 37 additions and 8 deletions

View File

@ -75,9 +75,17 @@ namespace Configs {
return link;
if(auto url = QUrl(link); url.isValid() && url.host() == "raw.githubusercontent.com")
{
QStringList list = url.path().split('/');
QStringList list = url.path().split('/');
QString result;
switch(dataStore->routing->ruleset_mirror) {
case Mirrors::GCORE: result = "https://gcore.jsdelivr.net/gh"; break;
case Mirrors::QUANTIL: result = "https://quantil.jsdelivr.net/gh"; break;
case Mirrors::FASTLY: result = "https://fastly.jsdelivr.net/gh"; break;
case Mirrors::CDN: result = "https://cdn.jsdelivr.net/gh"; break;
default: result = "https://testingcf.jsdelivr.net/gh";
}
int index = 0;
QString result = "https://cdn.jsdelivr.net/gh";
foreach(QString item, list)
{
if(!item.isEmpty())

View File

@ -45,7 +45,11 @@ namespace Configs {
enum Mirrors
{
GITHUB,
JSDELIVR,
CLOUDFLARE,
GCORE,
QUANTIL,
FASTLY,
CDN,
};
}
} // namespace Configs

View File

@ -24,7 +24,7 @@ namespace Configs {
QString domain_strategy = "AsIs";
QString outbound_domain_strategy = "AsIs";
int sniffing_mode = SniffingMode::FOR_ROUTING;
int ruleset_mirror = Mirrors::JSDELIVR;
int ruleset_mirror = Mirrors::CLOUDFLARE;
explicit Routing(int preset = 0);

View File

@ -97,9 +97,6 @@
</item>
<item row="5" column="0">
<widget class="QLabel" name="ruleset_mirror_l">
<property name="toolTip">
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Change will apply on next launch&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Remote Rule-set Mirror</string>
</property>
@ -114,7 +111,27 @@
</item>
<item>
<property name="text">
<string>jsDelivr</string>
<string>jsDelivr(Cloudflare)</string>
</property>
</item>
<item>
<property name="text">
<string>jsDelivr(Gcore)</string>
</property>
</item>
<item>
<property name="text">
<string>jsDelivr(Quantil)</string>
</property>
</item>
<item>
<property name="text">
<string>jsDelivr(Fastly)</string>
</property>
</item>
<item>
<property name="text">
<string>jsDelivr(CDN)</string>
</property>
</item>
</widget>