mirror of
https://github.com/openwrt/luci.git
synced 2026-06-17 17:03:20 +04:00
luci-app-mwan3: only request interfaces status
Before mwan3 rpcd plugin optimisations, same change in prometheus-node-exporter-lua changed request time from 1.9s to 1.3s. Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
This commit is contained in:
+3
-2
@@ -6,6 +6,7 @@
|
||||
const callMwan3Status = rpc.declare({
|
||||
object: 'mwan3',
|
||||
method: 'status',
|
||||
params: ['section'],
|
||||
expect: { },
|
||||
});
|
||||
|
||||
@@ -76,13 +77,13 @@ function renderMwan3Status(status) {
|
||||
return view.extend({
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
callMwan3Status(),
|
||||
callMwan3Status("interfaces"),
|
||||
]);
|
||||
},
|
||||
|
||||
render: function (data) {
|
||||
poll.add(function() {
|
||||
return callMwan3Status().then(function(result) {
|
||||
return callMwan3Status("interfaces").then(function(result) {
|
||||
var view = document.getElementById('mwan3-service-status');
|
||||
view.innerHTML = renderMwan3Status(result);
|
||||
});
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
const callMwan3Status = rpc.declare({
|
||||
object: 'mwan3',
|
||||
method: 'status',
|
||||
params: ['section'],
|
||||
expect: { },
|
||||
});
|
||||
|
||||
@@ -19,7 +20,7 @@ return baseclass.extend({
|
||||
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
callMwan3Status(),
|
||||
callMwan3Status("interfaces"),
|
||||
]);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user