mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-17 03:44:07 +03:00
refactor: switch UCI lookups from 'main' to 'settings', add routing_excluded_ips and relocate update_interval in UI
This commit is contained in:
@@ -167,18 +167,6 @@ function createSettingsContent(section) {
|
||||
return true;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
form.ListValue,
|
||||
'update_interval',
|
||||
_('List Update Frequency'),
|
||||
_('Select how often the lists will be updated'),
|
||||
);
|
||||
Object.entries(main.UPDATE_INTERVAL_OPTIONS).forEach(([key, label]) => {
|
||||
o.value(key, _(label));
|
||||
});
|
||||
o.default = '1d';
|
||||
o.rmempty = false;
|
||||
|
||||
o = section.option(
|
||||
form.Flag,
|
||||
'yacd',
|
||||
@@ -197,6 +185,18 @@ function createSettingsContent(section) {
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
|
||||
o = section.option(
|
||||
form.ListValue,
|
||||
'update_interval',
|
||||
_('List Update Frequency'),
|
||||
_('Select how often the lists will be updated'),
|
||||
);
|
||||
Object.entries(main.UPDATE_INTERVAL_OPTIONS).forEach(([key, label]) => {
|
||||
o.value(key, _(label));
|
||||
});
|
||||
o.default = '1d';
|
||||
o.rmempty = false;
|
||||
|
||||
o = section.option(
|
||||
form.Flag,
|
||||
'detour',
|
||||
@@ -272,6 +272,29 @@ function createSettingsContent(section) {
|
||||
);
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
|
||||
o = section.option(
|
||||
form.DynamicList,
|
||||
'routing_excluded_ips',
|
||||
_('Routing Excluded IPs'),
|
||||
_('Specify a local IP address to be excluded from routing'),
|
||||
);
|
||||
o.placeholder = 'IP';
|
||||
o.rmempty = true;
|
||||
o.validate = function (section_id, value) {
|
||||
// Optional
|
||||
if (!value || value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const validation = main.validateIPV4(value);
|
||||
|
||||
if (validation.valid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validation.message;
|
||||
};
|
||||
}
|
||||
|
||||
const EntryPoint = {
|
||||
|
||||
Reference in New Issue
Block a user