+import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
+import { AlertModule } from 'ngx-bootstrap';
import { DataTableModule } from './datatable/datatable.module';
+import { ViewCacheComponent } from './view-cache/view-cache.component';
+
@NgModule({
imports: [
- DataTableModule
+ CommonModule,
+ DataTableModule,
+ AlertModule.forRoot()
],
- declarations: [],
+ declarations: [ViewCacheComponent],
providers: [],
exports: [
- DataTableModule
+ DataTableModule,
+ ViewCacheComponent
]
})
-export class ComponentsModule {}
+export class ComponentsModule { }
--- /dev/null
+<alert type="info"
+ *ngIf="status === vcs.ValueNone">
+ Retrieving data, please wait.
+</alert>
+
+<alert type="warning"
+ *ngIf="status === vcs.ValueStale">
+ Displaying previously cached data.
+</alert>
+
+<alert type="danger"
+ *ngIf="status === vcs.ValueException">
+ Could not load data. Please check the cluster health.
+</alert>
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AlertModule } from 'ngx-bootstrap';
+
+import { ViewCacheComponent } from './view-cache.component';
+
+describe('ViewCacheComponent', () => {
+ let component: ViewCacheComponent;
+ let fixture: ComponentFixture<ViewCacheComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ViewCacheComponent ],
+ imports: [AlertModule.forRoot()]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ViewCacheComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component, Input, OnInit } from '@angular/core';
+
+import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum';
+
+@Component({
+ selector: 'cd-view-cache',
+ templateUrl: './view-cache.component.html',
+ styleUrls: ['./view-cache.component.scss']
+})
+export class ViewCacheComponent implements OnInit {
+ @Input() status: ViewCacheStatus;
+ vcs = ViewCacheStatus;
+
+ constructor() {}
+
+ ngOnInit() {}
+}
PipesModule,
ComponentsModule,
ServicesModule,
- PasswordButtonDirective
+ PasswordButtonDirective,
+ ComponentsModule
],
declarations: [
PasswordButtonDirective