This commit is contained in:
Mateusz Gruszczyński committed 2026-11-19 12:40:17 +01:00
1 parent d4a604970e
commit 38a23e2210
40 files changed
+928 -532

No files matched your search

+6 -2
View File
@@ -313,8 +313,11 @@ function load(value = defaults(), migrationIds = [], show = true) {
note(rateFields, "vhRateHelp");
const countryFields = subsection(g, "vhTrafficCountrySection");
field(countryFields, "country-mode", "vhCountryMode", access.mode || "off", "select", { values: [["off", "vhOff"], ["block", "vhCountryBlock"], ["allow", "vhCountryAllow"]] });
field(countryFields, "country-list", "vhCountryList", (access.countries || []).join("\n"), "textarea", { rows: 3, maxLength: 1024 });
const countryMode = field(countryFields, "country-mode", "vhCountryMode", access.mode || "off", "select", { values: [["off", "vhOff"], ["block", "vhCountryBlock"], ["allow", "vhCountryAllow"]] });
const countryList = field(countryFields, "country-list", "vhCountryList", (access.countries || []).join("\n"), "textarea", { rows: 3, maxLength: 1024 });
window.rustProxyCountryPicker?.attach(countryList);
const syncCountryPicker = () => { countryList.disabled = countryMode.value === "off"; };
countryMode.addEventListener("change", syncCountryPicker); syncCountryPicker();
note(countryFields, "vhCountryPolicyHelp");
const countryRateFields = subsection(g, "vhTrafficCountryRatesSection");
@@ -515,6 +518,7 @@ function load(value = defaults(), migrationIds = [], show = true) {
field(cacheOptions, "vh-cache-object", "vhCacheObject", cache.max_object_bytes == null ? "" : cache.max_object_bytes / 1024, "number", { min: 1, step: "any", max: (envelope?.config.cache?.max_object_bytes ?? 1048576) / 1024 });
tri(cacheOptions, "vh-cache-query", "cacheBypassQuery", cache.bypass_query);
tri(cacheOptions, "vh-cache-static-cookie", "vhCacheStaticCookie", cache.static_ignore_cookies);
tri(cacheOptions, "vh-cache-static-vary-cookie", "vhCacheStaticVaryCookie", cache.static_ignore_vary_cookie);
const staticExtensionFields = el("div", undefined, "vh-wide vh-override-fields"); cacheOptions.append(staticExtensionFields);
const customStatic = field(staticExtensionFields, "vh-cache-static-custom", "vhCacheStaticCustom", cache.static_extensions != null, "checkbox", { switch: true });
const staticExtensions = field(staticExtensionFields, "vh-cache-static-extensions", "vhCacheStaticExtensions", (cache.static_extensions || envelope?.config.cache?.static_extensions || []).join("\n"), "textarea", { rows: 5, maxLength: 2048 });