You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/06/05 14:14:50 UTC
[incubator-dlab] 08/09: [DLAB-747]: cleanup status and keys check
from main navigation
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 58740b2606cf7f8aa2ddcad5a51f20b62ea86d60
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Wed Jun 5 17:11:02 2019 +0300
[DLAB-747]: cleanup status and keys check from main navigation
---
.../management/endpoints/endpoints.component.scss | 2 +
.../management/management.component.html | 8 +-
.../management/management.component.ts | 135 +++------------------
.../ssn-monitor/ssn-monitor.component.html | 1 +
.../project-form/project-form.component.scss | 2 +
.../src/app/reporting/reporting.component.ts | 2 -
.../src/app/shared/navbar/navbar.component.ts | 45 +------
.../resources/webapp/src/assets/styles/_theme.scss | 9 ++
.../src/main/resources/webapp/src/styles.scss | 2 -
9 files changed, 37 insertions(+), 169 deletions(-)
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss
index ed6e478..fce53e1 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss
@@ -32,6 +32,8 @@
position: absolute;
right: 0;
bottom: 5px;
+ font-family: 'Open Sans', sans-serif;
+ font-weight: 300;
}
}
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
index e77144f..16e9f5d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
@@ -38,9 +38,9 @@
</button>
</div>
<mat-divider></mat-divider>
- <management-grid [currentUser]="user.toLowerCase()" [uploadKey]="uploadKey" [healthStatus]="healthStatus?.status"
- [isAdmin]="healthStatus?.admin" [allEnvironmentData]="allEnvironmentData"
- [environmentsHealthStatuses]="healthStatus?.list_resources" (refreshGrid)="buildGrid()"
- (actionToggle)="manageEnvironmentAction($event)">
+ <management-grid
+ [currentUser]="user.toLowerCase()" [isAdmin]="healthStatus?.admin"
+ [allEnvironmentData]="allEnvironmentData" [environmentsHealthStatuses]="healthStatus?.list_resources"
+ (refreshGrid)="buildGrid()" (actionToggle)="manageEnvironmentAction($event)">
</management-grid>
</div>
\ No newline at end of file
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index 970b41c..a891d85 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -17,10 +17,9 @@
* under the License.
*/
-import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material';
import { ToastrService } from 'ngx-toastr';
-import { Subscription } from 'rxjs';
import {
HealthStatusService,
@@ -28,7 +27,6 @@ import {
UserAccessKeyService,
BackupService,
UserResourceService,
- RolesGroupsService,
StorageService
} from '../../core/services';
@@ -44,23 +42,13 @@ import { EndpointsComponent } from './endpoints/endpoints.component';
templateUrl: './management.component.html',
styleUrls: ['./management.component.scss']
})
-export class ManagementComponent implements OnInit, OnDestroy {
+export class ManagementComponent implements OnInit {
public user: string = '';
public healthStatus: GeneralEnvironmentStatus;
public allEnvironmentData: Array<EnvironmentModel>;
- public uploadKey: boolean = true;
public anyEnvInProgress: boolean = false;
public notebookInProgress: boolean = false;
- private subscriptions: Subscription = new Subscription();
- private clear = undefined;
-
- @ViewChild('backupDialog') backupDialog;
- @ViewChild('manageEnvDialog') manageEnvironmentDialog;
- @ViewChild('keyUploadModal') keyUploadDialog;
- @ViewChild('ssnMonitor') ssnMonitorDialog;
- // @ViewChild('rolesGroupsModal') rolesGroupsDialog;
-
constructor(
public toastr: ToastrService,
public dialog: MatDialog,
@@ -69,23 +57,12 @@ export class ManagementComponent implements OnInit, OnDestroy {
private manageEnvironmentsService: ManageEnvironmentsService,
private userAccessKeyService: UserAccessKeyService,
private userResourceService: UserResourceService,
- private rolesService: RolesGroupsService,
private storageService: StorageService
) { }
ngOnInit() {
this.buildGrid();
this.user = this.storageService.getUserName();
- this.subscriptions.add(this.userAccessKeyService.accessKeyEmitter
- .subscribe(result => this.uploadKey = (result && result.status === 200)));
-
- this.subscriptions.add(this.userAccessKeyService.keyUploadProccessEmitter.subscribe(response => {
- if (response) this.buildGrid();
- }));
- }
-
- ngOnDestroy(): void {
- this.subscriptions.unsubscribe();
}
public buildGrid() {
@@ -105,8 +82,7 @@ export class ManagementComponent implements OnInit, OnDestroy {
}
showBackupDialog() {
- this.dialog.open(BackupDilogComponent, { panelClass: 'modal-sm' })
- .afterClosed().subscribe(result => result && this.createBackup(result));
+ this.dialog.open(BackupDilogComponent, { panelClass: 'modal-sm' });
}
showEndpointsDialog() {
@@ -114,14 +90,6 @@ export class ManagementComponent implements OnInit, OnDestroy {
.afterClosed().subscribe(result => result && this.buildGrid());
}
- getActiveUsersList() {
- return this.healthStatusService.getActiveUsers();
- }
-
- getTotalBudgetData() {
- return this.healthStatusService.getTotalBudgetData();
- }
-
openManageEnvironmentDialog() {
this.getActiveUsersList().subscribe(usersList => {
this.getTotalBudgetData().subscribe(
@@ -134,20 +102,9 @@ export class ManagementComponent implements OnInit, OnDestroy {
}
openSsnMonitorDialog() {
- this.healthStatusService.getSsnMonitorData().subscribe(
- data => this.dialog.open(SsnMonitorComponent, { data: data, panelClass: 'modal-lg' }),
- () => this.toastr.error('Failed ssn data loading!', 'Oops!'));
+ this.dialog.open(SsnMonitorComponent, { panelClass: 'modal-lg' });
}
- // openManageRolesDialog() {
- // this.rolesService.getGroupsData().subscribe(group => {
- // this.rolesService.getRolesData().subscribe(
- // roles => this.rolesGroupsDialog.open({ isFooter: false }, group, roles),
- // error => this.toastr.error(error.message, 'Oops!'));
- // },
- // error => this.toastr.error(error.message, 'Oops!'));
- // }
-
isEnvironmentsInProgress(data): boolean {
return data.exploratory.some(el => {
return el.status === 'creating' || el.status === 'starting' ||
@@ -159,47 +116,6 @@ export class ManagementComponent implements OnInit, OnDestroy {
return data.exploratory.some(el => el.status === 'creating');
}
- createBackup($event) {
- this.backupService.createBackup($event).subscribe(result => {
- this.getBackupStatus(result);
- this.toastr.success('Backup configuration is processing!', 'Processing!');
- this.clear = window.setInterval(() => this.getBackupStatus(result), 3000);
- },
- error => this.toastr.error(error.message, 'Oops!'));
- }
-
- // manageRolesGroups($event) {
- // switch ($event.action) {
- // case 'create':
- // this.rolesService.setupNewGroup($event.value).subscribe(res => {
- // this.toastr.success('Group creation success!', 'Created!');
- // this.getGroupsData();
- // }, () => this.toastr.error('Group creation failed!', 'Oops!'));
- // break;
- // case 'update':
- // this.rolesService.updateGroup($event.value).subscribe(res => {
- // this.toastr.success('Group data successfully updated!', 'Success!');
- // this.getGroupsData();
- // }, () => this.toastr.error('Failed group data updating!', 'Oops!'));
- // break;
- // case 'delete':
- // if ($event.type === 'users') {
- // this.rolesService.removeUsersForGroup($event.value).subscribe(res => {
- // this.toastr.success('Users was successfully deleted!', 'Success!');
- // this.getGroupsData();
- // }, () => this.toastr.error('Failed users deleting!', 'Oops!'));
- // } else if ($event.type === 'group') {
- // console.log('delete group');
- // this.rolesService.removeGroupById($event.value).subscribe(res => {
- // this.toastr.success('Group was successfully deleted!', 'Success!');
- // this.getGroupsData();
- // }, () => this.toastr.error('Failed group deleting!', 'Oops!'));
- // }
- // break;
- // default:
- // }
- // }
-
setBudgetLimits($event) {
this.healthStatusService.updateUsersBudget($event.users).subscribe((result: any) => {
this.healthStatusService.updateTotalBudgetData($event.total).subscribe((res: any) => {
@@ -211,18 +127,11 @@ export class ManagementComponent implements OnInit, OnDestroy {
}, error => this.toastr.error(error.message, 'Oops!'));
}
- // getGroupsData() {
- // this.rolesService.getGroupsData().subscribe(
- // list => this.rolesGroupsDialog.updateGroupData(list),
- // error => this.toastr.error(error.message, 'Oops!'));
- // }
-
manageEnvironment(event: { action: string, user: string }) {
- this.healthStatusService
- .manageEnvironment(event.action, event.user)
+ this.healthStatusService.manageEnvironment(event.action, event.user)
.subscribe(res => {
this.getActiveUsersList().subscribe(usersList => {
- this.manageEnvironmentDialog.usersList = usersList;
+ // this.manageEnvironmentDialog.usersList = usersList;
this.toastr.success(`Action ${event.action} is processing!`, 'Processing!');
this.buildGrid();
});
@@ -230,6 +139,10 @@ export class ManagementComponent implements OnInit, OnDestroy {
error => this.toastr.error(error.message, 'Oops!'));
}
+ get creatingBackup(): boolean {
+ return this.backupService.inProgress;
+ }
+
private getExploratoryList() {
this.userResourceService.getUserProvisionedResources()
.subscribe((result) => {
@@ -238,26 +151,6 @@ export class ManagementComponent implements OnInit, OnDestroy {
});
}
- private getBackupStatus(result) {
- const uuid = result.body;
- this.backupService.getBackupStatus(uuid)
- .subscribe((backupStatus: any) => {
- if (!this.creatingBackup) {
- backupStatus.status === 'FAILED'
- ? this.toastr.error('Backup configuration failed!', 'Oops!')
- : this.toastr.success('Backup configuration completed!', 'Success!');
- clearInterval(this.clear);
- }
- }, () => {
- clearInterval(this.clear);
- this.toastr.error('Backup configuration failed!', 'Oops!');
- });
- }
-
- get creatingBackup(): boolean {
- return this.backupService.inProgress;
- }
-
private getAllEnvironmentData() {
this.manageEnvironmentsService
.getAllEnvironmentData()
@@ -287,4 +180,12 @@ export class ManagementComponent implements OnInit, OnDestroy {
this.getExploratoryList();
});
}
+
+ private getActiveUsersList() {
+ return this.healthStatusService.getActiveUsers();
+ }
+
+ private getTotalBudgetData() {
+ return this.healthStatusService.getTotalBudgetData();
+ }
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/ssn-monitor/ssn-monitor.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/management/ssn-monitor/ssn-monitor.component.html
index 6f20975..30c818d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/ssn-monitor/ssn-monitor.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/ssn-monitor/ssn-monitor.component.html
@@ -116,6 +116,7 @@
</div>
<ng-template #empty>
<p class="info message">Monitor data are not available</p>
+ <mat-progress-bar mode="indeterminate"></mat-progress-bar>
</ng-template>
</div>
</div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss
index 4c241e9..bbdf8cd 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss
@@ -37,5 +37,7 @@
position: absolute;
right: 0;
bottom: 2px;
+ font-family: 'Open Sans', sans-serif;
+ font-weight: 300;
}
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
index 2d34fe4..aec9914 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
@@ -65,7 +65,6 @@ export class ReportingComponent implements OnInit, OnDestroy {
reportData: ReportingConfigModel = ReportingConfigModel.getDefault();
filterConfiguration: ReportingConfigModel = ReportingConfigModel.getDefault();
data: any;
- healthStatus: any;
billingEnabled: boolean;
admin: boolean;
@@ -191,7 +190,6 @@ export class ReportingComponent implements OnInit, OnDestroy {
private getEnvironmentHealthStatus() {
this.healthStatusService.getEnvironmentHealthStatus()
.subscribe((result: any) => {
- this.healthStatus = result.status;
this.billingEnabled = result.billingEnabled;
this.admin = result.admin;
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts
index 4c333f8..1b1c052 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts
@@ -20,7 +20,6 @@
import { Component, ViewEncapsulation, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { MatDialog, MatDialogRef } from '@angular/material';
import { Subscription, timer, interval } from 'rxjs';
-import { takeWhile } from 'rxjs/operators';
import { ToastrService } from 'ngx-toastr';
import { ApplicationSecurityService,
@@ -31,9 +30,8 @@ import { ApplicationSecurityService,
StorageService} from '../../core/services';
import { GeneralEnvironmentStatus } from '../../administration/management/management.model';
import { DICTIONARY } from '../../../dictionary/global.dictionary';
-import { HTTP_STATUS_CODES, FileUtils } from '../../core/util';
+import { FileUtils } from '../../core/util';
import { NotificationDialogComponent } from '../modal-dialog/notification-dialog';
-import { ProgressDialogComponent } from '../modal-dialog/progress-dialog';
@Component({
selector: 'dlab-navbar',
@@ -44,9 +42,6 @@ import { ProgressDialogComponent } from '../modal-dialog/progress-dialog';
export class NavbarComponent implements OnInit, OnDestroy {
readonly PROVIDER = DICTIONARY.cloud_provider;
- private alive: boolean = false;
- private lastStatus: number | boolean = false;
- private readonly CHECK_ACCESS_KEY_TIMEOUT: number = 30000;
private readonly CHECK_ACTIVE_SCHEDULE_TIMEOUT: number = 55000;
private readonly CHECK_ACTIVE_SCHEDULE_PERIOD: number = 15;
@@ -74,7 +69,6 @@ export class NavbarComponent implements OnInit, OnDestroy {
this.applicationSecurityService.loggedInStatus.subscribe(response => {
this.subscriptions.unsubscribe();
this.subscriptions.closed = false;
- this.alive = false;
this.isLoggedIn = response;
@@ -83,9 +77,6 @@ export class NavbarComponent implements OnInit, OnDestroy {
this.healthStatus = result;
result.status && this.checkQuoteUsed(this.healthStatus);
}));
- this.subscriptions.add(this.userAccessKeyService.accessKeyEmitter.subscribe(result => {
- result && this.processAccessKeyStatus(result.status);
- }));
this.subscriptions.add(timer(0, this.CHECK_ACTIVE_SCHEDULE_TIMEOUT).subscribe(() => this.refreshSchedulerData()));
this.currentUserName = this.getUserName();
this.checkVersionData();
@@ -95,7 +86,6 @@ export class NavbarComponent implements OnInit, OnDestroy {
ngOnDestroy(): void {
this.subscriptions.unsubscribe();
- this.alive = false;
}
getUserName(): string {
@@ -138,10 +128,6 @@ export class NavbarComponent implements OnInit, OnDestroy {
});
}
- public checkCreationProgress($event): void {
- this.userAccessKeyService.initialUserAccessKeyCheck();
- }
-
private checkQuoteUsed(params): void {
if (!this.storage.getBillingQuoteUsed() && params) {
let checkQuotaAlert = '';
@@ -156,35 +142,6 @@ export class NavbarComponent implements OnInit, OnDestroy {
}
}
- private processAccessKeyStatus(status: number): void {
- if (status === HTTP_STATUS_CODES.NOT_FOUND || status === HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR) {
- !this.dialog.openDialogs.length && this.dialog.closeAll();
-
- // this.keyUploadDialog.open({ isFooter: false });
- this.alive = false;
- this.lastStatus = status;
- } else if (status === HTTP_STATUS_CODES.ACCEPTED) {
- !this.dialog.openDialogs.length && this.dialog.open(ProgressDialogComponent, {panelClass: 'modal-xs'});
-
- if (!this.alive) {
- this.alive = true;
- this.subscriptions.add(
- interval(this.CHECK_ACCESS_KEY_TIMEOUT)
- .pipe(takeWhile(() => this.alive))
- .subscribe(() => this.userAccessKeyService.initialUserAccessKeyCheck()));
- }
- this.lastStatus = status;
- } else if (status === HTTP_STATUS_CODES.OK) {
- if (this.lastStatus) {
- this.userAccessKeyService.emitActionOnKeyUploadComplete();
- this.lastStatus = false;
- }
- this.alive = false;
- this.dialog.closeAll();
- // this.keyUploadDialog.close();
- }
- }
-
private refreshSchedulerData(): void {
this.schedulerService.getActiveSchcedulersData(this.CHECK_ACTIVE_SCHEDULE_PERIOD).subscribe((list: Array<any>) => {
if (list.length) {
diff --git a/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss b/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss
index 301f6ae..61d3ab5 100644
--- a/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss
+++ b/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss
@@ -512,4 +512,13 @@ mat-tab-group.mat-tab-group {
}
mat-divider.mat-divider {
margin: 10px 0;
+}
+
+mat-progress-bar {
+ .mat-progress-bar-fill::after {
+ background-color: #00BCD4;
+ }
+ .mat-progress-bar-buffer {
+ background-color: #baf0f7;
+ }
}
\ No newline at end of file
diff --git a/services/self-service/src/main/resources/webapp/src/styles.scss b/services/self-service/src/main/resources/webapp/src/styles.scss
index 1136d98..c765793 100644
--- a/services/self-service/src/main/resources/webapp/src/styles.scss
+++ b/services/self-service/src/main/resources/webapp/src/styles.scss
@@ -126,8 +126,6 @@ mat-chip.mat-chip strong {
.error {
color: #f1696e;
font-size: 12px;
- font-family: 'Open Sans', sans-serif;
- font-weight: 300;
}
.not-allowed {
cursor: not-allowed !important;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org