Added phone lines files..

This commit is contained in:
Martin Schröder 2015-05-27 12:47:10 +02:00 committed by Martin Schröder
parent ed774e3b30
commit 9c175479ce
6 changed files with 101 additions and 6 deletions

View file

@ -8,7 +8,8 @@ JUCI.app
scope: {
model: "=ngModel",
min: "@",
max: "@"
max: "@",
ngChange: "&"
},
templateUrl: plugin_root+"/widgets/luci.brightness.html",
replace: true,
@ -25,6 +26,7 @@ JUCI.app
var total = (max - min);
var step = total / 5;
var base_color = "ff";
var last_value = $scope.model;
function update(){
var bars = [];
@ -39,6 +41,12 @@ JUCI.app
//console.log("value: "+$scope.model+" "+bar.color);
bars.push(bar);
}
setTimeout(function(){
if($scope.model !== last_value && $scope.ngChange) {
last_value = $scope.model;
$scope.ngChange();
}
}, 0);
$scope.bars = bars;
} update();

View file

@ -0,0 +1,41 @@
{
"phone": {
"title": "Phone",
"index": 20
},
"phone/call_log": {
"title": "Call Log",
"acls": [ ],
"index": 10
},
"phone/number_blocking": {
"title": "Number Blocking",
"modes": [ "expert" ],
"acls": [ ],
"index": 20
},
"phone/ringing_schedule": {
"title": "Ringing Schedule",
"modes": [ "expert" ],
"acls": [ ],
"index": 30
},
"phone/numbers": {
"title": "Phone Numbers",
"modes": [ "expert" ],
"acls": [ ],
"index": 40
},
"phone/lines": {
"title": "Phone Lines",
"modes": [ "expert" ],
"acls": [ ],
"index": 41
},
"phone/speed_dialing": {
"title": "Speed Dialing",
"modes": [ "expert" ],
"acls": [ ],
"index": 50
}
}

View file

@ -0,0 +1,28 @@
<luci-layout-with-sidebar>
<div ng-controller="PhoneLines">
<luci-config-section>
<luci-config-heading>{{ 'Phone Lines' | translate }}</luci-config-heading>
<luci-config-info>{{ 'phone.lines.info' | translate }}</luci-config-info>
<luci-expandable title="{{line.name.value}}" ng-repeat="line in phone_lines track by $index">
<luci-config-lines>
<luci-config-line title="Name">
<input type="text" class="form-control" ng-model="line.name.value"/>
</luci-config-line>
<luci-config-line title="Internal Number">
{{line.extension.value}}
</luci-config-line>
<luci-config-line title="Outgoing Calls Number">
<luci-select ng-model="line.sip_account.value" ng-items="allSipAccounts"/>
</luci-config-line>
<luci-config-line title="Call Waiting">
<switch ng-model="line.callwaiting.value" class="green"/>
</luci-config-line>
<luci-config-line title="Call ID Restriction">
<switch ng-model="line.clir.value" class="green"/>
</luci-config-line>
</luci-config-lines>
</luci-expandable>
</luci-config-section>
<luci-config-apply/>
</div>
</luci-layout-with-sidebar>

View file

@ -0,0 +1,16 @@
//! Author: Martin K. Schröder <mkschreder.uk@gmail.com>
JUCI.app
.controller("PhoneLines", function($scope, $uci){
$uci.sync("voice_client").done(function(){
$scope.phone_lines = $uci.voice_client["@brcm_line"];
$scope.phone_numbers = $uci.voice_client["@sip_service_provider"];
$scope.allSipAccounts = $scope.phone_numbers.map(function(x){
return {
label: x.name.value,
value: x[".name"]
}
});
$scope.$apply();
});
});

View file

@ -8,20 +8,19 @@
<luci-config-section ng-show="boardpanel">
<luci-config-lines>
<luci-config-line title="{{'USB Port'|translate}}">
<switch id="enabled" name="enabled" ng-model="boardpanel.settings.usb_port.value" class="green"></switch>
<switch id="enabled" name="enabled" ng-model="boardpanel.settings.usb_port.value" class="green" ng-change="onSave()"></switch>
</luci-config-line>
<luci-config-line title="{{'Status-LED'|translate}}">
<switch id="enabled" name="enabled" ng-model="boardpanel.settings.status_led.value" class="green"></switch>
<switch id="enabled" name="enabled" ng-model="boardpanel.settings.status_led.value" class="green" ng-change="onSave()"></switch>
</luci-config-line>
<luci-config-line title="{{'Power-LED'|translate}}">
<switch id="enabled" name="enabled" ng-model="boardpanel.settings.power_led.value" class="green"></switch>
<switch id="enabled" name="enabled" ng-model="boardpanel.settings.power_led.value" class="green" ng-change="onSave()"></switch>
</luci-config-line>
<luci-config-line title="{{'Power-LED Brightness'|translate}}" no-pull>
<luci-brightness ng-model="boardpanel.settings.power_led_br.value" min="0" max="100"></luci-brightness>
<luci-brightness ng-model="boardpanel.settings.power_led_br.value" min="0" max="100" ng-change="onSave()"></luci-brightness>
<!--<switch id="enabled" name="enabled" ng-model="boardpanel.settings.power_led_br.value" class="green"></switch>-->
</luci-config-line>
</luci-config-lines>
</luci-config-section>
<luci-config-apply></luci-config-apply>
</div>
</luci-layout-with-sidebar>

View file

@ -7,4 +7,7 @@ JUCI.app
$scope.boardpanel = $uci.boardpanel;
$scope.$apply();
});
$scope.onSave = function(){
$uci.save();
}
});