diff --git a/luciexpress/htdocs/index.html b/luciexpress/htdocs/index.html index dcbca5df3..801ab0ec2 100644 --- a/luciexpress/htdocs/index.html +++ b/luciexpress/htdocs/index.html @@ -2,7 +2,7 @@ - LuCi Express + LuCi Express @@ -17,23 +17,11 @@ - -
-
-
- Router Configuration -
- -
-
-
+ +
+
+
-
-
@@ -51,11 +39,7 @@ - - - - - + @@ -64,47 +48,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/luciexpress/htdocs/js/app.js b/luciexpress/htdocs/js/app.js index 271f712ff..46afc72b9 100644 --- a/luciexpress/htdocs/js/app.js +++ b/luciexpress/htdocs/js/app.js @@ -31,7 +31,34 @@ function supports_html5_storage() { } } -var PLUGIN_ROOT = ""; +$juci = { + plugins: {}, + module: function(name){ + var plugin = this.plugins[name]; + var juci = this; + return { + plugin_root: plugin.plugin_root, + directive: function(name, fn){ + return juci.directive(name, fn); + var dir = fn(); + if(dir.templateUrl && plugin.plugin_root) dir.templateUrl = plugin.plugin_root + "/" + dir.templateUrl; + return juci.directive(name, dir); + }, + controller: function(name, fn){ + return juci.controller(name, fn); + }, + state: function(name, obj){ + if(obj.templateUrl && plugin.plugin_root) obj.templateUrl = plugin.plugin_root + "/" + obj.templateUrl; + if(obj.views) Object.keys(obj.views).map(function(k){ + var v = obj.views[k]; + if(v.templateUrl && plugin.plugin_root) v.templateUrl = plugin.plugin_root + "/" + v.templateUrl; + }); + $juci.$stateProvider.state(name, obj); + return this; + } + } + } +}; require.config({ baseUrl: '/', @@ -51,39 +78,60 @@ angular.module("luci", [ "uiSwitch", "gettext" ]) - .config(function ($stateProvider, $locationProvider, $urlRouterProvider) { + .config(function ($stateProvider, $locationProvider, $compileProvider, $urlRouterProvider, $controllerProvider) { //$locationProvider.otherwise({ redirectTo: "/" }); $locationProvider.hashPrefix('!'); + $juci.controller = $controllerProvider.register; + $juci.directive = $compileProvider.directive; + $juci.state = $stateProvider.state; + $juci.$stateProvider = $stateProvider; + $juci.redirect = function(page){ + window.location.href = "#!"+page; + } //$stateProvider.otherwise("login"); - //$urlRouterProvider.otherwise("/otherwise"); - $stateProvider.state("ready", { - url: "", + + /*$stateProvider.state("redirect", { + url: "/redirect/:path", views: { "content": { - templateUrl: "pages/overview.html" + templateUrl: "pages/default.html" } }, + onEnter: function($state, $stateParams){ + console.log(JSON.stringify($stateParams)); + $state.go($stateParams.path); + }, luci_config: {} - }); - $stateProvider.state("init", { - url: "/init", + }); */ + $stateProvider.state("404", { + url: "/404", views: { "content": { - templateUrl: "pages/loading.html" + templateUrl: "plugins/core/pages/404.html" + } + }, + onEnter: function(){ + if(!$juci._initialized){ + $juci.redirect("/init/404"); + } + } + }); + // application init state. All initialization is done here. + $stateProvider.state("init", { + url: "/init/:redirect", + views: { + "content": { + templateUrl: "plugins/core/pages/loading.html" } }, - onEnter: function($state, $config, $session, $rpc, $navigation, $rootScope, $http){ + onEnter: function($state, $stateParams, $config, $session, $rpc, $navigation, $location, $rootScope, $http){ + if($juci._initialized) { + $juci.redirect($stateParams.redirect || "overview"); + return; + } console.log("INIT"); async.series([ - function(next){ - console.log("Validating session.."); - $session.init().done(function(){ - next(); - }).fail(function(){ - console.log("Failed to verify session."); - $state.go("login"); - }); - }, + function(next){ console.log("Getting config.."); // TODO: use rpc @@ -96,35 +144,61 @@ angular.module("luci", [ var plugin_root = "plugins/"+id; $http.get(plugin_root + "/plugin.json") .success(function(data){ + var scripts = []; + data.plugin_root = plugin_root; + $juci.plugins[id] = data; if(data && data.scripts){ - var scripts = data.scripts.map(function(x){return plugin_root + "/" + x; }); - require(scripts, function(module){ - next(); /* - module.plugin_init({ - PLUGIN_ROOT: root - }, function(){ - next(); - }); */ - }); - } else { - next(); + data.scripts.map(function(x){scripts.push(plugin_root + "/" + x); }); } - }).error(function(data){ - next(); - }); - /*var plug = $config.plugins[id]; - var root = "plugins/"+id+"/"; - require(plug.scripts.map(function(s){return "plugins/"+s+"/"+s;}), function(module){ - module.plugin_init({ - PLUGIN_ROOT: root + // load page controllers + if(data.pages) { + Object.keys(data.pages).map(function(k){ + var page = data.pages[k]; + if(page.view){ + scripts.push(plugin_root + "/" + page.view); + $stateProvider.state(k.replace(".", "_"), { + url: "/"+k, + views: { + "content": { + templateUrl: (page.view)?(plugin_root + "/" + page.view + ".html"):"plugins/core/pages/default.html", + } + }, + onEnter: function($window){ + // TODO: all these redirects seem to load page multiple times. + //if(item.redirect) $window.location.href = "#!"+item.redirect; + }, + //luci_config: item + }); + } + }); + } + async.eachSeries(scripts, function(script, next){ + require([script], function(module){ + next(); + }); }, function(){ + + // goto next plugin next(); }); - }); */ + }).error(function(data){ + + next(); + }); }, function(){ + next(); }); }, + function(next){ + console.log("Validating session.."); + $session.init().done(function(){ + next(); + }).fail(function(){ + console.log("Failed to verify session."); + $state.go("login"); + }); + }, function(next){ console.log("Getting navigation.."); @@ -148,6 +222,7 @@ angular.module("luci", [ obj.page = "/pages/"+view.replace("/", ".")+".html"; } $navigation.register(obj); + }); //$rootScope.$apply(); next(); @@ -155,39 +230,73 @@ angular.module("luci", [ } ], function(err){ if(err) $state.go("error"); - console.log("READY"); - $state.go("ready"); + $juci._initialized = true; + + // add this here to avoid being redirected to the 404 page from the start + $urlRouterProvider.otherwise("/init/404"); + + console.log("redirecting -> "+$stateParams.redirect); + $state.go($stateParams.redirect || "overview"); }); }, luci_config: {} }); }) - .run(function($rootScope, $state, $session, gettextCatalog, $rpc, $navigation){ + .run(function($rootScope, $state, $session, gettextCatalog, $rpc, $config, $location, $navigation){ + $rootScope.config = $config; // set current language //gettextCatalog.currentLanguage = "se"; - //gettextCatalog.debug = true; - $state.go("init"); - + //gettextCatalog.debug = true; + /*$rootScope.$on('$routeChangeSuccess', function (event, current, previous) { + $rootScope.title = current.$$route.title; + });*/ + var path = $location.path().replace("/", "").replace(".", "_"); + $state.go("init", {"redirect": path}); }) - -angular.module("luci").controller("BodyCtrl", function ($scope, $state, $session, $location, $window, $rootScope, $config) { + +window.app = angular.module("luci"); + +angular.module("luci").controller("BodyCtrl", function ($scope, $localStorage, $state, $session, $location, $window, $rootScope, $config) { $scope.menuClass = function(page) { var current = $location.path().substring(1); return page === current ? "active" : ""; }; - $scope.mode = ""; $scope.modeList = [{ id: 0, label: "Basic Mode" }]; - $config.mode = localStorage.getItem("mode") || "basic"; - $config.theme = localStorage.getItem("theme") || "default"; + $config.mode = $localStorage.getItem("mode") || "basic"; + $config.theme = $localStorage.getItem("theme") || "vodaphone"; // TODO: change to default inteno + $scope.theme_index = "themes/"+$config.theme+"/index.html"; + + $scope.guiModes = [ + {id: "basic", label: "Basic Mode"}, + {id: "expert", label: "Expert Mode"}, + {id: "logout", label: "Log out"} + ]; + Object.keys($scope.guiModes).map(function(k){ + var m = $scope.guiModes[k]; + if(m.id == $config.mode) $scope.selectedMode = m; + }); + $scope.onChangeMode = function(item){ + var selected = item.id; + console.log(selected); + if(selected == "logout") { + $session.logout().always(function(){ + $window.location.href="/"; + }); + } else { + $config.mode = selected; + $state.reload(); + } + $localStorage.setItem("mode", selected); + }; /*setTimeout(function(){ $("#guiMode").selectpicker('val', $config.mode || "basic"); }, 100); */ - $("#guiMode").on("change", function(){ + /*$("#guiMode").on("change", function(){ var selected = $(this).find("option:selected").val(); console.log(selected); if(selected == "logout") { @@ -199,9 +308,10 @@ angular.module("luci").controller("BodyCtrl", function ($scope, $state, $session $state.reload(); } localStorage.setItem("mode", selected); - }); + }); */ -}) +}); + $(document).ready(function(){ diff --git a/luciexpress/htdocs/js/config.js b/luciexpress/htdocs/js/config.js index ca8e6b043..22c460f73 100644 --- a/luciexpress/htdocs/js/config.js +++ b/luciexpress/htdocs/js/config.js @@ -23,10 +23,14 @@ angular.module("luci") "vodaphone" : "/themes/vodaphone/" }, plugins: [ - "hello_world" + "hello_world", + "core", + "phone", + "router", + "wifi" ], rpc: { - host: "", + host: "http://192.168.1.1", exposed_calls: [ "session.login", "session.access", diff --git a/luciexpress/htdocs/js/navigation.js b/luciexpress/htdocs/js/navigation.js index 2019adcf9..60063a84d 100644 --- a/luciexpress/htdocs/js/navigation.js +++ b/luciexpress/htdocs/js/navigation.js @@ -64,10 +64,11 @@ angular.module("luci") this.register = function(item){ if(!item.path) return; item = this.insertLeaf(item.path, item); - + + // now also register with the routing service //if(item.page){ - (function(item){ + /* (function(item){ var lazyPromise = null; $stateProvider.state(item.path.replace(".", "_"), { url: "/"+item.path, @@ -82,7 +83,7 @@ angular.module("luci") }, luci_config: item }); - })(item); + })(item); */ //} //alert(JSON.stringify(data)); return data; diff --git a/luciexpress/htdocs/pages/internet.dns.js b/luciexpress/htdocs/pages/internet.dns.js deleted file mode 100644 index fe49c8360..000000000 --- a/luciexpress/htdocs/pages/internet.dns.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("InternetDNSPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/login.js b/luciexpress/htdocs/pages/login.js deleted file mode 100644 index 6a80a44f5..000000000 --- a/luciexpress/htdocs/pages/login.js +++ /dev/null @@ -1,14 +0,0 @@ -angular.module("luci") -.config(function($stateProvider, $navigationProvider){ - $stateProvider.state("login", { - url: "/login", - views: { - "content": { - templateUrl: "/pages/login.html" - } - } - }); -}) -.controller("LoginPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/overview.js b/luciexpress/htdocs/pages/overview.js deleted file mode 100644 index d1f5400f6..000000000 --- a/luciexpress/htdocs/pages/overview.js +++ /dev/null @@ -1,4 +0,0 @@ -angular.module("luci") -.controller("OverviewPageCtrl", function($scope){ - $scope.themeUrl = ""; -}); diff --git a/luciexpress/htdocs/pages/phone.js b/luciexpress/htdocs/pages/phone.js deleted file mode 100644 index 8b1378917..000000000 --- a/luciexpress/htdocs/pages/phone.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/luciexpress/htdocs/pages/phone.number_blocking.js b/luciexpress/htdocs/pages/phone.number_blocking.js deleted file mode 100644 index 8087ce7fb..000000000 --- a/luciexpress/htdocs/pages/phone.number_blocking.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("PhoneNumberBlockingPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/phone.numbers.js b/luciexpress/htdocs/pages/phone.numbers.js deleted file mode 100644 index 3b0bea29e..000000000 --- a/luciexpress/htdocs/pages/phone.numbers.js +++ /dev/null @@ -1,4 +0,0 @@ -angular.module("luci") -.controller("PhoneNumbersPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/phone.ringing_schedule.js b/luciexpress/htdocs/pages/phone.ringing_schedule.js deleted file mode 100644 index b40dbbf2a..000000000 --- a/luciexpress/htdocs/pages/phone.ringing_schedule.js +++ /dev/null @@ -1,4 +0,0 @@ -angular.module("luci") -.controller("PhoneRingingScheduleCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/phone.speed_dialing.js b/luciexpress/htdocs/pages/phone.speed_dialing.js deleted file mode 100644 index bf221e9ba..000000000 --- a/luciexpress/htdocs/pages/phone.speed_dialing.js +++ /dev/null @@ -1,4 +0,0 @@ -angular.module("luci") -.controller("PhoneSpeedDialingCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/status.events.js b/luciexpress/htdocs/pages/status.events.js deleted file mode 100644 index 62d1c36ce..000000000 --- a/luciexpress/htdocs/pages/status.events.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("StatusEventsPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/status.nat.js b/luciexpress/htdocs/pages/status.nat.js deleted file mode 100644 index 13a58cbd4..000000000 --- a/luciexpress/htdocs/pages/status.nat.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("StatusNATPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/status.restart.js b/luciexpress/htdocs/pages/status.restart.js deleted file mode 100644 index d889bdbfc..000000000 --- a/luciexpress/htdocs/pages/status.restart.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("StatusRestartPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/status.tv.js b/luciexpress/htdocs/pages/status.tv.js deleted file mode 100644 index 0a32dc220..000000000 --- a/luciexpress/htdocs/pages/status.tv.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("StatusTVPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/status.voice.js b/luciexpress/htdocs/pages/status.voice.js deleted file mode 100644 index f035af7be..000000000 --- a/luciexpress/htdocs/pages/status.voice.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("StatusVoicePageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/wifi.js b/luciexpress/htdocs/pages/wifi.js deleted file mode 100644 index 8b1378917..000000000 --- a/luciexpress/htdocs/pages/wifi.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/luciexpress/htdocs/pages/wifi.mac_filter.js b/luciexpress/htdocs/pages/wifi.mac_filter.js deleted file mode 100644 index 4c297a8cc..000000000 --- a/luciexpress/htdocs/pages/wifi.mac_filter.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("WifiMacFilterPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/wifi.schedule.js b/luciexpress/htdocs/pages/wifi.schedule.js deleted file mode 100644 index 8c3e13d58..000000000 --- a/luciexpress/htdocs/pages/wifi.schedule.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("WifiSchedulePageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/wifi.settings.js b/luciexpress/htdocs/pages/wifi.settings.js deleted file mode 100644 index 57f5858af..000000000 --- a/luciexpress/htdocs/pages/wifi.settings.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("WifiSettingsPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/pages/wifi.wps.js b/luciexpress/htdocs/pages/wifi.wps.js deleted file mode 100644 index 070d93a7d..000000000 --- a/luciexpress/htdocs/pages/wifi.wps.js +++ /dev/null @@ -1,3 +0,0 @@ -angular.module("luci").controller("WifiWPSPageCtrl", function($scope){ - -}); diff --git a/luciexpress/htdocs/plugins/core/pages/404.html b/luciexpress/htdocs/plugins/core/pages/404.html new file mode 100644 index 000000000..740df496c --- /dev/null +++ b/luciexpress/htdocs/plugins/core/pages/404.html @@ -0,0 +1,3 @@ + +

The page you were trying to access was not found!

+
diff --git a/luciexpress/htdocs/pages/default.html b/luciexpress/htdocs/plugins/core/pages/default.html similarity index 100% rename from luciexpress/htdocs/pages/default.html rename to luciexpress/htdocs/plugins/core/pages/default.html diff --git a/luciexpress/htdocs/plugins/core/pages/loading.html b/luciexpress/htdocs/plugins/core/pages/loading.html new file mode 100644 index 000000000..7e0ff1b7d --- /dev/null +++ b/luciexpress/htdocs/plugins/core/pages/loading.html @@ -0,0 +1 @@ +

Loading

diff --git a/luciexpress/htdocs/pages/login.html b/luciexpress/htdocs/plugins/core/pages/login.html similarity index 100% rename from luciexpress/htdocs/pages/login.html rename to luciexpress/htdocs/plugins/core/pages/login.html diff --git a/luciexpress/htdocs/plugins/core/pages/login.js b/luciexpress/htdocs/plugins/core/pages/login.js new file mode 100644 index 000000000..ba88268d2 --- /dev/null +++ b/luciexpress/htdocs/plugins/core/pages/login.js @@ -0,0 +1,4 @@ +$juci.module("core") +.controller("LoginPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/overview.html b/luciexpress/htdocs/plugins/core/pages/overview.html similarity index 100% rename from luciexpress/htdocs/pages/overview.html rename to luciexpress/htdocs/plugins/core/pages/overview.html diff --git a/luciexpress/htdocs/plugins/core/pages/overview.js b/luciexpress/htdocs/plugins/core/pages/overview.js new file mode 100644 index 000000000..543a90e53 --- /dev/null +++ b/luciexpress/htdocs/plugins/core/pages/overview.js @@ -0,0 +1,3 @@ +$juci.controller("OverviewPageCtrl", function($scope){ + $scope.themeUrl = ""; +}); diff --git a/luciexpress/htdocs/plugins/core/plugin.json b/luciexpress/htdocs/plugins/core/plugin.json new file mode 100644 index 000000000..268712106 --- /dev/null +++ b/luciexpress/htdocs/plugins/core/plugin.json @@ -0,0 +1,21 @@ +{ + "scripts": [ + "widgets/luci.footer", + "widgets/luci.layout.naked", + "widgets/luci.layout.single_column", + "widgets/luci.layout.with_sidebar", + "widgets/luci.login", + "widgets/luci.nav", + "widgets/luci.navbar", + "widgets/luci.progress", + "widgets/luci.table" + ], + "pages": { + "overview": { + "view": "pages/overview" + }, + "login": { + "view": "pages/login" + } + } +} diff --git a/luciexpress/htdocs/widgets/luci.footer.html b/luciexpress/htdocs/plugins/core/widgets/luci.footer.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.footer.html rename to luciexpress/htdocs/plugins/core/widgets/luci.footer.html diff --git a/luciexpress/htdocs/widgets/luci.footer.js b/luciexpress/htdocs/plugins/core/widgets/luci.footer.js similarity index 72% rename from luciexpress/htdocs/widgets/luci.footer.js rename to luciexpress/htdocs/plugins/core/widgets/luci.footer.js index f7286a291..c66efb8f7 100644 --- a/luciexpress/htdocs/widgets/luci.footer.js +++ b/luciexpress/htdocs/plugins/core/widgets/luci.footer.js @@ -1,15 +1,16 @@ -angular.module("luci") +$juci.module("core") .directive("luciFooter", function(){ + var plugin_root = $juci.module("core").plugin_root; + return { // accepted parameters for this tag scope: { }, - templateUrl: "widgets/luci.footer.html", - controller: "LuciFooterControl", - controllerAs: "ctrl" + templateUrl: plugin_root+"/widgets/luci.footer.html", + controller: "luciFooterController" }; }) -.controller("LuciFooterControl", function($scope, $rpc, $languages, gettextCatalog){ +.controller("luciFooterController", function($scope, $rpc, $languages, gettextCatalog){ // TODO: move this into a higher level controller maybe? $scope.languages = $languages.getLanguages(); $scope.isActiveLanguage = function(lang){ diff --git a/luciexpress/htdocs/widgets/luci.layout.naked.html b/luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.layout.naked.html rename to luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.html diff --git a/luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.js b/luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.js new file mode 100644 index 000000000..2ceab391f --- /dev/null +++ b/luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.js @@ -0,0 +1,16 @@ +$juci.module("core") +.directive("luciLayoutNaked", function(){ + var plugin_root = $juci.module("core").plugin_root; + return { + // accepted parameters for this tag + scope: { + }, + templateUrl: plugin_root+"/widgets/luci.layout.naked.html", + transclude: true, + controller: "luciLayoutNakedController", + controllerAs: "ctrl" + }; +}) +.controller("luciLayoutNakedController", function($scope, $session){ + +}); diff --git a/luciexpress/htdocs/widgets/luci.layout.single_column.html b/luciexpress/htdocs/plugins/core/widgets/luci.layout.single_column.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.layout.single_column.html rename to luciexpress/htdocs/plugins/core/widgets/luci.layout.single_column.html diff --git a/luciexpress/htdocs/plugins/core/widgets/luci.layout.single_column.js b/luciexpress/htdocs/plugins/core/widgets/luci.layout.single_column.js new file mode 100644 index 000000000..3e9a32d74 --- /dev/null +++ b/luciexpress/htdocs/plugins/core/widgets/luci.layout.single_column.js @@ -0,0 +1,16 @@ +$juci.module("core") +.directive("luciLayoutSingleColumn", function(){ + var plugin_root = $juci.module("core").plugin_root; + return { + // accepted parameters for this tag + scope: { + }, + templateUrl: plugin_root+"/widgets/luci.layout.single_column.html", + transclude: true, + controller: "luciLayoutSingleColumnController", + controllerAs: "ctrl" + }; +}) +.controller("luciLayoutSingleColumnController", function($scope, $session){ + +}); diff --git a/luciexpress/htdocs/widgets/luci.layout.with_sidebar.html b/luciexpress/htdocs/plugins/core/widgets/luci.layout.with_sidebar.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.layout.with_sidebar.html rename to luciexpress/htdocs/plugins/core/widgets/luci.layout.with_sidebar.html diff --git a/luciexpress/htdocs/plugins/core/widgets/luci.layout.with_sidebar.js b/luciexpress/htdocs/plugins/core/widgets/luci.layout.with_sidebar.js new file mode 100644 index 000000000..f57fd8f4b --- /dev/null +++ b/luciexpress/htdocs/plugins/core/widgets/luci.layout.with_sidebar.js @@ -0,0 +1,17 @@ +$juci.module("core") +.directive("luciLayoutWithSidebar", function(){ + var plugin_root = $juci.module("core").plugin_root; + + return { + // accepted parameters for this tag + scope: { + }, + templateUrl: plugin_root+"/widgets/luci.layout.with_sidebar.html", + transclude: true, + controller: "luciLayoutWithSidebarController", + controllerAs: "ctrl" + }; +}) +.controller("luciLayoutWithSidebarController", function($scope, $session){ + +}); diff --git a/luciexpress/htdocs/widgets/luci.login.html b/luciexpress/htdocs/plugins/core/widgets/luci.login.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.login.html rename to luciexpress/htdocs/plugins/core/widgets/luci.login.html diff --git a/luciexpress/htdocs/widgets/luci.login.js b/luciexpress/htdocs/plugins/core/widgets/luci.login.js similarity index 82% rename from luciexpress/htdocs/widgets/luci.login.js rename to luciexpress/htdocs/plugins/core/widgets/luci.login.js index acc4c275c..5e8334b84 100644 --- a/luciexpress/htdocs/widgets/luci.login.js +++ b/luciexpress/htdocs/plugins/core/widgets/luci.login.js @@ -1,10 +1,11 @@ -angular.module("luci") +$juci.module("core") .directive("luciLogin", function(){ + var plugin_root = $juci.module("core").plugin_root; return { // accepted parameters for this tag scope: { }, - templateUrl: "widgets/luci.login.html", + templateUrl: plugin_root+"/widgets/luci.login.html", replace: true, controller: "LoginControl", controllerAs: "ctrl" @@ -30,6 +31,8 @@ angular.module("luci") console.log("Logged out!"); //$state.go("home", {}, {reload: true}); $window.location.href="/"; - }); + }).fail(function(){ + alert("Error logging out!"); + }); } }); diff --git a/luciexpress/htdocs/widgets/luci.nav.html b/luciexpress/htdocs/plugins/core/widgets/luci.nav.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.nav.html rename to luciexpress/htdocs/plugins/core/widgets/luci.nav.html diff --git a/luciexpress/htdocs/widgets/luci.nav.js b/luciexpress/htdocs/plugins/core/widgets/luci.nav.js similarity index 92% rename from luciexpress/htdocs/widgets/luci.nav.js rename to luciexpress/htdocs/plugins/core/widgets/luci.nav.js index 50ca57d72..31afbd9e1 100644 --- a/luciexpress/htdocs/widgets/luci.nav.js +++ b/luciexpress/htdocs/plugins/core/widgets/luci.nav.js @@ -1,10 +1,11 @@ -angular.module("luci") +$juci.module("core") .directive("luciNav", function(){ + var plugin_root = $juci.module("core").plugin_root; return { // accepted parameters for this tag scope: { }, - templateUrl: "widgets/luci.nav.html", + templateUrl: plugin_root+"/widgets/luci.nav.html", replace: true, controller: "NavCtrl", controllerAs: "ctrl" diff --git a/luciexpress/htdocs/widgets/luci.navbar.html b/luciexpress/htdocs/plugins/core/widgets/luci.navbar.html similarity index 96% rename from luciexpress/htdocs/widgets/luci.navbar.html rename to luciexpress/htdocs/plugins/core/widgets/luci.navbar.html index 618862484..d4c601b69 100644 --- a/luciexpress/htdocs/widgets/luci.navbar.html +++ b/luciexpress/htdocs/plugins/core/widgets/luci.navbar.html @@ -30,7 +30,6 @@ diff --git a/luciexpress/htdocs/widgets/luci.navbar.js b/luciexpress/htdocs/plugins/core/widgets/luci.navbar.js similarity index 94% rename from luciexpress/htdocs/widgets/luci.navbar.js rename to luciexpress/htdocs/plugins/core/widgets/luci.navbar.js index 2ab6f46c0..f927838bd 100644 --- a/luciexpress/htdocs/widgets/luci.navbar.js +++ b/luciexpress/htdocs/plugins/core/widgets/luci.navbar.js @@ -1,11 +1,12 @@ -angular.module("luci") +$juci.module("core") .directive("luciNavbar", function(){ + var plugin_root = $juci.module("core").plugin_root; return { // accepted parameters for this tag scope: { }, - templateUrl: "widgets/luci.navbar.html", + templateUrl: plugin_root+"/widgets/luci.navbar.html", replace: true, controller: "NavigationCtrl", controllerAs: "ctrl" diff --git a/luciexpress/htdocs/widgets/luci.progress.html b/luciexpress/htdocs/plugins/core/widgets/luci.progress.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.progress.html rename to luciexpress/htdocs/plugins/core/widgets/luci.progress.html diff --git a/luciexpress/htdocs/widgets/luci.progress.js b/luciexpress/htdocs/plugins/core/widgets/luci.progress.js similarity index 82% rename from luciexpress/htdocs/widgets/luci.progress.js rename to luciexpress/htdocs/plugins/core/widgets/luci.progress.js index cc1b770c7..dbd3fce99 100644 --- a/luciexpress/htdocs/widgets/luci.progress.js +++ b/luciexpress/htdocs/plugins/core/widgets/luci.progress.js @@ -1,5 +1,6 @@ -angular.module("luci") +$juci.module("core") .directive("luciProgress", function(){ + var plugin_root = $juci.module("core").plugin_root; return { // accepted parameters for this tag scope: { @@ -8,7 +9,7 @@ angular.module("luci") total: "=", units: "=" }, - templateUrl: "widgets/luci.progress.html", + templateUrl: plugin_root+"/widgets/luci.progress.html", replace: true, controller: "LuciProgressControl", controllerAs: "ctrl", diff --git a/luciexpress/htdocs/widgets/luci.table.html b/luciexpress/htdocs/plugins/core/widgets/luci.table.html similarity index 100% rename from luciexpress/htdocs/widgets/luci.table.html rename to luciexpress/htdocs/plugins/core/widgets/luci.table.html diff --git a/luciexpress/htdocs/widgets/luci.table.js b/luciexpress/htdocs/plugins/core/widgets/luci.table.js similarity index 90% rename from luciexpress/htdocs/widgets/luci.table.js rename to luciexpress/htdocs/plugins/core/widgets/luci.table.js index a7f3761db..e1809a89b 100644 --- a/luciexpress/htdocs/widgets/luci.table.js +++ b/luciexpress/htdocs/plugins/core/widgets/luci.table.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("core") .directive('dynamic', function ($compile, $interpolate) { return { restrict: 'A', @@ -12,7 +12,8 @@ angular.module("luci") }; }) .directive("luciTable", function($compile){ - return { + var plugin_root = $juci.module("core").plugin_root; + return { // accepted parameters for this tag scope: { data: "=", @@ -20,7 +21,7 @@ angular.module("luci") title: "=", noequalize: "=" }, - templateUrl: "widgets/luci.table.html", + templateUrl: plugin_root+"/widgets/luci.table.html", replace: true, controller: "TableControl", controllerAs: "ctrl", @@ -30,7 +31,8 @@ angular.module("luci") }); }*/ }; - }).controller("TableControl", function($scope){ + }) + .controller("TableControl", function($scope){ if(!$scope.data) $scope.data = {}; // assign columns from passed argument if present diff --git a/luciexpress/htdocs/plugins/hello_world/hello_world.html b/luciexpress/htdocs/plugins/hello_world/hello_world.html new file mode 100644 index 000000000..7b88fd96d --- /dev/null +++ b/luciexpress/htdocs/plugins/hello_world/hello_world.html @@ -0,0 +1 @@ +

{{msg}}

diff --git a/luciexpress/htdocs/plugins/hello_world/hello_world.js b/luciexpress/htdocs/plugins/hello_world/hello_world.js new file mode 100644 index 000000000..22e66f0b5 --- /dev/null +++ b/luciexpress/htdocs/plugins/hello_world/hello_world.js @@ -0,0 +1,3 @@ +angular.module("hello_world", []).controller("HelloWorldCtrl", function($state){ + $state.msg = "Hello World!"; +}); diff --git a/luciexpress/htdocs/plugins/hello_world/plugin.json b/luciexpress/htdocs/plugins/hello_world/plugin.json new file mode 100644 index 000000000..b832d1756 --- /dev/null +++ b/luciexpress/htdocs/plugins/hello_world/plugin.json @@ -0,0 +1,4 @@ +{ + "scripts": ["hello_world"] +} + diff --git a/luciexpress/htdocs/plugins/hello_world/submodule.js b/luciexpress/htdocs/plugins/hello_world/submodule.js new file mode 100644 index 000000000..2078b9f7c --- /dev/null +++ b/luciexpress/htdocs/plugins/hello_world/submodule.js @@ -0,0 +1 @@ +console.log("Submodule!"); diff --git a/luciexpress/htdocs/pages/phone.call_log.html b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.html similarity index 96% rename from luciexpress/htdocs/pages/phone.call_log.html rename to luciexpress/htdocs/plugins/phone/pages/phone.call_log.html index 25e9a2d37..b78ca1790 100644 --- a/luciexpress/htdocs/pages/phone.call_log.html +++ b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.html @@ -1,4 +1,5 @@ +

Call Log

diff --git a/luciexpress/htdocs/pages/phone.call_log.js b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.js similarity index 91% rename from luciexpress/htdocs/pages/phone.call_log.js rename to luciexpress/htdocs/plugins/phone/pages/phone.call_log.js index cf44b0444..2b2e9b1c8 100644 --- a/luciexpress/htdocs/pages/phone.call_log.js +++ b/luciexpress/htdocs/plugins/phone/pages/phone.call_log.js @@ -1,5 +1,4 @@ -angular.module("luci") -.controller("PhoneCallLogPageCtrl", function($scope){ +$juci.controller("PhoneCallLogPageCtrl", function($scope){ $scope.phoneNumbers = [{ label: "All Numbers" }, { diff --git a/luciexpress/htdocs/pages/phone.number_blocking.html b/luciexpress/htdocs/plugins/phone/pages/phone.number_blocking.html similarity index 100% rename from luciexpress/htdocs/pages/phone.number_blocking.html rename to luciexpress/htdocs/plugins/phone/pages/phone.number_blocking.html diff --git a/luciexpress/htdocs/plugins/phone/pages/phone.number_blocking.js b/luciexpress/htdocs/plugins/phone/pages/phone.number_blocking.js new file mode 100644 index 000000000..859a97731 --- /dev/null +++ b/luciexpress/htdocs/plugins/phone/pages/phone.number_blocking.js @@ -0,0 +1,3 @@ +$juci.controller("PhoneNumberBlockingPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/phone.numbers.html b/luciexpress/htdocs/plugins/phone/pages/phone.numbers.html similarity index 100% rename from luciexpress/htdocs/pages/phone.numbers.html rename to luciexpress/htdocs/plugins/phone/pages/phone.numbers.html diff --git a/luciexpress/htdocs/plugins/phone/pages/phone.numbers.js b/luciexpress/htdocs/plugins/phone/pages/phone.numbers.js new file mode 100644 index 000000000..0185bd94e --- /dev/null +++ b/luciexpress/htdocs/plugins/phone/pages/phone.numbers.js @@ -0,0 +1,3 @@ +$juci.controller("PhoneNumbersPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/phone.ringing_schedule.html b/luciexpress/htdocs/plugins/phone/pages/phone.ringing_schedule.html similarity index 100% rename from luciexpress/htdocs/pages/phone.ringing_schedule.html rename to luciexpress/htdocs/plugins/phone/pages/phone.ringing_schedule.html diff --git a/luciexpress/htdocs/plugins/phone/pages/phone.ringing_schedule.js b/luciexpress/htdocs/plugins/phone/pages/phone.ringing_schedule.js new file mode 100644 index 000000000..7f8919096 --- /dev/null +++ b/luciexpress/htdocs/plugins/phone/pages/phone.ringing_schedule.js @@ -0,0 +1,3 @@ +$juci.controller("PhoneRingingScheduleCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/phone.speed_dialing.html b/luciexpress/htdocs/plugins/phone/pages/phone.speed_dialing.html similarity index 100% rename from luciexpress/htdocs/pages/phone.speed_dialing.html rename to luciexpress/htdocs/plugins/phone/pages/phone.speed_dialing.html diff --git a/luciexpress/htdocs/plugins/phone/pages/phone.speed_dialing.js b/luciexpress/htdocs/plugins/phone/pages/phone.speed_dialing.js new file mode 100644 index 000000000..334b11ebb --- /dev/null +++ b/luciexpress/htdocs/plugins/phone/pages/phone.speed_dialing.js @@ -0,0 +1,3 @@ +$juci.controller("PhoneSpeedDialingCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/plugins/phone/phone.js b/luciexpress/htdocs/plugins/phone/phone.js new file mode 100644 index 000000000..ba86d4d92 --- /dev/null +++ b/luciexpress/htdocs/plugins/phone/phone.js @@ -0,0 +1,12 @@ +$juci.module("phone") +.state("phone", { + url: "/phone", + views: { + "content": { + templateUrl: "pages/phone.call_log.html", + } + }, + onEnter: function($state){ + $juci.redirect("phone.call_log"); + }, +}); diff --git a/luciexpress/htdocs/plugins/phone/plugin.json b/luciexpress/htdocs/plugins/phone/plugin.json new file mode 100644 index 000000000..f797b6cc7 --- /dev/null +++ b/luciexpress/htdocs/plugins/phone/plugin.json @@ -0,0 +1,22 @@ +{ + "scripts": [ + "phone" + ], + "pages": { + "phone.number_blocking": { + "view": "pages/phone.number_blocking" + }, + "phone.call_log": { + "view": "pages/phone.call_log" + }, + "phone.numbers": { + "view": "pages/phone.numbers" + }, + "phone.ringing_schedule": { + "view": "pages/phone.ringing_schedule" + }, + "phone.speed_dialing": { + "view": "pages/phone.speed_dialing" + } + } +} diff --git a/luciexpress/htdocs/pages/internet.dns.html b/luciexpress/htdocs/plugins/router/pages/internet.dns.html similarity index 100% rename from luciexpress/htdocs/pages/internet.dns.html rename to luciexpress/htdocs/plugins/router/pages/internet.dns.html diff --git a/luciexpress/htdocs/plugins/router/pages/internet.dns.js b/luciexpress/htdocs/plugins/router/pages/internet.dns.js new file mode 100644 index 000000000..55e207164 --- /dev/null +++ b/luciexpress/htdocs/plugins/router/pages/internet.dns.js @@ -0,0 +1,4 @@ +$juci.module("router") +.controller("InternetDNSPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/internet.exposed_host.html b/luciexpress/htdocs/plugins/router/pages/internet.exposed_host.html similarity index 100% rename from luciexpress/htdocs/pages/internet.exposed_host.html rename to luciexpress/htdocs/plugins/router/pages/internet.exposed_host.html diff --git a/luciexpress/htdocs/pages/internet.exposed_host.js b/luciexpress/htdocs/plugins/router/pages/internet.exposed_host.js similarity index 73% rename from luciexpress/htdocs/pages/internet.exposed_host.js rename to luciexpress/htdocs/plugins/router/pages/internet.exposed_host.js index 908e13c39..5ca378a7e 100644 --- a/luciexpress/htdocs/pages/internet.exposed_host.js +++ b/luciexpress/htdocs/plugins/router/pages/internet.exposed_host.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("InternetExHostPageCtrl", function($scope){ }); diff --git a/luciexpress/htdocs/pages/internet.firewall.html b/luciexpress/htdocs/plugins/router/pages/internet.firewall.html similarity index 100% rename from luciexpress/htdocs/pages/internet.firewall.html rename to luciexpress/htdocs/plugins/router/pages/internet.firewall.html diff --git a/luciexpress/htdocs/pages/internet.firewall.js b/luciexpress/htdocs/plugins/router/pages/internet.firewall.js similarity index 83% rename from luciexpress/htdocs/pages/internet.firewall.js rename to luciexpress/htdocs/plugins/router/pages/internet.firewall.js index fe1587342..08a7a7eec 100644 --- a/luciexpress/htdocs/pages/internet.firewall.js +++ b/luciexpress/htdocs/plugins/router/pages/internet.firewall.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("InternetFirewallPageCtrl", function($scope){ $scope.firewallEnabled = 1; $scope.allowWANPing = 1; diff --git a/luciexpress/htdocs/pages/internet.port_mapping.html b/luciexpress/htdocs/plugins/router/pages/internet.port_mapping.html similarity index 100% rename from luciexpress/htdocs/pages/internet.port_mapping.html rename to luciexpress/htdocs/plugins/router/pages/internet.port_mapping.html diff --git a/luciexpress/htdocs/pages/internet.port_mapping.js b/luciexpress/htdocs/plugins/router/pages/internet.port_mapping.js similarity index 74% rename from luciexpress/htdocs/pages/internet.port_mapping.js rename to luciexpress/htdocs/plugins/router/pages/internet.port_mapping.js index 9ac14b7c8..c6061dfdb 100644 --- a/luciexpress/htdocs/pages/internet.port_mapping.js +++ b/luciexpress/htdocs/plugins/router/pages/internet.port_mapping.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("InternetPortMappingPageCtrl", function($scope){ }); diff --git a/luciexpress/htdocs/pages/settings.configuration.html b/luciexpress/htdocs/plugins/router/pages/settings.configuration.html similarity index 100% rename from luciexpress/htdocs/pages/settings.configuration.html rename to luciexpress/htdocs/plugins/router/pages/settings.configuration.html diff --git a/luciexpress/htdocs/pages/settings.configuration.js b/luciexpress/htdocs/plugins/router/pages/settings.configuration.js similarity index 74% rename from luciexpress/htdocs/pages/settings.configuration.js rename to luciexpress/htdocs/plugins/router/pages/settings.configuration.js index 30c89242a..b6459ec4c 100644 --- a/luciexpress/htdocs/pages/settings.configuration.js +++ b/luciexpress/htdocs/plugins/router/pages/settings.configuration.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("SettingsConfigurationCtrl", function($scope){ }); diff --git a/luciexpress/htdocs/pages/settings.energy.html b/luciexpress/htdocs/plugins/router/pages/settings.energy.html similarity index 100% rename from luciexpress/htdocs/pages/settings.energy.html rename to luciexpress/htdocs/plugins/router/pages/settings.energy.html diff --git a/luciexpress/htdocs/pages/settings.energy.js b/luciexpress/htdocs/plugins/router/pages/settings.energy.js similarity index 71% rename from luciexpress/htdocs/pages/settings.energy.js rename to luciexpress/htdocs/plugins/router/pages/settings.energy.js index f430c9cb3..f2cac59e2 100644 --- a/luciexpress/htdocs/pages/settings.energy.js +++ b/luciexpress/htdocs/plugins/router/pages/settings.energy.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("SettingsEnergyCtrl", function($scope){ }); diff --git a/luciexpress/htdocs/pages/settings.network.html b/luciexpress/htdocs/plugins/router/pages/settings.network.html similarity index 100% rename from luciexpress/htdocs/pages/settings.network.html rename to luciexpress/htdocs/plugins/router/pages/settings.network.html diff --git a/luciexpress/htdocs/pages/settings.network.js b/luciexpress/htdocs/plugins/router/pages/settings.network.js similarity index 72% rename from luciexpress/htdocs/pages/settings.network.js rename to luciexpress/htdocs/plugins/router/pages/settings.network.js index 78ebe98a6..7a5a6823a 100644 --- a/luciexpress/htdocs/pages/settings.network.js +++ b/luciexpress/htdocs/plugins/router/pages/settings.network.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("SettingsNetworkCtrl", function($scope){ }); diff --git a/luciexpress/htdocs/pages/settings.password.html b/luciexpress/htdocs/plugins/router/pages/settings.password.html similarity index 100% rename from luciexpress/htdocs/pages/settings.password.html rename to luciexpress/htdocs/plugins/router/pages/settings.password.html diff --git a/luciexpress/htdocs/pages/settings.password.js b/luciexpress/htdocs/plugins/router/pages/settings.password.js similarity index 72% rename from luciexpress/htdocs/pages/settings.password.js rename to luciexpress/htdocs/plugins/router/pages/settings.password.js index 51f6b8802..e5045d9fd 100644 --- a/luciexpress/htdocs/pages/settings.password.js +++ b/luciexpress/htdocs/plugins/router/pages/settings.password.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("SettingsPasswordCtrl", function($scope){ }); diff --git a/luciexpress/htdocs/pages/settings.upgrade.html b/luciexpress/htdocs/plugins/router/pages/settings.upgrade.html similarity index 100% rename from luciexpress/htdocs/pages/settings.upgrade.html rename to luciexpress/htdocs/plugins/router/pages/settings.upgrade.html diff --git a/luciexpress/htdocs/pages/settings.upgrade.js b/luciexpress/htdocs/plugins/router/pages/settings.upgrade.js similarity index 72% rename from luciexpress/htdocs/pages/settings.upgrade.js rename to luciexpress/htdocs/plugins/router/pages/settings.upgrade.js index 3d1707b5a..d49891988 100644 --- a/luciexpress/htdocs/pages/settings.upgrade.js +++ b/luciexpress/htdocs/plugins/router/pages/settings.upgrade.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("SettingsUpgradeCtrl", function($scope){ }); diff --git a/luciexpress/htdocs/pages/status.about.html b/luciexpress/htdocs/plugins/router/pages/status.about.html similarity index 100% rename from luciexpress/htdocs/pages/status.about.html rename to luciexpress/htdocs/plugins/router/pages/status.about.html diff --git a/luciexpress/htdocs/pages/status.about.js b/luciexpress/htdocs/plugins/router/pages/status.about.js similarity index 69% rename from luciexpress/htdocs/pages/status.about.js rename to luciexpress/htdocs/plugins/router/pages/status.about.js index 70f62fbda..ed5bb43f6 100644 --- a/luciexpress/htdocs/pages/status.about.js +++ b/luciexpress/htdocs/plugins/router/pages/status.about.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("StatusAbout", function($scope){ }); diff --git a/luciexpress/htdocs/pages/status.diagnostics.html b/luciexpress/htdocs/plugins/router/pages/status.diagnostics.html similarity index 100% rename from luciexpress/htdocs/pages/status.diagnostics.html rename to luciexpress/htdocs/plugins/router/pages/status.diagnostics.html diff --git a/luciexpress/htdocs/pages/status.diagnostics.js b/luciexpress/htdocs/plugins/router/pages/status.diagnostics.js similarity index 71% rename from luciexpress/htdocs/pages/status.diagnostics.js rename to luciexpress/htdocs/plugins/router/pages/status.diagnostics.js index 0da020663..bbe1b3ca4 100644 --- a/luciexpress/htdocs/pages/status.diagnostics.js +++ b/luciexpress/htdocs/plugins/router/pages/status.diagnostics.js @@ -1,4 +1,4 @@ -angular.module("luci") +$juci.module("router") .controller("StatusDiagnostics", function($scope){ }); diff --git a/luciexpress/htdocs/pages/status.dsl.html b/luciexpress/htdocs/plugins/router/pages/status.dsl.html similarity index 100% rename from luciexpress/htdocs/pages/status.dsl.html rename to luciexpress/htdocs/plugins/router/pages/status.dsl.html diff --git a/luciexpress/htdocs/pages/status.dsl.js b/luciexpress/htdocs/plugins/router/pages/status.dsl.js similarity index 95% rename from luciexpress/htdocs/pages/status.dsl.js rename to luciexpress/htdocs/plugins/router/pages/status.dsl.js index a7af54d88..a0cdfcd89 100644 --- a/luciexpress/htdocs/pages/status.dsl.js +++ b/luciexpress/htdocs/plugins/router/pages/status.dsl.js @@ -1,4 +1,5 @@ -angular.module("luci").controller("StatsCtrl", function($scope, $rpc, $session, gettextCatalog){ +$juci.module("router") +.controller("StatsCtrl", function($scope, $rpc, $session, gettextCatalog){ $scope.dslstats = {}; function $tr(str){ diff --git a/luciexpress/htdocs/pages/status.events.html b/luciexpress/htdocs/plugins/router/pages/status.events.html similarity index 100% rename from luciexpress/htdocs/pages/status.events.html rename to luciexpress/htdocs/plugins/router/pages/status.events.html diff --git a/luciexpress/htdocs/plugins/router/pages/status.events.js b/luciexpress/htdocs/plugins/router/pages/status.events.js new file mode 100644 index 000000000..871fe6811 --- /dev/null +++ b/luciexpress/htdocs/plugins/router/pages/status.events.js @@ -0,0 +1,4 @@ +$juci.module("router") +.controller("StatusEventsPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/status.nat.html b/luciexpress/htdocs/plugins/router/pages/status.nat.html similarity index 100% rename from luciexpress/htdocs/pages/status.nat.html rename to luciexpress/htdocs/plugins/router/pages/status.nat.html diff --git a/luciexpress/htdocs/plugins/router/pages/status.nat.js b/luciexpress/htdocs/plugins/router/pages/status.nat.js new file mode 100644 index 000000000..b5de09a97 --- /dev/null +++ b/luciexpress/htdocs/plugins/router/pages/status.nat.js @@ -0,0 +1,4 @@ +$juci.module("router") +.controller("StatusNATPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/status.overview.html b/luciexpress/htdocs/plugins/router/pages/status.overview.html similarity index 100% rename from luciexpress/htdocs/pages/status.overview.html rename to luciexpress/htdocs/plugins/router/pages/status.overview.html diff --git a/luciexpress/htdocs/pages/status.overview.js b/luciexpress/htdocs/plugins/router/pages/status.overview.js similarity index 97% rename from luciexpress/htdocs/pages/status.overview.js rename to luciexpress/htdocs/plugins/router/pages/status.overview.js index a38c80f1a..21ccdf463 100644 --- a/luciexpress/htdocs/pages/status.overview.js +++ b/luciexpress/htdocs/plugins/router/pages/status.overview.js @@ -1,4 +1,5 @@ -angular.module("luci").controller("StatsOverviewCtrl", function ($scope, $session, $rootScope, $rpc, gettextCatalog) { +$juci.module("router") +.controller("StatsOverviewCtrl", function ($scope, $session, $rootScope, $rpc, gettextCatalog) { $scope.sysinfo = {}; $scope.info = {}; diff --git a/luciexpress/htdocs/pages/status.restart.html b/luciexpress/htdocs/plugins/router/pages/status.restart.html similarity index 100% rename from luciexpress/htdocs/pages/status.restart.html rename to luciexpress/htdocs/plugins/router/pages/status.restart.html diff --git a/luciexpress/htdocs/plugins/router/pages/status.restart.js b/luciexpress/htdocs/plugins/router/pages/status.restart.js new file mode 100644 index 000000000..fb169d18d --- /dev/null +++ b/luciexpress/htdocs/plugins/router/pages/status.restart.js @@ -0,0 +1,4 @@ +$juci.module("router") +.controller("StatusRestartPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/status.tv.html b/luciexpress/htdocs/plugins/router/pages/status.tv.html similarity index 100% rename from luciexpress/htdocs/pages/status.tv.html rename to luciexpress/htdocs/plugins/router/pages/status.tv.html diff --git a/luciexpress/htdocs/plugins/router/pages/status.tv.js b/luciexpress/htdocs/plugins/router/pages/status.tv.js new file mode 100644 index 000000000..7e97f6ed7 --- /dev/null +++ b/luciexpress/htdocs/plugins/router/pages/status.tv.js @@ -0,0 +1,4 @@ +$juci.module("router") +.controller("StatusTVPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/status.voice.html b/luciexpress/htdocs/plugins/router/pages/status.voice.html similarity index 100% rename from luciexpress/htdocs/pages/status.voice.html rename to luciexpress/htdocs/plugins/router/pages/status.voice.html diff --git a/luciexpress/htdocs/plugins/router/pages/status.voice.js b/luciexpress/htdocs/plugins/router/pages/status.voice.js new file mode 100644 index 000000000..6e3b29d1a --- /dev/null +++ b/luciexpress/htdocs/plugins/router/pages/status.voice.js @@ -0,0 +1,4 @@ +$juci.module("router") +.controller("StatusVoicePageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/plugins/router/plugin.json b/luciexpress/htdocs/plugins/router/plugin.json new file mode 100644 index 000000000..f1076c596 --- /dev/null +++ b/luciexpress/htdocs/plugins/router/plugin.json @@ -0,0 +1,61 @@ +{ + "scripts": [ + "router" + ], + "pages": { + "internet.dns": { + "view": "pages/internet.dns" + }, + "internet.exposed_host": { + "view": "pages/internet.exposed_host" + }, + "internet.firewall": { + "view": "pages/internet.firewall" + }, + "internet.port_mapping": { + "view": "pages/internet.port_mapping" + }, + "settings.configuration": { + "view": "pages/settings.configuration" + }, + "settings.energy": { + "view": "pages/settings.energy" + }, + "settings.network": { + "view": "pages/settings.network" + }, + "settings.password": { + "view": "pages/settings.password" + }, + "settings.upgrade": { + "view": "pages/settings.upgrade" + }, + "status.about": { + "view": "pages/status.about" + }, + "status.diagnostics": { + "view": "pages/status.diagnostics" + }, + "status.dsl": { + "view": "pages/status.dsl" + }, + "status.events": { + "view": "pages/status.events" + }, + "status.nat": { + "view": "pages/status.nat" + }, + "status.overview": { + "view": "pages/status.overview" + }, + "status.restart": { + "view": "pages/status.restart" + }, + "status.tv": { + "view": "pages/status.tv" + }, + "status.voice": { + "view": "pages/status.voice" + } + } +} diff --git a/luciexpress/htdocs/plugins/router/router.js b/luciexpress/htdocs/plugins/router/router.js new file mode 100644 index 000000000..654348d55 --- /dev/null +++ b/luciexpress/htdocs/plugins/router/router.js @@ -0,0 +1,24 @@ +$juci.module("router") +.state("internet", { + url: "/internet", + views: { + "content": { + templateUrl: "pages/internet.firewall.html", + } + }, + onEnter: function($state){ + $juci.redirect("internet.firewall"); + }, +}) +.state("settings", { + url: "/settings", + onEnter: function($state){ + $juci.redirect("settings.password"); + }, +}) +.state("status", { + url: "/status", + onEnter: function($state){ + $juci.redirect("status.overview"); + }, +}); diff --git a/luciexpress/htdocs/pages/wifi.general.html b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.html similarity index 100% rename from luciexpress/htdocs/pages/wifi.general.html rename to luciexpress/htdocs/plugins/wifi/pages/wifi.general.html diff --git a/luciexpress/htdocs/pages/wifi.general.js b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js similarity index 83% rename from luciexpress/htdocs/pages/wifi.general.js rename to luciexpress/htdocs/plugins/wifi/pages/wifi.general.js index eb57a0688..6db76763f 100644 --- a/luciexpress/htdocs/pages/wifi.general.js +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.general.js @@ -1,4 +1,5 @@ -angular.module("luci").controller("WifiGeneralPageCtrl", function($scope){ +$juci.module("wifi") +.controller("WifiGeneralPageCtrl", function($scope){ $scope.wifiEnabled = 1; $scope.wifiButtonEnabled = 1; $scope.guestWifiEnabled = 0; diff --git a/luciexpress/htdocs/pages/wifi.mac_filter.html b/luciexpress/htdocs/plugins/wifi/pages/wifi.mac_filter.html similarity index 100% rename from luciexpress/htdocs/pages/wifi.mac_filter.html rename to luciexpress/htdocs/plugins/wifi/pages/wifi.mac_filter.html diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.mac_filter.js b/luciexpress/htdocs/plugins/wifi/pages/wifi.mac_filter.js new file mode 100644 index 000000000..fe725484e --- /dev/null +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.mac_filter.js @@ -0,0 +1,4 @@ +$juci.module("wifi") +.controller("WifiMacFilterPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/wifi.schedule.html b/luciexpress/htdocs/plugins/wifi/pages/wifi.schedule.html similarity index 100% rename from luciexpress/htdocs/pages/wifi.schedule.html rename to luciexpress/htdocs/plugins/wifi/pages/wifi.schedule.html diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.schedule.js b/luciexpress/htdocs/plugins/wifi/pages/wifi.schedule.js new file mode 100644 index 000000000..cbc658f00 --- /dev/null +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.schedule.js @@ -0,0 +1,4 @@ +$juci.module("wifi") +.controller("WifiSchedulePageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/wifi.settings.html b/luciexpress/htdocs/plugins/wifi/pages/wifi.settings.html similarity index 100% rename from luciexpress/htdocs/pages/wifi.settings.html rename to luciexpress/htdocs/plugins/wifi/pages/wifi.settings.html diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.settings.js b/luciexpress/htdocs/plugins/wifi/pages/wifi.settings.js new file mode 100644 index 000000000..7d38ac854 --- /dev/null +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.settings.js @@ -0,0 +1,4 @@ +$juci.module("wifi") +.controller("WifiSettingsPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/pages/wifi.wps.html b/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.html similarity index 100% rename from luciexpress/htdocs/pages/wifi.wps.html rename to luciexpress/htdocs/plugins/wifi/pages/wifi.wps.html diff --git a/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.js b/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.js new file mode 100644 index 000000000..e37e3502f --- /dev/null +++ b/luciexpress/htdocs/plugins/wifi/pages/wifi.wps.js @@ -0,0 +1,4 @@ +$juci.module("wifi") +.controller("WifiWPSPageCtrl", function($scope){ + +}); diff --git a/luciexpress/htdocs/plugins/wifi/plugin.json b/luciexpress/htdocs/plugins/wifi/plugin.json new file mode 100644 index 000000000..f69a7724b --- /dev/null +++ b/luciexpress/htdocs/plugins/wifi/plugin.json @@ -0,0 +1,22 @@ +{ + "scripts": [ + "wifi" + ], + "pages": { + "wifi.general": { + "view": "pages/wifi.general" + }, + "wifi.mac_filter": { + "view": "pages/wifi.mac_filter" + }, + "wifi.schedule": { + "view": "pages/wifi.schedule" + }, + "wifi.settings": { + "view": "pages/wifi.settings" + }, + "wifi.wps": { + "view": "pages/wifi.wps" + } + } +} diff --git a/luciexpress/htdocs/plugins/wifi/wifi.js b/luciexpress/htdocs/plugins/wifi/wifi.js new file mode 100644 index 000000000..1daa0bf3f --- /dev/null +++ b/luciexpress/htdocs/plugins/wifi/wifi.js @@ -0,0 +1,13 @@ +$juci.module("core") +.state("wifi", { + url: "/wifi", + views: { + "content": { + templateUrl: "pages/default.html", + } + }, + onEnter: function($state){ + + $juci.redirect("wifi.general"); + } +}); diff --git a/luciexpress/htdocs/themes/default/index.html b/luciexpress/htdocs/themes/default/index.html new file mode 100644 index 000000000..b3c2a9f88 --- /dev/null +++ b/luciexpress/htdocs/themes/default/index.html @@ -0,0 +1,27 @@ +
+
+
+
{{ config.model }}
+
+ + {{$select.selected.label}} + +
{{mode.label}}
+
+
+ +
+
+
+
+
diff --git a/luciexpress/htdocs/themes/vodaphone/img/vf-logo.png b/luciexpress/htdocs/themes/vodaphone/img/vf-logo.png new file mode 100644 index 000000000..9053217ad Binary files /dev/null and b/luciexpress/htdocs/themes/vodaphone/img/vf-logo.png differ diff --git a/luciexpress/htdocs/themes/vodaphone/index.html b/luciexpress/htdocs/themes/vodaphone/index.html new file mode 100644 index 000000000..4808cf5e6 --- /dev/null +++ b/luciexpress/htdocs/themes/vodaphone/index.html @@ -0,0 +1,22 @@ +
+
+
+
{{ config.model }}
+
+ + {{$select.selected.label}} + +
{{mode.label}}
+
+
+
+
+
+
+
diff --git a/luciexpress/htdocs/widgets/luci.layout.naked.js b/luciexpress/htdocs/widgets/luci.layout.naked.js deleted file mode 100644 index 9d07eafd4..000000000 --- a/luciexpress/htdocs/widgets/luci.layout.naked.js +++ /dev/null @@ -1,15 +0,0 @@ -angular.module("luci") -.directive("luciLayoutNaked", function(){ - return { - // accepted parameters for this tag - scope: { - }, - templateUrl: "widgets/luci.layout.naked.html", - transclude: true, - controller: "LuciLayoutNaked", - controllerAs: "ctrl" - }; -}) -.controller("LuciLayoutNaked", function($scope, $session){ - -}); diff --git a/luciexpress/htdocs/widgets/luci.layout.single_column.js b/luciexpress/htdocs/widgets/luci.layout.single_column.js deleted file mode 100644 index 858592599..000000000 --- a/luciexpress/htdocs/widgets/luci.layout.single_column.js +++ /dev/null @@ -1,15 +0,0 @@ -angular.module("luci") -.directive("luciLayoutSingleColumn", function(){ - return { - // accepted parameters for this tag - scope: { - }, - templateUrl: "widgets/luci.layout.single_column.html", - transclude: true, - controller: "LuciLayoutSingleColumn", - controllerAs: "ctrl" - }; -}) -.controller("LuciLayoutSingleColumn", function($scope, $session){ - -}); diff --git a/luciexpress/htdocs/widgets/luci.layout.with_sidebar.js b/luciexpress/htdocs/widgets/luci.layout.with_sidebar.js deleted file mode 100644 index 58a24ae05..000000000 --- a/luciexpress/htdocs/widgets/luci.layout.with_sidebar.js +++ /dev/null @@ -1,15 +0,0 @@ -angular.module("luci") -.directive("luciLayoutWithSidebar", function(){ - return { - // accepted parameters for this tag - scope: { - }, - templateUrl: "widgets/luci.layout.with_sidebar.html", - transclude: true, - controller: "LuciLayoutWithSidebar", - controllerAs: "ctrl" - }; -}) -.controller("LuciLayoutWithSidebar", function($scope, $session){ - -});