luci2: refresh views after modular rework
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Jan 2015 21:28:40 +0000 (22:28 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Jan 2015 21:28:40 +0000 (22:28 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
luci2/htdocs/luci2/view/network.interfaces.js
luci2/htdocs/luci2/view/network.routes.js
luci2/htdocs/luci2/view/status.overview.js
luci2/htdocs/luci2/view/system.leds.js

index a821ef5530838b06b24a4ca7a85ba966c848571a..8b925c7d9e13b1ec5160889a462aa0f5ceda3b9e 100644 (file)
@@ -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());
                });
        }
 });
index 44647069e973a62e881abd7087feece601cf2191..c60fcf9cb5d645cab485b32f33b5c698da71bcaa 100644 (file)
@@ -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
index 909c4c101b453f10364d146c3306056e2a7c92a1..932fe2912374331c8920ed4a4bdc17b0400199b9 100644 (file)
@@ -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 $('<span />')
                                                                        .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);
         });
        }
index 8165dafb3786e5b3209394cac387d86d695870de..ed4602673c029a0b4327658b6b8ab76008c326dc 100644 (file)
@@ -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())