diff --git a/src/portal/lib/src/config/gc/gc-history/gc-history.component.html b/src/portal/lib/src/config/gc/gc-history/gc-history.component.html index d71057e4d..b62b778f6 100644 --- a/src/portal/lib/src/config/gc/gc-history/gc-history.component.html +++ b/src/portal/lib/src/config/gc/gc-history/gc-history.component.html @@ -1,5 +1,5 @@
{{'GC.JOB_HISTORY' | translate}}
- + {{'GC.JOB_ID' | translate}} {{'GC.TRIGGER_TYPE' | translate}} {{'STATUS' | translate}} diff --git a/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts b/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts index 29df7c888..29e6ae4ef 100644 --- a/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts +++ b/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { GcRepoService } from "../gc.service"; import { GcJobViewModel } from "../gcLog"; import { GcViewModelFactory } from "../gc.viewmodel.factory"; +import { ErrorHandler } from "../../../error-handler/index"; @Component({ selector: 'gc-history', @@ -10,18 +11,25 @@ import { GcViewModelFactory } from "../gc.viewmodel.factory"; }) export class GcHistoryComponent implements OnInit { jobs: Array = []; + loading: boolean; constructor( private gcRepoService: GcRepoService, private gcViewModelFactory: GcViewModelFactory, - ) { } + private errorHandler: ErrorHandler + ) {} ngOnInit() { this.getJobs(); } getJobs() { + this.loading = true; this.gcRepoService.getJobs().subscribe(jobs => { this.jobs = this.gcViewModelFactory.createJobViewModel(jobs); + this.loading = false; + }, error => { + this.errorHandler.error(error); + this.loading = false; }); } diff --git a/src/portal/lib/src/config/gc/gc.component.ts b/src/portal/lib/src/config/gc/gc.component.ts index 925fa1900..c0e7a27e4 100644 --- a/src/portal/lib/src/config/gc/gc.component.ts +++ b/src/portal/lib/src/config/gc/gc.component.ts @@ -31,6 +31,7 @@ export class GcComponent implements OnInit { disableGC: boolean = false; getText = 'CONFIG.GC'; getLabelCurrent = 'GC.CURRENT_SCHEDULE'; + @Output() loadingGcStatus = new EventEmitter(); @ViewChild(CronScheduleComponent) CronScheduleComponent: CronScheduleComponent; constructor( @@ -48,8 +49,10 @@ export class GcComponent implements OnInit { } getCurrentSchedule() { + this.loadingGcStatus.emit(true); this.gcRepoService.getSchedule().subscribe(schedule => { this.initSchedule(schedule); + this.loadingGcStatus.emit(false); }); } diff --git a/src/portal/lib/src/config/vulnerability/vulnerability-config.component.ts b/src/portal/lib/src/config/vulnerability/vulnerability-config.component.ts index 8bb26ac98..cc6b7db00 100644 --- a/src/portal/lib/src/config/vulnerability/vulnerability-config.component.ts +++ b/src/portal/lib/src/config/vulnerability/vulnerability-config.component.ts @@ -25,6 +25,7 @@ const SCHEDULE_TYPE_NONE = "None"; styleUrls: ['./vulnerability-config.component.scss', '../registry-config.component.scss'] }) export class VulnerabilityConfigComponent implements OnInit { + onGoing: boolean; _localTime: Date = new Date(); originCron: OriginCron; schedule: any; @@ -40,6 +41,7 @@ export class VulnerabilityConfigComponent implements OnInit { @Input() showSubTitle: boolean = false; @Input() showScanningNamespaces: boolean = false; + @Output() loadingStatus = new EventEmitter(); systemInfo: SystemInfo; constructor( @@ -83,8 +85,11 @@ export class VulnerabilityConfigComponent implements OnInit { } getSchedule() { + this.onGoing = true; this.scanningService.getSchedule().subscribe(schedule => { this.initSchedule(schedule); + this.onGoing = false; + this.loadingStatus.emit(this.onGoing); }); } diff --git a/src/portal/src/app/gc-page/gc-page.component.html b/src/portal/src/app/gc-page/gc-page.component.html index 85dd3f092..7641e9cb6 100644 --- a/src/portal/src/app/gc-page/gc-page.component.html +++ b/src/portal/src/app/gc-page/gc-page.component.html @@ -1,12 +1,13 @@

{{'CONFIG.GC' | translate }}

+ - + diff --git a/src/portal/src/app/gc-page/gc-page.component.ts b/src/portal/src/app/gc-page/gc-page.component.ts index 11d69c7b0..f6a58b1d3 100644 --- a/src/portal/src/app/gc-page/gc-page.component.ts +++ b/src/portal/src/app/gc-page/gc-page.component.ts @@ -7,6 +7,7 @@ import { SessionService } from "../shared/session.service"; styleUrls: ["./gc-page.component.scss"] }) export class GcPageComponent implements OnInit { + inProgress: boolean; constructor(private session: SessionService) {} ngOnInit() {} @@ -16,4 +17,8 @@ export class GcPageComponent implements OnInit { this.session.getCurrentUser().has_admin_role ); } + + getGcStatus(status: boolean) { + this.inProgress = status; + } } diff --git a/src/portal/src/app/vulnerability-page/vulnerability-page.component.html b/src/portal/src/app/vulnerability-page/vulnerability-page.component.html index 9318b9dd4..826a3d0ea 100644 --- a/src/portal/src/app/vulnerability-page/vulnerability-page.component.html +++ b/src/portal/src/app/vulnerability-page/vulnerability-page.component.html @@ -1,14 +1,13 @@

{{'VULNERABILITY.SINGULAR' | translate }}

+ - + - - - + + -
diff --git a/src/portal/src/app/vulnerability-page/vulnerability-page.component.ts b/src/portal/src/app/vulnerability-page/vulnerability-page.component.ts index 618ed513f..a822469eb 100644 --- a/src/portal/src/app/vulnerability-page/vulnerability-page.component.ts +++ b/src/portal/src/app/vulnerability-page/vulnerability-page.component.ts @@ -7,11 +7,12 @@ import { AppConfigService } from "../app-config.service"; styleUrls: ["./vulnerability-page.component.scss"] }) export class VulnerabilityPageComponent implements OnInit { + inProgress: boolean = true; constructor(private appConfigService: AppConfigService) {} ngOnInit() {} - public get withClair(): boolean { - return this.appConfigService.getConfig().with_clair; + getStatus(status: boolean) { + this.inProgress = false; } }