mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(datatables): auto refresh on datatables (#2974)
* feat(datatables): auto refresh on datatables * feat(datatables): auto refresh implementation on docker related resources
This commit is contained in:
parent
cc487ae68a
commit
03c82cac69
51 changed files with 577 additions and 29 deletions
|
@ -58,6 +58,21 @@ function ($q, $scope, SystemService, NodeService, Notifications, StateManager, A
|
|||
$scope.totalMemory = memory;
|
||||
}
|
||||
|
||||
$scope.getNodes = getNodes;
|
||||
function getNodes() {
|
||||
var provider = $scope.applicationState.endpoint.mode.provider;
|
||||
if (provider === 'DOCKER_SWARM_MODE') {
|
||||
NodeService.nodes().then(function(data) {
|
||||
var nodes = data;
|
||||
processTotalCPUAndMemory(nodes);
|
||||
$scope.nodes = nodes;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve cluster details');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initView() {
|
||||
if (StateManager.getState().application.authentication) {
|
||||
$scope.isAdmin = Authentication.isAdmin();
|
||||
|
@ -66,16 +81,13 @@ function ($q, $scope, SystemService, NodeService, Notifications, StateManager, A
|
|||
var provider = $scope.applicationState.endpoint.mode.provider;
|
||||
$q.all({
|
||||
version: SystemService.version(),
|
||||
info: SystemService.info(),
|
||||
nodes: provider !== 'DOCKER_SWARM_MODE' || NodeService.nodes()
|
||||
info: SystemService.info()
|
||||
})
|
||||
.then(function success(data) {
|
||||
$scope.docker = data.version;
|
||||
$scope.info = data.info;
|
||||
if (provider === 'DOCKER_SWARM_MODE') {
|
||||
var nodes = data.nodes;
|
||||
processTotalCPUAndMemory(nodes);
|
||||
$scope.nodes = nodes;
|
||||
getNodes();
|
||||
} else {
|
||||
extractSwarmInfo(data.info);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue