mirror of https://github.com/portainer/portainer
fix(host-info) host info improvement EE-7075 (#11884)
parent
ba4526985a
commit
e828615467
|
@ -3,6 +3,7 @@
|
||||||
<host-details-panel
|
<host-details-panel
|
||||||
host="$ctrl.hostDetails"
|
host="$ctrl.hostDetails"
|
||||||
is-browse-enabled="$ctrl.isAgent && $ctrl.agentApiVersion > 1 && $ctrl.hostFeaturesEnabled"
|
is-browse-enabled="$ctrl.isAgent && $ctrl.agentApiVersion > 1 && $ctrl.hostFeaturesEnabled"
|
||||||
|
environment-id="$ctrl.environmentId"
|
||||||
browse-url="{{ $ctrl.browseUrl }}"
|
browse-url="{{ $ctrl.browseUrl }}"
|
||||||
></host-details-panel>
|
></host-details-panel>
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ angular.module('portainer.docker').component('hostOverview', {
|
||||||
refreshUrl: '@',
|
refreshUrl: '@',
|
||||||
browseUrl: '@',
|
browseUrl: '@',
|
||||||
hostFeaturesEnabled: '<',
|
hostFeaturesEnabled: '<',
|
||||||
|
environmentId: '<',
|
||||||
},
|
},
|
||||||
transclude: true,
|
transclude: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,9 +15,12 @@
|
||||||
<td>{{ device.Name }}</td>
|
<td>{{ device.Name }}</td>
|
||||||
<td>{{ device.Vendor }}</td>
|
<td>{{ device.Vendor }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr ng-if="!$ctrl.devices">
|
<tr ng-if="$ctrl.devices === undefined">
|
||||||
<td colspan="2" class="text-muted text-center">Loading...</td>
|
<td colspan="2" class="text-muted text-center">Loading...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr ng-if="$ctrl.devices === null">
|
||||||
|
<td colspan="2" class="text-muted text-center"> Failed to load devices. </td>
|
||||||
|
</tr>
|
||||||
<tr ng-if="$ctrl.devices.length === 0">
|
<tr ng-if="$ctrl.devices.length === 0">
|
||||||
<td colspan="2" class="text-muted text-center"> No device available. </td>
|
<td colspan="2" class="text-muted text-center"> No device available. </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
const ROOT_PATH = '/host';
|
||||||
|
|
||||||
|
export class HostDetailsPanelController {
|
||||||
|
/* @ngInject */
|
||||||
|
constructor($async, HostBrowserService) {
|
||||||
|
Object.assign(this, { $async, HostBrowserService });
|
||||||
|
|
||||||
|
this.getFilesForPath = this.getFilesForPath.bind(this);
|
||||||
|
this.getFilesForPathAsync = this.getFilesForPathAsync.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFilesForPath(path) {
|
||||||
|
return this.$async(this.getFilesForPathAsync, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getFilesForPathAsync(path) {
|
||||||
|
const isBrowseEnabledOrig = this.isBrowseEnabled;
|
||||||
|
this.isBrowseEnabled = false;
|
||||||
|
|
||||||
|
await this.HostBrowserService.ls(this.environmentId, path);
|
||||||
|
this.isBrowseEnabled = isBrowseEnabledOrig;
|
||||||
|
}
|
||||||
|
|
||||||
|
$onInit() {
|
||||||
|
this.getFilesForPath(ROOT_PATH);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,12 @@
|
||||||
|
import { HostDetailsPanelController } from './host-details-panel-controller';
|
||||||
|
|
||||||
angular.module('portainer.docker').component('hostDetailsPanel', {
|
angular.module('portainer.docker').component('hostDetailsPanel', {
|
||||||
templateUrl: './host-details-panel.html',
|
templateUrl: './host-details-panel.html',
|
||||||
|
controller: HostDetailsPanelController,
|
||||||
bindings: {
|
bindings: {
|
||||||
host: '<',
|
host: '<',
|
||||||
isBrowseEnabled: '<',
|
isBrowseEnabled: '<',
|
||||||
browseUrl: '@',
|
browseUrl: '@',
|
||||||
|
environmentId: '<',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ angular.module('portainer.docker').controller('HostViewController', [
|
||||||
|
|
||||||
this.engineDetails = {};
|
this.engineDetails = {};
|
||||||
this.hostDetails = {};
|
this.hostDetails = {};
|
||||||
this.devices = null;
|
this.devices = undefined;
|
||||||
this.disks = null;
|
this.disks = null;
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
|
|
|
@ -8,4 +8,5 @@
|
||||||
refresh-url="docker.host"
|
refresh-url="docker.host"
|
||||||
browse-url="docker.host.browser"
|
browse-url="docker.host.browser"
|
||||||
host-features-enabled="$ctrl.state.enableHostManagementFeatures"
|
host-features-enabled="$ctrl.state.enableHostManagementFeatures"
|
||||||
|
environment-id="$ctrl.endpoint.Id"
|
||||||
></host-overview>
|
></host-overview>
|
||||||
|
|
|
@ -101,6 +101,7 @@ function linuxStandaloneCommand(agentVersion: string, agentSecret: string) {
|
||||||
--restart=always \\
|
--restart=always \\
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \\
|
-v /var/run/docker.sock:/var/run/docker.sock \\
|
||||||
-v /var/lib/docker/volumes:/var/lib/docker/volumes \\
|
-v /var/lib/docker/volumes:/var/lib/docker/volumes \\
|
||||||
|
-v /:/host \\
|
||||||
portainer/agent:${agentVersion}
|
portainer/agent:${agentVersion}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue