mirror of https://github.com/portainer/portainer
feat(swarm-visualizer): add ram and cpu info to nodes & limits to tasks (#1458)
parent
f3b5f803f5
commit
406757d751
|
@ -73,6 +73,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ node.Role }}</div>
|
<div>{{ node.Role }}</div>
|
||||||
|
<div>CPU: {{ node.CPUs / 1000000000 }}</div>
|
||||||
|
<div>Memory: {{ node.Memory|humansize: 2 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tasks">
|
<div class="tasks">
|
||||||
<div class="task task_{{ task.Status.State | visualizerTask }}" ng-repeat="task in node.Tasks | filter: (state.DisplayOnlyRunningTasks || '') && { Status: { State: 'running' } }">
|
<div class="task task_{{ task.Status.State | visualizerTask }}" ng-repeat="task in node.Tasks | filter: (state.DisplayOnlyRunningTasks || '') && { Status: { State: 'running' } }">
|
||||||
|
@ -80,6 +82,8 @@
|
||||||
<div>Image: {{ task.Spec.ContainerSpec.Image | hideshasum }}</div>
|
<div>Image: {{ task.Spec.ContainerSpec.Image | hideshasum }}</div>
|
||||||
<div>Status: {{ task.Status.State }}</div>
|
<div>Status: {{ task.Status.State }}</div>
|
||||||
<div>Update: {{ task.Updated | getisodate }}</div>
|
<div>Update: {{ task.Updated | getisodate }}</div>
|
||||||
|
<div ng-if="task.Spec.Resources.Limits.MemoryBytes">Memory limit: {{ task.Spec.Resources.Limits.MemoryBytes | humansize: 2:2 }}</div>
|
||||||
|
<div ng-if="task.Spec.Resources.Limits.NanoCPUs">CPU limit: {{ task.Spec.Resources.Limits.NanoCPUs / 1000000000 }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -177,12 +177,15 @@ angular.module('portainer.filters', [])
|
||||||
})
|
})
|
||||||
.filter('humansize', function () {
|
.filter('humansize', function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
return function (bytes, round) {
|
return function (bytes, round, base) {
|
||||||
if (!round) {
|
if (!round) {
|
||||||
round = 1;
|
round = 1;
|
||||||
}
|
}
|
||||||
|
if (!base) {
|
||||||
|
base = 10;
|
||||||
|
}
|
||||||
if (bytes || bytes === 0) {
|
if (bytes || bytes === 0) {
|
||||||
return filesize(bytes, {base: 10, round: round});
|
return filesize(bytes, {base: base, round: round});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue