mirror of https://github.com/portainer/portainer
feat(engine-details): pass is agent to host details
parent
cf6be6f596
commit
6a9e389b7c
|
@ -7,7 +7,7 @@
|
|||
<rd-header-content>Docker</rd-header-content>
|
||||
</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>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<td>Total memory</td>
|
||||
<td>{{ $ctrl.host.totalMemory | humansize }}</td>
|
||||
</tr>
|
||||
<tr ng-if="$ctrl.isAgent">
|
||||
<!-- <tr ng-if="$ctrl.isAgent">
|
||||
<td>Physical device information</td>
|
||||
<td>{{ $ctrl.host.physicalDeviceInfo }}</td>
|
||||
</tr>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<tr ng-if="$ctrl.isAgent">
|
||||
<td>Physical disk</td>
|
||||
<td>{{ $ctrl.host.physicalDisk }}</td>
|
||||
</tr>
|
||||
</tr> -->
|
||||
</tbody>
|
||||
</table>
|
||||
</rd-widget-body>
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
angular.module('portainer.docker').controller('NodeDetailsViewController', [
|
||||
'$stateParams', 'NodeService', 'LabelHelper', 'Notifications', '$state',
|
||||
function NodeDetailsViewController($stateParams, NodeService, LabelHelper, Notifications, $state) {
|
||||
'$stateParams', 'NodeService', 'LabelHelper', 'Notifications', '$state', 'StateManager',
|
||||
function NodeDetailsViewController($stateParams, NodeService, LabelHelper, Notifications, $state, StateManager) {
|
||||
var ctrl = this;
|
||||
var originalNode;
|
||||
|
||||
ctrl.$onInit = initView;
|
||||
ctrl.updateLabels = updateLabels;
|
||||
ctrl.state = {
|
||||
isAgent: false
|
||||
};
|
||||
|
||||
function initView() {
|
||||
NodeService.node($stateParams.id).then(function(node) {
|
||||
|
@ -14,6 +17,9 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
|
|||
ctrl.engineDetails = buildEngineDetails(node);
|
||||
ctrl.nodeDetails = buildNodeDetails(node);
|
||||
});
|
||||
|
||||
var applicationState = StateManager.getState();
|
||||
ctrl.state.isAgent = applicationState.endpoint.mode.agentProxy;
|
||||
}
|
||||
|
||||
function buildHostDetails(node) {
|
||||
|
@ -37,8 +43,8 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
|
|||
// rootDirectory: node.DockerRootDir, TODO
|
||||
// storageDriver: node.Driver,
|
||||
// loggingDriver: node.LoggingDriver,
|
||||
volumePlugins: getPlugins(node.Plugins, 'Volume'),
|
||||
networkPlugins: getPlugins(node.Plugins, 'Network')
|
||||
volumePlugins: transformPlugins(node.Plugins, 'Volume'),
|
||||
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
|
||||
.filter(function(plugin) {
|
||||
return plugin.Type === type;
|
||||
|
|
Loading…
Reference in New Issue