1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

feat(swarmvisualizer): add labels display under node info (#2886)

* feat(swarmvisualizer): add labels display under node info

* feat(swarmvisualizer): fix css

* add toggle to display node labels

* feat(swarmvisualizer): rename filters section + fix display when label has no value

* feat(swarmvisualizer): retrieve state from local storage for node labels display toggle
This commit is contained in:
Anthony Brame 2019-08-13 17:38:04 +02:00 committed by xAt0mZ
parent 96155ac97f
commit ea6cddcfd3
3 changed files with 41 additions and 1 deletions

View file

@ -5,6 +5,7 @@ function ($q, $scope, $document, $interval, NodeService, ServiceService, TaskSer
$scope.state = {
ShowInformationPanel: true,
DisplayOnlyRunningTasks: false,
DisplayNodeLabels: false,
refreshRate: '5'
};
@ -22,6 +23,11 @@ function ($q, $scope, $document, $interval, NodeService, ServiceService, TaskSer
LocalStorage.storeSwarmVisualizerSettings('display_only_running_tasks', value);
};
$scope.changeDisplayNodeLabels = function() {
var value = $scope.state.DisplayNodeLabels;
LocalStorage.storeSwarmVisualizerSettings('display_node_labels', value);
};
$scope.changeUpdateRepeater = function() {
stopRepeater();
setUpdateRepeater();
@ -110,6 +116,10 @@ function ($q, $scope, $document, $interval, NodeService, ServiceService, TaskSer
if (displayOnlyRunningTasks !== undefined && displayOnlyRunningTasks !== null)
$scope.state.DisplayOnlyRunningTasks = displayOnlyRunningTasks;
var displayNodeLabels = LocalStorage.getSwarmVisualizerSettings('display_node_labels');
if (displayNodeLabels !== undefined && displayNodeLabels !== null)
$scope.state.DisplayNodeLabels = displayNodeLabels;
var refreshRate = LocalStorage.getSwarmVisualizerSettings('refresh_rate');
if (refreshRate !== undefined && refreshRate !== null)
$scope.state.refreshRate = refreshRate;