mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-02-20 19:33:01 +01:00
..
This commit is contained in:
parent
35955d2540
commit
8bbd5ee508
8 changed files with 59 additions and 173 deletions
|
|
@ -21,7 +21,7 @@
|
|||
<img ng-src="themes/vodafone/img/overview/overview-background-bot.jpg" id="Image-Maps-Com-image-maps-2015-04-08-032815" usemap="#image-maps-2015-04-08-032815" alt="Router">
|
||||
<div style="position: absolute; top: 70px; left: 100px; text-align: center; width: 60px;">{{wireless.clients.length}}</div>
|
||||
<div style="position: absolute; top: 70px; left: 450px; text-align: center; width: 60px;">{{network.clients.length}}</div>
|
||||
<div style="position: absolute; top: 70px; left: 795px; text-align: center; width: 60px;">{{sipAccounts.length||0}}</div>
|
||||
<div style="position: absolute; top: 70px; left: 795px; text-align: center; width: 60px;">{{sipAccounts.length}}</div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
<tr ng-repeat="sip in sipAccounts track by $index">
|
||||
<td>
|
||||
<div class="col-md-2"><strong style="font-size: 1.2em">U{{$index}}</strong></div>
|
||||
<div class="col-md-8"><strong>{{sip.user.value}}</strong></div>
|
||||
<div class="col-md-8"><strong>{{sip.username}}</strong></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -13,68 +13,52 @@ $juci.module("core")
|
|||
|
||||
};
|
||||
function refresh() {
|
||||
//var sections = result.values;
|
||||
//var cfgs = Object.keys(sections).filter(function(x) { return x.indexOf("cfg") == 0; });
|
||||
//$scope.wireless.wps = cfgs.filter(function(x) { return cfgs["wps_pbc"] == 1; }).length != 0;
|
||||
|
||||
$scope.defaultHostName = $tr(gettext("Unknown"));
|
||||
$scope.sipAccounts = [];
|
||||
$scope.wifiSchedStatus = gettext("off");
|
||||
$scope.wifiWPSStatus = gettext("off");
|
||||
async.series([
|
||||
function(next){
|
||||
$uci.sync(["wireless", "easybox", "voice_client"]).done(function(){
|
||||
$scope.wifi = $uci.wireless;
|
||||
$scope.easybox = $uci.easybox;
|
||||
$scope.voice_client = $uci.voice_client;
|
||||
if($uci.wireless && $uci.wireless.status)
|
||||
$scope.wifiSchedStatus = (($uci.wireless.status.schedule.value)?gettext("on"):gettext("off"));
|
||||
if($uci.wireless && $uci.wireless.wps)
|
||||
$scope.wifiWPSStatus = (($scope.easybox.settings.wpsbutton.value)?gettext("on"):gettext("off"));
|
||||
if($uci.voice_client && $uci.voice_client["@sip_service_provider"]){
|
||||
$scope.sipAccounts = $uci.voice_client["@sip_service_provider"];
|
||||
}
|
||||
}).always(function(){ next(); });
|
||||
},
|
||||
function(next){
|
||||
$rpc.router.clients().done(function(clients){
|
||||
//alert(JSON.stringify(Object.keys(clients).map(function(x) { return clients[x]; })));
|
||||
var all = Object.keys(clients).map(function(x) { return clients[x]; });
|
||||
$scope.wireless.clients = all.filter(function(x){
|
||||
return x.connected && x.wireless == true;
|
||||
});
|
||||
$scope.network.clients = all.filter(function(x){
|
||||
return x.connected && x.wireless == false;
|
||||
});
|
||||
next();
|
||||
}).fail(function(){
|
||||
next();
|
||||
});;
|
||||
},
|
||||
function(next){
|
||||
/*$rpc.asterisk.status().done(function(data){
|
||||
if(data && data.sip){
|
||||
var accounts = [];
|
||||
Object.keys(data.sip).map(function(k){
|
||||
if(data.sip[k].ip) accounts.push(data.sip[k]);
|
||||
$uci.sync(["wireless", "easybox"]).done(function(){
|
||||
//var sections = result.values;
|
||||
//var cfgs = Object.keys(sections).filter(function(x) { return x.indexOf("cfg") == 0; });
|
||||
//$scope.wireless.wps = cfgs.filter(function(x) { return cfgs["wps_pbc"] == 1; }).length != 0;
|
||||
$scope.wifi = $uci.wireless;
|
||||
$scope.easybox = $uci.easybox;
|
||||
$scope.wifiSchedStatus = (($scope.wifi.status.schedule.value)?gettext("on"):gettext("off"));
|
||||
$scope.wifiWPSStatus = (($scope.easybox.settings.wpsbutton.value)?gettext("on"):gettext("off"));
|
||||
$scope.defaultHostName = $tr(gettext("Unknown"));
|
||||
async.series([
|
||||
function(next){
|
||||
$rpc.router.clients().done(function(clients){
|
||||
//alert(JSON.stringify(Object.keys(clients).map(function(x) { return clients[x]; })));
|
||||
var all = Object.keys(clients).map(function(x) { return clients[x]; });
|
||||
$scope.wireless.clients = all.filter(function(x){
|
||||
return x.connected && x.wireless == true;
|
||||
});
|
||||
$scope.sipAccounts = accounts;
|
||||
}
|
||||
}).always(function(){ next(); }); */
|
||||
// just fall through
|
||||
next();
|
||||
},
|
||||
function(next){
|
||||
$rpc.router.dslstats().done(function(dslstats){
|
||||
var stats = dslstats.dslstats;
|
||||
if(stats && stats.bearers && stats.bearers.length > 0){
|
||||
$scope.dsl.max_rate_up = Math.round(stats.bearers[0].max_rate_up / 1000);
|
||||
$scope.dsl.max_rate_down = Math.round(stats.bearers[0].max_rate_down / 1000);
|
||||
}
|
||||
}).always(function(){ next(); });
|
||||
}
|
||||
], function(){
|
||||
$scope.$apply();
|
||||
$scope.network.clients = all.filter(function(x){
|
||||
return x.connected && x.wireless == false;
|
||||
});
|
||||
next();
|
||||
});
|
||||
},
|
||||
function(next){
|
||||
$rpc.asterisk.status().done(function(data){
|
||||
if(data && data.sip){
|
||||
var accounts = [];
|
||||
Object.keys(data.sip).map(function(k){
|
||||
if(data.sip[k].ip) accounts.push(data.sip[k]);
|
||||
});
|
||||
$scope.sipAccounts = accounts;
|
||||
}
|
||||
}).always(function(){ next(); });
|
||||
},
|
||||
function(next){
|
||||
$rpc.router.dslstats().done(function(dslstats){
|
||||
var stats = dslstats.dslstats;
|
||||
if(stats && stats.bearers && stats.bearers.length > 0){
|
||||
$scope.dsl.max_rate_up = Math.round(stats.bearers[0].max_rate_up / 1000);
|
||||
$scope.dsl.max_rate_down = Math.round(stats.bearers[0].max_rate_down / 1000);
|
||||
}
|
||||
}).always(function(){ next(); });
|
||||
}
|
||||
], function(){
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
} refresh();
|
||||
//setInterval(refresh, 5000);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
$juci.module("status")
|
||||
.controller("StatusRestartPageCtrl", function($scope, $rpc){
|
||||
$scope.onRestart = function(){
|
||||
$rpc.luci2.system.reboot().done(function(){
|
||||
console.log("Restarting the system...");
|
||||
});
|
||||
}
|
||||
.controller("StatusRestartPageCtrl", function($scope){
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
$juci.module("status")
|
||||
.controller("StatsCtrl", function($scope, $rpc, $session, gettext, $tr){
|
||||
.controller("StatsCtrl", function($scope, $rpc, $session, gettextCatalog){
|
||||
$scope.dslstats = {};
|
||||
|
||||
$scope.dslConnectionInfo = {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ $juci.module("wifi")
|
|||
window.uci = $uci;
|
||||
$scope.interfaces = $uci.wireless['@wifi-iface'];
|
||||
$scope.status = $uci.wireless.status;
|
||||
if($uci.easybox)
|
||||
$scope.easybox = $uci.easybox.settings;
|
||||
$scope.$apply();
|
||||
|
||||
next();
|
||||
|
|
|
|||
|
|
@ -8,46 +8,6 @@
|
|||
<luci-config-line title="{{'WPS Function'|translate}}"><switch id="enabled" name="enabled" ng-model="easybox.settings.wpsbutton.value" class="green"></switch></luci-config-line>
|
||||
</luci-config-lines>
|
||||
</luci-config-section>
|
||||
<luci-config-section>
|
||||
<luci-config-lines ng-repeat="interface in wireless['@wifi-iface']">
|
||||
<luci-config-line title="{{'Enable WPS on '|translate}} {{interface.ssid.value}}">
|
||||
<switch id="enabled" name="enabled" ng-model="interface.wps_pbc.value" class="green" ></switch>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
<h2 translate>WPS PBC</h2>
|
||||
<p translate>wifi.wps.pbc.info</p>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'Pressing WiFi on/off button on EasyBox for long time activates pairing '|translate}}">
|
||||
<switch id="enabled" name="enabled" ng-model="easybox.settings.wifibutton.value" class="green" ></switch>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Pair (within 2 minutes)'|translate}}">
|
||||
<button class="btn btn-default col-xs-12" ng-click="onPairPBC()" translate>Pair</button>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
<h2 translate>WPS with own PIN</h2>
|
||||
<p translate>wifi.wps.pin.info</p>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'WPS Using Generated PIN '|translate}}">
|
||||
<switch id="enabled" name="enabled" ng-model="easybox.settings.wpsdevicepin.value" ng-change="save" class="green"></switch>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Generated PIN'|translate}}">
|
||||
<input type="text" class="form-control" ng-model="generatedPIN" />
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Generate New PIN'|translate}}">
|
||||
<button class="btn btn-default" ng-click="onGeneratePIN()" translate>Generate</button>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
<h2 translate>WPS with foreign PIN</h2>
|
||||
<p translate>wifi.wps.otherpin.info</p>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'Enter your device PIN'|translate}}">
|
||||
<input type="text" class="form-control" ng-model="data.userPIN" />
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Pair (within 2 minutes)'|translate}}">
|
||||
<button class="btn btn-default" ng-click="onPairUserPIN()" translate>Pair</button>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
</luci-config-section>
|
||||
</luci-config>
|
||||
<modal title="{{'Attempting to Pair'|translate}}" ng-show="showProgress">
|
||||
<div ng-show="pairState == 'progress'" >
|
||||
|
|
|
|||
|
|
@ -1,68 +1,10 @@
|
|||
$juci.module("wifi")
|
||||
.controller("WifiWPSPageCtrl", function($scope, $uci){
|
||||
$scope.data = {
|
||||
userPIN: ""
|
||||
}
|
||||
$uci.sync(["easybox", "wireless"]).done(function(){
|
||||
$uci.sync(["easybox"]).done(function(){
|
||||
$scope.easybox = $uci.easybox;
|
||||
$scope.wireless = $uci.wireless;
|
||||
$scope.$apply();
|
||||
}).fail(function(err){
|
||||
console.log("failed to sync config: "+err);
|
||||
});
|
||||
$rpc.wps.showpin().done(function(data){
|
||||
$scope.generatedPIN = data.pin;
|
||||
});
|
||||
function pair(){
|
||||
$scope.showProgress = 1;
|
||||
$scope.pairState = 'progress';
|
||||
$scope.timeRemaining = 60;
|
||||
$uci.save().done(function(){
|
||||
var interval = setInterval(function(){
|
||||
$scope.timeRemaining --;
|
||||
if($scope.timeRemaining == 0){
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 1000);
|
||||
$rpc.wps.pbc().done(function(){
|
||||
clearInterval(interval);
|
||||
$scope.pairState = 'success';
|
||||
$scope.$apply();
|
||||
setTimeout(function(){
|
||||
$scope.showProgress = 0;
|
||||
$scope.$apply();
|
||||
}, 2000);
|
||||
}).fail(function(){
|
||||
clearInterval(interval);
|
||||
$scope.pairState = 'fail';
|
||||
$scope.$apply();
|
||||
setTimeout(function(){
|
||||
$scope.showProgress = 0;
|
||||
$scope.$apply();
|
||||
}, 2000);
|
||||
}).always(function(){
|
||||
$scope.showProgress = 0;
|
||||
});
|
||||
});
|
||||
}
|
||||
$scope.save = function(){
|
||||
$uci.save();
|
||||
}
|
||||
$scope.onPairPBC = function(){
|
||||
|
||||
pair();
|
||||
}
|
||||
$scope.onPairUserPIN = function(){
|
||||
$rpc.wps.stapin({ pin: $scope.data.userPIN }).done(function(data){
|
||||
pair();
|
||||
});
|
||||
}
|
||||
$scope.onGeneratePIN = function(){
|
||||
$rpc.wps.genpin().done(function(data){
|
||||
$rpc.wps.setpin({pin: data.pin}).done(function(){
|
||||
$scope.generatedPIN = data.pin;
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,5 +20,11 @@
|
|||
<div class="col-xs-1"></div>
|
||||
</div>
|
||||
</div>
|
||||
<luci-footer></luci-footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<luci-footer></luci-footer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue