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="$ctrl.hostDetails"
|
||||
is-browse-enabled="$ctrl.isAgent && $ctrl.agentApiVersion > 1 && $ctrl.hostFeaturesEnabled"
|
||||
environment-id="$ctrl.environmentId"
|
||||
browse-url="{{ $ctrl.browseUrl }}"
|
||||
></host-details-panel>
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ angular.module('portainer.docker').component('hostOverview', {
|
|||
refreshUrl: '@',
|
||||
browseUrl: '@',
|
||||
hostFeaturesEnabled: '<',
|
||||
environmentId: '<',
|
||||
},
|
||||
transclude: true,
|
||||
});
|
||||
|
|
|
@ -15,9 +15,12 @@
|
|||
<td>{{ device.Name }}</td>
|
||||
<td>{{ device.Vendor }}</td>
|
||||
</tr>
|
||||
<tr ng-if="!$ctrl.devices">
|
||||
<tr ng-if="$ctrl.devices === undefined">
|
||||
<td colspan="2" class="text-muted text-center">Loading...</td>
|
||||
</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">
|
||||
<td colspan="2" class="text-muted text-center"> No device available. </td>
|
||||
</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', {
|
||||
templateUrl: './host-details-panel.html',
|
||||
controller: HostDetailsPanelController,
|
||||
bindings: {
|
||||
host: '<',
|
||||
isBrowseEnabled: '<',
|
||||
browseUrl: '@',
|
||||
environmentId: '<',
|
||||
},
|
||||
});
|
||||
|
|
|
@ -17,7 +17,7 @@ angular.module('portainer.docker').controller('HostViewController', [
|
|||
|
||||
this.engineDetails = {};
|
||||
this.hostDetails = {};
|
||||
this.devices = null;
|
||||
this.devices = undefined;
|
||||
this.disks = null;
|
||||
|
||||
function initView() {
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
refresh-url="docker.host"
|
||||
browse-url="docker.host.browser"
|
||||
host-features-enabled="$ctrl.state.enableHostManagementFeatures"
|
||||
environment-id="$ctrl.endpoint.Id"
|
||||
></host-overview>
|
||||
|
|
|
@ -101,6 +101,7 @@ function linuxStandaloneCommand(agentVersion: string, agentSecret: string) {
|
|||
--restart=always \\
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \\
|
||||
-v /var/lib/docker/volumes:/var/lib/docker/volumes \\
|
||||
-v /:/host \\
|
||||
portainer/agent:${agentVersion}
|
||||
`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue