luci-app-sqm: displays a list of scripts and descriptions based on iptables system functions
Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
parent
1f926d3e21
commit
e85f3d273b
@ -8,13 +8,6 @@
|
|||||||
'require tools.widgets as widgets';
|
'require tools.widgets as widgets';
|
||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
handleGetHelpText: function(script_name, tbl) {
|
|
||||||
return fs.read("/usr/lib/sqm/" + script_name + ".help").then(function (text) {
|
|
||||||
if (text)
|
|
||||||
return [script_name, text];
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEnableSQM: rpc.declare({
|
handleEnableSQM: rpc.declare({
|
||||||
object: 'luci',
|
object: 'luci',
|
||||||
method: 'setInitAction',
|
method: 'setInitAction',
|
||||||
@ -26,13 +19,11 @@ return view.extend({
|
|||||||
return Promise.all([
|
return Promise.all([
|
||||||
L.resolveDefault(fs.list('/var/run/sqm/available_qdiscs'), []),
|
L.resolveDefault(fs.list('/var/run/sqm/available_qdiscs'), []),
|
||||||
L.resolveDefault(fs.list('/usr/lib/sqm'), []).then(L.bind(function(scripts) {
|
L.resolveDefault(fs.list('/usr/lib/sqm'), []).then(L.bind(function(scripts) {
|
||||||
var tasks = [], scriptHelpTbl = {};
|
var result = [];
|
||||||
|
|
||||||
for (var i = 0; i < scripts.length; i++)
|
for (var i = 0; i < scripts.length; i++)
|
||||||
if (scripts[i].name.search(/\.qos$/) != -1)
|
if (scripts[i].name.search(/\.qos$/) != -1)
|
||||||
tasks.push(L.resolveDefault(this.handleGetHelpText(scripts[i].name, scriptHelpTbl), [scripts[i].name, null]));
|
result.push([scripts[i].name]);
|
||||||
|
return result;
|
||||||
return Promise.all(tasks);
|
|
||||||
}, this)),
|
}, this)),
|
||||||
uci.load('sqm')
|
uci.load('sqm')
|
||||||
]);
|
]);
|
||||||
@ -117,14 +108,31 @@ return view.extend({
|
|||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
var qos_desc = "";
|
var qos_desc = "";
|
||||||
|
var hasIptables = L.hasSystemFeature('iptables');
|
||||||
|
var helpTexts = {
|
||||||
|
"layer_cake.qos": _("This uses the cake qdisc as a replacement for both htb as shaper and fq_codel as leaf qdisc.") + "<br />"
|
||||||
|
+ _("This exercises cake's diffserv profile(s) as different \"layers\" of priority.") + "<br />"
|
||||||
|
+ _("This script requires that cake is selected as qdisc, and forces its usage.") + "<br />"
|
||||||
|
+ _("See:") + " http://www.bufferbloat.net/projects/codel/wiki/Cake " + _("for more information"),
|
||||||
|
"piece_of_cake.qos": _("This just uses the cake qdisc as a replacement for both htb as shaper and fq_codel as leaf qdisc.") + "<br />"
|
||||||
|
+ _("It just does not come any simpler than this, in other words it truely is a \"piece of cake\".") + "<br />"
|
||||||
|
+ _("This script requires that cake is selected as qdisc, and forces its usage.") + "<br />"
|
||||||
|
+ _("See:") + " http://www.bufferbloat.net/projects/codel/wiki/Cake " + _("for more information"),
|
||||||
|
"simple.qos": _("BW-limited three-tier prioritisation scheme with your qdisc on each queue."),
|
||||||
|
"simplest.qos": _("Simplest possible configuration: HTB rate limiter with your qdisc attached."),
|
||||||
|
"simplest_tbf.qos": _("Simplest possible configuration (TBF): TBF rate limiter with your qdisc attached.") + "<br />"
|
||||||
|
+ _("TBF may give better performance than HTB on some architectures. This script forces fq_codel usage if cake is selected as qdisc.")
|
||||||
|
};
|
||||||
o = s.taboption("tab_qdisc", form.ListValue, "script", _("Queue setup script"));
|
o = s.taboption("tab_qdisc", form.ListValue, "script", _("Queue setup script"));
|
||||||
for (i = 0; i < scripts.length; i++) {
|
for (var i = 0; i < scripts.length; i++) {
|
||||||
o.value(scripts[i][0]);
|
var scriptName = scripts[i][0];
|
||||||
qos_desc += "<p><b>" + scripts[i][0] + ":</b><br />";
|
if (!hasIptables && scriptName.indexOf("simple") === 0) {
|
||||||
if (scripts[i][1])
|
continue;
|
||||||
qos_desc += scripts[i][1] + "</p>";
|
}
|
||||||
else
|
o.value(scriptName);
|
||||||
qos_desc += "No help text</p>";
|
qos_desc += "<b>" + scriptName + ":</b><br />";
|
||||||
|
if (helpTexts[scriptName])
|
||||||
|
qos_desc += helpTexts[scriptName] + "</br></br>";
|
||||||
}
|
}
|
||||||
o.default = "piece_of_cake.qos";
|
o.default = "piece_of_cake.qos";
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
@ -304,3 +304,36 @@ msgstr ""
|
|||||||
#: applications/luci-app-sqm/htdocs/luci-static/resources/view/network/sqm.js:219
|
#: applications/luci-app-sqm/htdocs/luci-static/resources/view/network/sqm.js:219
|
||||||
msgid "default"
|
msgid "default"
|
||||||
msgstr "默认"
|
msgstr "默认"
|
||||||
|
|
||||||
|
msgid "This uses the cake qdisc as a replacement for both htb as shaper and fq_codel as leaf qdisc."
|
||||||
|
msgstr "该脚本使用 cake 队列规则(qdisc)来替代 htb(分层令牌桶)作为流量整形器,同时取代 fq_codel 作为叶节点队列规则。"
|
||||||
|
|
||||||
|
msgid "This exercises cake's diffserv profile(s) as different \"layers\" of priority."
|
||||||
|
msgstr "它通过 cake 的差异化服务(diffserv)策略来模拟不同"层级"的流量优先级。"
|
||||||
|
|
||||||
|
msgid "This script requires that cake is selected as qdisc, and forces its usage."
|
||||||
|
msgstr "该脚本要求并强制使用 cake 作为队列规则(qdisc)。"
|
||||||
|
|
||||||
|
msgid "See:"
|
||||||
|
msgstr "参考:"
|
||||||
|
|
||||||
|
msgid "for more information"
|
||||||
|
msgstr "了解更多信息"
|
||||||
|
|
||||||
|
msgid "This just uses the cake qdisc as a replacement for both htb as shaper and fq_codel as leaf qdisc."
|
||||||
|
msgstr "该脚本仅使用 cake 队列规则(qdisc),同时替代 htb 作为整形器和 fq_codel 作为叶队列规则。"
|
||||||
|
|
||||||
|
msgid "It just does not come any simpler than this, in other words it truely is a \"piece of cake\"."
|
||||||
|
msgstr "这已经是最简单的配置了,换句话说,这真的是“小菜一碟”。"
|
||||||
|
|
||||||
|
msgid "BW-limited three-tier prioritisation scheme with your qdisc on each queue."
|
||||||
|
msgstr "带宽受限的三层优先级方案,每个队列都可使用您选择的 qdisc。"
|
||||||
|
|
||||||
|
msgid "Simplest possible configuration: HTB rate limiter with your qdisc attached."
|
||||||
|
msgstr "最简单的配置:HTB 限速器,并绑定您选择的 qdisc。"
|
||||||
|
|
||||||
|
msgid "Simplest possible configuration (TBF): TBF rate limiter with your qdisc attached."
|
||||||
|
msgstr "最简单的配置(TBF):TBF 限速器,并绑定您选择的 qdisc。"
|
||||||
|
|
||||||
|
msgid "TBF may give better performance than HTB on some architectures. This script forces fq_codel usage if cake is selected as qdisc."
|
||||||
|
msgstr "在某些架构上,TBF 可能比 HTB 有更好的性能。当 cake 被选为 qdisc 时,该脚本会强制使用 fq_codel。"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user