feat(engine-details): pass is agent to host details

pull/2255/head
Chaim Lando 2018-09-06 17:02:13 +03:00
parent cf6be6f596
commit 6a9e389b7c
3 changed files with 14 additions and 8 deletions

View File

@ -7,7 +7,7 @@
<rd-header-content>Docker</rd-header-content> <rd-header-content>Docker</rd-header-content>
</rd-header> </rd-header>
<host-details-panel host="$ctrl.hostDetails"></host-details-panel> <host-details-panel host="$ctrl.hostDetails" is-agent="$ctrl.isAgent"></host-details-panel>
<engine-details-panel engine="$ctrl.engineDetails"></engine-details-panel> <engine-details-panel engine="$ctrl.engineDetails"></engine-details-panel>

View File

@ -25,7 +25,7 @@
<td>Total memory</td> <td>Total memory</td>
<td>{{ $ctrl.host.totalMemory | humansize }}</td> <td>{{ $ctrl.host.totalMemory | humansize }}</td>
</tr> </tr>
<tr ng-if="$ctrl.isAgent"> <!-- <tr ng-if="$ctrl.isAgent">
<td>Physical device information</td> <td>Physical device information</td>
<td>{{ $ctrl.host.physicalDeviceInfo }}</td> <td>{{ $ctrl.host.physicalDeviceInfo }}</td>
</tr> </tr>
@ -36,7 +36,7 @@
<tr ng-if="$ctrl.isAgent"> <tr ng-if="$ctrl.isAgent">
<td>Physical disk</td> <td>Physical disk</td>
<td>{{ $ctrl.host.physicalDisk }}</td> <td>{{ $ctrl.host.physicalDisk }}</td>
</tr> </tr> -->
</tbody> </tbody>
</table> </table>
</rd-widget-body> </rd-widget-body>

View File

@ -1,11 +1,14 @@
angular.module('portainer.docker').controller('NodeDetailsViewController', [ angular.module('portainer.docker').controller('NodeDetailsViewController', [
'$stateParams', 'NodeService', 'LabelHelper', 'Notifications', '$state', '$stateParams', 'NodeService', 'LabelHelper', 'Notifications', '$state', 'StateManager',
function NodeDetailsViewController($stateParams, NodeService, LabelHelper, Notifications, $state) { function NodeDetailsViewController($stateParams, NodeService, LabelHelper, Notifications, $state, StateManager) {
var ctrl = this; var ctrl = this;
var originalNode; var originalNode;
ctrl.$onInit = initView; ctrl.$onInit = initView;
ctrl.updateLabels = updateLabels; ctrl.updateLabels = updateLabels;
ctrl.state = {
isAgent: false
};
function initView() { function initView() {
NodeService.node($stateParams.id).then(function(node) { NodeService.node($stateParams.id).then(function(node) {
@ -14,6 +17,9 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
ctrl.engineDetails = buildEngineDetails(node); ctrl.engineDetails = buildEngineDetails(node);
ctrl.nodeDetails = buildNodeDetails(node); ctrl.nodeDetails = buildNodeDetails(node);
}); });
var applicationState = StateManager.getState();
ctrl.state.isAgent = applicationState.endpoint.mode.agentProxy;
} }
function buildHostDetails(node) { function buildHostDetails(node) {
@ -37,8 +43,8 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
// rootDirectory: node.DockerRootDir, TODO // rootDirectory: node.DockerRootDir, TODO
// storageDriver: node.Driver, // storageDriver: node.Driver,
// loggingDriver: node.LoggingDriver, // loggingDriver: node.LoggingDriver,
volumePlugins: getPlugins(node.Plugins, 'Volume'), volumePlugins: transformPlugins(node.Plugins, 'Volume'),
networkPlugins: getPlugins(node.Plugins, 'Network') networkPlugins: transformPlugins(node.Plugins, 'Network')
}; };
} }
@ -83,7 +89,7 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
} }
} }
function getPlugins(pluginsList, type) { function transformPlugins(pluginsList, type) {
return pluginsList return pluginsList
.filter(function(plugin) { .filter(function(plugin) {
return plugin.Type === type; return plugin.Type === type;