Commit cbdfe04a authored by Sukru Senli's avatar Sukru Senli

system: cleanup page

parent c7e2c57f
......@@ -7,7 +7,7 @@
<juci-table
title="{{'Memory'|translate}}"
data="systemMemoryTbl"></juci-table>
<juci-table ng-show="show_diskinfo"
<juci-table
title="{{'Storage'|translate}}"
data="systemStorageTbl"></juci-table>
</div>
......
......@@ -18,22 +18,7 @@
* 02110-1301 USA
*/
UCI.juci.$registerSectionType("pagesystemstatus", {
"show_meminfo": { dvalue: true, type: Boolean },
"show_diskinfo": { dvalue: true, type: Boolean },
"show_loadavg": { dvalue: false, type: Boolean }
});
JUCI.app.run(function($uci){
$uci.$sync("juci").done(function(){
if($uci.juci && !$uci.juci.pagesystemstatus){
$uci.juci.$create({
".type":"pagesystemstatus",
".name":"pagesystemstatus"
});
}
});
})
JUCI.app
.controller("StatusSystemPage", function ($scope, $rootScope, $uci, $rpc, gettext, $tr, $config, $network, $localStorage) {
$scope.showExpert = $localStorage.getItem("mode") == "expert";
......@@ -49,7 +34,6 @@ JUCI.app.run(function($uci){
var sys = {};
var board = { release: {} };
var filesystems = [];
var netLoad = {};
JUCI.interval.repeat("update_status_system_page_clock", 1000, function(resume){
if(sys && sys.system && sys.system.localtime){
sys.system.localtime += 1;
......@@ -63,7 +47,6 @@ JUCI.app.run(function($uci){
async.parallel([
function (cb){$rpc.$call("router.system", "info").done(function(res){sys = res; cb();}).fail(function(){cb();});},
function (cb){$rpc.$call("router.system", "memory").done(function(res){memory = res; cb();}).fail(function(){cb();});},
function (cb){$network.getNetworkLoad().done(function(load){ netLoad = load; cb(); }).fail(function(){cb();});},
function (cb){$rpc.$call("router.system", "filesystem").done(function(res){
filesystems = res.filesystem;
cb();
......@@ -108,14 +91,11 @@ JUCI.app.run(function($uci){
[$tr(gettext("Swap")), '<juci-progress value="0" total="0" units="kB"></juci-progress>']
];
if($config.get("settings.pagesystemstatus.show_diskinfo.value")){
$scope.show_diskinfo = true;
$scope.systemStorageTbl.rows = [];
filesystems.map(function(disk){
if(disk.name.split(":").length === 2) return;
$scope.systemStorageTbl.rows.push([disk.name+" ("+disk.mounted_on+")", '<juci-progress value="'+Math.round(disk.used)+'" total="'+ Math.round(disk.available + disk.used) +'" units="kB"></juci-progress>']);
});
}
$scope.systemStorageTbl.rows = [];
filesystems.map(function(disk){
if(disk.name.split(":").length === 2) return;
$scope.systemStorageTbl.rows.push([disk.name+" ("+disk.mounted_on+")", '<juci-progress value="'+Math.round(disk.used)+'" total="'+ Math.round(disk.available + disk.used) +'" units="kB"></juci-progress>']);
});
}
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment