Maintenance for a few modules (#42)

This commit is contained in:
WM
2018-08-27 02:32:32 +02:00
committed by Sebastian Kinne
parent 13b3c40d76
commit a5d7d19cd5
161 changed files with 16954 additions and 10056 deletions

View File

@@ -2,35 +2,35 @@ registerController('Status_Controller', ['$api', '$scope', '$rootScope', '$inter
$scope.title = "Loading...";
$scope.version = "Loading...";
$scope.refreshInfo = (function() {
$scope.refreshInfo = (function() {
$api.request({
module: 'Status',
action: "refreshInfo"
}, function(response) {
$scope.title = response.title;
$scope.version = "v"+response.version;
})
});
module: 'Status',
action: "refreshInfo"
}, function(response) {
$scope.title = response.title;
$scope.version = "v" + response.version;
})
});
$scope.refreshInfo();
$scope.refreshInfo();
}]);
registerController('Status_SystemController', ['$api', '$scope', '$rootScope', '$filter', function($api, $scope, $rootScope, $filter) {
$scope.info = {
machine : "Loading...",
currentTime : "Loading...",
uptime : "Loading...",
hostname : "Loading..."
machine: "Loading...",
currentTime: "Loading...",
uptime: "Loading...",
hostname: "Loading..."
};
$scope.getInfo = function() {
$api.request({
module: 'Status',
action: 'getSystem'
}, function(response) {
$scope.info = response.info;
});
$api.request({
module: 'Status',
action: 'getSystem'
}, function(response) {
$scope.info = response.info;
});
};
$scope.getInfo();
@@ -39,29 +39,29 @@ registerController('Status_SystemController', ['$api', '$scope', '$rootScope', '
registerController('Status_CPUController', ['$api', '$scope', '$rootScope', '$filter', '$sce', function($api, $scope, $rootScope, $filter, $sce) {
$scope.info = {
cpuModel : "Loading...",
bogoMIPS : "Loading...",
type : "Loading...",
loadAveragePourcentage : "0",
loadAverageAll : "Loading..."
cpuModel: "Loading...",
bogoMIPS: "Loading...",
type: "Loading...",
loadAveragePourcentage: "0",
loadAverageAll: "Loading..."
};
$scope.getInfo = function() {
$api.request({
module: 'Status',
action: 'getCPU'
}, function(response) {
$scope.info = response.info;
});
$api.request({
module: 'Status',
action: 'getCPU'
}, function(response) {
$scope.info = response.info;
});
};
$scope.getSrc = (function() {
$scope.src = $sce.trustAsResourceUrl('/modules/Status/svg/graph_cpu.svg');
});
$scope.src = $sce.trustAsResourceUrl('/modules/Status/svg/graph_cpu.svg');
});
$scope.setSrc = (function() {
$scope.src = $sce.trustAsResourceUrl('about:blank');
});
$scope.src = $sce.trustAsResourceUrl('about:blank');
});
$scope.setSrc();
$scope.getInfo();
@@ -70,7 +70,7 @@ registerController('Status_CPUController', ['$api', '$scope', '$rootScope', '$fi
registerController('Status_DHCPController', ['$api', '$scope', '$rootScope', '$filter', function($api, $scope, $rootScope, $filter) {
$scope.info = {
clientsList : []
clientsList: []
};
$scope.title = "Loading...";
@@ -79,43 +79,43 @@ registerController('Status_DHCPController', ['$api', '$scope', '$rootScope', '$f
$scope.loading = false;
$scope.getInfo = function() {
$scope.loading = true;
$scope.loading = true;
$api.request({
module: 'Status',
action: 'getDHCP'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
$api.request({
module: 'Status',
action: 'getDHCP'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
};
$scope.getMACInfo = function(param) {
$scope.title = "Loading...";
$scope.output = "Loading...";
$scope.title = "Loading...";
$scope.output = "Loading...";
$api.request({
module: 'Status',
action: 'getMACInfo',
mac: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
$api.request({
module: 'Status',
action: 'getMACInfo',
mac: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
};
$scope.getPingInfo = function(param) {
$scope.title = "Loading...";
$scope.output = "Loading...";
$scope.title = "Loading...";
$scope.output = "Loading...";
$api.request({
module: 'Status',
action: 'getPingInfo',
ip: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
$api.request({
module: 'Status',
action: 'getPingInfo',
ip: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
};
$scope.getInfo();
@@ -124,20 +124,20 @@ registerController('Status_DHCPController', ['$api', '$scope', '$rootScope', '$f
registerController('Status_MemoryController', ['$api', '$scope', '$rootScope', '$filter', function($api, $scope, $rootScope, $filter) {
$scope.info = {
memoryTotal : "Loading...",
memoryFree : "Loading...",
memoryFreePourcentage : "0",
memoryUsed : "Loading...",
memoryUsedPourcentage : "0"
memoryTotal: "Loading...",
memoryFree: "Loading...",
memoryFreePourcentage: "0",
memoryUsed: "Loading...",
memoryUsedPourcentage: "0"
};
$scope.getInfo = function() {
$api.request({
module: 'Status',
action: 'getMemory'
}, function(response) {
$scope.info = response.info;
});
$api.request({
module: 'Status',
action: 'getMemory'
}, function(response) {
$scope.info = response.info;
});
};
$scope.getInfo();
@@ -146,50 +146,50 @@ registerController('Status_MemoryController', ['$api', '$scope', '$rootScope', '
registerController('Status_WiFiController', ['$api', '$scope', '$rootScope', '$filter', function($api, $scope, $rootScope, $filter) {
$scope.info = {
wifiClientsList : []
wifiClientsList: []
};
$scope.title = "Loading...";
$scope.output = "Loading...";
$scope.loading = false;
$scope.getInfo = function() {
$scope.loading = true;
$scope.loading = true;
$api.request({
module: 'Status',
action: 'getWiFi'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
$api.request({
module: 'Status',
action: 'getWiFi'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
};
$scope.getMACInfo = function(param) {
$scope.title = "Loading...";
$scope.output = "Loading...";
$scope.title = "Loading...";
$scope.output = "Loading...";
$api.request({
module: 'Status',
action: 'getMACInfo',
mac: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
$api.request({
module: 'Status',
action: 'getMACInfo',
mac: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
};
$scope.getPingInfo = function(param) {
$scope.title = "Loading...";
$scope.output = "Loading...";
$scope.title = "Loading...";
$scope.output = "Loading...";
$api.request({
module: 'Status',
action: 'getPingInfo',
ip: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
$api.request({
module: 'Status',
action: 'getPingInfo',
ip: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
};
$scope.getInfo();
@@ -198,21 +198,21 @@ registerController('Status_WiFiController', ['$api', '$scope', '$rootScope', '$f
registerController('Status_SwapController', ['$api', '$scope', '$rootScope', '$filter', function($api, $scope, $rootScope, $filter) {
$scope.info = {
swapAvailable : false,
swapTotal : "Loading...",
swapFree : "Loading...",
swapFreePourcentage : "0",
swapUsed : "Loading...",
swapUsedPourcentage : "0"
swapAvailable: false,
swapTotal: "Loading...",
swapFree: "Loading...",
swapFreePourcentage: "0",
swapUsed: "Loading...",
swapUsedPourcentage: "0"
};
$scope.getInfo = function() {
$api.request({
module: 'Status',
action: 'getSwap'
}, function(response) {
$scope.info = response.info;
});
$api.request({
module: 'Status',
action: 'getSwap'
}, function(response) {
$scope.info = response.info;
});
};
$scope.getInfo();
@@ -221,21 +221,21 @@ registerController('Status_SwapController', ['$api', '$scope', '$rootScope', '$f
registerController('Status_StorageController', ['$api', '$scope', '$rootScope', '$filter', function($api, $scope, $rootScope, $filter) {
$scope.info = {
storagesList : []
storagesList: []
};
$scope.loading = false;
$scope.getInfo = function() {
$scope.loading = true;
$scope.loading = true;
$api.request({
module: 'Status',
action: 'getStorage'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
$api.request({
module: 'Status',
action: 'getStorage'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
};
$scope.getInfo();
@@ -244,10 +244,10 @@ registerController('Status_StorageController', ['$api', '$scope', '$rootScope',
registerController('Status_InterfaceController', ['$api', '$scope', '$rootScope', '$filter', '$sce', function($api, $scope, $rootScope, $filter, $sce) {
$scope.info = {
wanIpAddress : "Loading...",
wanGateway : "Loading...",
dnsList : [],
interfacesList : []
wanIpAddress: "Loading...",
wanGateway: "Loading...",
dnsList: [],
interfacesList: []
};
$scope.title = "Loading...";
@@ -256,53 +256,53 @@ registerController('Status_InterfaceController', ['$api', '$scope', '$rootScope'
$scope.loading = false;
$scope.getMACInfo = function(param) {
$scope.title = "Loading...";
$scope.output = "Loading...";
$scope.title = "Loading...";
$scope.output = "Loading...";
$api.request({
module: 'Status',
action: 'getMACInfo',
mac: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
$api.request({
module: 'Status',
action: 'getMACInfo',
mac: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
};
$scope.getPingInfo = function(param) {
$scope.title = "Loading...";
$scope.output = "Loading...";
$scope.title = "Loading...";
$scope.output = "Loading...";
$api.request({
module: 'Status',
action: 'getPingInfo',
ip: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
$api.request({
module: 'Status',
action: 'getPingInfo',
ip: param
}, function(response) {
$scope.title = response.title;
$scope.output = response.output;
});
};
$scope.getInfo = function() {
$scope.loading = true;
$scope.loading = true;
$api.request({
module: 'Status',
action: 'getInterfaces'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
$api.request({
module: 'Status',
action: 'getInterfaces'
}, function(response) {
$scope.info = response.info;
$scope.loading = false;
});
};
$scope.getSrc = (function(param) {
$scope.src = $sce.trustAsResourceUrl('/modules/Status/svg/graph_if.svg?'+param);
$scope.interfaceName = param;
});
$scope.src = $sce.trustAsResourceUrl('/modules/Status/svg/graph_if.svg?' + param);
$scope.interfaceName = param;
});
$scope.setSrc = (function() {
$scope.src = $sce.trustAsResourceUrl('about:blank');
});
$scope.src = $sce.trustAsResourceUrl('about:blank');
});
$scope.setSrc();
$scope.getInfo();