mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 18:44:03 +08:00
🌈 Sync 2026-06-30 20:43:37
This commit is contained in:
1 parent
8e7c1b1778
commit
0486fb03d6
11 files changed
+599
-131
No files matched your search
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=BitSrunLoginGo
|
PKG_NAME:=BitSrunLoginGo
|
||||||
PKG_VERSION:=1.6.7
|
PKG_VERSION:=1.6.7
|
||||||
PKG_RELEASE:=5
|
PKG_RELEASE:=6
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/Mmx233/BitSrunLoginGo/tar.gz/v$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/Mmx233/BitSrunLoginGo/tar.gz/v$(PKG_VERSION)?
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ config bitsrunlogin-go 'config'
|
|||||||
# Interface name in regex, e.g. "eth0\.[2-3]"
|
# Interface name in regex, e.g. "eth0\.[2-3]"
|
||||||
# Multi-interfaces mode will be enabled if not empty
|
# Multi-interfaces mode will be enabled if not empty
|
||||||
option interfaces ''
|
option interfaces ''
|
||||||
|
option interfaces_interval ''
|
||||||
|
# Custom DNS server. System DNS will be used if empty
|
||||||
|
option dns_server ''
|
||||||
|
|
||||||
# Enable debug log
|
# Enable debug log
|
||||||
option debug '0'
|
option debug '0'
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ start_service() {
|
|||||||
uci_json_add_boolean "skip_cert_verify" "skip_cert_verify"
|
uci_json_add_boolean "skip_cert_verify" "skip_cert_verify"
|
||||||
uci_json_add_int "timeout" "timeout" "5"
|
uci_json_add_int "timeout" "timeout" "5"
|
||||||
uci_json_add_string "interfaces" "interfaces"
|
uci_json_add_string "interfaces" "interfaces"
|
||||||
|
uci_json_add_int "interfaces_interval" "interfaces_interval"
|
||||||
|
uci_json_add_string "dns_server" "dns_server"
|
||||||
json_close_object
|
json_close_object
|
||||||
json_add_object "guardian"
|
json_add_object "guardian"
|
||||||
json_add_boolean "enable" "1"
|
json_add_boolean "enable" "1"
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=daed
|
PKG_NAME:=daed
|
||||||
PKG_VERSION:=2026.06.14
|
PKG_VERSION:=2026.06.14
|
||||||
PKG_RELEASE:=15
|
PKG_RELEASE:=16
|
||||||
|
|
||||||
PKG_SOURCE:=daed-src-2026.06.14-4e215048068a.tar.gz
|
PKG_SOURCE:=daed-src-2026.06.14-4e215048068a.tar.gz
|
||||||
PKG_SOURCE_URL:=https://github.com/kenzok8/openwrt-daede/releases/download/daed-src
|
PKG_SOURCE_URL:=https://github.com/kenzok8/openwrt-daede/releases/download/daed-src
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
From: kenzok8 <kenzok8@noreply>
|
||||||
|
Date: 2026-06-30
|
||||||
|
Subject: [PATCH] daed: raise manual latency probe concurrency to 16
|
||||||
|
|
||||||
|
Raise concurrent probes 8->16 so manual latency tests finish faster
|
||||||
|
when many nodes (incl. dead/timeout ones) are present.
|
||||||
|
Reported: https://github.com/kenzok8/openwrt-daede/issues/20
|
||||||
|
---
|
||||||
|
--- a/graphql/service/node/latency_mutation_utils.go
|
||||||
|
+++ b/graphql/service/node/latency_mutation_utils.go
|
||||||
|
@@ -19,7 +19,7 @@
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
-const latencyProbeConcurrency = 8
|
||||||
|
+const latencyProbeConcurrency = 16
|
||||||
|
|
||||||
|
func TestLatencies(ctx context.Context, ids *[]graphql.ID) ([]*LatencyResolver, error) {
|
||||||
|
option, err := latencyProbeOption(ctx)
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
'require baseclass';
|
'require baseclass';
|
||||||
'require form';
|
'require form';
|
||||||
'require fs';
|
'require fs';
|
||||||
|
'require dom';
|
||||||
'require rpc';
|
'require rpc';
|
||||||
'require uci';
|
'require uci';
|
||||||
'require ui';
|
'require ui';
|
||||||
@@ -495,6 +496,31 @@ const CBIDynamicList = form.DynamicList.extend({ // @less_25_12
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const CBIMultiValue = form.MultiValue.extend({ // @pr8758_merged
|
||||||
|
__name__: 'CBI.MultiValue',
|
||||||
|
|
||||||
|
renderWidget(section_id, option_index, cfgvalue) {
|
||||||
|
const value = (cfgvalue != null) ? cfgvalue : this.default;
|
||||||
|
const choices = this.transformChoices();
|
||||||
|
|
||||||
|
const widget = new UIDropdown(L.toArray(value), choices, {
|
||||||
|
id: this.cbid(section_id),
|
||||||
|
sort: this.keylist,
|
||||||
|
multiple: true,
|
||||||
|
keep_order: this.keep_order,
|
||||||
|
optional: this.optional || this.rmempty,
|
||||||
|
select_placeholder: this.placeholder,
|
||||||
|
create: this.create,
|
||||||
|
display_items: this.display_size ?? this.size ?? 3,
|
||||||
|
dropdown_items: this.dropdown_size ?? this.size ?? -1,
|
||||||
|
validate: this.getValidator(section_id),
|
||||||
|
disabled: (this.readonly != null) ? this.readonly : this.map.readonly
|
||||||
|
});
|
||||||
|
|
||||||
|
return widget.render();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const CBIStaticList = form.DynamicList.extend({
|
const CBIStaticList = form.DynamicList.extend({
|
||||||
__name__: 'CBI.StaticList',
|
__name__: 'CBI.StaticList',
|
||||||
|
|
||||||
@@ -786,6 +812,360 @@ const UIDynamicList = ui.DynamicList.extend({ // @less_25_12
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// keep selected order for multiple selection
|
||||||
|
const UIDropdown = ui.Dropdown.extend({ // @pr8758_merged
|
||||||
|
__init__(value, choices, options) {
|
||||||
|
if (typeof(choices) != 'object')
|
||||||
|
choices = {};
|
||||||
|
|
||||||
|
if (!Array.isArray(value))
|
||||||
|
this.values = (value != null && value != '') ? [ value ] : [];
|
||||||
|
else
|
||||||
|
this.values = value;
|
||||||
|
|
||||||
|
this.orderCounter = this.values.length;
|
||||||
|
this.choices = choices;
|
||||||
|
this.options = Object.assign({
|
||||||
|
sort: true,
|
||||||
|
multiple: Array.isArray(value),
|
||||||
|
keep_order: false,
|
||||||
|
optional: true,
|
||||||
|
select_placeholder: _('-- Please choose --'),
|
||||||
|
custom_placeholder: _('-- custom --'),
|
||||||
|
display_items: 3,
|
||||||
|
dropdown_items: -1,
|
||||||
|
create: false,
|
||||||
|
create_query: '.create-item-input',
|
||||||
|
create_template: 'script[type="item-template"]'
|
||||||
|
}, options);
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const sb = E('div', {
|
||||||
|
'id': this.options.id,
|
||||||
|
'class': 'cbi-dropdown',
|
||||||
|
'multiple': this.options.multiple ? '' : null,
|
||||||
|
'keep_order': this.options.keep_order ? '' : null,
|
||||||
|
'optional': this.options.optional ? '' : null,
|
||||||
|
'disabled': this.options.disabled ? '' : null,
|
||||||
|
'tabindex': -1
|
||||||
|
}, E('ul'));
|
||||||
|
|
||||||
|
let keys = Object.keys(this.choices);
|
||||||
|
|
||||||
|
if (this.options.sort === true)
|
||||||
|
keys.sort(L.naturalCompare);
|
||||||
|
else if (Array.isArray(this.options.sort))
|
||||||
|
keys = this.options.sort;
|
||||||
|
|
||||||
|
if (this.options.create)
|
||||||
|
for (let i = 0; i < this.values.length; i++)
|
||||||
|
if (!this.choices.hasOwnProperty(this.values[i]))
|
||||||
|
keys.push(this.values[i]);
|
||||||
|
|
||||||
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
let label = this.choices[keys[i]];
|
||||||
|
|
||||||
|
if (dom.elem(label))
|
||||||
|
label = label.cloneNode(true);
|
||||||
|
|
||||||
|
sb.lastElementChild.appendChild(E('li', {
|
||||||
|
'data-value': keys[i],
|
||||||
|
'selected': (this.values.indexOf(keys[i]) > -1) ? '' : null
|
||||||
|
}, [ label ?? keys[i] ]));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.create) {
|
||||||
|
const createEl = E('input', {
|
||||||
|
'type': 'text',
|
||||||
|
'class': 'create-item-input',
|
||||||
|
'readonly': this.options.readonly ? '' : null,
|
||||||
|
'maxlength': this.options.maxlength,
|
||||||
|
'placeholder': this.options.custom_placeholder ?? this.options.placeholder,
|
||||||
|
'inputmode': 'text',
|
||||||
|
'enterkeyhint': 'done'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.options.datatype || this.options.validate)
|
||||||
|
UI.prototype.addValidator(createEl, this.options.datatype ?? 'string',
|
||||||
|
true, this.options.validate, 'blur', 'keyup');
|
||||||
|
|
||||||
|
sb.lastElementChild.appendChild(E('li', { 'data-value': '-' }, createEl));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.create_markup)
|
||||||
|
sb.appendChild(E('script', { type: 'item-template' },
|
||||||
|
this.options.create_markup));
|
||||||
|
|
||||||
|
return this.bind(sb);
|
||||||
|
},
|
||||||
|
|
||||||
|
bind(sb) {
|
||||||
|
const o = this.options;
|
||||||
|
|
||||||
|
o.multiple = sb.hasAttribute('multiple');
|
||||||
|
o.keep_order = sb.hasAttribute('keep_order');
|
||||||
|
o.optional = sb.hasAttribute('optional');
|
||||||
|
o.placeholder = sb.getAttribute('placeholder') ?? o.placeholder;
|
||||||
|
o.display_items = parseInt(sb.getAttribute('display-items') ?? o.display_items);
|
||||||
|
o.dropdown_items = parseInt(sb.getAttribute('dropdown-items') ?? o.dropdown_items);
|
||||||
|
o.create_query = sb.getAttribute('item-create') ?? o.create_query;
|
||||||
|
o.create_template = sb.getAttribute('item-template') ?? o.create_template;
|
||||||
|
|
||||||
|
const ul = sb.querySelector('ul');
|
||||||
|
const more = sb.appendChild(E('span', { class: 'more', tabindex: -1 }, '···'));
|
||||||
|
sb.appendChild(E('span', { class: 'open', tabindex: -1 }, '▾'));
|
||||||
|
const canary = sb.appendChild(E('div'));
|
||||||
|
const create = sb.querySelector(this.options.create_query);
|
||||||
|
let ndisplay = this.options.display_items;
|
||||||
|
let n = 0;
|
||||||
|
|
||||||
|
if (this.options.multiple) {
|
||||||
|
let items = ul.querySelectorAll('li');
|
||||||
|
|
||||||
|
for (let i = 0; i < items.length; i++) {
|
||||||
|
this.transformItem(sb, items[i]);
|
||||||
|
|
||||||
|
if (items[i].hasAttribute('selected')) {
|
||||||
|
if (ndisplay-- > 0)
|
||||||
|
items[i].setAttribute('display', n++);
|
||||||
|
|
||||||
|
if (this.options.keep_order) {
|
||||||
|
const value = items[i].getAttribute('data-value');
|
||||||
|
if (this.values.includes(value))
|
||||||
|
items[i].setAttribute('data-order', this.values.indexOf(value) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (this.options.optional && !ul.querySelector('li[data-value=""]')) {
|
||||||
|
const placeholder = E('li', { placeholder: '' },
|
||||||
|
this.options.select_placeholder ?? this.options.placeholder);
|
||||||
|
|
||||||
|
ul.firstChild
|
||||||
|
? ul.insertBefore(placeholder, ul.firstChild)
|
||||||
|
: ul.appendChild(placeholder);
|
||||||
|
}
|
||||||
|
|
||||||
|
let items = ul.querySelectorAll('li');
|
||||||
|
const sel = sb.querySelectorAll('[selected]');
|
||||||
|
|
||||||
|
sel.forEach(s => {
|
||||||
|
s.removeAttribute('selected');
|
||||||
|
});
|
||||||
|
|
||||||
|
const s = sel[0] ?? items[0];
|
||||||
|
if (s) {
|
||||||
|
s.setAttribute('selected', '');
|
||||||
|
s.setAttribute('display', n++);
|
||||||
|
}
|
||||||
|
|
||||||
|
ndisplay--;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.saveValues(sb, ul);
|
||||||
|
|
||||||
|
ul.setAttribute('tabindex', -1);
|
||||||
|
sb.setAttribute('tabindex', 0);
|
||||||
|
|
||||||
|
if (ndisplay < 0)
|
||||||
|
sb.setAttribute('more', '')
|
||||||
|
else
|
||||||
|
sb.removeAttribute('more');
|
||||||
|
|
||||||
|
if (ndisplay == this.options.display_items)
|
||||||
|
sb.setAttribute('empty', '')
|
||||||
|
else
|
||||||
|
sb.removeAttribute('empty');
|
||||||
|
|
||||||
|
dom.content(more, (ndisplay == this.options.display_items)
|
||||||
|
? (this.options.select_placeholder ?? this.options.placeholder) : '···');
|
||||||
|
|
||||||
|
|
||||||
|
sb.addEventListener('click', this.handleClick.bind(this));
|
||||||
|
sb.addEventListener('keydown', this.handleKeydown.bind(this));
|
||||||
|
sb.addEventListener('cbi-dropdown-close', this.handleDropdownClose.bind(this));
|
||||||
|
sb.addEventListener('cbi-dropdown-select', this.handleDropdownSelect.bind(this));
|
||||||
|
|
||||||
|
if ('ontouchstart' in window) {
|
||||||
|
sb.addEventListener('touchstart', ev => ev.stopPropagation());
|
||||||
|
window.addEventListener('touchstart', this.closeAllDropdowns);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sb.addEventListener('focus', this.handleFocus.bind(this));
|
||||||
|
|
||||||
|
canary.addEventListener('focus', this.handleCanaryFocus.bind(this));
|
||||||
|
|
||||||
|
window.addEventListener('click', this.closeAllDropdowns);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (create) {
|
||||||
|
create.addEventListener('keydown', this.handleCreateKeydown.bind(this));
|
||||||
|
create.addEventListener('focus', this.handleCreateFocus.bind(this));
|
||||||
|
create.addEventListener('blur', this.handleCreateBlur.bind(this));
|
||||||
|
|
||||||
|
const li = findParent(create, 'li');
|
||||||
|
|
||||||
|
li.setAttribute('unselectable', '');
|
||||||
|
li.addEventListener('click', this.handleCreateClick.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.node = sb;
|
||||||
|
|
||||||
|
this.setUpdateEvents(sb, 'cbi-dropdown-open', 'cbi-dropdown-close');
|
||||||
|
this.setChangeEvents(sb, 'cbi-dropdown-change', 'cbi-dropdown-close');
|
||||||
|
|
||||||
|
dom.bindClassInstance(sb, this);
|
||||||
|
|
||||||
|
return sb;
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleItem(sb, li, force_state) {
|
||||||
|
const ul = li.parentNode;
|
||||||
|
|
||||||
|
if (li.hasAttribute('unselectable'))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this.options.multiple) {
|
||||||
|
const cbox = li.querySelector('input[type="checkbox"]');
|
||||||
|
const items = li.parentNode.querySelectorAll('li');
|
||||||
|
const label = sb.querySelector('ul.preview');
|
||||||
|
let sel = li.parentNode.querySelectorAll('[selected]').length;
|
||||||
|
const more = sb.querySelector('.more');
|
||||||
|
let ndisplay = this.options.display_items;
|
||||||
|
let n = 0;
|
||||||
|
|
||||||
|
if (li.hasAttribute('selected')) {
|
||||||
|
if (force_state !== true) {
|
||||||
|
if (sel > 1 || this.options.optional) {
|
||||||
|
li.removeAttribute('selected');
|
||||||
|
cbox.checked = cbox.disabled = false;
|
||||||
|
sel--;
|
||||||
|
|
||||||
|
if (this.options.keep_order)
|
||||||
|
li.removeAttribute('data-order');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cbox.disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (force_state !== false) {
|
||||||
|
li.setAttribute('selected', '');
|
||||||
|
cbox.checked = true;
|
||||||
|
cbox.disabled = false;
|
||||||
|
sel++;
|
||||||
|
|
||||||
|
if (this.options.keep_order)
|
||||||
|
li.setAttribute('data-order', ++this.orderCounter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (label && label.firstElementChild)
|
||||||
|
label.removeChild(label.firstElementChild);
|
||||||
|
|
||||||
|
for (let i = 0; i < items.length; i++) {
|
||||||
|
items[i].removeAttribute('display');
|
||||||
|
if (items[i].hasAttribute('selected')) {
|
||||||
|
if (ndisplay-- > 0) {
|
||||||
|
items[i].setAttribute('display', n++);
|
||||||
|
if (label)
|
||||||
|
label.appendChild(items[i].cloneNode(true));
|
||||||
|
}
|
||||||
|
const c = items[i].querySelector('input[type="checkbox"]');
|
||||||
|
if (c)
|
||||||
|
c.disabled = (sel == 1 && !this.options.optional);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ndisplay < 0)
|
||||||
|
sb.setAttribute('more', '');
|
||||||
|
else
|
||||||
|
sb.removeAttribute('more');
|
||||||
|
|
||||||
|
if (ndisplay === this.options.display_items)
|
||||||
|
sb.setAttribute('empty', '');
|
||||||
|
else
|
||||||
|
sb.removeAttribute('empty');
|
||||||
|
|
||||||
|
dom.content(more, (ndisplay === this.options.display_items)
|
||||||
|
? (this.options.select_placeholder ?? this.options.placeholder) : '···');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let sel = li.parentNode.querySelector('[selected]');
|
||||||
|
if (sel) {
|
||||||
|
sel.removeAttribute('display');
|
||||||
|
sel.removeAttribute('selected');
|
||||||
|
}
|
||||||
|
|
||||||
|
li.setAttribute('display', 0);
|
||||||
|
li.setAttribute('selected', '');
|
||||||
|
|
||||||
|
this.closeDropdown(sb);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.saveValues(sb, ul);
|
||||||
|
},
|
||||||
|
|
||||||
|
saveValues(sb, ul) {
|
||||||
|
const sel = Array.from(ul.querySelectorAll('li[selected]'));
|
||||||
|
const div = sb.lastElementChild;
|
||||||
|
const name = this.options.name;
|
||||||
|
let strval = '';
|
||||||
|
const values = [];
|
||||||
|
|
||||||
|
if (this.options.keep_order) {
|
||||||
|
sel.sort((a, b) =>
|
||||||
|
(+a.getAttribute('data-order') || 0) -
|
||||||
|
(+b.getAttribute('data-order') || 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (div.lastElementChild)
|
||||||
|
div.removeChild(div.lastElementChild);
|
||||||
|
|
||||||
|
sel.forEach(s => {
|
||||||
|
if (s.hasAttribute('placeholder'))
|
||||||
|
return;
|
||||||
|
|
||||||
|
const v = {
|
||||||
|
text: s.innerText,
|
||||||
|
value: s.hasAttribute('data-value') ? s.getAttribute('data-value') : s.innerText,
|
||||||
|
element: s
|
||||||
|
};
|
||||||
|
|
||||||
|
div.appendChild(E('input', {
|
||||||
|
type: 'hidden',
|
||||||
|
name: name,
|
||||||
|
value: v.value
|
||||||
|
}));
|
||||||
|
|
||||||
|
values.push(v);
|
||||||
|
|
||||||
|
strval += strval.length ? ` ${v.value}` : v.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
const detail = {
|
||||||
|
instance: this,
|
||||||
|
element: sb
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.options.multiple)
|
||||||
|
detail.values = values;
|
||||||
|
else
|
||||||
|
detail.value = values.length ? values[0] : null;
|
||||||
|
|
||||||
|
sb.value = strval;
|
||||||
|
|
||||||
|
sb.dispatchEvent(new CustomEvent('cbi-dropdown-change', {
|
||||||
|
bubbles: true,
|
||||||
|
detail: detail
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/* Method */
|
/* Method */
|
||||||
/* thanks to homeproxy */
|
/* thanks to homeproxy */
|
||||||
function calcStringMD5(e) {
|
function calcStringMD5(e) {
|
||||||
@@ -1114,109 +1494,80 @@ function loadModalTitle(title, addtitle, section_id) {
|
|||||||
return label ? title + ' » ' + label : addtitle;
|
return label ? title + ' » ' + label : addtitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadProxyGroupLabel(preadds, section_id) {
|
function loadLabel(preadds, section_id) {
|
||||||
delete this.keylist;
|
delete this.keylist;
|
||||||
delete this.vallist;
|
delete this.vallist;
|
||||||
|
|
||||||
preadds?.forEach((arr) => {
|
for (const arr of preadds || [])
|
||||||
this.value.apply(this, arr);
|
this.value(...arr);
|
||||||
});
|
|
||||||
uci.sections(this.config, 'proxy_group', (res) => {
|
|
||||||
if (res.enabled !== '0')
|
|
||||||
this.value(res['.name'], res.label);
|
|
||||||
});
|
|
||||||
|
|
||||||
return this.super('load', section_id);
|
return this.super('load', section_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadNodeLabel(preadds, section_id) {
|
function loadLabelValues(uciconfig, sectiontype, options = {}) {
|
||||||
delete this.keylist;
|
const values = [];
|
||||||
delete this.vallist;
|
|
||||||
|
|
||||||
preadds?.forEach((arr) => {
|
switch (sectiontype) {
|
||||||
this.value.apply(this, arr);
|
case 'proxy_group':
|
||||||
});
|
case 'node':
|
||||||
uci.sections(this.config, 'node', (res) => {
|
case 'provider':
|
||||||
if (res.enabled !== '0')
|
uci.sections(uciconfig, sectiontype, (res) => {
|
||||||
this.value(res['.name'], res.label);
|
if (res.enabled !== '0')
|
||||||
});
|
values.push([res['.name'], res.label]);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'ruleset':
|
||||||
|
uci.sections(uciconfig, sectiontype, (res) => {
|
||||||
|
if (
|
||||||
|
res.enabled !== '0' &&
|
||||||
|
(!options.behaviors ||
|
||||||
|
options.behaviors.includes(res.behavior))
|
||||||
|
) {
|
||||||
|
values.push([res['.name'], res.label]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'subrule-group': {
|
||||||
|
const groups = new Set();
|
||||||
|
|
||||||
return this.super('load', section_id);
|
uci.sections(uciconfig, 'subrules', (res) => {
|
||||||
}
|
if (res.enabled !== '0')
|
||||||
|
groups.add(res.group);
|
||||||
|
});
|
||||||
|
|
||||||
function loadProviderLabel(preadds, section_id) {
|
for (const group of groups)
|
||||||
delete this.keylist;
|
values.push([group, group]);
|
||||||
delete this.vallist;
|
break;
|
||||||
|
}
|
||||||
|
case 'rematch-name': {
|
||||||
|
const names = new Set();
|
||||||
|
|
||||||
preadds?.forEach((arr) => {
|
for (const type of ['rules', 'subrules']) {
|
||||||
this.value.apply(this, arr);
|
uci.sections(uciconfig, type, (res) => {
|
||||||
});
|
if (res.enabled === '0')
|
||||||
uci.sections(this.config, 'provider', (res) => {
|
return;
|
||||||
if (res.enabled !== '0')
|
|
||||||
this.value(res['.name'], res.label);
|
|
||||||
});
|
|
||||||
|
|
||||||
return this.super('load', section_id);
|
try {
|
||||||
}
|
const payload =
|
||||||
|
JSON.parse(res?.entry?.trim() || '{}').payload || [];
|
||||||
|
|
||||||
function loadRulesetLabel(preadds, behaviors, section_id) {
|
for (const p of payload)
|
||||||
delete this.keylist;
|
if (p.type === 'REMATCH-NAME')
|
||||||
delete this.vallist;
|
names.add(p.factor);
|
||||||
|
} catch {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
preadds?.forEach((arr) => {
|
for (const name of names)
|
||||||
this.value.apply(this, arr);
|
values.push([name, name]);
|
||||||
});
|
|
||||||
uci.sections(this.config, 'ruleset', (res) => {
|
|
||||||
if (res.enabled !== '0')
|
|
||||||
if (behaviors ? behaviors.includes(res.behavior) : true)
|
|
||||||
this.value(res['.name'], res.label);
|
|
||||||
});
|
|
||||||
|
|
||||||
return this.super('load', section_id);
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
function loadSubRuleGroup(preadds, section_id) {
|
return values;
|
||||||
delete this.keylist;
|
|
||||||
delete this.vallist;
|
|
||||||
|
|
||||||
preadds?.forEach((arr) => {
|
|
||||||
this.value.apply(this, arr);
|
|
||||||
});
|
|
||||||
let groups = {};
|
|
||||||
uci.sections(this.config, 'subrules', (res) => {
|
|
||||||
if (res.enabled !== '0')
|
|
||||||
groups[res.group] = res.group;
|
|
||||||
});
|
|
||||||
Object.keys(groups).forEach((group) => {
|
|
||||||
this.value(group, group);
|
|
||||||
});
|
|
||||||
|
|
||||||
return this.super('load', section_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadRematchName(preadds, section_id) {
|
|
||||||
delete this.keylist;
|
|
||||||
delete this.vallist;
|
|
||||||
|
|
||||||
preadds?.forEach((arr) => {
|
|
||||||
this.value.apply(this, arr);
|
|
||||||
});
|
|
||||||
let names = {};
|
|
||||||
for (const section_type of ['rules', 'subrules'])
|
|
||||||
uci.sections(this.config, section_type, (res) => {
|
|
||||||
if (res.enabled !== '0')
|
|
||||||
try {
|
|
||||||
const obj = JSON.parse(res?.entry?.trim() || '{}');
|
|
||||||
for (const p of obj.payload || [])
|
|
||||||
if (p.type === 'REMATCH-NAME')
|
|
||||||
names[p.factor] = p.factor;
|
|
||||||
} catch {}
|
|
||||||
});
|
|
||||||
Object.keys(names).forEach((name) => {
|
|
||||||
this.value(name, name);
|
|
||||||
});
|
|
||||||
|
|
||||||
return this.super('load', section_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderStatus(ElId, isRunning, instance, noGlobal) {
|
function renderStatus(ElId, isRunning, instance, noGlobal) {
|
||||||
@@ -1790,6 +2141,7 @@ return baseclass.extend({
|
|||||||
/* Prototype */
|
/* Prototype */
|
||||||
GridSection: CBIGridSection,
|
GridSection: CBIGridSection,
|
||||||
DynamicList: CBIDynamicList,
|
DynamicList: CBIDynamicList,
|
||||||
|
MultiValue: CBIMultiValue,
|
||||||
StaticList: CBIStaticList,
|
StaticList: CBIStaticList,
|
||||||
ListValue: CBIListValue,
|
ListValue: CBIListValue,
|
||||||
RichValue: CBIRichValue,
|
RichValue: CBIRichValue,
|
||||||
@@ -1819,12 +2171,8 @@ return baseclass.extend({
|
|||||||
// load
|
// load
|
||||||
loadDefaultLabel,
|
loadDefaultLabel,
|
||||||
loadModalTitle,
|
loadModalTitle,
|
||||||
loadProxyGroupLabel,
|
loadLabel,
|
||||||
loadNodeLabel,
|
loadLabelValues,
|
||||||
loadProviderLabel,
|
|
||||||
loadRulesetLabel,
|
|
||||||
loadSubRuleGroup,
|
|
||||||
loadRematchName,
|
|
||||||
// render
|
// render
|
||||||
renderStatus,
|
renderStatus,
|
||||||
updateStatus,
|
updateStatus,
|
||||||
|
|||||||
@@ -609,7 +609,12 @@ function renderListeners(s, uciconfig, isClient) {
|
|||||||
o = s.taboption('field_general', hm.ListValue, 'rule', _('Sub rule'),
|
o = s.taboption('field_general', hm.ListValue, 'rule', _('Sub rule'),
|
||||||
_('Name of the Sub rule used for inbound matching.'));
|
_('Name of the Sub rule used for inbound matching.'));
|
||||||
o.value.apply(o, ['', _('null')]);
|
o.value.apply(o, ['', _('null')]);
|
||||||
o.load = L.bind(hm.loadSubRuleGroup, o, [['', _('null')]]);
|
o.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('null')],
|
||||||
|
...hm.loadLabelValues(this.config, 'subrule-group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
o.editable = true;
|
o.editable = true;
|
||||||
|
|
||||||
o = s.taboption('field_general', hm.ListValue, 'proxy', _('Proxy group'),
|
o = s.taboption('field_general', hm.ListValue, 'proxy', _('Proxy group'),
|
||||||
@@ -618,7 +623,12 @@ function renderListeners(s, uciconfig, isClient) {
|
|||||||
hm.preset_outbound.direct.forEach((res) => {
|
hm.preset_outbound.direct.forEach((res) => {
|
||||||
o.value.apply(o, res);
|
o.value.apply(o, res);
|
||||||
})
|
})
|
||||||
o.load = L.bind(hm.loadProxyGroupLabel, o, hm.preset_outbound.direct);
|
o.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.direct,
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
o.editable = true;
|
o.editable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ const parseProxyGroupYaml = hm.parseYaml.extend({
|
|||||||
id: this.id,
|
id: this.id,
|
||||||
label: this.label,
|
label: this.label,
|
||||||
type: cfg.type,
|
type: cfg.type,
|
||||||
groups: cfg.proxies ? cfg.proxies.map((grop) => hm.preset_outbound.full.map(([key, label]) => key).includes(grop) ? grop : this.calcID(hm.glossary["proxy_group"].field, grop)) : null, // array
|
groups: cfg.proxies ? cfg.proxies.map((grop) => hm.preset_outbound.proxy.map(([key, label]) => key).includes(grop) ? grop : this.calcID(hm.glossary["proxy_group"].field, grop)) : null, // array
|
||||||
use: cfg.use ? cfg.use.map((prov) => this.calcID(hm.glossary["provider"].field, prov)) : null, // array
|
use: cfg.use ? cfg.use.map((prov) => this.calcID(hm.glossary["provider"].field, prov)) : null, // array
|
||||||
include_all: this.bool2str(cfg["include-all"]), // bool
|
include_all: this.bool2str(cfg["include-all"]), // bool
|
||||||
include_all_proxies: this.bool2str(cfg["include-all-proxies"]), // bool
|
include_all_proxies: this.bool2str(cfg["include-all-proxies"]), // bool
|
||||||
include_all_providers: this.bool2str(cfg["include-all-providers"]), // bool
|
include_all_providers: this.bool2str(cfg["include-all-providers"]), // bool
|
||||||
empty_fallback: cfg["empty-fallback"] ? hm.preset_outbound.full.map(([key, label]) => key).includes(cfg["empty-fallback"]) ? cfg["empty-fallback"] : this.calcID(hm.glossary["proxy_group"].field, cfg["empty-fallback"]) : null, // string
|
empty_fallback: cfg["empty-fallback"] ? hm.preset_outbound.proxy.map(([key, label]) => key).includes(cfg["empty-fallback"]) ? cfg["empty-fallback"] : this.calcID(hm.glossary["proxy_group"].field, cfg["empty-fallback"]) : null, // string
|
||||||
// Url-test fields
|
// Url-test fields
|
||||||
tolerance: cfg.tolerance,
|
tolerance: cfg.tolerance,
|
||||||
// Load-balance fields
|
// Load-balance fields
|
||||||
@@ -255,7 +255,7 @@ const parseDNSYaml = hm.parseYaml.extend({
|
|||||||
|
|
||||||
let detour = addr.parseParam('detour');
|
let detour = addr.parseParam('detour');
|
||||||
if (detour)
|
if (detour)
|
||||||
addr.setParam('detour', hm.preset_outbound.full.map(([key, label]) => key).includes(detour) ? detour : this.calcID(hm.glossary["proxy_group"].field, detour));
|
addr.setParam('detour', hm.preset_outbound.dns.map(([key, label]) => key).includes(detour) ? detour : detour === 'RULES' ? '' : this.calcID(hm.glossary["proxy_group"].field, detour));
|
||||||
|
|
||||||
// key mapping // 2026/01/17
|
// key mapping // 2026/01/17
|
||||||
let config = {
|
let config = {
|
||||||
@@ -614,7 +614,7 @@ function renderPayload(s, total, uciconfig) {
|
|||||||
o.depends(prefix + 'type', 'RULE-SET');
|
o.depends(prefix + 'type', 'RULE-SET');
|
||||||
initPayload(o, n, 'factor', uciconfig);
|
initPayload(o, n, 'factor', uciconfig);
|
||||||
o.load = L.bind(function(n, key, uciconfig, section_id) {
|
o.load = L.bind(function(n, key, uciconfig, section_id) {
|
||||||
hm.loadRulesetLabel.call(this, [], null, section_id);
|
hm.loadLabel.call(this, hm.loadLabelValues(this.config, 'ruleset'), section_id);
|
||||||
|
|
||||||
return new RulesEntry(uci.get(uciconfig, section_id, 'entry')).getPayload(n)[key];
|
return new RulesEntry(uci.get(uciconfig, section_id, 'entry')).getPayload(n)[key];
|
||||||
}, o, n, 'factor', uciconfig)
|
}, o, n, 'factor', uciconfig)
|
||||||
@@ -688,8 +688,11 @@ function renderPayload(s, total, uciconfig) {
|
|||||||
['tcp', _('TCP')],
|
['tcp', _('TCP')],
|
||||||
['RULESET', '-- RULE-SET --']
|
['RULESET', '-- RULE-SET --']
|
||||||
];
|
];
|
||||||
hm.loadRulesetLabel.call(this, fusedval, null, section_id);
|
|
||||||
this.super('load', section_id);
|
hm.loadLabel.call(this, [
|
||||||
|
...fusedval,
|
||||||
|
...hm.loadLabelValues(this.config, 'ruleset')
|
||||||
|
], section_id);
|
||||||
|
|
||||||
return new RulesEntry(uci.get(uciconfig, section_id, 'entry')).getPayloads().slice(n).map(e => e[key] ?? '');
|
return new RulesEntry(uci.get(uciconfig, section_id, 'entry')).getPayloads().slice(n).map(e => e[key] ?? '');
|
||||||
}, o, n, 'factor', uciconfig)
|
}, o, n, 'factor', uciconfig)
|
||||||
@@ -791,7 +794,10 @@ function renderRules(s, uciconfig) {
|
|||||||
|
|
||||||
o = s.option(hm.ListValue, 'detour', _('Proxy group'));
|
o = s.option(hm.ListValue, 'detour', _('Proxy group'));
|
||||||
o.load = function(section_id) {
|
o.load = function(section_id) {
|
||||||
hm.loadProxyGroupLabel.call(this, hm.preset_outbound.full, section_id);
|
hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.full,
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
|
||||||
return new RulesEntry(uci.get(uciconfig, section_id, 'entry')).detour;
|
return new RulesEntry(uci.get(uciconfig, section_id, 'entry')).detour;
|
||||||
}
|
}
|
||||||
@@ -867,7 +873,12 @@ function renderPolicies(s, uciconfig) {
|
|||||||
o = s.option(form.MultiValue, 'rule_set', _('Rule set'),
|
o = s.option(form.MultiValue, 'rule_set', _('Rule set'),
|
||||||
_('Match rule set.'));
|
_('Match rule set.'));
|
||||||
o.value('', _('-- Please choose --'));
|
o.value('', _('-- Please choose --'));
|
||||||
o.load = L.bind(hm.loadRulesetLabel, o, [['', _('-- Please choose --')]], ['domain', 'classical']);
|
o.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'ruleset', {behaviors: ['domain', 'classical']})
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
o.depends('type', 'rule_set');
|
o.depends('type', 'rule_set');
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
@@ -893,7 +904,12 @@ function renderPolicies(s, uciconfig) {
|
|||||||
hm.preset_outbound.direct.forEach((res) => {
|
hm.preset_outbound.direct.forEach((res) => {
|
||||||
o.value.apply(o, res);
|
o.value.apply(o, res);
|
||||||
})
|
})
|
||||||
o.load = L.bind(hm.loadProxyGroupLabel, o, hm.preset_outbound.direct);
|
o.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.direct,
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
o.editable = true;
|
o.editable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1041,16 +1057,28 @@ return view.extend({
|
|||||||
so.value.apply(so, res);
|
so.value.apply(so, res);
|
||||||
})
|
})
|
||||||
|
|
||||||
so = ss.taboption('field_general', form.MultiValue, 'groups', _('Group'));
|
so = ss.taboption('field_general', hm.MultiValue, 'groups', _('Group')); // @pr8758_merged
|
||||||
hm.preset_outbound.full.forEach((res) => {
|
hm.preset_outbound.proxy.forEach((res) => {
|
||||||
so.value.apply(so, res);
|
so.value.apply(so, res);
|
||||||
})
|
})
|
||||||
so.load = L.bind(hm.loadProxyGroupLabel, so, hm.preset_outbound.full);
|
so.keep_order = true;
|
||||||
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.proxy,
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.editable = true;
|
so.editable = true;
|
||||||
|
|
||||||
so = ss.taboption('field_general', form.MultiValue, 'proxies', _('Node'));
|
so = ss.taboption('field_general', hm.MultiValue, 'proxies', _('Node')); // @pr8758_merged
|
||||||
so.value('', _('-- Please choose --'));
|
so.value('', _('-- Please choose --'));
|
||||||
so.load = L.bind(hm.loadNodeLabel, so, [['', _('-- Please choose --')]]);
|
so.keep_order = true;
|
||||||
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'node')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.validate = function(section_id, value) {
|
so.validate = function(section_id, value) {
|
||||||
if (this.section.getOption('include_all').formvalue(section_id) === '1' ||
|
if (this.section.getOption('include_all').formvalue(section_id) === '1' ||
|
||||||
this.section.getOption('include_all_proxies').formvalue(section_id) === '1')
|
this.section.getOption('include_all_proxies').formvalue(section_id) === '1')
|
||||||
@@ -1062,9 +1090,15 @@ return view.extend({
|
|||||||
}
|
}
|
||||||
so.editable = true;
|
so.editable = true;
|
||||||
|
|
||||||
so = ss.taboption('field_general', form.MultiValue, 'use', _('Provider'));
|
so = ss.taboption('field_general', hm.MultiValue, 'use', _('Provider')); // @pr8758_merged
|
||||||
so.value('', _('-- Please choose --'));
|
so.value('', _('-- Please choose --'));
|
||||||
so.load = L.bind(hm.loadProviderLabel, so, [['', _('-- Please choose --')]]);
|
so.keep_order = true;
|
||||||
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'provider')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.validate = function(section_id, value) {
|
so.validate = function(section_id, value) {
|
||||||
if (this.section.getOption('include_all').formvalue(section_id) === '1' ||
|
if (this.section.getOption('include_all').formvalue(section_id) === '1' ||
|
||||||
this.section.getOption('include_all_providers').formvalue(section_id) === '1')
|
this.section.getOption('include_all_providers').formvalue(section_id) === '1')
|
||||||
@@ -1096,8 +1130,13 @@ return view.extend({
|
|||||||
hm.preset_outbound.proxy.forEach((res) => {
|
hm.preset_outbound.proxy.forEach((res) => {
|
||||||
so.value.apply(so, res);
|
so.value.apply(so, res);
|
||||||
})
|
})
|
||||||
so.load = L.bind(hm.loadNodeLabel, so, hm.preset_outbound.proxy);
|
so.load = function(section_id) {
|
||||||
so.modalonly = true;
|
return hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.proxy,
|
||||||
|
...hm.loadLabelValues(this.config, 'node')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
|
so.textvalue = hm.textvalue2Value;
|
||||||
|
|
||||||
/* Override fields */
|
/* Override fields */
|
||||||
so = ss.taboption('field_override', form.Flag, 'disable_udp', _('Disable UDP'));
|
so = ss.taboption('field_override', form.Flag, 'disable_udp', _('Disable UDP'));
|
||||||
@@ -1293,7 +1332,10 @@ return view.extend({
|
|||||||
|
|
||||||
so = ss.option(form.ListValue, 'SUB-RULE', _('SUB-RULE'));
|
so = ss.option(form.ListValue, 'SUB-RULE', _('SUB-RULE'));
|
||||||
so.load = function(section_id) {
|
so.load = function(section_id) {
|
||||||
hm.loadSubRuleGroup.call(this, [['', _('-- Please choose --')]], section_id);
|
hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'subrule-group')
|
||||||
|
], section_id);
|
||||||
|
|
||||||
return new RulesEntry(uci.get(data[0], section_id, 'entry')).subrule || '';
|
return new RulesEntry(uci.get(data[0], section_id, 'entry')).subrule || '';
|
||||||
}
|
}
|
||||||
@@ -1563,7 +1605,10 @@ return view.extend({
|
|||||||
|
|
||||||
so = ss.option(hm.ListValue, 'detour', _('Proxy group'));
|
so = ss.option(hm.ListValue, 'detour', _('Proxy group'));
|
||||||
so.load = function(section_id) {
|
so.load = function(section_id) {
|
||||||
hm.loadProxyGroupLabel.call(this, hm.preset_outbound.dns, section_id);
|
hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.dns,
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
|
||||||
return new DNSAddress(uci.get(data[0], section_id, 'address')).parseParam('detour');
|
return new DNSAddress(uci.get(data[0], section_id, 'address')).parseParam('detour');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const CBIBubblesValue = form.DummyValue.extend({
|
|||||||
__name__: 'CBI.BubblesValue',
|
__name__: 'CBI.BubblesValue',
|
||||||
|
|
||||||
load(section_id) {
|
load(section_id) {
|
||||||
const uciconfig = this.config || this.section.configthis.config || this.map.config;
|
const uciconfig = this.config || this.section.config || this.map.config;
|
||||||
const type = uci.get(uciconfig, section_id, 'type');
|
const type = uci.get(uciconfig, section_id, 'type');
|
||||||
const detour = uci.get(uciconfig, section_id, 'chain_tail_group') || uci.get(uciconfig, section_id, 'chain_tail');
|
const detour = uci.get(uciconfig, section_id, 'chain_tail_group') || uci.get(uciconfig, section_id, 'chain_tail');
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ const parseProviderYaml = hm.parseYaml.extend({
|
|||||||
url: cfg.url,
|
url: cfg.url,
|
||||||
size_limit: cfg["size-limit"],
|
size_limit: cfg["size-limit"],
|
||||||
interval: cfg.interval,
|
interval: cfg.interval,
|
||||||
proxy: cfg.proxy ? hm.preset_outbound.full.map(([key, label]) => key).includes(cfg.proxy) ? cfg.proxy : this.calcID(hm.glossary["proxy_group"].field, cfg.proxy) : null,
|
proxy: cfg.proxy ? hm.preset_outbound.direct.map(([key, label]) => key).includes(cfg.proxy) ? cfg.proxy : this.calcID(hm.glossary["proxy_group"].field, cfg.proxy) : null,
|
||||||
age_private_key: cfg["age-secret-key"],
|
age_private_key: cfg["age-secret-key"],
|
||||||
header: cfg.header ? JSON.stringify(cfg.header, null, 2) : null, // string: object
|
header: cfg.header ? JSON.stringify(cfg.header, null, 2) : null, // string: object
|
||||||
/* Health fields */
|
/* Health fields */
|
||||||
@@ -265,13 +265,23 @@ return view.extend({
|
|||||||
|
|
||||||
/* Rematch fields */
|
/* Rematch fields */
|
||||||
so = ss.taboption('field_general', form.ListValue, 'target_rematch_name', _('REMATCH-NAME marking'));
|
so = ss.taboption('field_general', form.ListValue, 'target_rematch_name', _('REMATCH-NAME marking'));
|
||||||
so.load = L.bind(hm.loadRematchName, so, [['', _('-- Please choose --')]]);
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'rematch-name')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.rmempty = false;
|
so.rmempty = false;
|
||||||
so.depends('type', 'rematch');
|
so.depends('type', 'rematch');
|
||||||
so.modalonly = true;
|
so.modalonly = true;
|
||||||
|
|
||||||
so = ss.taboption('field_general', form.ListValue, 'target_sub_rule', _('Use sub rule'));
|
so = ss.taboption('field_general', form.ListValue, 'target_sub_rule', _('Use sub rule'));
|
||||||
so.load = L.bind(hm.loadSubRuleGroup, so, [['', _('-- Please choose --')]]);
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'subrule-group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.depends('type', 'rematch');
|
so.depends('type', 'rematch');
|
||||||
so.modalonly = true;
|
so.modalonly = true;
|
||||||
|
|
||||||
@@ -1750,7 +1760,12 @@ return view.extend({
|
|||||||
hm.preset_outbound.direct.forEach((res) => {
|
hm.preset_outbound.direct.forEach((res) => {
|
||||||
so.value.apply(so, res);
|
so.value.apply(so, res);
|
||||||
})
|
})
|
||||||
so.load = L.bind(hm.loadProxyGroupLabel, so, hm.preset_outbound.direct);
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.direct,
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.textvalue = hm.textvalue2Value;
|
so.textvalue = hm.textvalue2Value;
|
||||||
//so.editable = true;
|
//so.editable = true;
|
||||||
so.depends('type', 'http');
|
so.depends('type', 'http');
|
||||||
@@ -2032,13 +2047,23 @@ return view.extend({
|
|||||||
so.modalonly = false;
|
so.modalonly = false;
|
||||||
|
|
||||||
so = ss.option(form.ListValue, 'chain_head_sub', _('Destination provider'));
|
so = ss.option(form.ListValue, 'chain_head_sub', _('Destination provider'));
|
||||||
so.load = L.bind(hm.loadProviderLabel, so, [['', _('-- Please choose --')]]);
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'provider')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.rmempty = false;
|
so.rmempty = false;
|
||||||
so.depends('type', 'provider');
|
so.depends('type', 'provider');
|
||||||
so.modalonly = true;
|
so.modalonly = true;
|
||||||
|
|
||||||
so = ss.option(form.ListValue, 'chain_head', _('Destination proxy node'));
|
so = ss.option(form.ListValue, 'chain_head', _('Destination proxy node'));
|
||||||
so.load = L.bind(hm.loadNodeLabel, so, [['', _('-- Please choose --')]]);
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'node')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.rmempty = false;
|
so.rmempty = false;
|
||||||
so.validate = function(section_id, value) {
|
so.validate = function(section_id, value) {
|
||||||
const chain_tail = this.section.getUIElement(section_id, 'chain_tail').getValue();
|
const chain_tail = this.section.getUIElement(section_id, 'chain_tail').getValue();
|
||||||
@@ -2052,13 +2077,23 @@ return view.extend({
|
|||||||
so.modalonly = true;
|
so.modalonly = true;
|
||||||
|
|
||||||
so = ss.option(form.ListValue, 'chain_tail_group', _('Transit proxy group'));
|
so = ss.option(form.ListValue, 'chain_tail_group', _('Transit proxy group'));
|
||||||
so.load = L.bind(hm.loadProxyGroupLabel, so, [['', _('-- Please choose --')]]);
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.rmempty = false;
|
so.rmempty = false;
|
||||||
so.depends({chain_tail: /.+/, '!reverse': true});
|
so.depends({chain_tail: /.+/, '!reverse': true});
|
||||||
so.modalonly = true;
|
so.modalonly = true;
|
||||||
|
|
||||||
so = ss.option(form.ListValue, 'chain_tail', _('Transit proxy node'));
|
so = ss.option(form.ListValue, 'chain_tail', _('Transit proxy node'));
|
||||||
so.load = L.bind(hm.loadNodeLabel, so, [['', _('-- Please choose --')]]);
|
so.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
['', _('-- Please choose --')],
|
||||||
|
...hm.loadLabelValues(this.config, 'node')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
so.rmempty = false;
|
so.rmempty = false;
|
||||||
so.validate = function(section_id, value) {
|
so.validate = function(section_id, value) {
|
||||||
const chain_head = this.section.getUIElement(section_id, 'chain_head').getValue();
|
const chain_head = this.section.getUIElement(section_id, 'chain_head').getValue();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const parseRulesetYaml = hm.parseYaml.extend({
|
|||||||
path_in_bundle: cfg["path-in-bundle"],
|
path_in_bundle: cfg["path-in-bundle"],
|
||||||
size_limit: cfg["size-limit"],
|
size_limit: cfg["size-limit"],
|
||||||
interval: cfg.interval,
|
interval: cfg.interval,
|
||||||
proxy: cfg.proxy ? hm.preset_outbound.full.map(([key, label]) => key).includes(cfg.proxy) ? cfg.proxy : this.calcID(hm.glossary["proxy_group"].field, cfg.proxy) : null,
|
proxy: cfg.proxy ? hm.preset_outbound.direct.map(([key, label]) => key).includes(cfg.proxy) ? cfg.proxy : this.calcID(hm.glossary["proxy_group"].field, cfg.proxy) : null,
|
||||||
header: cfg.header ? JSON.stringify(cfg.header, null, 2) : null, // string: object
|
header: cfg.header ? JSON.stringify(cfg.header, null, 2) : null, // string: object
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -406,7 +406,12 @@ return view.extend({
|
|||||||
hm.preset_outbound.direct.forEach((res) => {
|
hm.preset_outbound.direct.forEach((res) => {
|
||||||
o.value.apply(o, res);
|
o.value.apply(o, res);
|
||||||
})
|
})
|
||||||
o.load = L.bind(hm.loadProxyGroupLabel, o, hm.preset_outbound.direct);
|
o.load = function(section_id) {
|
||||||
|
return hm.loadLabel.call(this, [
|
||||||
|
...hm.preset_outbound.direct,
|
||||||
|
...hm.loadLabelValues(this.config, 'proxy_group')
|
||||||
|
], section_id);
|
||||||
|
}
|
||||||
o.textvalue = hm.textvalue2Value;
|
o.textvalue = hm.textvalue2Value;
|
||||||
//o.editable = true;
|
//o.editable = true;
|
||||||
o.depends('type', 'http');
|
o.depends('type', 'http');
|
||||||
|
|||||||
+4
-3
@@ -5,8 +5,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=smartdns
|
PKG_NAME:=smartdns
|
||||||
PKG_VERSION:=48
|
PKG_VERSION:=48.2
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=4
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/pymumu/smartdns/tar.gz/Release$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/pymumu/smartdns/tar.gz/Release$(PKG_VERSION)?
|
||||||
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
|
|||||||
include $(TOPDIR)/feeds/packages/lang/rust/rust-package.mk
|
include $(TOPDIR)/feeds/packages/lang/rust/rust-package.mk
|
||||||
|
|
||||||
MAKE_PATH:=src
|
MAKE_PATH:=src
|
||||||
MAKE_VARS+= VER=$(PKG_VERSION)
|
MAKE_VARS+= VER=$(PKG_VERSION) WITH_ZLIB=0
|
||||||
|
|
||||||
define Package/smartdns/Default
|
define Package/smartdns/Default
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
@@ -104,6 +104,7 @@ ifneq ($(CONFIG_PACKAGE_smartdns-ui),)
|
|||||||
pushd plugin/smartdns-ui ; \
|
pushd plugin/smartdns-ui ; \
|
||||||
$(CARGO_PKG_CONFIG_VARS) \
|
$(CARGO_PKG_CONFIG_VARS) \
|
||||||
MAKEFLAGS="$(PKG_JOBS)" \
|
MAKEFLAGS="$(PKG_JOBS)" \
|
||||||
|
WITH_ZLIB=0 \
|
||||||
TARGET_CFLAGS="$(filter-out -O%,$(TARGET_CFLAGS)) $(RUSTC_CFLAGS)" \
|
TARGET_CFLAGS="$(filter-out -O%,$(TARGET_CFLAGS)) $(RUSTC_CFLAGS)" \
|
||||||
BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$(TOOLCHAIN_ROOT_DIR)" \
|
BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$(TOOLCHAIN_ROOT_DIR)" \
|
||||||
cargo build -v --profile $(CARGO_PKG_PROFILE) \
|
cargo build -v --profile $(CARGO_PKG_PROFILE) \
|
||||||
|
|||||||
Reference in new issue
Block a user