From 943c1a37298915ebef03430117fe289410fcedee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Fri, 29 May 2015 11:54:09 +0200 Subject: [PATCH] Fixed up pages and added luci redirect --- luciexpress/Makefile | 1 + .../internet/widgets/uci.network.interface.edit.html | 6 +++--- .../plugins/settings/pages/settings.configuration.js | 10 ++++++---- .../plugins/settings/pages/settings.upgrade.html | 5 +++-- .../htdocs/plugins/settings/pages/settings.upgrade.js | 4 ++++ .../htdocs/plugins/status/pages/status.events.js | 4 ++-- .../htdocs/plugins/status/pages/status.status.js | 2 +- luciexpress/luci_redirect.sh | 4 ++++ 8 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 luciexpress/luci_redirect.sh diff --git a/luciexpress/Makefile b/luciexpress/Makefile index fe74072e8..1e968268f 100644 --- a/luciexpress/Makefile +++ b/luciexpress/Makefile @@ -63,6 +63,7 @@ define Package/luciexpress/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/io/luciexpress-io $(1)/usr/libexec/ $(LN) /usr/libexec/luciexpress-io $(1)/www/cgi-bin/luci-upload $(LN) /usr/libexec/luciexpress-io $(1)/www/cgi-bin/luci-backup + $(CP) luci_redirect.sh $(1)/www/cgi-bin/luci endef define Package/luciexpress/postinst diff --git a/luciexpress/htdocs/plugins/internet/widgets/uci.network.interface.edit.html b/luciexpress/htdocs/plugins/internet/widgets/uci.network.interface.edit.html index afdb520ce..944bb2df9 100644 --- a/luciexpress/htdocs/plugins/internet/widgets/uci.network.interface.edit.html +++ b/luciexpress/htdocs/plugins/internet/widgets/uci.network.interface.edit.html @@ -21,10 +21,10 @@ {{interface.netmask.value}} - + - +
@@ -38,7 +38,7 @@
-
+

Static DHCP

diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js index 0f18082ed..1eb5b25e9 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js +++ b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js @@ -1,7 +1,7 @@ //! Author: Martin K. Schröder JUCI.app -.controller("SettingsConfigurationCtrl", function($scope, $rpc){ +.controller("SettingsConfigurationCtrl", function($scope, $rpc, gettext){ $scope.sessionID = $rpc.$sid(); $scope.resetPossible = 0; $rpc.luci2.system.reset_test().done(function(result){ @@ -11,9 +11,11 @@ JUCI.app } }); $scope.onReset = function(){ - $rpc.luci2.system.reset_start().done(function(result){ - console.log("Performing reset: "+JSON.stringify(result)); - }); + if(confirm(gettext("This will reset your configuration to factory defaults. Do you want to continue?"))){ + $rpc.luci2.system.reset_start().done(function(result){ + console.log("Performing reset: "+JSON.stringify(result)); + }); + } } $scope.onSaveConfig = function(){ $scope.showModal = 1; diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html index 6d5743eb9..b0a1369aa 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html +++ b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html @@ -31,7 +31,8 @@

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

- + @@ -44,7 +45,7 @@ - + diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js index cd910c189..1e214516b 100644 --- a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js +++ b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.js @@ -158,6 +158,7 @@ JUCI.app $scope.onCheckOnline = function(){ $scope.onlineUpgradeAvailable = false; + $scope.onlineCheckInProgress = 1; $rpc.luci2.system.upgrade_check({type: "online"}).done(function(response){ if(response.stdout) { $scope.onlineUpgrade = response.stdout.replace("\n", ""); @@ -166,6 +167,7 @@ JUCI.app $scope.onlineUpgrade = gettext("No upgrade has been found!"); } if(response.stderr) $scope.$emit("error", "Online upgrade check failed: "+response.stderr); + $scope.onlineCheckInProgress = 0; $scope.$apply(); }); } @@ -175,6 +177,7 @@ JUCI.app $scope.onCheckUSB = function(){ $scope.usbUpgradeAvailable = false; + $scope.usbCheckInProgress = 1; $rpc.luci2.system.upgrade_check({type: "usb"}).done(function(response){ if(response.stdout) { $scope.usbUpgrade = response.stdout.replace("\n", ""); @@ -183,6 +186,7 @@ JUCI.app $scope.usbUpgrade = gettext("No upgrade has been found!"); } if(response.stderr) $scope.$emit("error", "USB upgrade check failed: "+response.stderr); + $scope.usbCheckInProgress = 0; $scope.$apply(); }); } diff --git a/luciexpress/htdocs/plugins/status/pages/status.events.js b/luciexpress/htdocs/plugins/status/pages/status.events.js index 4018b115e..962e16da5 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.events.js +++ b/luciexpress/htdocs/plugins/status/pages/status.events.js @@ -7,8 +7,8 @@ JUCI.app $scope.selectedLogTypes = ["system", "network", "other"]; var groups = { - "system": [], - "network": ["netifd", "brcmnetlink", "dnsmasq-dhcp"], + "system": ["dropbear", "peripheral_manager"], + "network": ["netifd", "brcmnetlink", "dnsmasq-dhcp", "dnsmasq"], }; JUCI.interval.repeat("syslog", 1000, function(done){ diff --git a/luciexpress/htdocs/plugins/status/pages/status.status.js b/luciexpress/htdocs/plugins/status/pages/status.status.js index a59fa42a0..78da13a28 100644 --- a/luciexpress/htdocs/plugins/status/pages/status.status.js +++ b/luciexpress/htdocs/plugins/status/pages/status.status.js @@ -30,7 +30,7 @@ JUCI.app }); } }); - sections = sections.sort(function(a, b) { return a.interface.up > b.interface.up; }); + sections = sections.filter(function(x){ return x.interface !== undefined; }).sort(function(a, b) { return a.interface.up > b.interface.up; }); for(var c = 0; c < sections.length; c++){ var sec = sections[c]; if(sec.interface.up) sec.status = "ok"; diff --git a/luciexpress/luci_redirect.sh b/luciexpress/luci_redirect.sh new file mode 100644 index 000000000..758d83436 --- /dev/null +++ b/luciexpress/luci_redirect.sh @@ -0,0 +1,4 @@ +#!/usr/sbin/bash +echo "Content-type: text/html" +echo +echo "Click here to go to new JUCI webgui."