Added own dropbear plugin to main tree

This commit is contained in:
Martin Schröder 2015-05-12 10:07:29 +02:00 committed by Martin Schröder
parent a5cecb9fa8
commit d26e3cedd3
6 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,6 @@
<div class="row" ng-class="{'field-error': model.error}" data-toggle="tooltip" data-placement="top" title="{{model.error}}">
<div class="col-xs-2"><label translate>from</label></div>
<div class="col-xs-4"><input class="form-control" type="text" ng-model="data.from" placeholder="09:00"/></div>
<div class="col-xs-2"><label translate>to</label></div>
<div class="col-xs-4"><input class="form-control" type="text" ng-model="data.to" placeholder="09:00"/></div>
</div>

View file

@ -0,0 +1,34 @@
$juci.app.directive("luciInputTimespan", function () {
var plugin_root = $juci.module("core").plugin_root;
return {
templateUrl: plugin_root + "/widgets/luci.input.timespan.html",
restrict: 'E',
replace: true,
scope: {
model: "=ngModel"
},
controller: "luciInputTimespan"
};
}).controller("luciInputTimespan", function($scope){
$scope.data = {
from: "", to: ""
};
$scope.$watch("model", function(model){
if(!model) return;
var value = model.value;
if(!value || !value.split) return;
var parts = value.split("-");
if(parts.length != 2){
$scope.data.from = $scope.data.to = "";
} else {
$scope.data.from = parts[0];
$scope.data.to = parts[1];
}
});
$scope.$watch("data.from", function(value){
if($scope.model) $scope.model.value = $scope.data.from + "-"+$scope.data.to;
});
$scope.$watch("data.to", function(value){
if($scope.model) $scope.model.value = $scope.data.from + "-"+$scope.data.to;
});
});

View file

@ -0,0 +1,6 @@
{
"settings/dropbear": {
"title": "Dropbear",
"index": 20
}
}

View file

@ -0,0 +1,9 @@
<luci-layout-with-sidebar>
<div ng-controller="DropbearSettings">
<luci-config-section>
<luci-config-heading>{{ 'Dropbear' | translate }}</luci-config-heading>
<luci-config-info>{{ 'settings.dropbear.info' | translate }}</luci-config-info>
</luci-config-section>
</div>
</luci-layout-with-sidebar>

View file

@ -0,0 +1,5 @@
//! Author: Martin K. Schröder <mkschreder.uk@gmail.com>
$juci.app.controller("DropbearSettings", function($scope){
});

View file

@ -0,0 +1,9 @@
{
"scripts": [
],
"pages": {
"settings/dropbear": {
"view": "pages/services.dropbear"
}
}
}