mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-12 03:58:40 +01:00
And some more...
This commit is contained in:
parent
6b83c177e8
commit
45fc69129a
120 changed files with 570 additions and 266 deletions
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en" ng-app="luci">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>LuCi Express</title>
|
||||
<title >LuCi Express</title><!--ng-bind="title"-->
|
||||
|
||||
<link href="/css/normalize.css" rel="stylesheet" type="text/css" />
|
||||
<!--<link href="/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css" />-->
|
||||
|
|
@ -17,23 +17,11 @@
|
|||
<link href="/bower_components/angular-ui-switch/angular-ui-switch.min.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" href="css/app.css"/>
|
||||
</head>
|
||||
<body ng-controller="BodyCtrl" role="document" ng-cloak >
|
||||
<div class="top-bar">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<span style="font-size: 28px; margin-top: 10px;">Router Configuration</span>
|
||||
<div style="float: right; margin-top: 10px; ">
|
||||
<select id="guiMode" class="selectpicker" >
|
||||
<option value="basic">Basic Mode</option>
|
||||
<option value="expert">Expert Mode</option>
|
||||
<option value="logout">Logout</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<body role="document" ng-cloak >
|
||||
<div ng-controller="BodyCtrl">
|
||||
<div ng-include="theme_index"></div>
|
||||
|
||||
</div>
|
||||
<div ui-view="content" style="min-height: 1000px;"></div>
|
||||
|
||||
<div style="margin-bottom: 40px"></div>
|
||||
<script src="/bower_components/async/lib/async.js"></script>
|
||||
<script src="/bower_components/requirejs/require.js"></script>
|
||||
|
|
@ -51,11 +39,7 @@
|
|||
<!--<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>-->
|
||||
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="/bower_components/angular-ui-switch/angular-ui-switch.min.js"></script>
|
||||
<!--<script src="/bower_components/ng-switchery/src/ng-switchery.js"></script>-->
|
||||
<!--<script src="/lib/ui-bootstrap.min.js"></script>-->
|
||||
<!--<script src="/lib/ui-bootstrap-tpls.min.js"></script>-->
|
||||
<!--<script src="/lib/ui-bootstrap-angular.js"></script>-->
|
||||
<!-- auto generated part -->
|
||||
|
||||
<!-- ###---### -->
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/config.js"></script>
|
||||
|
|
@ -64,47 +48,6 @@
|
|||
<script src="js/session.js"></script>
|
||||
<script src="js/tr.js"></script>
|
||||
<script src="js/localStorage.js"></script>
|
||||
<script src="pages/login.js"></script>
|
||||
<script src="pages/overview.js"></script>
|
||||
<script src="pages/internet.dns.js"></script>
|
||||
<script src="pages/internet.exposed_host.js"></script>
|
||||
<script src="pages/internet.firewall.js"></script>
|
||||
<script src="pages/internet.port_mapping.js"></script>
|
||||
<script src="pages/phone.js"></script>
|
||||
<script src="pages/phone.call_log.js"></script>
|
||||
<script src="pages/phone.number_blocking.js"></script>
|
||||
<script src="pages/phone.numbers.js"></script>
|
||||
<script src="pages/phone.ringing_schedule.js"></script>
|
||||
<script src="pages/phone.speed_dialing.js"></script>
|
||||
<script src="pages/settings.configuration.js"></script>
|
||||
<script src="pages/settings.energy.js"></script>
|
||||
<script src="pages/settings.network.js"></script>
|
||||
<script src="pages/settings.password.js"></script>
|
||||
<script src="pages/settings.upgrade.js"></script>
|
||||
<script src="pages/status.about.js"></script>
|
||||
<script src="pages/status.diagnostics.js"></script>
|
||||
<script src="pages/status.dsl.js"></script>
|
||||
<script src="pages/status.events.js"></script>
|
||||
<script src="pages/status.nat.js"></script>
|
||||
<script src="pages/status.overview.js"></script>
|
||||
<script src="pages/status.restart.js"></script>
|
||||
<script src="pages/status.tv.js"></script>
|
||||
<script src="pages/status.voice.js"></script>
|
||||
<script src="pages/wifi.js"></script>
|
||||
<script src="pages/wifi.general.js"></script>
|
||||
<script src="pages/wifi.mac_filter.js"></script>
|
||||
<script src="pages/wifi.schedule.js"></script>
|
||||
<script src="pages/wifi.settings.js"></script>
|
||||
<script src="pages/wifi.wps.js"></script>
|
||||
<script src="widgets/luci.login.js"></script>
|
||||
<script src="widgets/luci.navbar.js"></script>
|
||||
<script src="widgets/luci.nav.js"></script>
|
||||
<script src="widgets/luci.progress.js"></script>
|
||||
<script src="widgets/luci.table.js"></script>
|
||||
<script src="widgets/luci.footer.js"></script>
|
||||
<script src="widgets/luci.layout.single_column.js"></script>
|
||||
<script src="widgets/luci.layout.with_sidebar.js"></script>
|
||||
<script src="widgets/luci.layout.naked.js"></script>
|
||||
<!-- ###---### -->
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -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(){
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("InternetDNSPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -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){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
angular.module("luci")
|
||||
.controller("OverviewPageCtrl", function($scope){
|
||||
$scope.themeUrl = "";
|
||||
});
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("PhoneNumberBlockingPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
angular.module("luci")
|
||||
.controller("PhoneNumbersPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
angular.module("luci")
|
||||
.controller("PhoneRingingScheduleCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
angular.module("luci")
|
||||
.controller("PhoneSpeedDialingCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("StatusEventsPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("StatusNATPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("StatusRestartPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("StatusTVPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("StatusVoicePageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("WifiMacFilterPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("WifiSchedulePageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("WifiSettingsPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
angular.module("luci").controller("WifiWPSPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
3
luciexpress/htdocs/plugins/core/pages/404.html
Normal file
3
luciexpress/htdocs/plugins/core/pages/404.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<luci-layout-single-column>
|
||||
<p translate>The page you were trying to access was not found!</p>
|
||||
</luci-layout-single-column>
|
||||
1
luciexpress/htdocs/plugins/core/pages/loading.html
Normal file
1
luciexpress/htdocs/plugins/core/pages/loading.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<p>Loading</p>
|
||||
4
luciexpress/htdocs/plugins/core/pages/login.js
Normal file
4
luciexpress/htdocs/plugins/core/pages/login.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$juci.module("core")
|
||||
.controller("LoginPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
3
luciexpress/htdocs/plugins/core/pages/overview.js
Normal file
3
luciexpress/htdocs/plugins/core/pages/overview.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$juci.controller("OverviewPageCtrl", function($scope){
|
||||
$scope.themeUrl = "";
|
||||
});
|
||||
21
luciexpress/htdocs/plugins/core/plugin.json
Normal file
21
luciexpress/htdocs/plugins/core/plugin.json
Normal file
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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){
|
||||
16
luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.js
Normal file
16
luciexpress/htdocs/plugins/core/widgets/luci.layout.naked.js
Normal file
|
|
@ -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){
|
||||
|
||||
});
|
||||
|
|
@ -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){
|
||||
|
||||
});
|
||||
|
|
@ -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){
|
||||
|
||||
});
|
||||
|
|
@ -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!");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -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"
|
||||
|
|
@ -30,7 +30,6 @@
|
|||
<ul class="dropdown-menu" role="menu">
|
||||
<li >
|
||||
<a href="" data-theme="default" class="theme-link">Default</a>
|
||||
<a href="" data-theme="red" class="theme-link">Red</a>
|
||||
<a href="" data-theme="vodaphone" class="theme-link">Vodaphone</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -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"
|
||||
|
|
@ -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",
|
||||
|
|
@ -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
|
||||
1
luciexpress/htdocs/plugins/hello_world/hello_world.html
Normal file
1
luciexpress/htdocs/plugins/hello_world/hello_world.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<p>{{msg}}</p>
|
||||
3
luciexpress/htdocs/plugins/hello_world/hello_world.js
Normal file
3
luciexpress/htdocs/plugins/hello_world/hello_world.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
angular.module("hello_world", []).controller("HelloWorldCtrl", function($state){
|
||||
$state.msg = "Hello World!";
|
||||
});
|
||||
4
luciexpress/htdocs/plugins/hello_world/plugin.json
Normal file
4
luciexpress/htdocs/plugins/hello_world/plugin.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"scripts": ["hello_world"]
|
||||
}
|
||||
|
||||
1
luciexpress/htdocs/plugins/hello_world/submodule.js
Normal file
1
luciexpress/htdocs/plugins/hello_world/submodule.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
console.log("Submodule!");
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
<luci-layout-with-sidebar>
|
||||
<test-directive></test-directive>
|
||||
<div ng-controller="PhoneCallLogPageCtrl">
|
||||
<h2>Call Log</h3>
|
||||
<div class="row">
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
angular.module("luci")
|
||||
.controller("PhoneCallLogPageCtrl", function($scope){
|
||||
$juci.controller("PhoneCallLogPageCtrl", function($scope){
|
||||
$scope.phoneNumbers = [{
|
||||
label: "All Numbers"
|
||||
}, {
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
$juci.controller("PhoneNumberBlockingPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
3
luciexpress/htdocs/plugins/phone/pages/phone.numbers.js
Normal file
3
luciexpress/htdocs/plugins/phone/pages/phone.numbers.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$juci.controller("PhoneNumbersPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
$juci.controller("PhoneRingingScheduleCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
$juci.controller("PhoneSpeedDialingCtrl", function($scope){
|
||||
|
||||
});
|
||||
12
luciexpress/htdocs/plugins/phone/phone.js
Normal file
12
luciexpress/htdocs/plugins/phone/phone.js
Normal file
|
|
@ -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");
|
||||
},
|
||||
});
|
||||
22
luciexpress/htdocs/plugins/phone/plugin.json
Normal file
22
luciexpress/htdocs/plugins/phone/plugin.json
Normal file
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
4
luciexpress/htdocs/plugins/router/pages/internet.dns.js
Normal file
4
luciexpress/htdocs/plugins/router/pages/internet.dns.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$juci.module("router")
|
||||
.controller("InternetDNSPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("InternetExHostPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("InternetFirewallPageCtrl", function($scope){
|
||||
$scope.firewallEnabled = 1;
|
||||
$scope.allowWANPing = 1;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("InternetPortMappingPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("SettingsConfigurationCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("SettingsEnergyCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("SettingsNetworkCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("SettingsPasswordCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("SettingsUpgradeCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("StatusAbout", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
angular.module("luci")
|
||||
$juci.module("router")
|
||||
.controller("StatusDiagnostics", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -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){
|
||||
4
luciexpress/htdocs/plugins/router/pages/status.events.js
Normal file
4
luciexpress/htdocs/plugins/router/pages/status.events.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$juci.module("router")
|
||||
.controller("StatusEventsPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
4
luciexpress/htdocs/plugins/router/pages/status.nat.js
Normal file
4
luciexpress/htdocs/plugins/router/pages/status.nat.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$juci.module("router")
|
||||
.controller("StatusNATPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
@ -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 = {};
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
$juci.module("router")
|
||||
.controller("StatusRestartPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
4
luciexpress/htdocs/plugins/router/pages/status.tv.js
Normal file
4
luciexpress/htdocs/plugins/router/pages/status.tv.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$juci.module("router")
|
||||
.controller("StatusTVPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
4
luciexpress/htdocs/plugins/router/pages/status.voice.js
Normal file
4
luciexpress/htdocs/plugins/router/pages/status.voice.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$juci.module("router")
|
||||
.controller("StatusVoicePageCtrl", function($scope){
|
||||
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue