1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-29 10:19:41 +02:00

feat(k8s): remove cluster status panel (#5570)

This commit is contained in:
Anthony Lapenna 2021-09-28 13:48:06 +13:00 committed by GitHub
parent f0a88b7367
commit 46ffca92fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 139 deletions

View file

@ -25,34 +25,6 @@
</form>
<!-- !resource-reservation -->
<!-- cluster-status -->
<div class="col-sm-12 form-section-title">
Cluster status
</div>
<table class="table">
<tbody>
<tr class="text-muted">
<td style="border-top: none; width: 25%;">Component</td>
<td style="border-top: none; width: 25%;">Status</td>
<td style="border-top: none; width: 50%;" ng-if="ctrl.hasUnhealthyComponentStatus">Error</td>
</tr>
<tr ng-repeat="cs in ctrl.componentStatuses">
<td style="width: 25%;">
{{ cs.ComponentName }}
</td>
<td style="width: 25%;">
<span ng-if="cs.Healthy"><i class="fa fa-check green-icon" aria-hidden="true" style="margin-right: 2px;"></i> healthy</span>
<span ng-if="!cs.Healthy"><i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px;"></i> unhealthy</span>
</td>
<td ng-if="ctrl.hasUnhealthyComponentStatus" style="width: 50%;">
{{ cs.ErrorMessage !== '' ? cs.ErrorMessage : '-' }}
</td>
</tr>
</tbody>
</table>
<!-- !cluster-status -->
<!-- leader-status -->
<div ng-if="ctrl.systemEndpoints.length > 0">
<div class="col-sm-12 form-section-title">

View file

@ -15,7 +15,6 @@ class KubernetesClusterController {
KubernetesNodeService,
KubernetesMetricsService,
KubernetesApplicationService,
KubernetesComponentStatusService,
KubernetesEndpointService
) {
this.$async = $async;
@ -26,32 +25,16 @@ class KubernetesClusterController {
this.KubernetesNodeService = KubernetesNodeService;
this.KubernetesMetricsService = KubernetesMetricsService;
this.KubernetesApplicationService = KubernetesApplicationService;
this.KubernetesComponentStatusService = KubernetesComponentStatusService;
this.KubernetesEndpointService = KubernetesEndpointService;
this.onInit = this.onInit.bind(this);
this.getNodes = this.getNodes.bind(this);
this.getNodesAsync = this.getNodesAsync.bind(this);
this.getApplicationsAsync = this.getApplicationsAsync.bind(this);
this.getComponentStatus = this.getComponentStatus.bind(this);
this.getComponentStatusAsync = this.getComponentStatusAsync.bind(this);
this.getEndpointsAsync = this.getEndpointsAsync.bind(this);
this.hasResourceUsageAccess = this.hasResourceUsageAccess.bind(this);
}
async getComponentStatusAsync() {
try {
this.componentStatuses = await this.KubernetesComponentStatusService.get();
this.hasUnhealthyComponentStatus = _.find(this.componentStatuses, { Healthy: false }) ? true : false;
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to retrieve cluster component statuses');
}
}
getComponentStatus() {
return this.$async(this.getComponentStatusAsync);
}
async getEndpointsAsync() {
try {
const endpoints = await this.KubernetesEndpointService.get();
@ -152,14 +135,12 @@ class KubernetesClusterController {
this.state = {
applicationsLoading: true,
viewReady: false,
hasUnhealthyComponentStatus: false,
useServerMetrics,
};
await this.getNodes();
if (this.isAdmin) {
await this.getEndpoints();
await this.getComponentStatus();
await this.getApplications();
}