mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-03 07:54:28 +01:00
ddns ui
This commit is contained in:
parent
00a48a3390
commit
8bf1dd098f
2 changed files with 97 additions and 15 deletions
|
|
@ -34,6 +34,61 @@
|
|||
<luci-config-line title="{{'Dynamic DNS'|translate}}">
|
||||
<switch ng-model="status.wlan.value" class="green" ng-change="onApply()"></switch>
|
||||
</luci-config-line>
|
||||
<div>
|
||||
<br/>
|
||||
<div class="form-group" class="col-md-12" ng-class="{ 'field-error': model.error }" data-toggle="tooltip" data-placement="top" title="{{model.error}}">
|
||||
<div class="col-md-6 text-left">
|
||||
<label class="detail-strong-input">{{'Provider'|translate}}</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-sm-8 col-sm-offset-4 no-side-padding">
|
||||
<ui-select ng-model="selectedSection"
|
||||
theme="bootstrap"
|
||||
search-enabled="false"
|
||||
on-select="onChangeProvider($item)">
|
||||
<ui-select-match placeholder="{{'Select provider'|translate}}">{{$select.selected}}</ui-select-match>
|
||||
<ui-select-choices repeat="provider in providers"
|
||||
refresh-delay="0">
|
||||
<div >{{provider}}</div>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="col-md-12"/>
|
||||
<div class="form-group" class="col-md-12" ng-class="{ 'field-error': model.error }" data-toggle="tooltip" data-placement="top" title="{{model.error}}">
|
||||
<div class="col-md-6 text-left">
|
||||
<label class="detail-strong-input">{{'Domain name'|translate}}</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-sm-8 col-sm-offset-4 no-side-padding">
|
||||
<input type="text" class="form-control" ng-model="data.field_4" placeholder="{{'Add domain name'|translate}}" maxlength="3" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="col-md-12"/>
|
||||
<div class="form-group" class="col-md-12" ng-class="{ 'field-error': model.error }" data-toggle="tooltip" data-placement="top" title="{{model.error}}">
|
||||
<div class="col-md-6 text-left">
|
||||
<label class="detail-strong-input">{{'Account'|translate}}</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-sm-8 col-sm-offset-4 no-side-padding">
|
||||
<input type="text" class="form-control" ng-model="data.field_4" placeholder="{{'Add account'|translate}}" maxlength="3" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="col-md-12"/>
|
||||
<div class="form-group" class="col-md-12" ng-class="{ 'field-error': model.error }" data-toggle="tooltip" data-placement="top" title="{{model.error}}">
|
||||
<div class="col-md-6 text-left">
|
||||
<label class="detail-strong-input">{{'Password'|translate}}</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-sm-8 col-sm-offset-4 no-side-padding">
|
||||
<input type="text" class="form-control" ng-model="data.field_4" placeholder="{{'Add password'|translate}}" maxlength="3" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</luci-config-lines>
|
||||
</luci-config-section>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,45 @@
|
|||
$juci.module("internet")
|
||||
.controller("InternetDNSPageCtrl", function($scope, $uci){
|
||||
.controller("InternetDNSPageCtrl", function($scope, $uci){
|
||||
|
||||
$uci.sync("network").done( function(){
|
||||
console.log($uci.network.wan.peerdns); });
|
||||
$scope.providers = ["dyndns.org"];
|
||||
|
||||
$scope.onApply = function(){
|
||||
$scope.busy = 1;
|
||||
$uci.save().done(function(){
|
||||
console.log("Settings saved!");
|
||||
}).fail(function(){
|
||||
console.error("Could not save internet settings!");
|
||||
}).always(function(){
|
||||
$scope.$apply();
|
||||
$scope.busy = 0;
|
||||
});
|
||||
}
|
||||
});
|
||||
$uci.sync("network").done( function(){
|
||||
console.log($uci.network.wan.peerdns); });
|
||||
|
||||
$scope.onApply = function(){
|
||||
$scope.busy = 1;
|
||||
$uci.save().done(function(){
|
||||
console.log("Settings saved!");
|
||||
}).fail(function(){
|
||||
console.error("Could not save internet settings!");
|
||||
}).always(function(){
|
||||
$scope.$apply();
|
||||
$scope.busy = 0;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.onChangeProvider = function(item){
|
||||
$scope.selectedConfig = item;
|
||||
$scope.error = "";
|
||||
$scope.loading = 1;
|
||||
$scope.subsections = {};
|
||||
|
||||
|
||||
$rpc.uci.state({
|
||||
config: item.id
|
||||
}).done(function(data){
|
||||
$scope.subsections = data.values;
|
||||
Object.keys($scope.subsections).map(function(k){
|
||||
$scope.subsections[k] = filterHiddenValues($scope.subsections[k]);
|
||||
});
|
||||
$scope.loading = 0;
|
||||
$scope.$apply();
|
||||
}).fail(function(err){
|
||||
console.error("Could not retrieve data!", err);
|
||||
$scope.error("Could not retrieve data!");
|
||||
$scope.loading = 0;
|
||||
$scope.$apply();
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue