From c15ee9af7ec9f6a9aa60c60239f2eed9889c6e2e Mon Sep 17 00:00:00 2001 From: Chaim Lando Date: Wed, 5 Sep 2018 12:30:40 +0300 Subject: [PATCH] feat(engine-details): build host details object --- .../host-details-panel/host-details-panel.html | 2 +- .../host-details-panel/host-details-panel.js | 3 ++- app/docker/views/host/host-view-controller.js | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/docker/components/host-view-panels/host-details-panel/host-details-panel.html b/app/docker/components/host-view-panels/host-details-panel/host-details-panel.html index 0927f3b6c..aca9a949c 100644 --- a/app/docker/components/host-view-panels/host-details-panel/host-details-panel.html +++ b/app/docker/components/host-view-panels/host-details-panel/host-details-panel.html @@ -23,7 +23,7 @@ Total memory - {{ $ctrl.host.totalMemory }} + {{ $ctrl.host.totalMemory | humansize }} Physical device information diff --git a/app/docker/components/host-view-panels/host-details-panel/host-details-panel.js b/app/docker/components/host-view-panels/host-details-panel/host-details-panel.js index 9cb3d6349..fbd2edfb0 100644 --- a/app/docker/components/host-view-panels/host-details-panel/host-details-panel.js +++ b/app/docker/components/host-view-panels/host-details-panel/host-details-panel.js @@ -3,6 +3,7 @@ angular.module('portainer.docker').component('hostDetailsPanel', { 'app/docker/components/host-view-panels/host-details-panel/host-details-panel.html', controller: 'HostDetailsPanelController', bindings: { - host: '<' + host: '<', + isAgent: '<' } }); diff --git a/app/docker/views/host/host-view-controller.js b/app/docker/views/host/host-view-controller.js index 7361e5b5e..f1ed74083 100644 --- a/app/docker/views/host/host-view-controller.js +++ b/app/docker/views/host/host-view-controller.js @@ -17,7 +17,7 @@ angular.module('portainer.docker').controller('HostViewController', [ }) .then(function success(data) { ctrl.engineDetails = buildEngineDetails(data); - ctrl.hostDetails = buildHostDetails(data); + ctrl.hostDetails = buildHostDetails(data.info); }) .catch(function error(err) { Notifications.error( @@ -42,8 +42,18 @@ angular.module('portainer.docker').controller('HostViewController', [ }; } - function buildHostDetails() { - return {}; + function buildHostDetails(info) { + return { + os: { + arch: info.Architecture, + type: info.OSType, + name: info.OperatingSystem + }, + name: info.Name, + kernelVersion: info.KernelVersion, + totalCPU: info.NCPU, + totalMemory: info.MemTotal + }; } } ]);