From 4411d183e7da1799b0256f6fdbdfc1ef0461c463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Thu, 7 May 2015 12:07:15 +0200 Subject: [PATCH] Added many new features --- luciexpress/README.md | 6 +- luciexpress/htdocs/js/app.js | 24 +--- luciexpress/htdocs/js/config.js | 33 ++---- luciexpress/htdocs/js/init.js | 3 + luciexpress/htdocs/js/localStorage.js | 24 +--- luciexpress/htdocs/js/navigation.js | 23 +--- luciexpress/htdocs/js/rpc.js | 26 +---- luciexpress/htdocs/js/session.js | 24 +--- luciexpress/htdocs/js/status.js | 2 + luciexpress/htdocs/js/theme.js | 24 +--- luciexpress/htdocs/js/tr.js | 24 +--- luciexpress/htdocs/js/uci.js | 65 ++++++++++- .../htdocs/plugins/core/pages/overview.html | 4 +- .../htdocs/plugins/core/pages/overview.js | 106 ++++++++++-------- luciexpress/htdocs/plugins/core/plugin.json | 1 + .../plugins/core/widgets/luci.dropdown.js | 50 +++++++++ .../plugins/core/widgets/theme_picker.js | 4 +- .../core/widgets/wifi.signal.indicator.js | 12 +- .../plugins/phone/pages/phone.call_log.html | 7 -- .../plugins/phone/pages/phone.call_log.js | 29 +---- .../settings/pages/settings.configuration.js | 5 +- .../settings/pages/settings.upgrade.html | 4 +- .../settings/pages/settings.upgrade.js | 67 ++++------- .../plugins/status/pages/status.about.html | 20 +++- .../status/pages/status.diagnostics.html | 45 +++----- .../status/pages/status.diagnostics.js | 36 +++++- .../plugins/status/pages/status.restart.html | 9 +- .../plugins/status/pages/status.restart.js | 8 +- .../plugins/status/pages/status.status.dsl.js | 29 +++-- .../status/pages/status.status.voice.js | 1 + .../htdocs/plugins/wifi/pages/wifi.general.js | 3 +- .../htdocs/plugins/wifi/pages/wifi.wps.html | 2 +- .../htdocs/themes/vodafone/css/theme.css | 14 ++- .../widgets/luci.layout.single_column.html | 10 +- .../widgets/luci.layout.with_sidebar.html | 10 +- luciexpress/share/acl.d/luci2.json | 24 +++- luciexpress/src/rpcd/luci2.c | 61 +++------- questd/src/igmp.c | 3 +- 38 files changed, 413 insertions(+), 429 deletions(-) create mode 100644 luciexpress/htdocs/plugins/core/widgets/luci.dropdown.js diff --git a/luciexpress/README.md b/luciexpress/README.md index d370f4220..bbd7de23a 100644 --- a/luciexpress/README.md +++ b/luciexpress/README.md @@ -90,7 +90,11 @@ The menu system in the gui is actually created on the router side and retreived License Notice -------------- -Project Author: Martin K. Schröder +Contributors: + - Noel Wuyts : angular, widgets, development + - Feten Besbes : css + +Project lead: Martin K. Schröder Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. diff --git a/luciexpress/htdocs/js/app.js b/luciexpress/htdocs/js/app.js index 46bc00b04..de69bff72 100644 --- a/luciexpress/htdocs/js/app.js +++ b/luciexpress/htdocs/js/app.js @@ -1,25 +1,5 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder + $.jsonRPC.setup({ endPoint: '/ubus', namespace: 'luci' diff --git a/luciexpress/htdocs/js/config.js b/luciexpress/htdocs/js/config.js index 9f11eb2a2..e5fa888ba 100644 --- a/luciexpress/htdocs/js/config.js +++ b/luciexpress/htdocs/js/config.js @@ -1,25 +1,5 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder + angular.module("luci") .factory('$config', function(){ return { @@ -80,8 +60,17 @@ angular.module("luci") "asterisk.status", "luci2.system.password_set", "luci2.system.backup_restore", + "luci2.system.upgrade_test", + "luci2.system.upgrade_clean", + "luci2.system.upgrade_start", "luci2.system.reset_test", "luci2.system.reset_start", + "luci2.system.reboot", + "luci2.system.ping", + "luci2.network.ping", + "luci2.network.traceroute", + "network.interface.dump", + "router.networks", // local stuff for the node server. "local.features", "local.set_rpc_host" diff --git a/luciexpress/htdocs/js/init.js b/luciexpress/htdocs/js/init.js index ff05738c9..7aa6ad7ae 100644 --- a/luciexpress/htdocs/js/init.js +++ b/luciexpress/htdocs/js/init.js @@ -1,3 +1,5 @@ +//! Author: Martin K. Schröder + angular.module("luci") .controller("InitPageController", function($scope, $tr, $state, $stateParams, $config, $session, $localStorage, @@ -41,6 +43,7 @@ angular.module("luci") if(page.view){ //scripts.push(plugin_root + "/" + page.view); //console.log("Registering state "+k.replace(/\./g, "_")); + // TODO: there is still a problem with state changes where template gets loaded before the dependencies so controller is not found $juci.$stateProvider.state(k.replace(/\./g, "_"), { url: "/"+k, views: { diff --git a/luciexpress/htdocs/js/localStorage.js b/luciexpress/htdocs/js/localStorage.js index 06a1af31f..ab0e8a38e 100644 --- a/luciexpress/htdocs/js/localStorage.js +++ b/luciexpress/htdocs/js/localStorage.js @@ -1,25 +1,5 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder + // service for managing session data angular.module("luci") .factory('$localStorage', function() { diff --git a/luciexpress/htdocs/js/navigation.js b/luciexpress/htdocs/js/navigation.js index 60e209404..183a157c7 100644 --- a/luciexpress/htdocs/js/navigation.js +++ b/luciexpress/htdocs/js/navigation.js @@ -1,25 +1,4 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder // provides a service for managing all pages // pages register with this service, and menus can query it to get the navigation tree diff --git a/luciexpress/htdocs/js/rpc.js b/luciexpress/htdocs/js/rpc.js index 354a46faf..815d99343 100644 --- a/luciexpress/htdocs/js/rpc.js +++ b/luciexpress/htdocs/js/rpc.js @@ -1,25 +1,5 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder + // luci rpc module for communicating with the server angular.module("luci") .factory('$rpc', function($rootScope, $config, gettext){ @@ -71,7 +51,7 @@ angular.module("luci") } }, error: function(result){ - console.error("RPC error: "+JSON.stringify(result)); + console.error("RPC error ("+namespace+"."+method+"): "+JSON.stringify(result)); if(result && result.error){ deferred.reject(result.error); $rootScope.$broadcast("error", result.error.message); diff --git a/luciexpress/htdocs/js/session.js b/luciexpress/htdocs/js/session.js index 0120d0535..9f0db2dac 100644 --- a/luciexpress/htdocs/js/session.js +++ b/luciexpress/htdocs/js/session.js @@ -1,25 +1,5 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder + // service for managing session data angular.module("luci") .factory('$session', function($rpc, $rootScope, $localStorage, $rpc) { diff --git a/luciexpress/htdocs/js/status.js b/luciexpress/htdocs/js/status.js index 1c8ef0f3d..84182c542 100644 --- a/luciexpress/htdocs/js/status.js +++ b/luciexpress/htdocs/js/status.js @@ -1,3 +1,5 @@ +//! Author: Martin K. Schröder + angular.module("luci") .factory('$status', function($rpc) { var updates = { diff --git a/luciexpress/htdocs/js/theme.js b/luciexpress/htdocs/js/theme.js index 56bada4f2..228bc955c 100644 --- a/luciexpress/htdocs/js/theme.js +++ b/luciexpress/htdocs/js/theme.js @@ -1,25 +1,5 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder + // luci rpc module for communicating with the server angular.module("luci") .factory('$theme', function($rootScope, $config, $localStorage, $http){ diff --git a/luciexpress/htdocs/js/tr.js b/luciexpress/htdocs/js/tr.js index 12cd678d1..66c0ef2e0 100644 --- a/luciexpress/htdocs/js/tr.js +++ b/luciexpress/htdocs/js/tr.js @@ -1,25 +1,5 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - +//! Author: Martin K. Schröder + // service for managing session data angular.module("luci") .factory('$tr', function(gettextCatalog) { diff --git a/luciexpress/htdocs/js/uci.js b/luciexpress/htdocs/js/uci.js index e224216f7..e9aa4287e 100644 --- a/luciexpress/htdocs/js/uci.js +++ b/luciexpress/htdocs/js/uci.js @@ -1,3 +1,5 @@ +//! Author: Martin K. Schröder + angular.module("luci") .provider('$uci', function($rpcProvider){ $rpc = $rpcProvider.$get(); @@ -53,6 +55,55 @@ angular.module("luci") "disabled": { dvalue: false, type: Boolean }, "ping_wan": { dvalue: false, type: Boolean } }, + "voice_client-brcm_line": { + "extension": { dvalue: '', type: String }, + "sip_account": { dvalue: '', type: String }, + "noise": { dvalue: false, type: Boolean }, + "vad": { dvalue: false, type: Boolean }, + "txgain": { dvalue: false, type: Boolean }, + "rxgain": { dvalue: false, type: Boolean }, + "echo_cancel": { dvalue: true, type: Boolean }, + "callwaiting": { dvalue: false, type: Boolean }, + "clir": { dvalue: false, type: Boolean }, + "name": { dvalue: '', type: String }, + "instance": { dvalue: '', type: String } + }, + "voice_client-sip_service_provider": { + "name": { dvalue: "Account 1", type: String }, + "codec0": { dvalue: "alaw", type: String }, + "codec1": { dvalue: "ulaw", type: String }, + "codec2": { dvalue: "g729", type: String }, + "codec3": { dvalue: "g726", type: String }, + "autoframing": { dvalue: false, type: Boolean }, + "cfim_on": { dvalue: "*21*", type: String }, + "cfim_off": { dvalue: "#21#", type: String }, + "cfbs_on": { dvalue: "*61*", type: String }, + "cfbs_off": { dvalue: "#61#", type: String }, + "call_return": { dvalue: "*69", type: String }, + "redial": { dvalue: "*66", type: String }, + "is_fax": { dvalue: false, type: Boolean }, + "transport": { dvalue: "udp", type: String }, + "priority_ulaw": { dvalue: 0, type: Number }, + "priority_alaw": { dvalue: 0, type: Number }, + "priority_g729": { dvalue: 0, type: Number }, + "priority_g723": { dvalue: 0, type: Number }, + "priority_g726": { dvalue: 0, type: Number }, + "enabled": { dvalue: true, type: Boolean }, + "target": { dvalue: "direct", type: String }, + "call_lines": { dvalue: "BRCM/4", type: String }, + "mailbox": { dvalue: "-", type: String }, + "call_filter": { dvalue: "-", type: String }, + "domain": { dvalue: "217.27.161.62", type: String }, + "user": { dvalue: "0854601910", type: String }, + "authuser": { dvalue: "0854601910", type: String }, + "displayname": { dvalue: "TEST", type: String }, + "ptime_ulaw": { dvalue: 20, type: Number }, + "ptime_g726": { dvalue: 20, type: Number }, + "ptime_g729": { dvalue: 20, type: Number }, + "ptime_alaw": { dvalue: 20, type: Number }, + "host": { dvalue: "217.27.161.62", type: String }, + "outboundproxy": { dvalue: "217.27.161.62", type: String } + }, "wifi-status": { "wlan": { dvalue: true, type: Boolean }, "wps": { dvalue: true, type: Boolean }, @@ -80,8 +131,8 @@ angular.module("luci") "dtim_period":{ dvalue: 0, type: Number }, "beacon_int": { dvalue: 0, type: Number }, "rxchainps": { dvalue: false, type: Boolean }, - "rxchainps_qt":{dvalue: 0, type: Number }, - "rxchainps_pps":{dvalue: 0, type: Number }, + "rxchainps_qt":{ dvalue: 0, type: Number }, + "rxchainps_pps":{ dvalue: 0, type: Number }, "rifs": { dvalue: false, type: Boolean }, "rifs_advert":{ dvalue: false, type: Boolean }, "maxassoc": { dvalue: 0, type: Number }, @@ -366,12 +417,18 @@ angular.module("luci") if(!(configs instanceof Array)) configs = [configs]; if(!configs || configs.length == 0) { next(); return; }; async.eachSeries(configs, function(cf, next){ - if(!(cf in self)) { next("invalid config name "+cf); return; }; + if(!(cf in self)) { + console.error("invalid config name "+cf); + next(); + return; + }; self[cf].$sync().done(function(){ console.log("Synched config "+cf); next(); }).fail(function(){ - next("Could not sync config "+cf); + console.error("Could not sync config "+cf); + next(); // continue because we want to sync as many as we can! + //next("Could not sync config "+cf); }); }, function(err){ next(err); diff --git a/luciexpress/htdocs/plugins/core/pages/overview.html b/luciexpress/htdocs/plugins/core/pages/overview.html index 72948b83c..2ce0e3daf 100644 --- a/luciexpress/htdocs/plugins/core/pages/overview.html +++ b/luciexpress/htdocs/plugins/core/pages/overview.html @@ -21,7 +21,7 @@ Router
{{wireless.clients.length}}
{{network.clients.length}}
-
{{sipAccounts.length}}
+
{{sipAccounts.length||0}}
@@ -90,7 +90,7 @@
U{{$index}}
-
{{sip.username}}
+
{{sip.user.value}}
diff --git a/luciexpress/htdocs/plugins/core/pages/overview.js b/luciexpress/htdocs/plugins/core/pages/overview.js index e2c1b45d0..0777683c4 100644 --- a/luciexpress/htdocs/plugins/core/pages/overview.js +++ b/luciexpress/htdocs/plugins/core/pages/overview.js @@ -13,52 +13,68 @@ $juci.module("core") }; function refresh() { - $uci.sync(["wireless", "easybox"]).done(function(){ - //var sections = result.values; - //var cfgs = Object.keys(sections).filter(function(x) { return x.indexOf("cfg") == 0; }); - //$scope.wireless.wps = cfgs.filter(function(x) { return cfgs["wps_pbc"] == 1; }).length != 0; - $scope.wifi = $uci.wireless; - $scope.easybox = $uci.easybox; - $scope.wifiSchedStatus = (($scope.wifi.status.schedule.value)?gettext("on"):gettext("off")); - $scope.wifiWPSStatus = (($scope.easybox.settings.wpsbutton.value)?gettext("on"):gettext("off")); - $scope.defaultHostName = $tr(gettext("Unknown")); - async.series([ - function(next){ - $rpc.router.clients().done(function(clients){ - //alert(JSON.stringify(Object.keys(clients).map(function(x) { return clients[x]; }))); - var all = Object.keys(clients).map(function(x) { return clients[x]; }); - $scope.wireless.clients = all.filter(function(x){ - return x.connected && x.wireless == true; - }); - $scope.network.clients = all.filter(function(x){ - return x.connected && x.wireless == false; - }); - next(); + //var sections = result.values; + //var cfgs = Object.keys(sections).filter(function(x) { return x.indexOf("cfg") == 0; }); + //$scope.wireless.wps = cfgs.filter(function(x) { return cfgs["wps_pbc"] == 1; }).length != 0; + + $scope.defaultHostName = $tr(gettext("Unknown")); + $scope.sipAccounts = []; + $scope.wifiSchedStatus = gettext("off"); + $scope.wifiWPSStatus = gettext("off"); + async.series([ + function(next){ + $uci.sync(["wireless", "easybox", "voice_client"]).done(function(){ + $scope.wifi = $uci.wireless; + $scope.easybox = $uci.easybox; + $scope.voice_client = $uci.voice_client; + if($uci.wireless && $uci.wireless.status) + $scope.wifiSchedStatus = (($uci.wireless.status.schedule.value)?gettext("on"):gettext("off")); + if($uci.wireless && $uci.wireless.wps) + $scope.wifiWPSStatus = (($scope.easybox.settings.wpsbutton.value)?gettext("on"):gettext("off")); + if($uci.voice_client && $uci.voice_client["@sip_service_provider"]){ + $scope.sipAccounts = $uci.voice_client["@sip_service_provider"]; + } + }).always(function(){ next(); }); + }, + function(next){ + $rpc.router.clients().done(function(clients){ + //alert(JSON.stringify(Object.keys(clients).map(function(x) { return clients[x]; }))); + var all = Object.keys(clients).map(function(x) { return clients[x]; }); + $scope.wireless.clients = all.filter(function(x){ + return x.connected && x.wireless == true; }); - }, - function(next){ - $rpc.asterisk.status().done(function(data){ - if(data && data.sip){ - var accounts = []; - Object.keys(data.sip).map(function(k){ - if(data.sip[k].ip) accounts.push(data.sip[k]); - }); - $scope.sipAccounts = accounts; - } - }).always(function(){ next(); }); - }, - function(next){ - $rpc.router.dslstats().done(function(dslstats){ - var stats = dslstats.dslstats; - if(stats && stats.bearers && stats.bearers.length > 0){ - $scope.dsl.max_rate_up = Math.round(stats.bearers[0].max_rate_up / 1000); - $scope.dsl.max_rate_down = Math.round(stats.bearers[0].max_rate_down / 1000); - } - }).always(function(){ next(); }); - } - ], function(){ - $scope.$apply(); - }); + $scope.network.clients = all.filter(function(x){ + return x.connected && x.wireless == false; + }); + next(); + }).fail(function(){ + next(); + });; + }, + function(next){ + /*$rpc.asterisk.status().done(function(data){ + if(data && data.sip){ + var accounts = []; + Object.keys(data.sip).map(function(k){ + if(data.sip[k].ip) accounts.push(data.sip[k]); + }); + $scope.sipAccounts = accounts; + } + }).always(function(){ next(); }); */ + // just fall through + next(); + }, + function(next){ + $rpc.router.dslstats().done(function(dslstats){ + var stats = dslstats.dslstats; + if(stats && stats.bearers && stats.bearers.length > 0){ + $scope.dsl.max_rate_up = Math.round(stats.bearers[0].max_rate_up / 1000); + $scope.dsl.max_rate_down = Math.round(stats.bearers[0].max_rate_down / 1000); + } + }).always(function(){ next(); }); + } + ], function(){ + $scope.$apply(); }); } refresh(); //setInterval(refresh, 5000); diff --git a/luciexpress/htdocs/plugins/core/plugin.json b/luciexpress/htdocs/plugins/core/plugin.json index 357cf5633..b52516cee 100644 --- a/luciexpress/htdocs/plugins/core/plugin.json +++ b/luciexpress/htdocs/plugins/core/plugin.json @@ -5,6 +5,7 @@ "widgets/luci.progress", "widgets/luci.table", "widgets/luci.config", + "widgets/luci.dropdown", "widgets/luci.layout.naked", "widgets/luci.layout.single_column", "widgets/luci.layout.with_sidebar", diff --git a/luciexpress/htdocs/plugins/core/widgets/luci.dropdown.js b/luciexpress/htdocs/plugins/core/widgets/luci.dropdown.js new file mode 100644 index 000000000..b8530d2a5 --- /dev/null +++ b/luciexpress/htdocs/plugins/core/widgets/luci.dropdown.js @@ -0,0 +1,50 @@ +$juci.module("core") +.directive('luciDropdown', function ($compile) { + return { + restrict: 'E', + scope: { + items: '=ngModel', + doSelect: '&onChange', + selectedItem: '=ngSelected', + placeholder: '@placeholder' + }, + link: function (scope, element, attrs) { + var html = ''; + switch (attrs.type) { + case "button": + html += '
'; + break; + default: + html += ''; + element.append($compile(html)(scope)); + scope.$watch("items", function(){ + if(scope.items){ + if(scope.items.length) scope.bSelectedItem = scope.items[0]; + for (var i = 0; i < scope.items.length; i++) { + if (scope.items[i].id === scope.selectedItem) { + scope.bSelectedItem = scope.items[i]; + break; + } + } + } + }); + scope.selectVal = function (item) { + if(!item) return; + switch (attrs.type) { + case "button": + $('button.button-label', element).html(item.label); + break; + default: + $('a.dropdown-toggle', element).html(' ' + item.label); + break; + } + scope.selectedItem = item; + scope.doSelect(item); + }; + scope.selectVal(scope.bSelectedItem); + } + }; +}); diff --git a/luciexpress/htdocs/plugins/core/widgets/theme_picker.js b/luciexpress/htdocs/plugins/core/widgets/theme_picker.js index 08b001b1c..eb4d8abfa 100644 --- a/luciexpress/htdocs/plugins/core/widgets/theme_picker.js +++ b/luciexpress/htdocs/plugins/core/widgets/theme_picker.js @@ -15,6 +15,8 @@ $juci.module("core") }; }); $scope.onChangeTheme = function(item){ - $theme.changeTheme(item.id); + $theme.changeTheme(item.id).done(function(){ + window.location.reload(); + }); } }); diff --git a/luciexpress/htdocs/plugins/core/widgets/wifi.signal.indicator.js b/luciexpress/htdocs/plugins/core/widgets/wifi.signal.indicator.js index ab3454bfe..1017aa61a 100644 --- a/luciexpress/htdocs/plugins/core/widgets/wifi.signal.indicator.js +++ b/luciexpress/htdocs/plugins/core/widgets/wifi.signal.indicator.js @@ -11,14 +11,14 @@ $juci.module("core") require: "^ngModel" }; }).controller("wifiSignalIndicator", function($scope, $uci, $rpc){ - var step = 100 / 4; $scope.bars = [false, false, false, false]; $scope.$watch("value", function(value){ - $scope.bars[0] = true; - $scope.bars[1] = $scope.bars[2] = $scope.bars[3] = false; - if(value > step) $scope.bars[1] = true; - if(value > (step * 2)) $scope.bars[2] = true; - if(value > (step * 3)) $scope.bars[3] = true; + var q = value / 5; + $scope.bars[0] = $scope.bars[1] = $scope.bars[2] = $scope.bars[3] = false; + if(value > 1) $scope.bars[0] = true; + if(value > 2) $scope.bars[1] = true; + if(value > 3) $scope.bars[2] = true; + if(value > 4) $scope.bars[3] = true; }); $scope.barStyle = function(idx, active){ var height = 5 + ((idx) * 5); diff --git a/luciexpress/htdocs/plugins/phone/pages/phone.call_log.html b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.html index 1debe9ec3..c322c08b6 100644 --- a/luciexpress/htdocs/plugins/phone/pages/phone.call_log.html +++ b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.html @@ -1,5 +1,4 @@ -
{{ 'Call Log' | translate }} @@ -34,11 +33,5 @@ - -
diff --git a/luciexpress/htdocs/plugins/phone/pages/phone.call_log.js b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.js index 32bbef2ec..fae25d098 100644 --- a/luciexpress/htdocs/plugins/phone/pages/phone.call_log.js +++ b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.js @@ -1,30 +1,11 @@ -/* - * juci - javascript universal client interface - * - * Project Author: Martin K. Schröder - * - * Copyright (C) 2012-2013 Inteno Broadband Technology AB. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ +//! Author: Martin K. Schröder $juci.module("phone") .controller("PhoneCallLogPageCtrl", function($scope, $uci, gettext, $tr){ - $scope.phoneFilter = ""; - $scope.uniquePhones = []; + /*$scope.phoneFilter = ""; + $scope.phoneFilterSelected = {}; $scope.phoneList = []; + $scope.call_log = []; $rpc.asterisk.call_log.list().done(function(res){ var unique_phones = {}; $scope.call_log = res.call_log.map(function(log){ @@ -44,5 +25,5 @@ $juci.module("phone") }); $scope.onChangeFilter = function(item, model){ $scope.phoneFilter = model.from; - } + }*/ }); diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js index 70c454221..748fed54a 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js +++ b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js @@ -46,7 +46,7 @@ $juci.module("settings") $("form[name='restoreForm']").submit(); } $scope.onUploadComplete = function(result){ - console.log("Result: "+JSON.stringify(result)+": "+$scope.restore.password); + console.log("Uploaded: "+JSON.stringify(result)+": "+$scope.restore.password); $rpc.luci2.system.backup_restore({ password: $scope.restore.password }).done(function(result){ @@ -54,7 +54,10 @@ $juci.module("settings") alert(result.stderr); } else { $scope.showUploadModal = 0; + $scope.$apply(); } + }).fail(function(err){ + console.error("Filed: "+JSON.stringify(err)); }); } $scope.onAcceptModal = function(){ diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html index d85b0640b..84f593075 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html +++ b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html @@ -11,7 +11,7 @@

{{'Manual Firmware Upgrade'|translate}}

{{'settings.upgrade.manual.info'|translate}}

-
+ @@ -19,7 +19,7 @@ - +
diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js index ae3b400a9..384753503 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js +++ b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js @@ -109,7 +109,7 @@ })( jQuery); $juci.module("settings") -.controller("SettingsUpgradeCtrl", function($scope, $uci, $session){ +.controller("SettingsUpgradeCtrl", function($scope, $uci, $rpc, $session){ $scope.sessionID = $session.sid; $scope.uploadFilename = "/tmp/firmware.bin"; $scope.usbFileName = "()"; @@ -125,53 +125,24 @@ $juci.module("settings") $scope.onUploadComplete = function(result){ console.log("Upload completed: "+JSON.stringify(result)); } - setInterval(function checkUpload(){ - var iframe = $("#postiframe"); - var json = iframe.contents().text(); - if(json.length) { - $scope.onUploadComplete(JSON.parse(json)); - iframe.contents().html(""); - } - }, 500); + $scope.onUploadUpgrade = function(){ - var formData = new FormData($('uploadForm')[0]); - - /*$.upload( "/cgi-bin/luci-upload", new FormData($('*uploadForm*')[0])) - .progress( function( progressEvent, upload) { - if( progressEvent.lengthComputable) { - var percent = Math.round( progressEvent.loaded * 100 / progressEvent.total) + '%'; - if( upload) { - console.log( percent + ' uploaded'); - } else { - console.log( percent + ' downloaded'); - } - } - }) - .done( function() { - console.log( 'Finished upload'); - });*/ - $.ajax({ - type : 'POST', - url : 'http://192.168.1.4/cgi-bin/luci-upload', - data: formData, - cache: false, - contentType: false, - processData: false, - xhr: function() { // custom xhr - myXhr = $.ajaxSettings.xhr(); - if(myXhr.upload){ // if upload property exists - myXhr.upload.addEventListener('progress', function(){ - console.log("Progress"); - }, false); // progressbar - } - return myXhr; - }, - success : function(data) { - console.log("Upload completed!"); - }, - error: function(data){ - console.log("Error: "+JSON.stringify(data)); - } - }, "json"); + $("#postiframe").bind("load", function(){ + var json = $(this).contents().text(); + var obj = {}; + try { + obj = JSON.parse(json); + } catch(e){ alert("The server returned an error!"); } + + $rpc.luci2.system.upgrade_test().done(function(result){ + console.log(JSON.stringify(result)); + $rpc.luci2.system.upgrade_start().done(function(result){ + console.log(JSON.stringify(result)); + }); + }); + + $(this).unbind("load"); + }); + $("form[name='uploadForm']").submit(); } }); diff --git a/luciexpress/htdocs/plugins/status/pages/status.about.html b/luciexpress/htdocs/plugins/status/pages/status.about.html index 9a6e7791b..65af50cb7 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.about.html +++ b/luciexpress/htdocs/plugins/status/pages/status.about.html @@ -1,5 +1,23 @@
- About +

About

+
+Copyright (C) 2012-2013 Inteno Broadband Technology AB. 
+All rights reserved.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+version 2 as published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA
+			
diff --git a/luciexpress/htdocs/plugins/status/pages/status.diagnostics.html b/luciexpress/htdocs/plugins/status/pages/status.diagnostics.html index d59cd8e69..67fe70397 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.diagnostics.html +++ b/luciexpress/htdocs/plugins/status/pages/status.diagnostics.html @@ -12,38 +12,29 @@

{{'Ping Test'|translate}}

{{'status.diagnostics.ping.info'|translate}}

- - -
-
- -
-
- -
-
-
-
+
+
+ + +
+
+
{{'Ping results'|translate}}:
{{data.pingResults}}
+
{{'Error'|translate}}:
{{data.pingError}}

{{'Tracing Tool'|translate}}

{{'status.diagnostics.trace.info'|translate}}

- -
- - - -
+ +
+
+
+ +
+
+
{{'Trace results'|translate}}:
{{data.traceResults}}
+
{{'Error'|translate}}:
{{data.traceError}}
+
diff --git a/luciexpress/htdocs/plugins/status/pages/status.diagnostics.js b/luciexpress/htdocs/plugins/status/pages/status.diagnostics.js index 4390ed0be..d0c0ec2ac 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.diagnostics.js +++ b/luciexpress/htdocs/plugins/status/pages/status.diagnostics.js @@ -1,4 +1,38 @@ $juci.module("status") .controller("StatusDiagnostics", function($scope){ - + $scope.data = {}; + $rpc.router.networks().done(function(result){ + if(result){ + $scope.data.allInterfaces = Object.keys(result).map(function(x){return {label: x, id: x};}); + $scope.$apply(); + } + }); + $scope.onTraceTest = function(){ + var item = $scope.data.traceInterface; + if(item && item.id){ + console.log("Performing trace on interface "+item.id); + $rpc.luci2.network.traceroute({ data: "google.com" }).done(function(result){ + if(result.stderr) $scope.data.traceError = result.stderr; + $scope.data.traceResults = result.stdout; + $scope.$apply(); + }).fail(function(error){ + $scope.data.traceResults = ""; + $scope.data.traceError = JSON.stringify(error); + $scope.$apply(); + }); + } + } + $scope.onPingTest = function(){ + $scope.data.pingResults = "..."; + $scope.data.error = ""; + $rpc.luci2.network.ping({ data: $scope.data.pingHost }).done(function(result){ + if(result.stderr) $scope.data.pingError = result.stderr; + $scope.data.pingResults = result.stdout; + $scope.$apply(); + }).fail(function(error){ + $scope.data.pingResults = ""; + $scope.data.pingError = JSON.stringify(error); + $scope.$apply(); + }); + } }); diff --git a/luciexpress/htdocs/plugins/status/pages/status.restart.html b/luciexpress/htdocs/plugins/status/pages/status.restart.html index 84c32567e..67149a9f6 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.restart.html +++ b/luciexpress/htdocs/plugins/status/pages/status.restart.html @@ -1,5 +1,12 @@
- Restart + + {{ 'EasyBox' | translate }} + + + + + +
diff --git a/luciexpress/htdocs/plugins/status/pages/status.restart.js b/luciexpress/htdocs/plugins/status/pages/status.restart.js index 1ff15c542..ce4126aa4 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.restart.js +++ b/luciexpress/htdocs/plugins/status/pages/status.restart.js @@ -1,4 +1,8 @@ $juci.module("status") -.controller("StatusRestartPageCtrl", function($scope){ - +.controller("StatusRestartPageCtrl", function($scope, $rpc){ + $scope.onRestart = function(){ + $rpc.luci2.system.reboot().done(function(){ + console.log("Restarting the system..."); + }); + } }); diff --git a/luciexpress/htdocs/plugins/status/pages/status.status.dsl.js b/luciexpress/htdocs/plugins/status/pages/status.status.dsl.js index c2d1559b4..42e66b318 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.status.dsl.js +++ b/luciexpress/htdocs/plugins/status/pages/status.status.dsl.js @@ -1,11 +1,7 @@ $juci.module("status") -.controller("StatsCtrl", function($scope, $rpc, $session, gettextCatalog){ +.controller("StatsCtrl", function($scope, $rpc, $session, gettext, $tr){ $scope.dslstats = {}; - function $tr(str){ - return gettextCatalog.getString(str); - } - $scope.dslConnectionInfo = { title: "test", rows: [[$tr("None"), $tr("None")]] @@ -75,12 +71,23 @@ $juci.module("status") [ dslstats.mode, dslstats.mode_details ] ]; $scope.dslStatusInfo.rows = [ - [ $tr('Line Status'), dslstats.line_status_configured, dslstats.line_status ], - [ $tr('Line Type'), dslstats.line_type_configured, dslstats.line_type ] - ] - $scope.dslStatusInfo.rows = [ - [ $tr('Actual Data Rate'), dslstats.bearers[0].rate_down, dslstats.bearers[0].rate_up ] - ] + [ $tr(gettext('Line Status')), dslstats.line_status_configured, dslstats.line_status ], + [ $tr(gettext('Line Type')), dslstats.line_type_configured, dslstats.line_type ] + ]; + $scope.dslRateInfo.rows = [ + [ $tr(gettext('Actual Data Rate')), dslstats.bearers[0].rate_down, dslstats.bearers[0].rate_up ] + ]; + $scope.dslOpInfo.rows = [ + [ $tr(gettext('SNR Margin')), dslstats.snr_down, dslstats.snr_up ], + [ $tr(gettext('Loop Attenuation')), dslstats.attn_down, dslstats.attn_up ] + ]; + $scope.dslErrorInfo.rows = [ + [ $tr(gettext('FEC Corrections')), dslstats.counters.totals.fec_down, dslstats.counters.totals.fec_up ], + [ $tr(gettext('CRC Errors')), dslstats.counters.totals.crc_down, dslstats.counters.totals.crc_up ] + ]; + $scope.dslCellInfo.rows = [ + [ $tr(gettext('Cell Counter')), dslstats.bearers[0].total_cells_down, dslstats.bearers[0].total_cells_up ] + ]; $scope.dslstats = dslstats; $scope.$apply(); }); diff --git a/luciexpress/htdocs/plugins/status/pages/status.status.voice.js b/luciexpress/htdocs/plugins/status/pages/status.status.voice.js index 973f1415f..036c44c97 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.status.voice.js +++ b/luciexpress/htdocs/plugins/status/pages/status.status.voice.js @@ -7,6 +7,7 @@ $juci.module("status") if(data.sip[k].ip) accounts.push(data.sip[k]); }); $scope.sipAccounts = accounts; + $scope.$apply(); } }); }); diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js index 2506d75c0..782224c90 100644 --- a/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js @@ -27,7 +27,8 @@ $juci.module("wifi") window.uci = $uci; $scope.interfaces = $uci.wireless['@wifi-iface']; $scope.status = $uci.wireless.status; - $scope.easybox = $uci.easybox.settings; + if($uci.easybox) + $scope.easybox = $uci.easybox.settings; $scope.$apply(); next(); diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.html b/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.html index 7309f62a5..d25b37d17 100644 --- a/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.html +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.html @@ -21,7 +21,7 @@ - +

WPS with own PIN

diff --git a/luciexpress/htdocs/themes/vodafone/css/theme.css b/luciexpress/htdocs/themes/vodafone/css/theme.css index 2241d0dc9..405790083 100644 --- a/luciexpress/htdocs/themes/vodafone/css/theme.css +++ b/luciexpress/htdocs/themes/vodafone/css/theme.css @@ -153,7 +153,19 @@ h1, h2 { } .footer { - margin-top: 1000px; + margin-top: 0px; +} + +@media screen and ( min-width: 600px ){ + .dynheight { + min-height: 768px; + } +} + +@media screen and ( max-width: 600px ){ + .footer { + margin-top: 100px; + } } .animate-show { diff --git a/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.single_column.html b/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.single_column.html index c089e469a..107d8cfb4 100644 --- a/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.single_column.html +++ b/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.single_column.html @@ -1,6 +1,6 @@
-
+
@@ -20,11 +20,5 @@
-
-
-
- -
-
-
+
diff --git a/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.with_sidebar.html b/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.with_sidebar.html index 8b4e04f19..b02a71afc 100644 --- a/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.with_sidebar.html +++ b/luciexpress/htdocs/themes/vodafone/widgets/luci.layout.with_sidebar.html @@ -1,6 +1,6 @@
-
+
@@ -36,11 +36,5 @@
-->
-
-
-
- -
-
-
+
diff --git a/luciexpress/share/acl.d/luci2.json b/luciexpress/share/acl.d/luci2.json index 3385646a4..4ef927e6e 100644 --- a/luciexpress/share/acl.d/luci2.json +++ b/luciexpress/share/acl.d/luci2.json @@ -108,7 +108,17 @@ "read": { "ubus": { "luci2.system": [ - "sshkeys_get" + "sshkeys_get", + "upgrade_test", + "upgrade_clean", + "upgrade_start" + ], + + "asterisk": [ + "status" + ], + "asterisk.call_log": [ + "list" ], "wps": [ "genpin", @@ -116,12 +126,19 @@ "pbc", "showpin", "stapin" + ], + "router": [ + "networks" + ], + "network.interface": [ + "dump" ] }, "uci": [ "dropbear", "easybox", - "hosts" + "hosts", + "voice_client" ] }, "write": { @@ -130,6 +147,9 @@ "sshkeys_set", "password_set" ], + "asterisk.call_log": [ + "list" + ], "wps": [ "genpin", "setpin", diff --git a/luciexpress/src/rpcd/luci2.c b/luciexpress/src/rpcd/luci2.c index 4b1f7b22a..7ed30a12f 100644 --- a/luciexpress/src/rpcd/luci2.c +++ b/luciexpress/src/rpcd/luci2.c @@ -1065,55 +1065,24 @@ rpc_luci2_upgrade_start(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - const char *fwpath = "/tmp/firmware.bin"; - //const char *keep = ""; - bool found = false; + struct blob_attr *tb[__RPC_BACKUP_MAX]; + + blobmsg_parse(rpc_backup_policy, __RPC_BACKUP_MAX, tb, + blob_data(msg), blob_len(msg)); + + struct blob_attr *filename = tb[RPC_BACKUP_PASSWORD]; + + if (filename && blobmsg_data_len(filename) > 0 && blobmsg_data(filename) && strlen(blobmsg_data(filename)) > 0){ + const char *cmd[] = { "sysupgrade", blobmsg_data(filename), NULL }; - struct blob_attr *tb[__RPC_UPGRADE_MAX]; - blobmsg_parse(rpc_upgrade_policy, __RPC_UPGRADE_MAX, tb, blob_data(msg), blob_len(msg)); + return ops->exec(cmd, NULL, NULL, NULL, NULL, NULL, ctx, req); + } + + const char *cmd[] = { "sysupgrade", "/tmp/firmware.bin", NULL }; - if (tb[RPC_UPGRADE_PATH] && strlen(blobmsg_data(tb[RPC_UPGRADE_PATH]))) { - fwpath = strdup(blobmsg_data(tb[RPC_UPGRADE_PATH])); - found = true; - } - -/* if (tb[RPC_UPGRADE_KEEP] && !blobmsg_data(tb[RPC_UPGRADE_KEEP]))*/ -/* keep = "-n";*/ - - struct uci_package *p; - struct uci_element *e; - struct uci_section *s; - struct uci_ptr ptr = { .package = "system" }; - - if (!found) - uci_load(cursor, ptr.package, &p); - - if (p) - { - uci_foreach_element(&p->sections, e) - { - s = uci_to_section(e); - - if (strcmp(s->type, "upgrade")) - continue; - - ptr.o = NULL; - ptr.option = "fw_upload_path"; - ptr.section = e->name; - uci_lookup_ptr(cursor, &ptr, NULL, true); - break; - } - - if (ptr.o && ptr.o->type == UCI_TYPE_STRING) - { - fwpath = strdup(ptr.o->v.string); - } - - uci_unload(cursor, p); - } - - const char *cmd[3] = { "sysupgrade", fwpath, NULL }; return ops->exec(cmd, NULL, NULL, NULL, NULL, NULL, ctx, req); + + return 0; } static int diff --git a/questd/src/igmp.c b/questd/src/igmp.c index bc39d9fe5..a6e8a1d40 100644 --- a/questd/src/igmp.c +++ b/questd/src/igmp.c @@ -42,7 +42,8 @@ int igmp_rpc(struct ubus_context *ctx, struct ubus_object *obj, void *object, *array; blob_buf_init(&bb, 0); - if (!(in = fopen("/proc/net/igmp_snooping", "r"))) + // /proc/net/ + if (!(in = fopen("/tmp/igmp_snooping", "r"))) return 1; array = blobmsg_open_array(&bb, "tables");