From 85ef2c5c9325797279cdcaf5cc7e58b0eacfcaaa Mon Sep 17 00:00:00 2001 From: Srinivasan Date: Fri, 12 Feb 2021 21:21:33 +0530 Subject: [PATCH] backuprestore image part baseurl added Signed-off-by: Srinivasan Change-Id: I60cc613f0bd5897171144bbff44c55d48ac749c7 --- example-apps/ROBO/RoboUI/package.json | 1 + .../ROBO/RoboUI/src/app/app-routing.module.ts | 6 + .../ROBO/RoboUI/src/app/app.component.html | 11 +- example-apps/ROBO/RoboUI/src/app/app.module.ts | 4 +- .../app/backuprestore/backuprestore.component.html | 252 +++++++++++++++++++++ .../app/backuprestore/backuprestore.component.scss | 43 ++++ .../backuprestore/backuprestore.component.spec.ts | 25 ++ .../app/backuprestore/backuprestore.component.ts | 180 +++++++++++++++ .../src/app/data-fetch/data-fetch.component.ts | 4 +- .../app/data-monitor/data-monitor.component.html | 47 ++++ .../app/data-monitor/data-monitor.component.scss | 26 +++ .../data-monitor/data-monitor.component.spec.ts | 25 ++ .../src/app/data-monitor/data-monitor.component.ts | 73 ++++++ example-apps/ROBO/RoboUI/src/app/datainterface.ts | 74 +++++- example-apps/ROBO/RoboUI/src/app/robo.service.ts | 55 ++++- .../ROBO/RoboUI/src/assets/data/appspvc.json | 53 +++++ .../ROBO/RoboUI/src/assets/data/backuprestore.json | 50 ++++ example-apps/ROBO/RoboUI/src/proxy.conf.json | 7 + 18 files changed, 911 insertions(+), 25 deletions(-) create mode 100644 example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.html create mode 100644 example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.scss create mode 100644 example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.spec.ts create mode 100644 example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.ts create mode 100644 example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.html create mode 100644 example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.scss create mode 100644 example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.spec.ts create mode 100644 example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.ts create mode 100644 example-apps/ROBO/RoboUI/src/assets/data/appspvc.json create mode 100644 example-apps/ROBO/RoboUI/src/assets/data/backuprestore.json create mode 100644 example-apps/ROBO/RoboUI/src/proxy.conf.json diff --git a/example-apps/ROBO/RoboUI/package.json b/example-apps/ROBO/RoboUI/package.json index 76e7792..393dd73 100644 --- a/example-apps/ROBO/RoboUI/package.json +++ b/example-apps/ROBO/RoboUI/package.json @@ -23,6 +23,7 @@ "@angular/router": "~11.0.5", "@ng-bootstrap/ng-bootstrap": "^8.0.0", "bootstrap": "^4.5.3", + "image-to-base64": "^2.1.1", "ngx-toastr": "^13.2.0", "rxjs": "~6.6.3", "tslib": "^2.0.0", diff --git a/example-apps/ROBO/RoboUI/src/app/app-routing.module.ts b/example-apps/ROBO/RoboUI/src/app/app-routing.module.ts index 10c02b8..67db521 100644 --- a/example-apps/ROBO/RoboUI/src/app/app-routing.module.ts +++ b/example-apps/ROBO/RoboUI/src/app/app-routing.module.ts @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { DataFetchComponent } from './data-fetch/data-fetch.component'; import { DataMonitorComponent } from './data-monitor/data-monitor.component'; +import { BackuprestoreComponent } from './backuprestore/backuprestore.component'; const routes: Routes = [ { @@ -12,6 +13,11 @@ const routes: Routes = [ path: 'datamonitor', component: DataMonitorComponent }, + + { + path: 'backuprestore', + component: BackuprestoreComponent + } // { // path: '**', // redirectTo: '' diff --git a/example-apps/ROBO/RoboUI/src/app/app.component.html b/example-apps/ROBO/RoboUI/src/app/app.component.html index 3a30c9f..cb728e6 100644 --- a/example-apps/ROBO/RoboUI/src/app/app.component.html +++ b/example-apps/ROBO/RoboUI/src/app/app.component.html @@ -8,27 +8,20 @@
Data Upload Data Monitor - + Backup and Restore
- - - - Data Upload Data Monitor - + Backup and Restore
-
diff --git a/example-apps/ROBO/RoboUI/src/app/app.module.ts b/example-apps/ROBO/RoboUI/src/app/app.module.ts index b6e1531..d7c1bfd 100644 --- a/example-apps/ROBO/RoboUI/src/app/app.module.ts +++ b/example-apps/ROBO/RoboUI/src/app/app.module.ts @@ -45,12 +45,14 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ToastrModule } from 'ngx-toastr'; import { DataMonitorComponent } from './data-monitor/data-monitor.component'; +import { BackuprestoreComponent } from './backuprestore/backuprestore.component'; @NgModule({ declarations: [ AppComponent, DataFetchComponent, - DataMonitorComponent + DataMonitorComponent, + BackuprestoreComponent ], imports: [ BrowserModule, diff --git a/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.html b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.html new file mode 100644 index 0000000..09b62c3 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.html @@ -0,0 +1,252 @@ +
+
+ +
+
+ + + + Apps +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAMESPACE {{apps.namespace}} NAME {{apps.name}} READY {{apps.ready}} STATUS {{apps.status}} RESTARTS {{apps.restarts}} AGE {{apps.age}} IP {{apps.ip}} NODE {{apps.node}} NOMINATED NODE {{apps.nominatednode}} READINESS GATES {{apps.readinessgates}}
+ + + +
+
+ + PVs and PVCs +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAMESPACE {{pvs.namespace}} NAME {{pvs.name}} STATUS {{pvs.status}} VOLUME {{pvs.volume}} CAPACITY {{pvs.capacity}} ACCESS MODES {{pvs.accessmodes}} STORAGE CLASS {{pvs.storageclass}} AGE {{pvs.age}} VOLUME NODE {{pvs.volumemode}} READINESS GATES {{pvs.readinessgates}}
+ + + +
+
+ +
+
+ + Backups +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NAME {{backups.name}} STATUS {{backups.status}} ERRORS {{backups.errors}} WARNINGS {{backups.warnings}} CREATED {{backups.created}}
+ + + +
+
+ +
+ Backup Name + + Backup Name + + +
+
+ Namespace.. + + Namespace + + + + +
+
+ +
+
+ +
+ + Restores +
+ + + + + + + + + + + + + + + + + + + + +
NAME {{restores.name}} BACKUP {{restores.backup}} STATUS {{restores.status}}
+ + + +
+
+ Restore Name + + Restore Name + + +
+
+ Backup Name + + Backup Name + + +
+
+ +
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.scss b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.scss new file mode 100644 index 0000000..b4e714f --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.scss @@ -0,0 +1,43 @@ +.main { + .center{ + padding-top: 20px; + display: flex; + justify-content: center; + align-items: center; + } + .tabs{ + padding-top: 10px; + .appstable { + + } + .pvstable { + + } + .center{ + padding-top: 20px; + display: flex; + justify-content: center; + align-items: center; + } + .backup-det { + .center{ + padding-top: 20px; + display: flex; + justify-content: center; + align-items: center; + } + } + .restore-det { + .center{ + padding-top: 20px; + display: flex; + justify-content: center; + align-items: center; + } + } + } +} + +table{ + width: 100%; +} \ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.spec.ts b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.spec.ts new file mode 100644 index 0000000..0164415 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BackuprestoreComponent } from './backuprestore.component'; + +describe('BackuprestoreComponent', () => { + let component: BackuprestoreComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BackuprestoreComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BackuprestoreComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.ts b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.ts new file mode 100644 index 0000000..b5631f3 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/backuprestore/backuprestore.component.ts @@ -0,0 +1,180 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; + +import {MatTableDataSource} from '@angular/material/table'; +import { MatPaginator } from '@angular/material/paginator'; +import { RoboService } from './../../app/robo.service'; + +import { appsinfo,pvpvsinfo,backupsinfo,restoresinfo,backupData,restoreData } from './../../app/datainterface' + +import { ToastrService } from 'ngx-toastr'; + +@Component({ + selector: 'app-backuprestore', + templateUrl: './backuprestore.component.html', + styleUrls: ['./backuprestore.component.scss'] +}) +export class BackuprestoreComponent implements OnInit { + + appsColumns: string [] = ['namespace','name','ready','status','restarts','age','ip','node','nominatednode','readinessgates'] + appsDataSource = new MatTableDataSource(APPS_INFO_LIST); + + appsArrayList = []; + + pvsColumns: string [] = ['namespace','name','status','volume','capacity','accessmodes','storageclass','age','volumemode'] + pvsDataSource = new MatTableDataSource(PVS_INFO_LIST); + + pvsArrayList = []; + + backupsColumns: string [] = ['name','status','errors','warnings','created'] + backupsDataSource = new MatTableDataSource(BACKUPS_INFO_LIST); + + backupsArrayList = []; + + restoresColumns: string [] = ['name','backup','status'] + restoresDataSource = new MatTableDataSource(RESTORES_INFO_LIST); + + restoresArrayList = []; + + selectedNamespace : string + selectedBackupName : string + + selectedRestoreName: string + selectedBackupname : string + + appsinfo = {} + + backupData = {} as backupData + + restoreData = {} as restoreData + + @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator; + + constructor( + private roboService: RoboService, + private toastService: ToastrService + ) {} + + ngOnInit(): void { + this.selectedBackupName = "backup01" + this.selectedRestoreName = "restore01" + this.selectedNamespace = "default" + this.selectedBackupname = "backup01" + + this.getAppsPvcs(); + + this.getBackupsRestores(); + } + + getAppsPvcs() { + this.roboService.getAppsPvcsInfo() + .subscribe(data => { + debugger; + console.log(data); + this.appsinfo = data; + this.appsArrayList = data.appsData; + this.appsDataSource = new MatTableDataSource(this.appsArrayList); + this.appsDataSource.paginator = this.paginator; + + this.pvsArrayList = data.pvcData; + this.pvsDataSource = new MatTableDataSource(this.pvsArrayList); + this.pvsDataSource.paginator = this.paginator; + }, + error => console.log(error)); + } + + getBackupsRestores() { + this.roboService.getBackupRestoreInfo() + .subscribe(data => { + debugger; + console.log(data); + this.appsinfo = data; + this.backupsArrayList = data.backupsData; + this.backupsDataSource = new MatTableDataSource(this.backupsArrayList); + this.backupsDataSource.paginator = this.paginator; + + this.restoresArrayList = data.restoresData; + this.restoresDataSource = new MatTableDataSource(this.restoresArrayList); + this.restoresDataSource.paginator = this.paginator; + }, + error => console.log(error)); + } + + refreshPage() { + debugger; + this.getBackupsRestores(); + this.getAppsPvcs(); + } + + postBackup() { + console.log("Inside postBackup.....") + this.backupData.backupName = this.selectedBackupName; + this.backupData.namespace = this.selectedNamespace; + this.showBackupSuccess() + this.roboService.postBackup(this.backupData) + .subscribe(data => { + debugger; + if(data.responce == "success"){ + this.showBackupSuccess(); + } + console.log(data); + } + ,error => console.log(error) + ); + } + + restore() { + console.log("Inside postBackup.....") + + this.restoreData.restoreName = this.selectedRestoreName; + this.restoreData.backupName = this.selectedBackupname; + this.showRestoreSuccess() + this.roboService.postRestore(this.restoreData) + .subscribe(data => { + debugger; + if(data.responce == "success"){ + this.showRestoreSuccess(); + } + console.log(data); + } + ,error => console.log(error) + ); + } + + showBackupSuccess() { + this.toastService.success('Backup Successful..','Backup Data'); + } + + showRestoreSuccess() { + this.toastService.success('Restore Successful..','Restore Data'); + } + + simulateDisaster() { + console.log("Inside simulateDisaster....") + this.roboService.disturbCluster() + .subscribe(data => { + debugger; + console.log(data); + }, + error => console.log(error)); + } + +} + +const APPS_INFO_LIST: appsinfo[] = [ + { namespace: '',name: '', ready: '', status: '', restarts: '', age: '', ip: '', node: '', nominatednode: '', readinessgates: '' } +]; + +const PVS_INFO_LIST: pvpvsinfo[] = [ + { namespace: '',name: '', status: '', volume: '', capacity: '', accessmodes: '', storageclass: '', age: '', volumemode: '' } +]; + +const BACKUPS_INFO_LIST: backupsinfo[] = [ + { name: '', status: '', errors: '', warnings: '', created: ''} +]; + +const RESTORES_INFO_LIST: restoresinfo[] = [ + { name: '', backup: '', status: ''} +]; + + +// "zone.js": "~0.10.2" \ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/app/data-fetch/data-fetch.component.ts b/example-apps/ROBO/RoboUI/src/app/data-fetch/data-fetch.component.ts index a4cb262..205dbb7 100644 --- a/example-apps/ROBO/RoboUI/src/app/data-fetch/data-fetch.component.ts +++ b/example-apps/ROBO/RoboUI/src/app/data-fetch/data-fetch.component.ts @@ -25,8 +25,8 @@ export class DataFetchComponent implements OnInit { cameraColumns: string [] = ['cameraID','cameraLocation','cameraNumber','rtspUrl']; cameraDataSource = new MatTableDataSource(CAMERA_INFO_LIST); - SERVER_URL = "http://localhost:9996/v1/monitor/video"; - videoUploadForm: FormGroup; + SERVER_URL = "http://localhost:30092/v1/monitor/video"; + videoUploadForm: FormGroup; cameraDetailsForm: FormGroup; cameraData = {} as cameraData; diff --git a/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.html b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.html new file mode 100644 index 0000000..9ac8d51 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.html @@ -0,0 +1,47 @@ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Shelf Name {{monitor.shelfName}} Object Type {{monitor.ObjType}} Current Count {{monitor.currentCount}} Total Count {{monitor.totalCount}} Time {{monitor.time}}
+ + + +
+
+
+ + + + +
+ +
\ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.scss b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.scss new file mode 100644 index 0000000..cf16078 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.scss @@ -0,0 +1,26 @@ + +.maindiv{ + + position: center; + position: relative; + padding-top: 20px; + + .tablepage { + + position: relative; + .filter { + width: 70%; + padding-left: 20px; + } + .monitortable { + table { + width: 100%; + } + } + + } + + .image-card { + padding: 20px; + } +} \ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.spec.ts b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.spec.ts new file mode 100644 index 0000000..71389ff --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DataMonitorComponent } from './data-monitor.component'; + +describe('DataMonitorComponent', () => { + let component: DataMonitorComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DataMonitorComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DataMonitorComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.ts b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.ts new file mode 100644 index 0000000..5c503b5 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/app/data-monitor/data-monitor.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; + +import {MatTableDataSource} from '@angular/material/table'; + +import { MatPaginator } from '@angular/material/paginator'; + +import { cameraData,monitorinfo, monitorDetails } from './../datainterface' +import { RoboService } from './../../app/robo.service'; + +import { DomSanitizer, SafeUrl } from "@angular/platform-browser"; + + +@Component({ + selector: 'app-data-monitor', + templateUrl: './data-monitor.component.html', + styleUrls: ['./data-monitor.component.scss'] +}) +export class DataMonitorComponent implements OnInit { + + monitorColumns: string [] = ['shelfName','objType','currentCount','totalCount','time']; + monitorDataSource = new MatTableDataSource(MONITOR_INFO_LIST); + + monitorArrayList = []; + + imageBlobUrl : any; + image: any; + thumbnail: any; + + monitorInfo = {} as monitorDetails; + + @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator; + + constructor( + private roboService: RoboService, + private sanitizer: DomSanitizer + ) { } + + ngOnInit(): void { + this.monitorDetails(); + this.inventoryDetails(); + } + + monitorDetails() { + debugger; + this.roboService.getMonitorImage() + .subscribe( (data:any) => { + debugger; + console.log(data); + + let objectURL = 'data:image/jpeg;base64,' + data.image; + this.thumbnail = this.sanitizer.bypassSecurityTrustUrl(objectURL); + + }, + error => console.log(error)); + } + + inventoryDetails() { + this.roboService.getMonitorInfo() + .subscribe(data => { + console.log(data); + this.monitorInfo = data; + this.monitorArrayList = data.InventryData; + this.monitorDataSource = new MatTableDataSource(this.monitorArrayList); + this.monitorDataSource.paginator = this.paginator; + }, + error => console.log(error)); + } + +} + +const MONITOR_INFO_LIST: monitorinfo[] = [ + { shelfName: '', ObjType: '', currentCount: '', totalCount: '', time: '' } +]; diff --git a/example-apps/ROBO/RoboUI/src/app/datainterface.ts b/example-apps/ROBO/RoboUI/src/app/datainterface.ts index f5d79b6..0688130 100644 --- a/example-apps/ROBO/RoboUI/src/app/datainterface.ts +++ b/example-apps/ROBO/RoboUI/src/app/datainterface.ts @@ -20,6 +20,10 @@ export interface monitorDetails { InventryData: monitorinfo[]; } +export interface monitorImage { + image: Blob; +} + export interface monitorinfo { shelfName: string; @@ -32,4 +36,72 @@ export interface monitorinfo { export interface cameraID { cameraID: string; -} \ No newline at end of file +} + + +export interface appsinfo { + namespace: string; + name: string; + ready: string; + status: string; + restarts: string; + age: string; + ip: string; + node: string; + nominatednode: string; + readinessgates: string; +} + +export interface appsPvcs { + appsData: appsinfo[]; + pvcData: pvpvsinfo[]; +} + +export interface pvpvsinfo { + namespace: string; + name: string; + status: string; + volume: string; + capacity: string; + accessmodes: string; + storageclass: string; + age: string; + volumemode: string; +} + +export interface backupRestore { + backupsData: backupsinfo[]; + restoresData: restoresinfo[]; +} + +export interface backupsinfo { + name: string; + status: string; + errors: string; + warnings: string; + created: string; +} + +// export interface backups { +// backupsData: backupsinfo[]; +// } + +export interface restoresinfo { + name: string; + backup: string; + status: string; +} + +export interface backupData { + backupName: string; + namespace: string; +} + +export interface restoreData { + restoreName: string; + backupName: string; +} + +// export interface restores { +// restoresData: restoresinfo[]; +// } \ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/app/robo.service.ts b/example-apps/ROBO/RoboUI/src/app/robo.service.ts index 6e7d713..53aaeb6 100644 --- a/example-apps/ROBO/RoboUI/src/app/robo.service.ts +++ b/example-apps/ROBO/RoboUI/src/app/robo.service.ts @@ -4,7 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/comm import { Observable,throwError } from 'rxjs' import { timer, Subscription, pipe } from 'rxjs'; -import { cameraData, camerainfo, cameraDetails, monitorDetails, monitorinfo, cameraID } from './datainterface' +import { cameraData, camerainfo, cameraDetails, monitorDetails, monitorinfo, cameraID, appsPvcs, backupRestore, monitorImage } from './datainterface' @Injectable({ @@ -12,18 +12,25 @@ import { cameraData, camerainfo, cameraDetails, monitorDetails, monitorinfo, cam }) export class RoboService { - private baseUrl = 'http://localhost:9996'; + private baseUrl = 'http://localhost:30091'; + private inventoryBaseUrl = 'http://localhost:30092'; - private postCameraDetailsUrl = this.baseUrl + '/v1/monitor/cameras' - private cameraDetailsUrl = this.baseUrl + '/v1/monitor/cameras' - private cameraDetails_url = './../assets/data/camera.json' + private postCameraDetailsUrl = this.inventoryBaseUrl + '/v1/monitor/cameras' + private cameraDetailsUrl = this.inventoryBaseUrl + '/v1/monitor/cameras' + private monitorDetailsUrl = this.inventoryBaseUrl + '/v1/inventry/table' + private monitorImageUrl = this.inventoryBaseUrl + '/v1/inventry/image' + private triggerObjUrl = this.inventoryBaseUrl + '/v1/monitor/cameras/' + private appsPvcsDetailsUrl = this.baseUrl + '/v1/robo/apps-pvcs' + private backupRestoreDetailsUrl = this.baseUrl + '/v1/robo/backup-restore' + private postBackupDetailsUrl = this.baseUrl + '/v1/robo/backup' + private postRestoreDetailsUrl = this.baseUrl + '/v1/robo/restore' + private disasterUrl = this.baseUrl + '/v1/robo/disaster' + private cameraDetails_url = './../assets/data/camera.json' + private backupRestoreDetails_url = './../assets/data/backuprestore.json' + private appsPvcsDetails_url = './../assets/data/appspvc.json' private monitorDetails_url = './../assets/data/inventory.json' - private monitorDetailsUrl = this.baseUrl + '/v1/inventry/table' - - private monitorImageUrl = this.baseUrl + '/v1/monitor/image' - private triggerObjUrl = this.baseUrl + '/v1/monitor/cameras/' constructor(private http:HttpClient) { } @@ -55,9 +62,9 @@ export class RoboService { return this.http.get(this.monitorDetailsUrl); } - getMonitorImage(): Observable { + getMonitorImage(): Observable { debugger; - return this.http.get(this.monitorImageUrl); + return this.http.get(this.monitorImageUrl); } @@ -67,4 +74,28 @@ export class RoboService { this.triggerObjUrl = this.triggerObjUrl + data; return this.http.get(this.triggerObjUrl) } -} + + getAppsPvcsInfo(): Observable { + return this.http.get(this.appsPvcsDetailsUrl); + } + + getBackupRestoreInfo(): Observable { + return this.http.get(this.backupRestoreDetailsUrl); + } + + disturbCluster(): Observable { + return this.http.get(this.disasterUrl); + } + + postBackup(data): Observable { + console.log(data); + debugger; + return this.http.post(this.postBackupDetailsUrl, data) + } + + postRestore(data): Observable { + console.log(data); + debugger; + return this.http.post(this.postRestoreDetailsUrl, data) + } +} \ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/assets/data/appspvc.json b/example-apps/ROBO/RoboUI/src/assets/data/appspvc.json new file mode 100644 index 0000000..ea58c93 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/assets/data/appspvc.json @@ -0,0 +1,53 @@ +{ + "appsData": [ + { + "namespace": "default01", + "name": "appname", + "ready": "ready", + "status": "running", + "restarts": "3 times", + "age": "3d", + "ip": "10.10.0.1", + "node": "ealtcenter", + "nominatednode": "ealtcenter", + "readinessgates": "passed" + }, + { + "namespace": "default02", + "name": "appname", + "ready": "ready", + "status": "running", + "restarts": "3 times", + "age": "3d", + "ip": "10.10.0.1", + "node": "ealtcenter", + "nominatednode": "ealtcenter", + "readinessgates": "passed" + } + ], + + "pvcData": [ + { + "namespace": "default", + "name": "pvcname01", + "status": "ready", + "volume": "samplevolume", + "capacity": "samplecapacity", + "accessmodes" : "sampleaccessmodes", + "storageclass" : "samplestorage", + "age" : "5d", + "volumemode" : "samplevolumemode" + }, + { + "namespace": "default", + "name": "pvcname02", + "status": "ready", + "volume": "samplevolume", + "capacity": "samplecapacity", + "accessmodes" : "sampleaccessmodes", + "storageclass" : "samplestorage", + "age" : "5d", + "volumemode" : "samplevolumemode" + } + ] +} \ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/assets/data/backuprestore.json b/example-apps/ROBO/RoboUI/src/assets/data/backuprestore.json new file mode 100644 index 0000000..f68d9c7 --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/assets/data/backuprestore.json @@ -0,0 +1,50 @@ +{ + "backupsData": [ + { + "name": "backupname01", + "status": "ready", + "errors": "sampleerrors", + "warnings": "warning", + "created": "created", + "expires": "expires", + "storage": "storage", + "location": "samplelocation", + "selector": "selector" + }, + { + "name": "backupname02", + "status": "ready", + "errors": "sampleerrors", + "warnings": "warning", + "created": "created", + "expires": "expires", + "storage": "storage", + "location": "samplelocation", + "selector": "selector" + } + ], + "restoresData": [ + { + "name": "backupname01", + "backup": "nback03", + "status": "ready", + "started": "starts", + "completed": "completed", + "errors": "err", + "warnings": "warn02", + "created": "createdsample", + "selector": "selector" + }, + { + "name": "backupname01", + "backup": "nback03", + "status": "ready", + "started": "starts", + "completed": "completed", + "errors": "err", + "warnings": "warn02", + "created": "createdsample", + "selector": "selector" + } + ] +} \ No newline at end of file diff --git a/example-apps/ROBO/RoboUI/src/proxy.conf.json b/example-apps/ROBO/RoboUI/src/proxy.conf.json new file mode 100644 index 0000000..386d42c --- /dev/null +++ b/example-apps/ROBO/RoboUI/src/proxy.conf.json @@ -0,0 +1,7 @@ +{ + "/v1/*": { + "target": "http://192.168.29.203:3000", + "secure": false, + "logLevel": "debug" + } +} \ No newline at end of file -- 2.16.6