1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-01 03:45:22 +02:00

fix(host-info) host info improvement EE-7075 (#11883)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run

This commit is contained in:
cmeng 2024-06-27 03:18:29 +12:00 committed by GitHub
parent 9339d10233
commit 91a477d9fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 40 additions and 2 deletions

View file

@ -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>

View file

@ -10,6 +10,7 @@ angular.module('portainer.docker').component('hostOverview', {
refreshUrl: '@',
browseUrl: '@',
hostFeaturesEnabled: '<',
environmentId: '<',
},
transclude: true,
});

View file

@ -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>

View file

@ -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);
}
}

View file

@ -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: '<',
},
});

View file

@ -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() {

View file

@ -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>

View file

@ -99,6 +99,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}
`;
}