mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 09:54:06 +08:00
🛸 Sync 2026-10-20 02:16:58
This commit is contained in:
1 parent
64729a26c6
commit
590565b35a
25 files changed
+887
-408
No files matched your search
@@ -393,8 +393,11 @@ return L.view.extend({
|
||||
|
||||
o = s.option(form.Value, "multipath_weight", _("Weight"), _("Only used by *weight schedulers/path managers. Ignored if no weight scheduler is selected.") + '<br />' + _("A weight >100 make it more attractive, a weight <100 make it less attractive. Max 256"));
|
||||
o.datatype = "uinteger";
|
||||
o.rmempty = false;
|
||||
o.default = 100;
|
||||
// 100 shown as a placeholder, not a default: with a default every Save
|
||||
// of this page wrote multipath_weight='100' on each interface that had
|
||||
// none. Unset means 100 for every reader (omr-weight-sync, mqvpn).
|
||||
o.placeholder = "100";
|
||||
o.rmempty = true;
|
||||
|
||||
return m.render();
|
||||
}
|
||||
|
||||
@@ -12,12 +12,10 @@ var callMptcpCheckTrace = rpc.declare({
|
||||
|
||||
return view.extend({
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
uci.load('network'),
|
||||
// only for the old copy of the mode below: the ACL doesn't
|
||||
// give this config (VPS passwords and tokens) to non-root users
|
||||
L.resolveDefault(uci.load('openmptcprouter'), null)
|
||||
]);
|
||||
// network only: the old openmptcprouter.<iface>.multipath copy is
|
||||
// left out, the ACL does not grant that config (VPS password and
|
||||
// token)
|
||||
return uci.load('network');
|
||||
},
|
||||
|
||||
render: function() {
|
||||
@@ -25,8 +23,7 @@ return view.extend({
|
||||
uci.sections('network', 'interface', function(s) {
|
||||
var name = s['.name'];
|
||||
if (name === 'loopback') return;
|
||||
var multipath = s.multipath ||
|
||||
uci.get('openmptcprouter', name, 'multipath') || 'off';
|
||||
var multipath = s.multipath || 'off';
|
||||
if (multipath !== 'off')
|
||||
ifaces.push(name);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
'require form';
|
||||
'require uci';
|
||||
'require rpc';
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Ycarus (Yannick Chabanois) <contact@openmptcprouter.com> for OpenMPTCProuter
|
||||
@@ -34,6 +35,13 @@ var DSCP_CLASSES = [
|
||||
['ef', _('EF (46) - Voice')]
|
||||
];
|
||||
|
||||
// mqvpn's state through rpcd: the ACL does not grant the mqvpn config (PSK)
|
||||
var callMqvpnState = rpc.declare({
|
||||
object: 'luci.mptcp',
|
||||
method: 'mqvpn_state',
|
||||
expect: { '': {} }
|
||||
});
|
||||
|
||||
// Same WAN filter as this app's own mptcp.js "Interfaces Settings"
|
||||
// section: excludes the pseudo-interfaces that are never a real WAN.
|
||||
function isEligibleIface(name) {
|
||||
@@ -76,21 +84,22 @@ return L.view.extend({
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
uci.load('network'),
|
||||
// mqvpn may not be installed at all -- resolve to null instead
|
||||
// of rejecting the whole page's load() in that case.
|
||||
L.resolveDefault(uci.load('mqvpn'), null)
|
||||
// mqvpn may not be installed at all -- resolve to "disabled"
|
||||
// instead of rejecting the whole page's load() in that case.
|
||||
L.resolveDefault(callMqvpnState(), {})
|
||||
]);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
render: function(data) {
|
||||
var m, s, o;
|
||||
var mqvpn = (data && data[1]) || {};
|
||||
|
||||
var mptcpScheduler = normalizeSchedulerValue(uci.get('network', 'globals', 'mptcp_scheduler'));
|
||||
var mptcpHasDscpScheduler = (mptcpScheduler === 'bpf_dscp');
|
||||
var mptcpHasWeightScheduler = (mptcpScheduler === 'bpf_weight' || mptcpScheduler === 'bpf_weight_rr' || mptcpScheduler === 'bpf_burstweight');
|
||||
|
||||
var mqvpnEnabled = (uci.get('mqvpn', 'settings', 'enable') === '1');
|
||||
var mqvpnScheduler = uci.get('mqvpn', 'multipath', 'scheduler');
|
||||
var mqvpnEnabled = (mqvpn.enabled === true);
|
||||
var mqvpnScheduler = mqvpn.scheduler;
|
||||
// mqvpn has no scheduler value dedicated to DSCP the way MPTCP has
|
||||
// bpf_dscp -- 007-mqvpn-dscp pushes the DSCP mask unconditionally
|
||||
// whenever mqvpn is enabled, regardless of which scheduler is
|
||||
@@ -170,8 +179,10 @@ return L.view.extend({
|
||||
o = s.option(form.Value, 'multipath_weight', _('Weight'),
|
||||
_('A weight >100 makes a WAN more attractive, a weight <100 makes it less attractive. Max 256.'));
|
||||
o.datatype = 'uinteger';
|
||||
o.rmempty = false;
|
||||
o.default = 100;
|
||||
// a placeholder, not a default: a default made every Save write
|
||||
// multipath_weight='100' on each WAN that had none (unset is 100)
|
||||
o.placeholder = '100';
|
||||
o.rmempty = true;
|
||||
}
|
||||
|
||||
return m.render();
|
||||
|
||||
Reference in new issue
Block a user