From 1877c5c56a161570bfbf496b1f73405458f9cdd6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 7 Jan 2015 22:28:40 +0100 Subject: [PATCH] luci2: refresh views after modular rework Signed-off-by: Jo-Philipp Wich --- luci2/htdocs/luci2/view/network.interfaces.js | 12 ++++++------ luci2/htdocs/luci2/view/network.routes.js | 2 +- luci2/htdocs/luci2/view/status.overview.js | 10 +++++----- luci2/htdocs/luci2/view/system.leds.js | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/luci2/htdocs/luci2/view/network.interfaces.js b/luci2/htdocs/luci2/view/network.interfaces.js index a821ef5..8b925c7 100644 --- a/luci2/htdocs/luci2/view/network.interfaces.js +++ b/luci2/htdocs/luci2/view/network.interfaces.js @@ -151,11 +151,11 @@ L.ui.view.extend({ return $.when.apply($, deferreds).then(function() { $('button').prop('disabled', false); return $.when( - L.NetworkModel.refreshDeviceStatus(), - L.NetworkModel.refreshInterfaceStatus() + L.network.refreshDeviceStatus(), + L.network.refreshInterfaceStatus() ); }).then(function() { - var networks = L.NetworkModel.getInterfaces(); + var networks = L.network.getInterfaces(); for (var i = 0; i < networks.length; i++) { @@ -164,7 +164,7 @@ L.ui.view.extend({ } var max = 0.1; - var networks = L.NetworkModel.getInterfaces(); + var networks = L.network.getInterfaces(); for (var i = 0; i < networks.length; i++) { @@ -354,8 +354,8 @@ L.ui.view.extend({ execute: function() { var self = this; - return L.NetworkModel.init().then(function() { - self.renderContents(L.NetworkModel.getInterfaces()); + return L.network.load().then(function() { + self.renderContents(L.network.getInterfaces()); }); } }); diff --git a/luci2/htdocs/luci2/view/network.routes.js b/luci2/htdocs/luci2/view/network.routes.js index 4464706..c60fcf9 100644 --- a/luci2/htdocs/luci2/view/network.routes.js +++ b/luci2/htdocs/luci2/view/network.routes.js @@ -4,7 +4,7 @@ L.ui.view.extend({ execute: function() { var self = this; - var ifaces = L.NetworkModel.getInterfaces(); + var ifaces = L.network.getInterfaces(); var m = new L.cbi.Map('network', { readonly: !self.options.acls.network diff --git a/luci2/htdocs/luci2/view/status.overview.js b/luci2/htdocs/luci2/view/status.overview.js index 909c4c1..932fe29 100644 --- a/luci2/htdocs/luci2/view/status.overview.js +++ b/luci2/htdocs/luci2/view/status.overview.js @@ -22,9 +22,9 @@ L.ui.view.extend({ renderContents: function() { var self = this; return $.when( - L.NetworkModel.refreshStatus().then(function() { - var wan = L.NetworkModel.findWAN(); - var wan6 = L.NetworkModel.findWAN6(); + L.network.refreshStatus().then(function() { + var wan = L.network.findWAN(); + var wan6 = L.network.findWAN6(); if (!wan && !wan6) { @@ -41,7 +41,7 @@ L.ui.view.extend({ width: '146px', align: 'right', format: function(v) { - var dev = L.NetworkModel.resolveAlias(v.getDevice()); + var dev = L.network.resolveAlias(v.getDevice()); if (dev) return $('') .addClass('badge') @@ -411,7 +411,7 @@ L.ui.view.extend({ execute: function() { var self = this; - return L.NetworkModel.init().then(function() { + return L.network.load().then(function() { self.repeat(self.renderContents, 5000); }); } diff --git a/luci2/htdocs/luci2/view/system.leds.js b/luci2/htdocs/luci2/view/system.leds.js index 8165daf..ed46026 100644 --- a/luci2/htdocs/luci2/view/system.leds.js +++ b/luci2/htdocs/luci2/view/system.leds.js @@ -19,7 +19,7 @@ L.ui.view.extend({ prepare: function() { delete m.sections[0].fields._net_dev.choices; - var devs = L.NetworkModel.getDevices().sort(function(a, b) { + var devs = L.network.getDevices().sort(function(a, b) { if (a.name() < b.name()) return -1; else if (a.name() > b.name()) -- 2.30.2