1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-30 18:59:41 +02:00
portainer/app/docker/components/host-view-panels/host-details-panel/host-details-panel-controller.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
713 B
JavaScript
Raw Normal View History

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