From 45fc69129ad9f760fdf66f1a460f2ba035de2a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Wed, 22 Apr 2015 15:02:22 +0200 Subject: [PATCH] And some more... --- luciexpress/htdocs/index.html | 69 +----- luciexpress/htdocs/js/app.js | 218 +++++++++++++----- luciexpress/htdocs/js/config.js | 8 +- luciexpress/htdocs/js/navigation.js | 7 +- luciexpress/htdocs/pages/internet.dns.js | 3 - luciexpress/htdocs/pages/login.js | 14 -- luciexpress/htdocs/pages/overview.js | 4 - luciexpress/htdocs/pages/phone.js | 1 - .../htdocs/pages/phone.number_blocking.js | 3 - luciexpress/htdocs/pages/phone.numbers.js | 4 - .../htdocs/pages/phone.ringing_schedule.js | 4 - .../htdocs/pages/phone.speed_dialing.js | 4 - luciexpress/htdocs/pages/status.events.js | 3 - luciexpress/htdocs/pages/status.nat.js | 3 - luciexpress/htdocs/pages/status.restart.js | 3 - luciexpress/htdocs/pages/status.tv.js | 3 - luciexpress/htdocs/pages/status.voice.js | 3 - luciexpress/htdocs/pages/wifi.js | 1 - luciexpress/htdocs/pages/wifi.mac_filter.js | 3 - luciexpress/htdocs/pages/wifi.schedule.js | 3 - luciexpress/htdocs/pages/wifi.settings.js | 3 - luciexpress/htdocs/pages/wifi.wps.js | 3 - .../htdocs/plugins/core/pages/404.html | 3 + .../{ => plugins/core}/pages/default.html | 0 .../htdocs/plugins/core/pages/loading.html | 1 + .../{ => plugins/core}/pages/login.html | 0 .../htdocs/plugins/core/pages/login.js | 4 + .../{ => plugins/core}/pages/overview.html | 0 .../htdocs/plugins/core/pages/overview.js | 3 + luciexpress/htdocs/plugins/core/plugin.json | 21 ++ .../core}/widgets/luci.footer.html | 0 .../{ => plugins/core}/widgets/luci.footer.js | 11 +- .../core}/widgets/luci.layout.naked.html | 0 .../plugins/core/widgets/luci.layout.naked.js | 16 ++ .../widgets/luci.layout.single_column.html | 0 .../core/widgets/luci.layout.single_column.js | 16 ++ .../widgets/luci.layout.with_sidebar.html | 0 .../core/widgets/luci.layout.with_sidebar.js | 17 ++ .../core}/widgets/luci.login.html | 0 .../{ => plugins/core}/widgets/luci.login.js | 9 +- .../{ => plugins/core}/widgets/luci.nav.html | 0 .../{ => plugins/core}/widgets/luci.nav.js | 5 +- .../core}/widgets/luci.navbar.html | 1 - .../{ => plugins/core}/widgets/luci.navbar.js | 5 +- .../core}/widgets/luci.progress.html | 0 .../core}/widgets/luci.progress.js | 5 +- .../core}/widgets/luci.table.html | 0 .../{ => plugins/core}/widgets/luci.table.js | 10 +- .../plugins/hello_world/hello_world.html | 1 + .../htdocs/plugins/hello_world/hello_world.js | 3 + .../htdocs/plugins/hello_world/plugin.json | 4 + .../htdocs/plugins/hello_world/submodule.js | 1 + .../phone}/pages/phone.call_log.html | 1 + .../phone}/pages/phone.call_log.js | 3 +- .../phone}/pages/phone.number_blocking.html | 0 .../phone/pages/phone.number_blocking.js | 3 + .../phone}/pages/phone.numbers.html | 0 .../plugins/phone/pages/phone.numbers.js | 3 + .../phone}/pages/phone.ringing_schedule.html | 0 .../phone/pages/phone.ringing_schedule.js | 3 + .../phone}/pages/phone.speed_dialing.html | 0 .../phone/pages/phone.speed_dialing.js | 3 + luciexpress/htdocs/plugins/phone/phone.js | 12 + luciexpress/htdocs/plugins/phone/plugin.json | 22 ++ .../router}/pages/internet.dns.html | 0 .../plugins/router/pages/internet.dns.js | 4 + .../router}/pages/internet.exposed_host.html | 0 .../router}/pages/internet.exposed_host.js | 2 +- .../router}/pages/internet.firewall.html | 0 .../router}/pages/internet.firewall.js | 2 +- .../router}/pages/internet.port_mapping.html | 0 .../router}/pages/internet.port_mapping.js | 2 +- .../router}/pages/settings.configuration.html | 0 .../router}/pages/settings.configuration.js | 2 +- .../router}/pages/settings.energy.html | 0 .../router}/pages/settings.energy.js | 2 +- .../router}/pages/settings.network.html | 0 .../router}/pages/settings.network.js | 2 +- .../router}/pages/settings.password.html | 0 .../router}/pages/settings.password.js | 2 +- .../router}/pages/settings.upgrade.html | 0 .../router}/pages/settings.upgrade.js | 2 +- .../router}/pages/status.about.html | 0 .../router}/pages/status.about.js | 2 +- .../router}/pages/status.diagnostics.html | 0 .../router}/pages/status.diagnostics.js | 2 +- .../router}/pages/status.dsl.html | 0 .../{ => plugins/router}/pages/status.dsl.js | 3 +- .../router}/pages/status.events.html | 0 .../plugins/router/pages/status.events.js | 4 + .../router}/pages/status.nat.html | 0 .../htdocs/plugins/router/pages/status.nat.js | 4 + .../router}/pages/status.overview.html | 0 .../router}/pages/status.overview.js | 3 +- .../router}/pages/status.restart.html | 0 .../plugins/router/pages/status.restart.js | 4 + .../{ => plugins/router}/pages/status.tv.html | 0 .../htdocs/plugins/router/pages/status.tv.js | 4 + .../router}/pages/status.voice.html | 0 .../plugins/router/pages/status.voice.js | 4 + luciexpress/htdocs/plugins/router/plugin.json | 61 +++++ luciexpress/htdocs/plugins/router/router.js | 24 ++ .../wifi}/pages/wifi.general.html | 0 .../{ => plugins/wifi}/pages/wifi.general.js | 3 +- .../wifi}/pages/wifi.mac_filter.html | 0 .../plugins/wifi/pages/wifi.mac_filter.js | 4 + .../wifi}/pages/wifi.schedule.html | 0 .../plugins/wifi/pages/wifi.schedule.js | 4 + .../wifi}/pages/wifi.settings.html | 0 .../plugins/wifi/pages/wifi.settings.js | 4 + .../{ => plugins/wifi}/pages/wifi.wps.html | 0 .../htdocs/plugins/wifi/pages/wifi.wps.js | 4 + luciexpress/htdocs/plugins/wifi/plugin.json | 22 ++ luciexpress/htdocs/plugins/wifi/wifi.js | 13 ++ luciexpress/htdocs/themes/default/index.html | 27 +++ .../htdocs/themes/vodaphone/img/vf-logo.png | Bin 0 -> 5289 bytes .../htdocs/themes/vodaphone/index.html | 22 ++ .../htdocs/widgets/luci.layout.naked.js | 15 -- .../widgets/luci.layout.single_column.js | 15 -- .../widgets/luci.layout.with_sidebar.js | 15 -- 120 files changed, 570 insertions(+), 266 deletions(-) delete mode 100644 luciexpress/htdocs/pages/internet.dns.js delete mode 100644 luciexpress/htdocs/pages/login.js delete mode 100644 luciexpress/htdocs/pages/overview.js delete mode 100644 luciexpress/htdocs/pages/phone.js delete mode 100644 luciexpress/htdocs/pages/phone.number_blocking.js delete mode 100644 luciexpress/htdocs/pages/phone.numbers.js delete mode 100644 luciexpress/htdocs/pages/phone.ringing_schedule.js delete mode 100644 luciexpress/htdocs/pages/phone.speed_dialing.js delete mode 100644 luciexpress/htdocs/pages/status.events.js delete mode 100644 luciexpress/htdocs/pages/status.nat.js delete mode 100644 luciexpress/htdocs/pages/status.restart.js delete mode 100644 luciexpress/htdocs/pages/status.tv.js delete mode 100644 luciexpress/htdocs/pages/status.voice.js delete mode 100644 luciexpress/htdocs/pages/wifi.js delete mode 100644 luciexpress/htdocs/pages/wifi.mac_filter.js delete mode 100644 luciexpress/htdocs/pages/wifi.schedule.js delete mode 100644 luciexpress/htdocs/pages/wifi.settings.js delete mode 100644 luciexpress/htdocs/pages/wifi.wps.js create mode 100644 luciexpress/htdocs/plugins/core/pages/404.html rename luciexpress/htdocs/{ => plugins/core}/pages/default.html (100%) create mode 100644 luciexpress/htdocs/plugins/core/pages/loading.html rename luciexpress/htdocs/{ => plugins/core}/pages/login.html (100%) create mode 100644 luciexpress/htdocs/plugins/core/pages/login.js rename luciexpress/htdocs/{ => plugins/core}/pages/overview.html (100%) create mode 100644 luciexpress/htdocs/plugins/core/pages/overview.js create mode 100644 luciexpress/htdocs/plugins/core/plugin.json rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.footer.html (100%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.footer.js (72%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.layout.naked.html (100%) create mode 100644 luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.js rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.layout.single_column.html (100%) create mode 100644 luciexpress/htdocs/plugins/core/widgets/luci.layout.single_column.js rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.layout.with_sidebar.html (100%) create mode 100644 luciexpress/htdocs/plugins/core/widgets/luci.layout.with_sidebar.js rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.login.html (100%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.login.js (82%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.nav.html (100%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.nav.js (92%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.navbar.html (96%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.navbar.js (94%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.progress.html (100%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.progress.js (82%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.table.html (100%) rename luciexpress/htdocs/{ => plugins/core}/widgets/luci.table.js (90%) create mode 100644 luciexpress/htdocs/plugins/hello_world/hello_world.html create mode 100644 luciexpress/htdocs/plugins/hello_world/hello_world.js create mode 100644 luciexpress/htdocs/plugins/hello_world/plugin.json create mode 100644 luciexpress/htdocs/plugins/hello_world/submodule.js rename luciexpress/htdocs/{ => plugins/phone}/pages/phone.call_log.html (96%) rename luciexpress/htdocs/{ => plugins/phone}/pages/phone.call_log.js (91%) rename luciexpress/htdocs/{ => plugins/phone}/pages/phone.number_blocking.html (100%) create mode 100644 luciexpress/htdocs/plugins/phone/pages/phone.number_blocking.js rename luciexpress/htdocs/{ => plugins/phone}/pages/phone.numbers.html (100%) create mode 100644 luciexpress/htdocs/plugins/phone/pages/phone.numbers.js rename luciexpress/htdocs/{ => plugins/phone}/pages/phone.ringing_schedule.html (100%) create mode 100644 luciexpress/htdocs/plugins/phone/pages/phone.ringing_schedule.js rename luciexpress/htdocs/{ => plugins/phone}/pages/phone.speed_dialing.html (100%) create mode 100644 luciexpress/htdocs/plugins/phone/pages/phone.speed_dialing.js create mode 100644 luciexpress/htdocs/plugins/phone/phone.js create mode 100644 luciexpress/htdocs/plugins/phone/plugin.json rename luciexpress/htdocs/{ => plugins/router}/pages/internet.dns.html (100%) create mode 100644 luciexpress/htdocs/plugins/router/pages/internet.dns.js rename luciexpress/htdocs/{ => plugins/router}/pages/internet.exposed_host.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/internet.exposed_host.js (73%) rename luciexpress/htdocs/{ => plugins/router}/pages/internet.firewall.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/internet.firewall.js (83%) rename luciexpress/htdocs/{ => plugins/router}/pages/internet.port_mapping.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/internet.port_mapping.js (74%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.configuration.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.configuration.js (74%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.energy.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.energy.js (71%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.network.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.network.js (72%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.password.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.password.js (72%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.upgrade.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/settings.upgrade.js (72%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.about.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.about.js (69%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.diagnostics.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.diagnostics.js (71%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.dsl.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.dsl.js (95%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.events.html (100%) create mode 100644 luciexpress/htdocs/plugins/router/pages/status.events.js rename luciexpress/htdocs/{ => plugins/router}/pages/status.nat.html (100%) create mode 100644 luciexpress/htdocs/plugins/router/pages/status.nat.js rename luciexpress/htdocs/{ => plugins/router}/pages/status.overview.html (100%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.overview.js (97%) rename luciexpress/htdocs/{ => plugins/router}/pages/status.restart.html (100%) create mode 100644 luciexpress/htdocs/plugins/router/pages/status.restart.js rename luciexpress/htdocs/{ => plugins/router}/pages/status.tv.html (100%) create mode 100644 luciexpress/htdocs/plugins/router/pages/status.tv.js rename luciexpress/htdocs/{ => plugins/router}/pages/status.voice.html (100%) create mode 100644 luciexpress/htdocs/plugins/router/pages/status.voice.js create mode 100644 luciexpress/htdocs/plugins/router/plugin.json create mode 100644 luciexpress/htdocs/plugins/router/router.js rename luciexpress/htdocs/{ => plugins/wifi}/pages/wifi.general.html (100%) rename luciexpress/htdocs/{ => plugins/wifi}/pages/wifi.general.js (83%) rename luciexpress/htdocs/{ => plugins/wifi}/pages/wifi.mac_filter.html (100%) create mode 100644 luciexpress/htdocs/plugins/wifi/pages/wifi.mac_filter.js rename luciexpress/htdocs/{ => plugins/wifi}/pages/wifi.schedule.html (100%) create mode 100644 luciexpress/htdocs/plugins/wifi/pages/wifi.schedule.js rename luciexpress/htdocs/{ => plugins/wifi}/pages/wifi.settings.html (100%) create mode 100644 luciexpress/htdocs/plugins/wifi/pages/wifi.settings.js rename luciexpress/htdocs/{ => plugins/wifi}/pages/wifi.wps.html (100%) create mode 100644 luciexpress/htdocs/plugins/wifi/pages/wifi.wps.js create mode 100644 luciexpress/htdocs/plugins/wifi/plugin.json create mode 100644 luciexpress/htdocs/plugins/wifi/wifi.js create mode 100644 luciexpress/htdocs/themes/default/index.html create mode 100644 luciexpress/htdocs/themes/vodaphone/img/vf-logo.png create mode 100644 luciexpress/htdocs/themes/vodaphone/index.html delete mode 100644 luciexpress/htdocs/widgets/luci.layout.naked.js delete mode 100644 luciexpress/htdocs/widgets/luci.layout.single_column.js delete mode 100644 luciexpress/htdocs/widgets/luci.layout.with_sidebar.js 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 0000000000000000000000000000000000000000..9053217ad7ffffc7d17dc4c00556eb4177ce5c02 GIT binary patch literal 5289 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 literal 0 HcmV?d00001 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){ - -});