1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +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

@ -37,7 +37,7 @@
</table>
<form class="form-horizontal">
<div class="col-sm-12 form-section-title">
Filters
Options
</div>
<div class="form-group">
<div class="col-sm-12">
@ -48,6 +48,14 @@
<input type="checkbox" ng-model="state.DisplayOnlyRunningTasks" ng-change="changeDisplayOnlyRunningTasks()"><i></i>
</label>
</div>
<div class="col-sm-12">
<label class="control-label text-left">
Display node labels
</label>
<label class="switch" style="margin-left: 20px;">
<input type="checkbox" ng-model="state.DisplayNodeLabels" ng-change="changeDisplayNodeLabels()"><i></i>
</label>
</div>
</div>
</form>
<form class="form-horizontal">
@ -95,6 +103,17 @@
<div>CPU: {{ node.CPUs / 1000000000 }}</div>
<div>Memory: {{ node.Memory|humansize: 2 }}</div>
<div><span class="label label-{{ node.Status | nodestatusbadge }}">{{ node.Status }}</span></div>
<div class="node_labels" ng-if="node.Labels.length > 0 && state.DisplayNodeLabels">
<div>Labels</div>
<div class="node_label" ng-repeat="label in node.Labels">
<span class="label_key">
{{ label.key }}
</span>
<span class="label_value" ng-if="label.value">
= {{ label.value }}
</span>
</div>
</div>
</div>
<div class="tasks">
<div class="task task_{{ task.Status.State | visualizerTask }}" style="border: 2px solid {{ task.ServiceId | visualizerTaskBorderColor }}" ng-repeat="task in node.Tasks | orderBy: 'ServiceName' | filter: (state.DisplayOnlyRunningTasks || '') && { Status: { State: 'running' } }">