mirror of https://github.com/portainer/portainer
Merge branch 'develop' into feat2182-upload-files-host
commit
c50c5bed81
|
@ -8,7 +8,7 @@ angular.module('portainer.agent').factory('Host', [
|
|||
endpointId: EndpointProvider.endpointID
|
||||
},
|
||||
{
|
||||
info: { method: 'GET', isArray: false, params: { action: 'info' } }
|
||||
info: { method: 'GET', params: { action: 'info' } }
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -15,4 +15,7 @@
|
|||
|
||||
<engine-details-panel engine="$ctrl.engineDetails"></engine-details-panel>
|
||||
|
||||
<devices-panel ng-if="$ctrl.isAgent" devices="$ctrl.devices"></devices-panel>
|
||||
<disks-panel ng-if="$ctrl.isAgent" disks="$ctrl.disks"></disks-panel>
|
||||
|
||||
<ng-transclude></ng-transclude>
|
|
@ -1,9 +1,10 @@
|
|||
angular.module('portainer.docker').component('hostOverview', {
|
||||
templateUrl: 'app/docker/components/host-overview/host-overview.html',
|
||||
controller: 'HostOverviewController',
|
||||
bindings: {
|
||||
hostDetails: '<',
|
||||
engineDetails: '<',
|
||||
devices: '<',
|
||||
disks: '<',
|
||||
isAgent: '<',
|
||||
refreshUrl: '@'
|
||||
},
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
angular.module('portainer.docker').component('devicesPanel', {
|
||||
templateUrl:
|
||||
'app/docker/components/host-view-panels/devices-panel/devices-panel.html',
|
||||
// controller: 'DevicesPanelController'
|
||||
bindings: {
|
||||
devices: '<'
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
angular.module('portainer.docker').component('disksPanel', {
|
||||
templateUrl:
|
||||
'app/docker/components/host-view-panels/disks-panel/disks-panel.html',
|
||||
// controller: 'DisksPanelController'
|
||||
bindings: {
|
||||
disks: '<'
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Volume Plugins</td>
|
||||
<td>{{ $ctrl.engine.volumePlugins | commaSeparated }}</td>
|
||||
<td>{{ $ctrl.engine.volumePlugins | arraytostr: ', ' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Network Plugins</td>
|
||||
<td>{{ $ctrl.engine.networkPlugins | commaSeparated }}</td>
|
||||
<td>{{ $ctrl.engine.networkPlugins | arraytostr: ', ' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
angular.module('portainer.docker').component('engineDetailsPanel', {
|
||||
templateUrl:
|
||||
'app/docker/components/host-view-panels/engine-details-panel/engine-details-panel.html',
|
||||
controller: 'EngineDetailsPanelController',
|
||||
bindings: {
|
||||
engine: '<'
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
angular.module('portainer.docker').component('hostDetailsPanel', {
|
||||
templateUrl:
|
||||
'app/docker/components/host-view-panels/host-details-panel/host-details-panel.html',
|
||||
controller: 'HostDetailsPanelController',
|
||||
bindings: {
|
||||
host: '<',
|
||||
isAgent: '<'
|
||||
|
|
|
@ -7,7 +7,7 @@ angular.module('portainer.docker').controller('NodeLabelsTableController', [
|
|||
function removeLabel(index) {
|
||||
var label = ctrl.labels.splice(index, 1);
|
||||
if (label !== null) {
|
||||
ctrl.onChangedLabels({ labels: ctrl.labels });
|
||||
ctrl.onChangedLabels({ labels: ctrl.labels });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,21 +19,5 @@ angular.module('portainer.docker').controller('NodeLabelsTableController', [
|
|||
ctrl.onChangedLabels({ labels: ctrl.labels });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cancelChanges() {
|
||||
ctrl.labels = ctrl.labels
|
||||
.filter(function(label) {
|
||||
return label.originalValue || label.originalKey;
|
||||
})
|
||||
.map(function(label) {
|
||||
return Object.assign(label, {
|
||||
value: label.originalValue,
|
||||
key: label.originalKey
|
||||
});
|
||||
});
|
||||
ctrl.hasChanges = false;
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
</tr>
|
||||
<tr ng-if=" $ctrl.details.engineLabels.length">
|
||||
<td>Engine Labels</td>
|
||||
<td>{{ $ctrl.details.engineLabels | commaSeparated }}</td>
|
||||
<td>{{ $ctrl.details.engineLabels | arraytostr:', ' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
angular.module('portainer.docker').controller('HostViewController', [
|
||||
'$q',
|
||||
'$scope',
|
||||
'SystemService',
|
||||
'Notifications',
|
||||
function HostViewController($q, $scope, SystemService, Notifications) {
|
||||
'$q', 'SystemService', 'Notifications', 'StateManager', 'AgentService',
|
||||
function HostViewController($q, SystemService, Notifications, StateManager, AgentService) {
|
||||
var ctrl = this;
|
||||
this.$onInit = initView;
|
||||
|
||||
ctrl.state = {
|
||||
isAgent: false
|
||||
};
|
||||
|
||||
this.engineDetails = {};
|
||||
this.hostDetails = {};
|
||||
|
||||
function initView() {
|
||||
var applicationState = StateManager.getState();
|
||||
ctrl.state.isAgent = applicationState.endpoint.mode.agentProxy;
|
||||
|
||||
$q.all({
|
||||
version: SystemService.version(),
|
||||
info: SystemService.info()
|
||||
|
@ -18,6 +22,13 @@ angular.module('portainer.docker').controller('HostViewController', [
|
|||
.then(function success(data) {
|
||||
ctrl.engineDetails = buildEngineDetails(data);
|
||||
ctrl.hostDetails = buildHostDetails(data.info);
|
||||
|
||||
if (ctrl.state.isAgent) {
|
||||
return AgentService.hostInfo(data.info.Hostname).then(function onHostInfoLoad(agentHostInfo) {
|
||||
ctrl.devices = agentHostInfo.PCIDevices;
|
||||
ctrl.disks = agentHostInfo.PhysicalDisks;
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error(
|
||||
|
|
|
@ -2,4 +2,7 @@
|
|||
engine-details="$ctrl.engineDetails"
|
||||
host-details="$ctrl.hostDetails"
|
||||
refresh-url="docker.host"
|
||||
is-agent="$ctrl.state.isAgent"
|
||||
disks="$ctrl.disks"
|
||||
devices="$ctrl.devices"
|
||||
></host-overview>
|
|
@ -20,7 +20,9 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
|
|||
ctrl.engineDetails = buildEngineDetails(node);
|
||||
ctrl.nodeDetails = buildNodeDetails(node);
|
||||
if (ctrl.state.isAgent) {
|
||||
AgentService.hostInfo(node.Hostname).then(function onHostInfoLoad(agentHostInfo) {
|
||||
AgentService.hostInfo(node.Hostname).then(function onHostInfoLoad(
|
||||
agentHostInfo
|
||||
) {
|
||||
ctrl.devices = agentHostInfo.PCIDevices;
|
||||
ctrl.disks = agentHostInfo.PhysicalDisks;
|
||||
});
|
||||
|
@ -28,7 +30,6 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
function buildHostDetails(node) {
|
||||
return {
|
||||
os: {
|
||||
|
@ -61,10 +62,6 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function transformPlugins(pluginsList, type) {
|
||||
return pluginsList
|
||||
.filter(function(plugin) {
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
host-details="$ctrl.hostDetails"
|
||||
engine-details="$ctrl.engineDetails"
|
||||
refresh-url="docker.nodes.node"
|
||||
disks="$ctrl.disks"
|
||||
devices="$ctrl.devices"
|
||||
>
|
||||
<devices-panel ng-if="$ctrl.state.isAgent" devices="$ctrl.devices"></devices-panel>
|
||||
<disks-panel ng-if="$ctrl.state.isAgent" disks="$ctrl.disks"></disks-panel>
|
||||
<swarm-node-details-panel
|
||||
details="$ctrl.nodeDetails"
|
||||
original-node="$ctrl.originalNode"
|
||||
|
|
Loading…
Reference in New Issue