mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
feat(edge-devices): set specific page to view [EE-2082] (#6869)
This commit is contained in:
parent
12cddbd896
commit
b031a30f62
54 changed files with 892 additions and 639 deletions
|
@ -1,40 +0,0 @@
|
|||
<rd-header>
|
||||
<rd-header-title title-text="Edge Devices">
|
||||
<a data-toggle="tooltip" title="Refresh" ui-sref="edge.devices" ui-sref-opts="{reload: true}">
|
||||
<i class="fa fa-sync" aria-hidden="true"></i>
|
||||
</a>
|
||||
</rd-header-title>
|
||||
<rd-header-content>Edge Devices</rd-header-content>
|
||||
</rd-header>
|
||||
|
||||
<div
|
||||
class="row"
|
||||
style="width: 100%; height: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center"
|
||||
ng-if="$ctrl.loadingMessage"
|
||||
>
|
||||
<div class="sk-fold">
|
||||
<div class="sk-fold-cube"></div>
|
||||
<div class="sk-fold-cube"></div>
|
||||
<div class="sk-fold-cube"></div>
|
||||
<div class="sk-fold-cube"></div>
|
||||
</div>
|
||||
<span style="margin-top: 25px">
|
||||
{{ $ctrl.loadingMessage }}
|
||||
<i class="fa fa-cog fa-spin"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-if="!$ctrl.loadingMessage">
|
||||
<div class="col-sm-12">
|
||||
<edge-devices-datatable
|
||||
dataset="($ctrl.edgeDevices)"
|
||||
groups="($ctrl.groups)"
|
||||
is-fdo-enabled="($ctrl.isFDOEnabled)"
|
||||
is-open-amt-enabled="($ctrl.isOpenAMTEnabled)"
|
||||
show-waiting-room-link="($ctrl.showWaitingRoomLink)"
|
||||
mps-server="($ctrl.mpsServer)"
|
||||
on-refresh="($ctrl.getEnvironments)"
|
||||
set-loading-message="($ctrl.setLoadingMessage)"
|
||||
></edge-devices-datatable>
|
||||
</div>
|
||||
</div>
|
|
@ -1,55 +0,0 @@
|
|||
import { getEndpoints } from 'Portainer/environments/environment.service';
|
||||
|
||||
angular.module('portainer.edge').controller('EdgeDevicesViewController', EdgeDevicesViewController);
|
||||
/* @ngInject */
|
||||
export function EdgeDevicesViewController($q, $async, EndpointService, GroupService, SettingsService, ModalService, Notifications) {
|
||||
var ctrl = this;
|
||||
|
||||
ctrl.edgeDevices = [];
|
||||
|
||||
this.getEnvironments = function () {
|
||||
return $async(async () => {
|
||||
try {
|
||||
const [endpointsResponse, groups] = await Promise.all([
|
||||
getEndpoints(0, 100, {
|
||||
edgeDeviceFilter: 'trusted',
|
||||
}),
|
||||
GroupService.groups(),
|
||||
]);
|
||||
ctrl.groups = groups;
|
||||
ctrl.edgeDevices = endpointsResponse.value;
|
||||
} catch (err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve edge devices');
|
||||
ctrl.edgeDevices = [];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.getSettings = function () {
|
||||
return $async(async () => {
|
||||
try {
|
||||
const settings = await SettingsService.settings();
|
||||
|
||||
ctrl.isFDOEnabled = settings && settings.EnableEdgeComputeFeatures && settings.fdoConfiguration && settings.fdoConfiguration.enabled;
|
||||
ctrl.showWaitingRoomLink = process.env.PORTAINER_EDITION === 'BE' && settings && settings.EnableEdgeComputeFeatures && !settings.TrustOnFirstConnect;
|
||||
ctrl.isOpenAMTEnabled = settings && settings.EnableEdgeComputeFeatures && settings.openAMTConfiguration && settings.openAMTConfiguration.enabled;
|
||||
ctrl.mpsServer = ctrl.isOpenAMTEnabled ? settings.openAMTConfiguration.mpsServer : '';
|
||||
} catch (err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve settings');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.setLoadingMessage = function (message) {
|
||||
return $async(async () => {
|
||||
ctrl.loadingMessage = message;
|
||||
});
|
||||
};
|
||||
|
||||
function initView() {
|
||||
ctrl.getEnvironments();
|
||||
ctrl.getSettings();
|
||||
}
|
||||
|
||||
initView();
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import { EdgeDevicesViewController } from './edgeDevicesViewController';
|
||||
|
||||
angular.module('portainer.edge').component('edgeDevicesView', {
|
||||
templateUrl: './edgeDevicesView.html',
|
||||
controller: EdgeDevicesViewController,
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue