diff options
73 files changed, 2986 insertions, 282 deletions
diff --git a/components/datalake-handler/admin/src/src/app/app-routing.module.ts b/components/datalake-handler/admin/src/src/app/app-routing.module.ts index 37436156..37ed0401 100644 --- a/components/datalake-handler/admin/src/src/app/app-routing.module.ts +++ b/components/datalake-handler/admin/src/src/app/app-routing.module.ts @@ -31,13 +31,18 @@ import { FeederComponent } from "./feeder/feeder.component"; import { TopicsComponent } from "./topics/topics.component"; import { DatabaseComponent } from "./database/database.component"; import { AboutComponent } from "./about/about.component"; +import { DashboardSettingComponent } from './dashboard-setting/dashboard-setting.component'; +import { DashboardListComponent } from './dashboard-setting/dashboard-list/dashboard-list.component'; +import { TemplateComponent } from './dashboard-setting/template/template.component'; const routes: Routes = [ { path: "", redirectTo: "/feeder", pathMatch: "full" }, { path: "feeder", component: FeederComponent }, { path: "topics", component: TopicsComponent }, { path: "database", component: DatabaseComponent }, - { path: "about", component: AboutComponent } + { path: "about", component: AboutComponent }, + { path: 'dashboard-setting/dashboard-list', component: DashboardListComponent}, + { path: 'dashboard-setting/template', component: TemplateComponent}, ]; @NgModule({ diff --git a/components/datalake-handler/admin/src/src/app/app.module.ts b/components/datalake-handler/admin/src/src/app/app.module.ts index 7249e1dd..575e9b78 100644 --- a/components/datalake-handler/admin/src/src/app/app.module.ts +++ b/components/datalake-handler/admin/src/src/app/app.module.ts @@ -61,6 +61,7 @@ import { DatabaseListComponent } from "./database/database-list/database-list.co import { NgxDatatableModule } from "@swimlane/ngx-datatable"; import { CouchbaseComponent } from "./database/database-list/dbs-modal/couchbase/couchbase.component"; import { MongodbComponent } from "./database/database-list/dbs-modal/mongodb/mongodb.component"; +import { HdfsComponent } from "./database/database-list/dbs-modal/hdfs/hdfs.component"; import { DatabaseAddModalComponent } from "./database/database-list/database-add-modal/database-add-modal.component"; import { ElasticsearchComponent } from "./database/database-list/dbs-modal/elasticsearch/elasticsearch.component"; import { DruidComponent } from "./database/database-list/dbs-modal/druid/druid.component"; @@ -74,6 +75,13 @@ import { AboutComponent } from "./about/about.component"; // Loading spinner import { NgxSpinnerModule } from "ngx-spinner"; +import { DashboardSettingComponent } from './dashboard-setting/dashboard-setting.component'; +import { DashboardListComponent } from './dashboard-setting/dashboard-list/dashboard-list.component'; +import { TemplateComponent } from './dashboard-setting/template/template.component'; +import { CreateDashboardComponent } from './dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component'; +import { TemplateListComponent } from './dashboard-setting/template/template-list/template-list.component'; +import { NewTemplateModalComponent } from './dashboard-setting/template/template-list/new-template-modal/new-template-modal.component'; +import { EditTemplateModalComponent } from './dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component'; @NgModule({ declarations: [ @@ -87,6 +95,7 @@ import { NgxSpinnerModule } from "ngx-spinner"; DatabaseListComponent, CouchbaseComponent, MongodbComponent, + HdfsComponent, DatabaseAddModalComponent, ElasticsearchComponent, DruidComponent, @@ -94,7 +103,15 @@ import { NgxSpinnerModule } from "ngx-spinner"; TopicConfigModalComponent, ToastrNotificationComponent, AlertComponent, - AboutComponent + AboutComponent, + DashboardSettingComponent, + DashboardListComponent, + CreateDashboardComponent, + TemplateComponent, + TemplateListComponent, + NewTemplateModalComponent, + EditTemplateModalComponent, + ], imports: [ BrowserModule, @@ -121,8 +138,12 @@ import { NgxSpinnerModule } from "ngx-spinner"; DruidComponent, ElasticsearchComponent, MongodbComponent, + HdfsComponent, TopicDetailModalComponent, - TopicConfigModalComponent + TopicConfigModalComponent, + CreateDashboardComponent, + NewTemplateModalComponent, + EditTemplateModalComponent ] }) export class AppModule {} diff --git a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html index 4819abb0..48d74721 100644 --- a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html +++ b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html @@ -18,12 +18,12 @@ limitations under the License. ============LICENSE_END========================================================= --> -<div class="p-1"> +<div class="p-1" [ngClass]="{'alert-delete-model':this.dashboardDeteleModelShow == true}"> <div class="modal-header border-0 p-2"> </div> - <div class="modal-body border-0 p-1"> + <div class="modal-body border-0 p-1 " [ngClass]="{'alert-delete-title':this.dashboardDeteleModelShow == true}"> <div class="container"> @@ -41,13 +41,13 @@ limitations under the License. </div> </div> - <div class="modal-footer border-0 p-1"> + <div class="modal-footer border-0 p-1 " [ngClass]="{'alert-delete-content':this.dashboardDeteleModelShow == true}"> <div class="container align-content-center"> <div class="row"> <div class="col-md-6 p-1"> <span> <button type="button" class="btn dl-btn-dark btn-block" (click)="this.passBack()"> - OK + {{"OK" | translate}} </button> </span> </div> @@ -55,7 +55,7 @@ limitations under the License. <span> <button type="button" ngbAutofocus class="btn dl-btn-light btn-block" (click)="activeModal.close('Close click')"> - Cancel + {{"Cancel" | translate}} </button> </span> </div> diff --git a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts index e4b4699f..6514ae80 100644 --- a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts +++ b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.ts @@ -35,11 +35,13 @@ import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; }) export class AlertComponent { @Input() message: string; + @Input() dashboardDeteleModelShow; @Output() passEntry: EventEmitter<any> = new EventEmitter(); constructor(public activeModal: NgbActiveModal) {} passBack() { + console.log(this.dashboardDeteleModelShow,"dashboardDeteleModelShow"); this.passEntry.emit(true); } } diff --git a/components/datalake-handler/admin/src/src/app/core/models/dashboard.model.ts b/components/datalake-handler/admin/src/src/app/core/models/dashboard.model.ts new file mode 100644 index 00000000..33998b28 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/core/models/dashboard.model.ts @@ -0,0 +1,24 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +export class Dashboard { + name: string; + host: string; + port: number; + login: string; + pass: string; + enabled: boolean; +} diff --git a/components/datalake-handler/admin/src/src/app/core/models/template.model.ts b/components/datalake-handler/admin/src/src/app/core/models/template.model.ts new file mode 100644 index 00000000..5df69721 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/core/models/template.model.ts @@ -0,0 +1,51 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +// export class TemplateList { +// id:number; +// name:string; +// submitted:true; +// body: string; +// note:string; +// portalDesignConfig:{ +// id:number; +// name:string; +// submitted:true; +// body: string; +// note:string; +// topic: string; +// designType: string; +// } +// +// } + +export class Template { + id:number; + name:string; + submitted:true; + body: string; + note:string; + topic: string; + designType: string; + } + +export class newTemplate { + name:string; + submitted:true; + body: string; + note:string; + topic: string; + designType: string; +} diff --git a/components/datalake-handler/admin/src/src/app/core/services/dashboard-api.service.spec.ts b/components/datalake-handler/admin/src/src/app/core/services/dashboard-api.service.spec.ts new file mode 100644 index 00000000..ee5bd913 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/core/services/dashboard-api.service.spec.ts @@ -0,0 +1,27 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { TestBed } from '@angular/core/testing'; + +import { DashboardApiService } from './dashboard-api.service'; + +describe('DashboardApiService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: DashboardApiService = TestBed.get(DashboardApiService); + expect(service).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/core/services/dashboard-api.service.ts b/components/datalake-handler/admin/src/src/app/core/services/dashboard-api.service.ts new file mode 100644 index 00000000..d20f71ac --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/core/services/dashboard-api.service.ts @@ -0,0 +1,186 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import {Injectable} from "@angular/core"; +import {HttpClient, HttpHeaders} from "@angular/common/http"; +import {Observable, of} from "rxjs"; +import {map, catchError, tap, retry} from "rxjs/operators"; +import {throwError} from "rxjs"; + +import {Template,newTemplate} from "src/app/core/models/template.model"; +import { Dashboard } from "src/app/core/models/dashboard.model"; + +const prefix = "/datalake/v1/"; + +@Injectable({ + providedIn: 'root' +}) +export class DashboardApiService { + + constructor(private http: HttpClient) { + } + + private extractData(res: Response) { + if (res.status < 200 || res.status >= 300) { + throw new Error("Bad response status: " + res.status); + } + let body = res; + return body || {}; + } + + private handleError(error) { + let errorMessage = ""; + if (error.error instanceof ErrorEvent) { + // Get client-side error + errorMessage = error.error.message; + } else { + // Get server-side error + errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`; + console.log(errorMessage); + } + return throwError(errorMessage); + } + + private extractData2(res: Response) { + console.log(res,"detele/deploy template"); + let body = res; + return body || {}; + } + + + /* + Dashboard +*/ + getDashboardList(): Observable<any> { + let url = prefix + "portals/true"; //onilne + return this.http.get(url).pipe( + retry(1), + map(this.extractData), + catchError(this.handleError) + ); + } + + addDashboard(d: Dashboard): Observable<any> { + console.log(d,"add dashboard body"); + let url = prefix + "portals"; //onilne + return this.http + .put<any>(url, d) + .pipe( + retry(1), + tap(_ => console.log(`add db name=${d.name}`)), + catchError(this.handleError) + ); + } + + upadteDashboard(d: Dashboard): Observable<any> { + console.log(d,"add dashboard body"); + let url = prefix + "portals";//onilne + return this.http + .put(url, d) + .pipe( + retry(1), + tap(_ => this.extractData), + catchError(this.handleError) + ); + } + + deleteDashboard(d: Dashboard): Observable<any> { + console.log(d,"add dashboard body"); + let url = prefix + "portals"; //onilne + return this.http + .put(url,d) + .pipe( + retry(1), + tap(_ => console.log(`deleted db name=${d.name}`)), + catchError(this.handleError) + ); + } + + getDashboardName(): Observable<any> { + let url = prefix + "portals/getNames/false"; //onilne + return this.http.get(url).pipe( + retry(1), + map(this.extractData), + catchError(this.handleError) + ); + } + + /* + Template + */ + getTemplateAll(): Observable<any> { + return this.http.get(prefix + "portalDesigns/").pipe( //onlin + retry(1), + map(this.extractData), + catchError(this.handleError) + ); + } + + createNewTemplate(t: newTemplate): Observable<any> { + console.log(t,"createNewTemplate"); + return this.http + .post(prefix + "portalDesigns", t) + .pipe( + retry(1), + tap(_ => this.extractData), + catchError(this.handleError) + ); + } + + updateNewTemplate(t: Template): Observable<any> { + let id = t.id; + console.log(id,t,"updateNewTemplate"); + return this.http + .put(prefix + "portalDesigns/"+id, t) + .pipe( + retry(1), + tap(_ => this.extractData), + catchError(this.handleError) + ); + } + + getTopicName(): Observable<any> { + return this.http.get(prefix + "topics").pipe( //onlin + retry(1), + map(this.extractData), + catchError(this.handleError) + ); + } + + getTemplateTypeName(): Observable<any> { + return this.http.get(prefix + "designTypes").pipe( //onlin + retry(1), + map(this.extractData), + catchError(this.handleError) + ); + } + + DeleteTemplate(id): Observable<any> { + return this.http.delete(prefix + "portalDesigns/" + id ).pipe( //online + retry(1), + map(this.extractData2), + catchError(this.handleError) + ); + } + deployTemplateKibana(id, body): Observable<any> { + body.submitted = true; + console.log(id,body,'this.deployTemplateKibana()'); + return this.http.post(prefix+"portalDesigns/" + id, body).pipe( //online + retry(1), + map(this.extractData2), + catchError(this.handleError) + ); + } +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css new file mode 100644 index 00000000..7af4051a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.css @@ -0,0 +1,18 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +input::-webkit-input-placeholder{ + color: #A8A9AC; +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html new file mode 100644 index 00000000..eb355d19 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.html @@ -0,0 +1,115 @@ +<!-- + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<div class="p-1"> + <div class="modal-header pb-0 border-0"> + <div class="container"> + <div class="row"> + <div class="col-md-12"> + <label class="dl-h3" *ngIf="this.tempDb.name==undefined">{{ "NewDashboard" | translate}}</label> + <label class="dl-h3" style="letter-spacing: 0" *ngIf="this.tempDb.name!=undefined">{{this.tempDb.name}} | {{tempDbNameTitle}}</label> + </div> + </div> + + <div class="row"> + <div class="col-md-12"> + <hr> + </div> + </div> + </div> + </div> + + <div class="modal-body border-0 ml-4 mr-4"> + <div class="container"> + + <div class="form-group"> + <div class="row"> + <div class="col-md-3"><label class="dl-emphasis1" for="inputBucket">{{ "DestinationType" | translate}}</label></div> + <div class="col-md-4"> + <select #t_dataDashboardName class="custom-select dl-input-text" id="inputBucket" *ngIf="this.tempDb.name ==undefined" > + <option *ngFor="let item of nameArr" [selected]="item==this.tempDb.name"> + {{ item }}</option> + </select> + <select #t_dataDashboardName class="custom-select dl-input-text select-disabled" *ngIf="this.tempDb.name !=undefined" disabled > + <option [selected]="this.tempDb.name==this.tempDb.name"> + {{ this.tempDb.name }}</option> + </select> + </div> + </div> + </div> + + <div class="form-group"> + <div class="row"> + <div class="col-md-3"><label class="dl-emphasis1" for="inputHost">{{ "HOST" | translate}}</label></div> + <div class="col-md-4"> + <input [(ngModel)]="this.tempDb.host" class="form-control dl-input-text" id="inputHost" type="text" + placeholder="{{ 'InputValue' | translate}}"> + </div> + </div> + </div> + + <div class="form-group"> + <div class="row"> + <div class="col-md-3"><label class="dl-emphasis1" for="inputPort">{{ "PORT" | translate}}</label></div> + <div class="col-md-3"> + <input [(ngModel)]="this.tempDb.port" class="form-control dl-input-text" id="inputPort" type="text" + placeholder="{{ 'InputValue' | translate}}" (input)="this.adminService.onKeyPressNumber($event)"> + </div> + </div> + </div> + + <div class="form-group"> + <div class="row"> + <div class="col-md-3"><label class="dl-emphasis1" + for="inputUserName">{{ "AUTHENTICATION" | translate}}</label></div> + <div class="col-sm-4"> + <input [(ngModel)]="this.tempDb.login" class="form-control dl-input-text" id="inputUserName" type="text" + placeholder="{{ 'Username' | translate}}"> + </div> + <div class="col-sm-4"> + <input [(ngModel)]="this.tempDb.pass" class="form-control dl-input-text" id="inputPass" type="password" + placeholder=" {{ 'Password' | translate}}"> + </div> + </div> + </div> + </div> + </div> + + + <div class="modal-footer border-0 pt-0 pb-2"> + <div class="container"> + <div class="row"> + <div class="col-md-6 p-0"> + + </div> + <div class="col-md-3 p-1"> + <span> + <button type="button" class="btn dl-btn-dark btn-block" (click)="this.passBack()"> + {{ "Save" | translate}} + </button> + </span> + </div> + <div class="col-md-3 p-1"> + <span> + <button type="button" class="btn dl-btn-light btn-block" (click)="activeModal.close('Close click')"> + {{ "Cancel" | translate}} + </button> + </span> + </div> + </div> + </div> + </div> +</div> diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts new file mode 100644 index 00000000..6fa809d5 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CreateDashboardComponent } from './create-dashboard.component'; + +describe('CreateDashboardComponent', () => { + let component: CreateDashboardComponent; + let fixture: ComponentFixture<CreateDashboardComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CreateDashboardComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CreateDashboardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts new file mode 100644 index 00000000..4a865f21 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/create-dashboard/create-dashboard.component.ts @@ -0,0 +1,77 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import {Component, OnInit, Input, Output, ViewChild, EventEmitter, ElementRef} from '@angular/core'; +import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Dashboard } from "src/app/core/models/dashboard.model"; +import { AdminService } from "src/app/core/services/admin.service"; +import { RestApiService } from "src/app/core/services/rest-api.service"; +@Component({ + selector: 'app-create-dashboard', + templateUrl: './create-dashboard.component.html', + styleUrls: ['./create-dashboard.component.css'] +}) +export class CreateDashboardComponent implements OnInit { + + constructor( + public activeModal: NgbActiveModal, + public adminService: AdminService, + public restApiService: RestApiService, + ) {} + + @Output() passEntry: EventEmitter<any> = new EventEmitter(); + @Input() dashboard: Dashboard; + @Input() nameArr; + tempDb: Dashboard; + + selectshow = false; + tempDbNameTitle = null; + + @ViewChild("t_dataDashboardName") t_dataDashboardName: ElementRef; + + ngOnInit() { + // cache for display + + console.log(this.dashboard); + this.tempDb = new Dashboard(); + if(this.dashboard.enabled==undefined){ + this.dashboard.enabled = true; + } + const feeds = { + name: this.dashboard.name, + host: this.dashboard.host, + port: this.dashboard.port, + login: this.dashboard.login, + pass: this.dashboard.pass, + enabled: this.dashboard.enabled, + }; + console.log(feeds); + this.tempDb = feeds; + this.tempDbNameTitle = this.dashboard.host + } + + + + passBack() { + if(this.tempDb.host == '' || this.tempDb.host == undefined){ + return false; + } + this.dashboard = this.tempDb; + this.dashboard.name = this.t_dataDashboardName.nativeElement.value; + console.log(this.dashboard,"this.dashboard output"); + this.passEntry.emit(this.dashboard); + } + +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.css new file mode 100644 index 00000000..5dab0c0c --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.css @@ -0,0 +1,64 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +.db-block { + min-width: 180px; + min-height: 180px; + padding: 10px; +} +.db-panel { + background: #FFFFFF; + box-shadow: 3px 3px 11px 0 #D2D3D5; + border-radius: 20px; + position: relative; + font-family: "Open Sans", sans-serif; + font-weight: 600; + font-size: 18px; + color: #313032; + text-align: center; + padding: 10px; +} +.db-dropdown { + background-color: #ffffff; +} + +.db-dropdown:hover { + background-color: #ffffff; +} + +.db-config-icon { + color: #5DBEBB; + background-color: #ffffff; +} + +.db-config-icon:hover { + background-color: #D2D3D5; +} + +.dropdown-item { + font-family: "Open Sans", sans-serif; + font-weight: 400; + font-size: 14px; +} +.dropdown-menu.action-btn{ + min-width: 2rem!important; + left: -70px!important; +} +.truecheck{ + color:#5DBEBB +} +.falsecheck{ + color:#BDBEC0 +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.html new file mode 100644 index 00000000..8205158e --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.html @@ -0,0 +1,242 @@ +<!-- + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<div class="row"> + <div class="col-md-12 path"> + {{"HOME" | translate}} > {{"ConfigDashboard" | translate}} > {{"SIDEBAR.DASHBOARDLIST" | translate}} + </div> +</div> + +<div class="d-flex flex-wrap"> + + <!-- Database list --> + <div *ngFor="let db of this.dbs;let thisIndex=index" class="col-sm-2 db-block"> + <div class="db-panel" style="height: 100%"> + <div class="d-flex flex-column align-content-center"> + <div class="ml-auto dropdown db-dropdown mr-2" data-boundary="window"> + <a class="badge badge-light db-dropdown" data-toggle="dropdown" style="cursor: pointer"> + <i class="fas fa-ellipsis-h fa-2x db-config-icon"></i> + </a> + <div class="dropdown-menu action-btn"> + <button class="dropdown-item" type="button" (click)="this.openDashboardModal(thisIndex)"> + {{ 'EDIT' | translate }} + </button> + <button class="dropdown-item" type="button" (click)="this.deleteDashboard(thisIndex)"> + {{ 'DELETE' | translate }} + </button> + </div> + </div> + + <div> + <div class="align-self-center" style="height: 130px;"> + <!-- Kibana --> + <div class="p-0" *ngIf="db.name == 'Kibana'"> + <span data-toggle="tooltip" title="Kibana"> + <svg version="1.1" id="kibana_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="45%" height="20%" viewBox="0 0 612 750" enable-background="new 0 0 612 792" xml:space="preserve"> +<image overflow="visible" width="85%" height="100%" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAACECAIAAADtMcm8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ +bWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp +bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6 +eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0 +NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJo +dHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlw +dGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAv +IiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RS +ZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpD +cmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNl +SUQ9InhtcC5paWQ6RTRFRTFCRTE4MUJCMTFFOUI2RTlCMEM4NDRDMkQwRDEiIHhtcE1NOkRvY3Vt +ZW50SUQ9InhtcC5kaWQ6RTRFRTFCRTI4MUJCMTFFOUI2RTlCMEM4NDRDMkQwRDEiPiA8eG1wTU06 +RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFNEVFMUJERjgxQkIxMUU5QjZF +OUIwQzg0NEMyRDBEMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFNEVFMUJFMDgxQkIxMUU5 +QjZFOUIwQzg0NEMyRDBEMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1w +bWV0YT4gPD94cGFja2V0IGVuZD0iciI/Plz7FhIAAAe9SURBVHja7JxfTFNXHMfL7f8W0KpjMhRQ +By3OBxMzHIvOPbrpsy4YtsQ9zBcX/+Bk6gZE3dwUlYJ7cQOJcy/iROeYOEVqAkwLmIBIMidTrDba +lraAFCkt+0EnqdDeP+25t7fn3m9Ic9velttPzjmf87v3tAkOh6O3t1cihl4MBoPs5s2be/fsE1nQ +SV7eOxWVFYQIgmbS09MPHzlMQEQWdJKUlHTih0qNRgPbIjLqyGSycuPxtLS0wF0RGXWKS4qXL18+ +dVdERpFNm/LXrfsw+BERGYUit+/YPu1BERm1IkVkjBUpImOsSBEZY0WKyBgrUkTGWJEiMsaKFJEx +VqSIjLEiRWSMFSkiY6xIERljRYrIGCtSRMZYkSIyxooUkTFWpIiMsSKFjiwCRQoaWWSKFC6yiBUp +UGTRKFKgyKJRpBCR5UenSMEhA0XuiE6RwkKGRJECQoZKkUJBhlCRQkGGUJGCQIZWkfgjQ65IzJGx +oUickbGkSGyRsadIbJGxp0g8kbGqSAyRsa1I3JBxoEiskHGjSHyQcaZIfJBxpkhMkHGpyOmt2+fz +ZS7KnIAHI+j4xEPj4+P+cd+4XzLm8w1Dnj8fHR3lmSLzCgt3xmxAcLsHrl69RrlfSkpKcnLyrFnJ +MOIq5AqA6HK5hoaGuD/iRYsyv/v+UCzHUGhTdPZ7NplpD+p0ugULFmi1Wq931G5zQAOVy+WsHm5i +UqKxwpiYmBhLZNG82DmZwLZUKtXrs1NTU2Hb8sgC/Z2Nwz127Cj3ikSJLDjA6O7dHviDbYVCsWzZ +W/PmznO6nM5+J6p/sf/A/hUrVsR+csPGm8JI19Fx++XQA8n0DA8/e2ZLSEiIR0VygSw4/04GNqBD +6bOzPZ5hm83O8yoyxsim8ngysLF48WJoeI8tlrGxMZqK5LiK5AuyqfRORq1W5+bmjng8DoeDvIoE +RXJcRfIOWSAej8dkMsFGbu7bGo3a8ugxf6pIniKbyq1bZrgFw6akvN738CEfqsj4qDHv3OlubGxU +qVUL0xfyTZHTW1k04mcDHNwuXZqzMndlDKtIilZGs2DiMi6X+9Lvl1avfu/GjRt8RMa3A9LpZvt8 +Y9D2rVbr5s2fbtiwYWZtKyJ7RZFajTa44UMVsWrV6tLSUv70Bn4hy8zIHPVOPzfn9/tPn/4ZwLW3 +t4vIXonBoB8YdId79unTpxs3flRYWBjz5sYXZNnZ2eRlQCB1dRfy8t69/899oSNLS3vD6eynOd2x +2+3r1q+vrT0nXGRarRbqc0bTQ9i/qKjo44JPXrx4IThkoMg5c3SRDU8trS1r1rxvsViEhQwUGU1L +gU66du0HZrNZKMj0ejJF0szIyEh+/qbyciP+yECR/f0OJG8F/frkyR/r6//AGRkjRdIZEBVy+b69 ++4zlRg5mbTFAFoEiyT4AQahV6sD2qVM1335ziOb58bhBBqQiVmTId9OoNcH0a2trdxV+weqKCK6R +LVmyBOFkCnjNvIxiMpm2bv3c4/HggGyiihxwo3o36I9SqTTkU+Zb5i2fbRkcHIxvZNC+6FSRNKNQ +KMnXf3R13dm2bTsb5QFHyECRg4MDCBWpUiopd7vdcbtw5y7kNuACWUCRyI44SJGUaW5uhsmH3++P +J2RsK5IyV678efDAQYTUWEfGgSIpc/58XWVFZXwg40yRlIFZ7pkzv/AdGVpFyuWKKJdIHi07amoy +8RdZSspr3CuSsnrfvbsosJ6Bd8hAkRH3oHCKREIfCqnSktIop7jokQUUiWqtbASKJI/Vav36q2J+ +IcvKehOhItVqNfLFeFCERqMCxEeTk5PjcrkQKlImZWU5V/nx8u7u7tgjA0Xa7Tb+KJIkUI18WbQn +srMdyJDxUJHksVgsMO2IGTLeKpI858792tLSGgNkPFckeUqKS2w2G9fI+K9IktjtdqDGKTKDwRAX +iiRJa+tfzc0tHCGbrCLtqA6dVUWSp+xIGf0rLJEjQ6tIsAfbiiTJgwcPqqqq2UWmVCrRKpLLIT9k +qquqA9+1YgUZfLbU1NQ4VWS4eL3eI4fL2EIGihwefh6niiT1QGtbWxt6ZGgVqVKquFckSSorTiBG +hlyREAmf0tnZ2XC5ARkynBRJEqOxgnxmThcZfooMF6vVSr52mS4y/BRJkpqaGpJr1bSQ6fV6LBUZ +tvC02evr6yNHBop0OvtxVWS4VP1UHe4KPwWyjIwMvBUZLn19fU1NTYyRgSJHRjzYKzJcwl1SIcgV +iWr5CZFA8HzIn5mO9g7rEysDZGgVqdao44tXIGfPnqWLDLkipYRUEoepq7sA5To1MtSKVMaFIkMG +qunGa40UyFArEhyplMRzLl78jQyZTjcbtSJVkjiP2WyetuSLCFYkSE3IigwZqJyuN14PjQwU6R3z +ClyRIXO5oSEEMlGR5BO04L5JBBSJ6nt+8a7IsA0t6Lwj4Xa7QZGoOhEGigyZ4GsChNX6RFQkZdrb +2qeuDSM7b4WNIkNmaGios7MTMTKcFBkyLS/XbRBIPie0L5wUGRpZ6/8r0RD8ftmEImUyCe659/e9 +wE81R9sxZTI8FTkz0LYCv80cFTJQpFqlkggmXV1dUSHDW5GhkXVGhwx7Rc5MT0+P3++XFRQUZGVl +M33x3Llz5s+fLxFeCIL4T4ABAKZ9PUaesuDFAAAAAElFTkSuQmCC" transform="matrix(1 0 0 1 70 0)"> +</image> +</svg> + + </span> + </div> + <!-- Couchbase --> + <div class="p-0" *ngIf="db.name == 'Couchbase'"> + <span data-toggle="tooltip" title="Couchbase"> + <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + x="0px" y="0px" width="100" height="100" viewBox="-408 285.3 25 25" + style="enable-background:new -408 285.3 25 25;" xml:space="preserve"> + <path style="fill: #313032" + d="M-395.5,285.3c-6.9,0-12.5,5.6-12.5,12.5s5.6,12.5,12.5,12.5s12.5-5.6,12.5-12.5S-388.6,285.3-395.5,285.3z + M-387.1,300c0,0.8-0.4,1.4-1.3,1.6c-1.5,0.3-4.6,0.4-7.2,0.4s-5.7-0.2-7.2-0.4c-0.8-0.2-1.3-0.8-1.3-1.6v-4.9 + c0-0.8,0.6-1.5,1.3-1.6c0.4-0.1,1.5-0.2,2.2-0.2c0.3,0,0.5,0.2,0.5,0.6v3.4l4.4-0.1l4.4,0.1v-3.4c0-0.4,0.2-0.6,0.5-0.6 + c0.8,0,1.8,0.1,2.2,0.2c0.7,0.1,1.3,0.8,1.3,1.6C-387.1,296.7-387.1,298.3-387.1,300L-387.1,300z" /> + </svg> + </span> + </div> + <!-- Druid --> + <div class="p-0" *ngIf="db.name == 'Druid'"> + <span class="pr-1" data-toggle="tooltip" title="Druid"> + <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + x="0px" y="0px" width="100" height="100" viewBox="-403 285.3 34 25" + style="enable-background:new -403 285.3 34 25;" xml:space="preserve"> + <g> + <path style="fill: #313032" + d="M-385.5,285.3c2.2,0,4.3,0,6.5,0c4.2,0,8,2.7,9.4,6.6c0.6,1.7,0.8,3.4,0.6,5.2c-0.3,2.6-1,5-2.5,7.2 + c-2.3,3.4-5.5,5.2-9.5,5.8c-1.4,0.2-2.7,0.2-4.1,0.2c-0.6,0-0.9-0.3-0.9-0.7c0-0.5,0.3-0.9,0.8-0.9c0.6,0,1.2,0,1.9,0 + c3.7-0.1,7-1.4,9.6-4.2c1.8-1.9,2.7-4.3,3-6.9c0.2-1.8,0.2-3.6-0.5-5.3c-1.1-2.6-3.1-4.2-5.8-5c-1.1-0.3-2.1-0.3-3.2-0.4 + c-4,0-8.1,0-12.1,0c-0.2,0-0.3,0-0.5,0c-0.4,0-0.7-0.4-0.7-0.8s0.3-0.7,0.6-0.8c0.2,0,0.4,0,0.6,0L-385.5,285.3L-385.5,285.3z" /> + <path style="fill: #313032" d="M-389.7,304.6h-7.2c-0.2,0-0.3,0-0.5,0c-0.4-0.1-0.7-0.3-0.7-0.7c0-0.4,0.2-0.7,0.6-0.9 + c0.2-0.1,0.5-0.1,0.8-0.1c4.7,0,9.5,0,14.2,0c1.7,0,3.1-0.6,4.2-1.8c1-1,1.5-2.3,1.6-3.7c0.1-1.1,0-2.1-0.7-3.1 + c-0.8-1-1.8-1.5-3.1-1.5c-4.5,0-9,0-13.5,0c-0.5,0-1,0-1.4-0.1c-0.4,0-0.6-0.3-0.7-0.7c0-0.5,0.2-0.8,0.6-0.9c0.1,0,0.3,0,0.4,0 + h14.4c2.4,0,4.5,1.5,5.3,3.8c0.5,1.6,0.4,3.3-0.3,4.8c-1.2,3-3.9,4.9-7.2,4.9C-385,304.6-387.3,304.6-389.7,304.6L-389.7,304.6z + M-400.4,292.6c-0.6,0-1.1,0-1.7,0c-0.5,0-0.8-0.3-0.9-0.7s0.2-0.8,0.7-0.9c0.3,0,0.5-0.1,0.8-0.1c0.8,0,1.5,0,2.3,0 + c0.2,0,0.5,0,0.7,0.1c0.4,0.1,0.6,0.5,0.6,0.9s-0.3,0.7-0.7,0.7C-399.2,292.7-399.8,292.6-400.4,292.6L-400.4,292.6z M-390.3,310.3 + c-0.5,0-1,0-1.6,0c-0.5,0-0.8-0.3-0.9-0.7c0-0.5,0.3-0.9,0.7-0.9c1.1-0.1,2.2-0.1,3.4,0c0.4,0,0.8,0.4,0.7,0.8l0,0 + c0,0.5-0.4,0.7-0.9,0.8L-390.3,310.3L-390.3,310.3z" /> + </g> + </svg> + </span> + </div> + + <!-- Elasticsearch --> + <div class="p-0" *ngIf="db.name == 'Elasticsearch'"> + <span class="pr-1" data-toggle="tooltip" title="Elasticsearch"> + <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + x="0px" y="0px" width="100" height="100" viewBox="2066.4 284.8 25.1 25" + style="enable-background:new 2066.4 284.8 25.1 25;" xml:space="preserve"> + <g> + <path style="fill: #FFFFFF" d="M2091.6,297.9c0-2.1-1.3-3.9-3.3-4.7c0.1-0.4,0.1-0.9,0.1-1.4c0-3.9-3.2-7.1-7.1-7.1c-2.3,0-4.4,1.1-5.7,3 + c-0.7-0.5-1.5-0.8-2.3-0.8c-2.1,0-3.8,1.7-3.8,3.8c0,0.5,0.1,0.9,0.2,1.3c-2,0.7-3.3,2.6-3.3,4.7c0,2.1,1.3,4,3.3,4.7 + c-0.1,0.4-0.1,0.9-0.1,1.4c0,3.9,3.2,7.1,7.1,7.1c2.3,0,4.4-1.1,5.7-3c0.7,0.5,1.5,0.8,2.3,0.8c2.1,0,3.8-1.7,3.8-3.8 + c0-0.5-0.1-0.9-0.2-1.3C2090.2,301.8,2091.6,300,2091.6,297.9L2091.6,297.9z" /> + <path style="fill: #313032" d="M2076.3,295.5l5.6,2.6l5.7-5c0.1-0.4,0.1-0.8,0.1-1.3c0-3.5-2.8-6.3-6.3-6.3c-2.1,0-4,1-5.2,2.7l-0.9,4.9 + L2076.3,295.5L2076.3,295.5z" /> + <path style="fill: #313032" d="M2070.5,301.4c-0.1,0.4-0.1,0.8-0.1,1.3c0,3.5,2.8,6.3,6.3,6.3c2.1,0,4.1-1,5.2-2.8l0.9-4.9l-1.3-2.4l-5.6-2.6 + L2070.5,301.4L2070.5,301.4z" /> + <path style="fill: #313032" d="M2070.4,291.7l3.8,0.9l0.9-4.4c-0.5-0.4-1.2-0.6-1.8-0.6c-1.7,0-3,1.4-3,3 + C2070.2,291.1,2070.3,291.4,2070.4,291.7L2070.4,291.7z" /> + <path style="fill: #313032" + d="M2070.1,292.7c-1.7,0.6-2.9,2.2-2.9,4c0,1.8,1.1,3.3,2.7,4l5.4-4.9l-1-2.1L2070.1,292.7L2070.1,292.7z" /> + <path style="fill: #313032" d="M2082.9,306.3c0.5,0.4,1.2,0.6,1.8,0.6c1.7,0,3-1.4,3-3c0-0.4-0.1-0.7-0.2-1l-3.8-0.9L2082.9,306.3 + L2082.9,306.3z" /> + <path style="fill: #313032" + d="M2083.7,300.9l4.2,1c1.7-0.6,2.9-2.2,2.9-4c0-1.8-1.1-3.3-2.7-4l-5.5,4.8L2083.7,300.9L2083.7,300.9z" /> + </g> + </svg> + </span> + </div> + + <!-- MongoDB --> + <div class="p-0" *ngIf="db.name == 'MongoDB'"> + <span class="pr-1" data-toggle="tooltip" title="MongoDB"> + <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + x="0px" y="0px" width="100" height="100" viewBox="-397.2 285.8 11.2 25" + style="enable-background:new -397.2 285.8 11.2 25;" xml:space="preserve"> + <g transform="matrix(1.2754196 0 0 1.2754196 -16.030009 -21.83192)"> + <path style="fill: #313032" + d="M-294.5,241.2c0.2,0.3,0.4,0.7,0.5,1c0.1,0.2,0.2,0.4,0.4,0.5c0.4,0.4,0.9,0.9,1.2,1.4 + c0.9,1.2,1.5,2.5,1.9,3.9c0.3,0.9,0.4,1.7,0.4,2.6c0,2.7-0.9,4.9-2.7,6.8c-0.3,0.3-0.6,0.6-1,0.8c-0.2,0-0.3-0.2-0.4-0.3 + c-0.2-0.2-0.2-0.5-0.3-0.8c-0.1-0.3-0.1-0.6-0.1-1c0,0,0-0.1,0-0.2C-294.4,256.1-294.6,241.3-294.5,241.2z" /> + <path style="fill: #313032" + d="M-294.5,241.2C-294.5,241.2-294.5,241.2-294.5,241.2c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.2-0.3,0.3-0.5,0.5 + c-0.9,0.8-1.7,1.8-2.3,2.9c-0.8,1.5-1.2,3.1-1.3,4.8c0,0.6,0.2,2.8,0.4,3.4c0.5,1.6,1.4,3,2.7,4.2c0.3,0.3,0.6,0.5,0.9,0.8 + c0.1,0,0.1-0.1,0.1-0.2c0-0.2,0.1-0.3,0.1-0.4c0.1-0.5,0.2-1.1,0.2-1.6C-294.4,256.2-294.4,241.3-294.5,241.2L-294.5,241.2z" /> + <path style="fill: #313032" d="M-294,258.9c0-0.2,0.2-0.4,0.3-0.7c-0.1,0-0.2-0.2-0.3-0.3c-0.1-0.1-0.1-0.2-0.2-0.4c-0.2-0.4-0.2-0.9-0.2-1.4 + c0,0,0-0.1,0-0.2s0-0.1,0-0.2c0,0-0.1,0.4-0.1,0.5c0,0.5-0.1,1-0.2,1.4c0,0.2,0,0.4-0.2,0.5c0,0,0,0,0,0.1c0.2,0.5,0.2,1.1,0.3,1.7 + v0.2c0,0.3,0,0.2,0.2,0.3c0.1,0,0.2,0,0.3,0.1c0.1,0,0.1,0,0.1-0.1c0-0.1,0-0.2,0-0.4c0-0.3,0-0.7,0-1 + C-294,259.3-294,259.1-294,258.9z" /> + </g> + </svg> + </span> + </div> + </div> + + <div class="mt-auto"> + <i class="fa fa-check-circle" aria-hidden="true" + [ngClass]="{'truecheck':db.enabled == true,'falsecheck':db.enabled == false}"></i> + {{ db.host }} + </div> + </div> + + </div> + </div> + </div> + + <!-- Add --> + <div class="col-sm-2 db-block"> + <div class="db-panel"> + <div class="d-flex flex-column align-content-center"> + <div class="ml-auto dropdown db-dropdown mr-2" style="visibility: hidden;" data-boundary="window"> + <a class="badge badge-light db-dropdown" data-toggle="dropdown"> + <i class="fas fa-ellipsis-h fa-2x db-config-icon"></i> + </a> + <div class="dropdown-menu"> + <button class="dropdown-item" type="button"> + <i class="fas fa-times db-config-icon"></i> Delete + </button> + </div> + </div> + + <div> + <button type="button" class="btn" (click)="this.openCreateModal()"> + <div class="align-self-center" style="height: 130px;"> + <div style="width:100px; height:100px;"> + <i class="fas fa-plus fa-3x pt-4 dl-icon-enable"></i> + </div> + </div> + + <div class="mt-auto" style="visibility: hidden;"> + add + </div> + </button> + </div> + + </div> + </div> + </div> + +</div> + diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts new file mode 100644 index 00000000..d0e59ce4 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardListComponent } from './dashboard-list.component'; + +describe('DashboardListComponent', () => { + let component: DashboardListComponent; + let fixture: ComponentFixture<DashboardListComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DashboardListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DashboardListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts new file mode 100644 index 00000000..a2966a4e --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts @@ -0,0 +1,283 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import {Component, EventEmitter, OnInit, Output} from '@angular/core'; +import {Dashboard} from "../../core/models/dashboard.model"; +import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; +import {CreateDashboardComponent} from "./create-dashboard/create-dashboard.component"; + +import {AdminService} from "../../core/services/admin.service"; + +// DB modal components +import {DashboardApiService} from "src/app/core/services/dashboard-api.service"; + +import {AlertComponent} from "src/app/core/alert/alert.component"; + +// Notify +import {ToastrNotificationService} from "src/app/core/services/toastr-notification.service"; +// Loading spinner +import {NgxSpinnerService} from "ngx-spinner"; + +@Component({ + selector: 'app-dashboard-list', + templateUrl: './dashboard-list.component.html', + styleUrls: ['./dashboard-list.component.css'] +}) +export class DashboardListComponent implements OnInit { + @Output() passEntry: EventEmitter<any> = new EventEmitter(); + dbList: any = []; + dbs: Dashboard[] = []; + + loading: Boolean = true; + + tempDbDetail: Dashboard; + selectedLangs = sessionStorage.getItem("selectedLang"); + dashboardDeteleModelShow = true; + nameArr = []; + + constructor( + private adminService: AdminService, + private dashboardApiService: DashboardApiService, + private notificationService: ToastrNotificationService, + private modalService: NgbModal, + private spinner: NgxSpinnerService + ) { + // Set page title + this.adminService.setTitle("SIDEBAR.DASHBOARDLIST"); + this.getName(); + this.initData().then(data => { + this.initDbsList(this.dbList).then(data => { + this.dbs = data; + console.log(this.dbs, "dasboard-dbs[]") + }); + }); + } + + ngOnInit() { + this.spinner.show(); + } + + + async initData() { + this.dbList = []; + this.dbList = await this.getDbList(); + setTimeout(() => { + this.spinner.hide(); + }, 500); + } + + getDbList() { + var data: any; + data = this.dashboardApiService.getDashboardList().toPromise(); + + return data; + } + + async initDbsList(dbList: []) { + var d: Dashboard[] = []; + + if (dbList.length > 0) { + for (var i = 0; i < dbList.length; i++) { + let data = dbList[i]; + let feed = { + name: data["name"], + host: data["host"], + port: data["port"], + login: data["login"], + pass: data["pass"], + enabled: data["enabled"] + }; + d.push(feed); + } + } + return d; + } + + + openCreateModal() { + let thisIndex = -1; + this.openDashboardModal(thisIndex); + } + + openDashboardModal(thisIndex: number) { + var modalRef, index; + this.selectedLangs = sessionStorage.getItem("selectedLang"); + let tips = ""; + + + index = thisIndex; + console.log(index, "index,add or edit"); + this.tempDbDetail = new Dashboard(); + if (index != -1) { + modalRef = this.modalService.open(CreateDashboardComponent, { + size: "lg", + centered: true + }); + modalRef.componentInstance.dashboard = this.dbs[index]; + } else { + if(this.nameArr.length == 0 && this.dbs.length>0){ + console.log("All types have been created, you cannot create existing types again."); + return false; + }else { + modalRef = this.modalService.open(CreateDashboardComponent, { + size: "lg", + centered: true + }); + modalRef.componentInstance.dashboard = this.tempDbDetail; + } + + } + modalRef.componentInstance.nameArr = this.nameArr; + modalRef.componentInstance.passEntry.subscribe(receiveEntry => { + this.tempDbDetail = receiveEntry; + let host = this.tempDbDetail.host; + console.log(receiveEntry); + if (index != -1) { + // Db name found, to update db + this.dashboardApiService.upadteDashboard(this.tempDbDetail).subscribe( + res => { + console.log(res); + if (res.statusCode == 200) { + this.dbs[index] = this.tempDbDetail; + if (this.selectedLangs == "en-us") { + tips = "Success updated." + } else if (this.selectedLangs == "zh-hans") { + tips = "更新成功。" + } else if (this.selectedLangs == "zh-hant") { + tips = "更新成功。" + } + this.notificationService.success('"' + host + '"' + tips); + } else { + if (this.selectedLangs == "en-us") { + tips = "Fail updated." + } else if (this.selectedLangs == "zh-hans") { + tips = "更新失败。" + } else if (this.selectedLangs == "zh-hant") { + tips = "更新失敗。" + } + this.notificationService.error('"' + host + '"' + tips); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + } else { + // Db name not found, to insert db + this.dashboardApiService.addDashboard(this.tempDbDetail).subscribe( + res => { + console.log(res); + let tips = ""; + if (res.statusCode == 200) { + this.dbs.push(this.tempDbDetail); + this.dbs = [...this.dbs]; + this.getName(); + if (this.selectedLangs == "en-us") { + tips = "Success inserted." + } else if (this.selectedLangs == "zh-hans") { + tips = "新增成功。" + } else if (this.selectedLangs == "zh-hant") { + tips = "新增成功。" + } + this.notificationService.success('"' + host + '"' + tips); + }else { + if (this.selectedLangs == "en-us") { + tips = "Fail inserted." + } else if (this.selectedLangs == "zh-hans") { + tips = "新增失败。" + } else if (this.selectedLangs == "zh-hant") { + tips = "新增失敗。" + } + this.notificationService.error('"' + host + '"' + tips); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + } + }); + } + + deleteDashboard(thisIndex: number) { + this.selectedLangs = sessionStorage.getItem("selectedLang"); + const index = thisIndex, host = this.dbs[thisIndex]["host"]; + let tips = ""; + if (this.selectedLangs == "en-us") { + tips = "Are you sure you want to delete "; + } else if (this.selectedLangs == "zh-hans") { + tips = "您确定您要删除"; + } else if (this.selectedLangs == "zh-hant") { + tips = "您確定您要刪除"; + } + const modalRef = this.modalService.open(AlertComponent, { + // size: "sm", + centered: true + }); + modalRef.componentInstance.dashboardDeteleModelShow = this.dashboardDeteleModelShow; + modalRef.componentInstance.message = + tips + '"'+host + '"' + ' ?'; + modalRef.componentInstance.passEntry.subscribe(receivedEntry => { + // Delete database + this.dbs[thisIndex].enabled = false; + this.dashboardApiService.deleteDashboard(this.dbs[thisIndex]).subscribe( + res => { + console.log(res); + if (res.statusCode == 200) { + // this.dbs[index].enabled = false; + this.dbs.splice(index, 1); + this.getName(); + if (this.selectedLangs == "en-us") { + tips = "Success deleted." + } else if (this.selectedLangs == "zh-hans") { + tips = "删除成功。" + } else if (this.selectedLangs == "zh-hant") { + tips = "刪除成功。" + } + this.notificationService.success('"' + host + '"' + tips); + } else { + this.dbs[thisIndex].enabled = true; + if (this.selectedLangs == "en-us") { + tips = "Fail deleted." + } else if (this.selectedLangs == "zh-hans") { + tips = "删除失败。" + } else if (this.selectedLangs == "zh-hant") { + tips = "刪除失敗。" + } + this.notificationService.error('"' + host + '"' + tips); + } + modalRef.close(); + }, + err => { + this.notificationService.error(err); + modalRef.close(); + } + ); + }); + } + + getName(){ + this.dashboardApiService.getDashboardName().subscribe(data => { + this.nameArr = data; + console.log(this.nameArr,"this.nameArr111"); + }); + console.log(this.nameArr,"this.nameArr222"); + } + +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.html new file mode 100644 index 00000000..134e2fc1 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.html @@ -0,0 +1,24 @@ +<!-- + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + + +<div class="row"> + <div class="col-md-12 path"> + Home > Dashboard List + </div> +</div> + +<app-dashboard-list></app-dashboard-list> diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.spec.ts new file mode 100644 index 00000000..10886c12 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardSettingComponent } from './dashboard-setting.component'; + +describe('DashboardSettingComponent', () => { + let component: DashboardSettingComponent; + let fixture: ComponentFixture<DashboardSettingComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DashboardSettingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DashboardSettingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.ts new file mode 100644 index 00000000..26efe645 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-setting.component.ts @@ -0,0 +1,29 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { Component, OnInit } from '@angular/core'; +@Component({ + selector: 'app-dashboard-setting', + templateUrl: './dashboard-setting.component.html', + styleUrls: ['./dashboard-setting.component.css'] +}) +export class DashboardSettingComponent implements OnInit { + + constructor() {} + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html new file mode 100644 index 00000000..7c75b6b7 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.html @@ -0,0 +1,15 @@ +<!-- + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts new file mode 100644 index 00000000..de3dc540 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditTemplateModalComponent } from './edit-template-modal.component'; + +describe('EditTemplateModalComponent', () => { + let component: EditTemplateModalComponent; + let fixture: ComponentFixture<EditTemplateModalComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditTemplateModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditTemplateModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts new file mode 100644 index 00000000..3c37c58b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/edit-template-modal/edit-template-modal.component.ts @@ -0,0 +1,43 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + ViewChild, + ElementRef +} from "@angular/core"; + + +@Component({ + selector: 'app-edit-template-modal', + templateUrl: './edit-template-modal.component.html', + styleUrls: ['./edit-template-modal.component.css'] +}) +export class EditTemplateModalComponent implements OnInit { + + + constructor() { + } + + + ngOnInit() { + + + } +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html new file mode 100644 index 00000000..7c75b6b7 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.html @@ -0,0 +1,15 @@ +<!-- + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts new file mode 100644 index 00000000..29df2b1a --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NewTemplateModalComponent } from './new-template-modal.component'; + +describe('NewTemplateModalComponent', () => { + let component: NewTemplateModalComponent; + let fixture: ComponentFixture<NewTemplateModalComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NewTemplateModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NewTemplateModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts new file mode 100644 index 00000000..398560bd --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/new-template-modal/new-template-modal.component.ts @@ -0,0 +1,44 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + ViewChild, + ElementRef +} from "@angular/core"; + + +@Component({ + selector: 'app-new-template-modal', + templateUrl: './new-template-modal.component.html', + styleUrls: ['./new-template-modal.component.css'] +}) +export class NewTemplateModalComponent implements OnInit { + + + constructor( + + + ) { } + + + ngOnInit() { + + } +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.html new file mode 100644 index 00000000..7c75b6b7 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.html @@ -0,0 +1,15 @@ +<!-- + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.spec.ts new file mode 100644 index 00000000..10a43a46 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TemplateListComponent } from './template-list.component'; + +describe('TemplateListComponent', () => { + let component: TemplateListComponent; + let fixture: ComponentFixture<TemplateListComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TemplateListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TemplateListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.ts new file mode 100644 index 00000000..acfe4d37 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template-list/template-list.component.ts @@ -0,0 +1,27 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import {Component, OnInit, ViewChild, ElementRef} from '@angular/core'; + +@Component({ + selector: 'app-template-list', + templateUrl: './template-list.component.html', + styleUrls: ['./template-list.component.css'] +}) +export class TemplateListComponent { + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.css b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.css new file mode 100644 index 00000000..424c839b --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.html b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.html new file mode 100644 index 00000000..2aede51d --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.html @@ -0,0 +1,23 @@ +<!-- + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<div class="row"> + <div class="col-md-12 path"> + {{"HOME" | translate}} > {{"ConfigDashboard" | translate}} > {{"SIDEBAR.TEMPLATE" | translate}} + </div> + <div class="col-md-12"> + <app-template-list></app-template-list> + </div> +</div> diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.spec.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.spec.ts new file mode 100644 index 00000000..21428a84 --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.spec.ts @@ -0,0 +1,40 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TemplateComponent } from './template.component'; + +describe('TemplateComponent', () => { + let component: TemplateComponent; + let fixture: ComponentFixture<TemplateComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TemplateComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TemplateComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.ts new file mode 100644 index 00000000..cb761deb --- /dev/null +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/template/template.component.ts @@ -0,0 +1,34 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { Component, OnInit } from '@angular/core'; +import {AdminService} from "../../core/services/admin.service"; + +@Component({ + selector: 'app-template', + templateUrl: './template.component.html', + styleUrls: ['./template.component.css'] +}) +export class TemplateComponent implements OnInit { + + constructor(private adminService: AdminService) { + // Set page title + this.adminService.setTitle("SIDEBAR.TEMPLATE"); + } + + ngOnInit() { + } + +} diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html index b454f61e..490bf49e 100644 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html +++ b/components/datalake-handler/admin/src/src/app/database/database-list/database-add-modal/database-add-modal.component.html @@ -41,6 +41,8 @@ limitations under the License. <a class="nav-link" id="v-pills-search-tab" data-toggle="pill" href="#v-pills-search" role="tab" aria-controls="v-pills-search" aria-selected="false">Search Engine</a> + <a class="nav-link" id="v-pills-hadoop-tab" data-toggle="pill" href="#v-pills-hadoop" role="tab" + aria-controls="v-pills-hadoop" aria-selected="false">Hadoop</a> </div> </div> @@ -87,6 +89,14 @@ limitations under the License. aria-selected="true">Elasticsearch</a> </div> </div> + + <!-- Hadoop --> + <div class="tab-pane fade" id="v-pills-hadoop" role="tabpanel" aria-labelledby="v-pills-hadoop-tab"> + <div class="nav flex-column nav-pills" id="menu-tab2" role="tablist" aria-orientation="vertical"> + <a class="nav-link" (click)="this.clickItem('HDFS')" data-toggle="pill" role="tab" + aria-selected="true">HDFS</a> + </div> + </div> </div> <div class="d-flex mt-auto justify-content-end p-3"> @@ -109,147 +119,5 @@ limitations under the License. </div> </div> - <!-- <div class="container-fluid p-0"> - <div class="row m-0 p-0"> - <div class="col-md-4 border-right"></div> - <div class="col-md-8"></div> - </div> - <div class="row m-0 p-0 border border-danger" style="height: 350px;"> - <div class="col-md-4 border-right"> - <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> - <a class="nav-link active" id="v-pills-all-tab" data-toggle="pill" href="#v-pills-all" role="tab" - aria-controls="v-pills-all" aria-selected="true">All</a> - </div> - </div> - <div class="col-md-8"> - <div class="tab-content" id="v-pills-tabContent"> - <div class="tab-pane fade show active" id="v-pills-all" role="tabpanel" aria-labelledby="v-pills-all-tab"> - 1111111111111111 - </div> - </div> - </div> - </div> - - <div class="row m-0 p-0 border border-info"> - <div class="col-md-6 p-0"> - - </div> - <div class="col-md-3 p-1"> - <span> - <button type="button" class="btn dl-btn-dark btn-block" (click)="this.passBack()"> - Next - </button> - </span> - </div> - <div class="col-md-3 p-1"> - <span> - <button type="button" class="btn dl-btn-light btn-block" (click)="activeModal.close('Close click')"> - Cancel - </button> - </span> - </div> - </div> - - <div class="d-flex justify-content-center"> - - <div class="p-0 border-right"> - <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> - <a class="nav-link active" id="v-pills-all-tab" data-toggle="pill" href="#v-pills-all" role="tab" - aria-controls="v-pills-all" aria-selected="true">All</a> - </div> - </div> - - <div class="p-0"> - <div class="tab-content" id="v-pills-tabContent"> - <div class="tab-pane fade show active" id="v-pills-all" role="tabpanel" aria-labelledby="v-pills-all-tab"> - 1111111111111111 - </div> - </div> - </div> - </div> - - <div class="d-flex"> - <div class="mb-auto"> - <div class="row"> - <div class="col-md-6 p-0"> - - </div> - <div class="col-md-3 p-1"> - <span> - <button type="button" class="btn dl-btn-dark btn-block" (click)="this.passBack()"> - Next - </button> - </span> - </div> - <div class="col-md-3 p-1"> - <span> - <button type="button" class="btn dl-btn-light btn-block" (click)="activeModal.close('Close click')"> - Cancel - </button> - </span> - </div> - </div> - </div> - </div> --> - - - <!-- <div class="row"> - <div class="col-sm-4"> - <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> - <a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" - aria-controls="v-pills-home" aria-selected="true">Home</a> - <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" - aria-controls="v-pills-profile" aria-selected="false">Profile</a> - <a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" - aria-controls="v-pills-messages" aria-selected="false">Messages</a> - <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" - aria-controls="v-pills-settings" aria-selected="false">Settings</a> - </div> - - </div> - <div class="col-sm-8"> - <div class="tab-content" id="v-pills-tabContent"> - <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"> - 1111111111111111 - </div> - <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab"> - 2222222222222222222 - </div> - <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab"> - 33333333333333333 - </div> - <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab"> - 4444444444444 - </div> - </div> - </div> - </div> --> - - </div> -</div> - - -<!-- <div class="modal-footer"> - <div class="container"> - <div class="row"> - <div class="col-md-6 p-0"> - - </div> - <div class="col-md-3 p-1"> - <span> - <button type="button" class="btn dl-btn-dark btn-block" (click)="this.passBack()"> - Next - </button> - </span> - </div> - <div class="col-md-3 p-1"> - <span> - <button type="button" class="btn dl-btn-light btn-block" (click)="activeModal.close('Close click')"> - Cancel - </button> - </span> - </div> - </div> - </div> - </div> --> +</div>
\ No newline at end of file diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html index a675270d..8b71f529 100644 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html +++ b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.html @@ -128,6 +128,111 @@ limitations under the License. </svg> </span> </div> + + <!-- HDFS --> + <div class="p-0" *ngIf="db.name == 'HDFS'"> + <span class="pr-1" data-toggle="tooltip" title="HDFS"> + <svg version="1.1" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100" height="100" + viewBox="290 -397 2500 1875" style="enable-background:new 290 -397 2500 1875;" xml:space="preserve"> + <style type="text/css"> + .st0 { + fill: #313032; + } + + .st1 { + fill: #FFFFFF; + } + + </style> + <path class="st0" + d="M2149.4,171.3c-85.6,46.1-167.6,92.4-211.3,180C1938,240.2,2049.6,191.3,2149.4,171.3 M1921-47.2 + c-63.6,43.3-108.5,130.8-102.9,216c-20.7-73.8-13.4-143.5,50.2-194.5c10.7-5.2,21.5-10.4,32.2-15.6 C1907.4-43.3,1914.2-45.2,1921-47.2" /> + <path class="st0" d="M2776.4,154c-11.5-72.7-30.6-143.2-57.2-194c-3.2-6.2-8.1-12.5-14.2-18.5c-13.2-13-32.7-25.3-52.8-32.2 + c-21.3-7.3-43.9-8.8-61.7,0.5c-4.6,2.4-9,5.6-12.8,9.5c-11.6,11.7-21.3,26-31.1,40.2c-10.9,15.9-21.8,31.9-34.9,43 + c-15.2,13-34.1,20.8-52,28c-7.5-18.3-16.6-35.9-27.1-52.6c-12.2-19.5-26.2-37.8-41.5-56.1c-11.2-13.5-23.9-25.6-37.9-36.2 + c-13.2-10.1-26.8-18.6-42.5-28.4c-42.3-26.5-78.2-58-114.9-90.2c-16.7-14.6-33.5-29.4-50-43c-87.4-72.1-168.9-107-256.1-112.5 + c-86.6-5.4-178,18.3-286,63.8c-52.1,21.9-90.8,47.8-124.5,79c-32.2,29.8-59.5,64.1-89.6,104.1c-17.5,1.2-33,3.8-48.8,10.2 + c-17.4,7-35,18.3-56,36.8c-14.6,12.9-29,26.1-43,39.7c-12.8,12.5-25.5,25.1-37.8,38.1c-98.3,15.8-178.4,33.2-250.1,61 + c-73.3,28.4-138,67.5-204.4,126.4c-26.1,23.1-50,48.7-71.2,76.4c-20.2,26.5-37.5,54.3-52.6,83.6c-13.3,14.7-26.6,29.5-41,42.5 + c-14,12.6-29,23.3-45.8,29.8l0,0c-9.8,3.8-13.8,6-14.2,5.8c-0.5-0.3-0.8-1.7-1.4-4.4c24.1-23,27.9-56.8,30.1-90.3 + c2.9,3.5,5.7,7.7,8.5,12.2c3.2,4.9,6.4,10,10.4,14.9l16.4,20.6l5.7-25.7c4.8-21.6,8.4-50.3,2.8-75.2c-3.6-16.2-11.1-30.6-24.2-40.8 + c1.2-3.3,2.4-6.3,3.6-9.2c4.1-10.5,8.3-21.3,11.9-31.4l7.1-20.2l-21.1,3.7c-28.1,4.9-88.4,38-130.9,82.1 + c-15.8,16.4-29.3,34.5-38.2,53.5c-9.3,19.8-13.4,40.4-9.8,61.1c3.1,18.1,12.2,35.8,28.6,52.6c3,12.1,5.8,22.6,8.7,32 + c3.4,10.8,7,20.4,11.6,29.8c12.4,25.7,32.1,41.4,54.9,48.7c18.3,5.9,38.6,6.2,58.5,1.8c-4,23.7-6.5,47.6-7.3,71.6 + c-1.3,33.5,0,70.6,3.7,113.6c0.8,9.4,2,19.8,3.6,31.1c1.4,9.6,3,19.1,4.7,28.5c-3.7,10.1-7.5,20.3-11.2,30.4L534,846.9l-38.2,37.8 + c-11.9,11.7-23.8,23.5-35.6,35.3c-1,1-5,4.8-8.6,8.3c-24.1,23.2-28.8,27.8-22,68.5c4.4,26.1,12.9,51.3,25.2,74.7 + c11.8,22.5,27.7,44.4,48,64.8c25.4,25.4,67,57.1,110.6,73.6c24.9,9.5,50.6,14.1,74.7,10.2c-1.2,3.7-2.4,7.4-3.8,11.1 + c-3.8,10.6-8,21-12.7,31.2c-29.6,64.8,0.8,98.6,48,120.2c23.6,10.7,51.6,18,77.7,24.8c5.3,1.4,10.7,2.8,17.4,4.6 + c30.9,8.3,84.2,23.7,132.9,26.7c53.2,3.4,101.1-7.6,114-55.3c5.1-18.9,8-33.4,9.2-47.6c1.1-13.2,0.7-26.5-0.9-42.9 + c15.2-33.6,21.6-43,32.7-59.2c2.2-3.2,4.8-7,5.6-8.2c11.9-17.6,17.5-30.1,19.5-44.2c2-13.6,0.3-27.1-2.2-47.8 + c-0.2-2-0.6-4.8-1.1-8.6c30.6,4,61.4,6.1,92.3,6.3c15.5,0.1,31-0.4,46.4-1.2c-4,2-7.8,4-12.1,6.2l-5.8,3 + c-41.1,21.1-42.8,61.1-29.9,102.2c11.6,37.1,35.4,75,50.4,98c31.4,48.5,61.5,89.5,97.8,111.8c38.1,23.4,81.7,26.1,137.9-4.3 + c28.6-15.5,37.6-31.3,49.8-52.6c3.7-6.5,7.8-13.6,12.4-20.6c11.8-7.8,41.2-32.1,70.1-56c9.8-8.1,19.7-16.2,30.7-25.2 + c7.6,5.6,16.9,9.5,28,12.2c14.5,3.5,31.7,5,52.4,6.5c15.5,1.1,65.9,1.1,98.4,1.1c10.1,0,18.4,0,23.4,0c33.6,0.2,60.8-1.6,81.3-13.2 + c21.9-12.4,34.8-34.3,37.6-73.7c1.2-17.5,1.5-28.3-1-39.3c-2.3-10.3-6.7-19.7-14.3-33.3c-0.5-17-0.9-34-1.4-51 + c-0.5-18-1-36.1-1.4-54.1c-0.6-21.3-2.9-38.6-7.2-55.6c-4.3-16.9-10.4-33.1-18.6-52.6c-5.1-12.3-9.9-24.7-14.4-37.2l-11.8,4.3 + l1.8-0.7l10-3.7v0c-7-19-14-37.4-23.7-57.2c0.6-3.8,1.3-7.9,1.9-12.3l18.7,18.1l27.6,26.6c21.1,20.3,40.3,38.8,63,52.1 + c23.4,13.8,49.7,21.8,83.8,20.2c35.7-1.7,73.9-16.7,105.3-39.9c30.4-22.5,54.8-52.7,65-86.2l8.8-29.1l7.1-23.2 + c50,8.5,103.7,11.2,155.6,5.8c50.1-5.3,98.4-18,140.1-40.3c61.3-32.7,107.3-80.9,140.3-138.1h0c36.9-63.9,57.6-139.3,65.4-216.8 + C2792.8,320.1,2789.3,235.5,2776.4,154L2776.4,154z M2128.1,676.7c-28.8-9.7-48.9-23.9-74.2-39.8c6.9,31.1,10,64,0.8,95 + c-14.6,49.2-38.1,129.8,28.7,144.6c25.4,5.6,37,4.8,72.9-13.7c-29.1,6.6-43.7,5-63.7,1.3c-18.1-3.3-27.7-14.8-32.8-28.4 + c6.3,4.6,16.6,7,34.3,11.3c49.6,12,96.8-11.9,106-46.3c5.4-20.1,4.5-30.6,15.9-58c10.3,3.2,20.8,6.1,31.7,8.7l-18.4,60 + c-15.9,52-78,93.8-132.8,92.9c-50.6-0.9-82.8-32.6-117.7-63.7c-24.1-21.4-47.3-41.9-70.2-62.3c-63-19.9-113.6-43.1-172.1-86.4 + c41.6,48.9,69.9,76,127.9,100.4c-8.4,86.1-38.4,148.9-63.9,231.4c-11.6,37.3-102.7,186.6-128,201.2c-18,10.4-130.9,105.4-152.1,118 + c-15.8,21-29.7,50-53.5,62.6c-72.4,38.3-119-35-158-97c-17.7-28.2-67-109.5-24.1-132.3c40.6-21.5,63.4-36.9,104.8-64.1 + c6.1,11.1,16.5,21.8,23.3,32.9l-4.5-36.4c-2.7-22-2.6-39.8-0.9-61.9c1.7-21.4,3.4-42.8,5.1-64.2c-6.2,21.8-18.7,43.5-24.9,65.3 + c-2.5,8.7-4.6,15.7-5.7,22.3c-93,19-185.3,20.2-278.4,3.6c-5.9-34.4-13.2-70.3-19.2-96.1c-1.8,28.8-0.7,108.5-0.8,153.1 + c-0.1,34.6-1.6,46.4-19.4,75.8c-16.7,27.5-23.7,33.8-47.1,80.3c2,29.3,2,48.7-5.8,76.6c-13,46.3-143.8,10.4-178.2,1 + c-42.5-11.6-130.3-28.9-108.2-85.5c19.4-49.8,31.8-102.4,41.3-172.1c-77.8-112.1-150.2-265.8-164.1-402 + c-10.8-105.7-4.3-170.8,18.6-235.4c36.2-102.5,87-191.2,168.3-262.6c109.8-96.3,212.4-135,373-159.5c-38.6,43.3-76.9,89-118.5,138 + c-42.2,49.6-67.2,99.8-94,154.1c-37,75-36.2,103.5,12.8,169.4c42.3,56.7,65.1,82.3,83.5,137.8c-15.2,31.4-20.8,58-25.9,100.8 + c51.7,56.6,90.2,95.3,140.4,107.3c49.3,11.7,90.4,9.5,134.5-13.1c97.9-50.1,188.5-114.7,299-117.4c51.1-125.6,45.9-230.6,21.4-352.2 + c-16.8-83-23.5-161.6-28.7-246.2c-20.7,87.2-24.6,163.8-9.2,250.6c18.5,104.6,32.9,220.2-18.6,312.2c-99.9,7.6-185.5,68.4-275.5,115 + c-36.2,18.8-73.9,20.6-113.9,9.6c-37.2-10.2-62.3-34.8-102.3-81c-0.6-46.4,9.8-67.8,31.1-109.8c34.2-67.5,72-130.2,113.4-196.6 + c-50.7,61.3-98.8,112.4-138.8,174c-15.3-43.5-37.1-65.6-73.3-114.6c-35.3-47.8-39-68.8-12.6-124.2c26.6-55.6,49.1-104.5,94.3-153.3 + c78.1-84.3,149.6-178.2,235.1-261.3c46.4-45.1,65.2-43.5,126.7-52.9c55.6-8.4,109.9-19.1,166.6-32.2c-54.8,5.1-107.8,7-161.2,8.3 + l-1.7,0c52.5-67.1,83-104.5,168.3-141.5c210-91.2,343.5-101.1,508.5,37.6c42.8,36,80.1,70.8,123.5,101.9 + c-15.7,1.3-29.3,4.2-47.2,11.2c21.8-4.2,47,0,69.6,4.1c6.3,4.1,12.9,8.1,19.6,12.1c30.6,18,48,28,68.7,56.8 + c21.9,30.5,40.1,60.9,56.2,94.5c-10.5-3.8-19.4-6.9-27.2-9.3c-17.8-8.2-38.6-6.9-55.2,3.4l-1.3,0.6c-16.9,8.3-43.2,17.6-60.7,20.5 + c9,3.1,28.8,4.2,38.1,0.5c1.2-0.5,2.5-0.9,3.8-1.2c-4.3,7.4-7,15.6-7.8,24.1c-1.1,11.2,1.1,22.5,6.3,32.6l0,0.1 + c1.6,3.7,3.8,7.2,6.2,9.6c-8,3-16.2,6.3-24.7,10c39.2-6,74.4-7,112.6-2c2.5,12,5.1,24.8,7.4,37.8l-14.2,1.1c-0.4,0-0.8,0.1-1.1,0.1 + c-18.1-14.4-38.2-12-65.7-5.7c-83.7,19.1-64,66-102.5,136.8c40-48.8,37-100,102.1-115.4c15.2-3.6,25.5-8.1,35.8-6.5 + c-18.5,9.3-34.5,24.7-40.8,42.6c-17.9,50.5-6.8,93-26.4,140.2c24.3-42.1,25.8-83.3,47.5-127.6c7.8-15.9,36.8-41.4,54.6-41.8 + l14.6-0.3c4.3,28,6.9,55.9,5.2,79c-3,42.2-14,104.8-20.5,128.7c22-28.3,32.1-88.3,41.7-130.6c10.1-44,7.5-96.7-1.3-144 + c-12.1-64.8,54.6-54.3,93.4-84.8c28.5-22.5,48.1-58.3,74.2-83.7c25.9-25.2,66.7,11.8,76.9,36.4c44.2,106.9,64.3,275.1,52.6,382.8 + c-13.1,120.9-71.5,252.9-178.2,312.5C2423.5,768.5,2263.2,722.2,2128.1,676.7L2128.1,676.7z M1934.9,1213.7 + c-4.4,49.9-21.1,53.2-64.9,52.4c-19.9-0.4-99.2-0.7-119.3-2.4c-28.4-2.5-44.4-5-53.1-11.5c44.6-32.8,120.5-168.1,135.3-214.7 + c15.6-49.2,32.8-92.2,45.5-137.7c5.9,19,10.5,37.9,19,58c14.2,33.7,21.2,54.6,22.2,90.8l3.2,114.6 + C1935.1,1184.7,1937.1,1189.3,1934.9,1213.7L1934.9,1213.7z M591.2,835.8c28.3,98.1,76.7,194.5,130.2,275.5v1.4 + c-3.4,13.9-7.2,27.5-15.4,38.4c-38.3,51.2-135.6-24-163.8-52.7c-30.8-31.5-51.4-68.7-56.3-103.6c-3.6-25.5-0.1-26.1,17.7-44.1 + l71.9-72.8L591.2,835.8L591.2,835.8z M537.1,219c-7.3,15.6-12.4,27.4-15.9,39.6c-15.3,52.7,6.9,99.8-41,138 + c22.5,45.4,21.5,63.5,73.8,42.5c20.2-8.1,36.8-19.4,51.7-32.9c-7.2,18.7-13.8,37.6-19.8,56.7c-1,3.2-2,6.5-3,9.7 + c-37.4,15.9-86.6,26-105.4-13.3c-9.1-19.1-14.3-37.8-21-61.9C394.8,333.5,486.9,249.2,537.1,219L537.1,219z M567.3,286.6 + c-7.6-7.6-13.7-12.8-23.5-11.7c0.8-6.4,1.9-12.7,3.5-18.5c0.8-3,1.6-6,2.5-8.9C562.6,254.9,565.9,268.4,567.3,286.6L567.3,286.6z + M2414.8,48.2c2.3,4.9,4.6,9.9,6.9,14.9c-1.9,1.4-3.6,2.8-5.3,4.3c-3-7.1-7.4-13.5-12.9-18.9C2407.1,48.4,2410.9,48.2,2414.8,48.2 + L2414.8,48.2z M636,337.9L636,337.9L636,337.9L636,337.9z M1109.6,1110.4L1109.6,1110.4L1109.6,1110.4z M1665,1276.2L1665,1276.2 + L1665,1276.2z M1890.6,847.2L1890.6,847.2L1890.6,847.2L1890.6,847.2z M543.4,414.6L543.4,414.6l-0.4-1.1L543.4,414.6L543.4,414.6z + M2710,592.7l0.3,0.2L2710,592.7z M326,399.3c9.8-111,31.4-158.9,110.3-242.5C337.3,226.5,312.7,258.2,326,399.3" /> + <path class="st0" d="M300.5,308.6c10.9-50,21-68.8,51.9-109.8C302.4,233.7,295.9,248,300.5,308.6 M1461.1-387.9 + c-59.3,14.3-70.6,25.2-88.3,83.3C1401.2-347.1,1417.5-360.9,1461.1-387.9" /> + <path class="st0" d="M1554.6-396.3c-117.5,28.8-152.1,49.3-191.1,185.5C1413.1-310.6,1450.7-347.3,1554.6-396.3 M1807.8,100.3 + c12.5-55.5,34.8-109,121-150.4C1814.5-21.5,1793.1,26.5,1807.8,100.3 M2534.8,104.1c67.7-24.1,100.3-78.5,116.5-142.5 + c-26.5,53.6-67.4,98.5-122.9,126c-29.8,14.7-48.8,9.6-82.1,6.4C2480.1,103.8,2501.6,116,2534.8,104.1 M2073.8,158.5 + c-8.7-18.2-24.2-32.3-43.1-39.2c16.6-8.9,32.9-18.2,45.6-29.7c-37.3,17.2-80.6,13-112.6,34.6c-28.2,19-67,79.3-95.6,104.9 + c20.7-8,40.7-22,59.1-36.6c0.2,28.4,16.1,54.3,41.2,67.4c-10.6,13.9-19,29.2-25,45.6c54.5-64.6,133.5-113.3,207.8-134.2 + c-20.8-0.3-45.3,3.6-70.4,11.8C2079.9,174.6,2077.5,166.3,2073.8,158.5 M1995.4,646.4c-2.6,16.7-6.3,37.5-8.9,54.2 + c7.1-18.9,15.6-40.9,23.8-59c8.7-19.1,13.6-20.9,32.2-31c13.1-7.1,37-17,50.1-24.1c-13.5,2.3-37.7,7.2-51.2,9.5 + C2005.3,602.2,2001,610.9,1995.4,646.4 M1378.9,0.9c-41.9,41.4-82.6,183.5-95.6,240.4c20.5-47.2,71.7-179.3,111-212.9 + c10.9-9.3,18.4-15,26.6-19.1c-28.1,47.2-26.1,58.9-16.2,122.2c8.4-64.3,30.6-89.1,67.1-137.1c40-10,77.4-22.1,118.4-38 + c-46.2,5.2-92.4,10-138.7,14.4C1412.7-25.7,1406.4-26.3,1378.9,0.9" /> + <path class="st1" + d="M1949.6,242.8c-7.6-16-0.8-35.2,15.2-42.8c16.1-7.6,35.4-0.8,43,15.3c0.7,1.4,1.3,2.9,1.7,4.5 + c-15.3,11.4-29.3,24.7-41.1,40.2C1960.5,256.8,1953.5,251,1949.6,242.8 M2307.3,104.4c1.3-13.2,12.6-23,25.8-21.7 + c13.3,1.3,23,13.1,21.7,26.3c-0.3,2.7-1,5.4-2.2,7.9c-12.1,2.1-24.2,5.6-36.7,10.2C2310.7,121.8,2306.6,112,2307.3,104.4" /> + </svg> + </span> + </div> </div> <div class="mt-auto"> diff --git a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts index d0c3a1cb..13a6274a 100644 --- a/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts +++ b/components/datalake-handler/admin/src/src/app/database/database-list/database-list.component.ts @@ -37,6 +37,7 @@ import { CouchbaseComponent } from "./dbs-modal/couchbase/couchbase.component"; import { DruidComponent } from "./dbs-modal/druid/druid.component"; import { ElasticsearchComponent } from "./dbs-modal/elasticsearch/elasticsearch.component"; import { MongodbComponent } from "./dbs-modal/mongodb/mongodb.component"; +import { HdfsComponent } from "./dbs-modal/hdfs/hdfs.component"; import { AlertComponent } from "src/app/core/alert/alert.component"; // Notify @@ -190,6 +191,13 @@ export class DatabaseListComponent implements OnInit { }); break; } + case "HDFS": { + modalRef = this.modalService.open(HdfsComponent, { + size: "lg", + centered: true + }); + break; + } default: { break; } diff --git a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts b/components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts index b3c766d1..f5d05bb7 100644 --- a/components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts +++ b/components/datalake-handler/admin/src/src/app/feeder/feeder.component.ts @@ -52,8 +52,7 @@ export class FeederComponent implements OnInit { this.adminService.setTitle("SIDEBAR.FEDDFER"); this.restApiService.getTopicsFromFeeder().subscribe( res => { - // TODO: -1, because __consumer_offsets - this.topicContent = (res.length - 1).toString(); + this.topicContent = res.length.toString(); setTimeout(() => { this.spinner.hide(); }, 500); diff --git a/components/datalake-handler/admin/src/src/app/header/header.component.ts b/components/datalake-handler/admin/src/src/app/header/header.component.ts index 629c19e5..7551157d 100644 --- a/components/datalake-handler/admin/src/src/app/header/header.component.ts +++ b/components/datalake-handler/admin/src/src/app/header/header.component.ts @@ -56,6 +56,7 @@ export class HeaderComponent { private translateService: TranslateService ) { this.translateService.setDefaultLang("en-us"); + sessionStorage.setItem("selectedLang","en-us"); } ngOnInit() { @@ -74,6 +75,7 @@ export class HeaderComponent { changeLanguage(lang: string) { this.translateService.use(lang); + sessionStorage.setItem("selectedLang",lang); } changeFeederStatus() { diff --git a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css index d6d32ca4..21d4bf74 100644 --- a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css +++ b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.css @@ -17,3 +17,9 @@ * limitations under the License. * ============LICENSE_END========================================================= */ +.navbar-nav-nohover:hover{ + background: transparent!important; +} +.navbar-nav-nohover:hover li{ + background: transparent!important; +} diff --git a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html index 238437a0..c8c72b03 100644 --- a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html +++ b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.html @@ -34,7 +34,7 @@ limitations under the License. </a> </li> - <li class="nav-item"> + <li class="nav-item "> <a class="nav-link" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" routerLink="/topics"> <i class="fas fa-cube"> </i> @@ -50,6 +50,32 @@ limitations under the License. </a> </li> + <li class="nav-item " > + <a (click)="this.dashboard = !this.dashboard" + class="nav-link" + style="color: #ffffff!important;background: transparent!important;cursor: pointer" + [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" + routerLink="{{dashboard==true?'/dashboard-setting/dashboard-list':'javascript:void(0)'}}" + > + <i class="fas fa-chart-line" aria-hidden="true"> </i> + {{"SIDEBAR.DASHBOARD" | translate}} + </a> + <ul class="navbar-nav flex-column navbar-nav-nohover" [ngbCollapse]="this.dashboard"> + <li class="nav-item"> + <a class="nav-link" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" + routerLink="/dashboard-setting/dashboard-list"> + {{"SIDEBAR.DASHBOARDLIST" | translate}} + </a> + </li> + <li class="nav-item"> + <a class="nav-link" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" + routerLink="dashboard-setting/template"> + {{"SIDEBAR.TEMPLATE" | translate}} + </a> + </li> + </ul> + </li> + <li class="nav-item"> <a class="nav-link" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" routerLink="/about"> diff --git a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts index f8b68a63..11065d3d 100644 --- a/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts +++ b/components/datalake-handler/admin/src/src/app/sidebar/sidebar.component.ts @@ -35,4 +35,6 @@ export class SidebarComponent implements OnInit { constructor() {} ngOnInit() {} + + dashboard = true; } diff --git a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html index 8c84e447..1e4ed1cc 100644 --- a/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html +++ b/components/datalake-handler/admin/src/src/app/topics/topic-list/topic-list.component.html @@ -343,6 +343,198 @@ limitations under the License. </g> </svg> </span> + + <!-- HDFS enable --> + <span *ngIf="row.sinkdbs.includes('HDFS')" class="pr-1" placement="bottom" ngbTooltip="HDFS" + container="body" tooltipClass="dl-db-icon-hover-enable" [openDelay]="300" [closeDelay]="300"> + <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" width="20" height="20" viewBox="290 -397 2500 1875" + style="enable-background:new 290 -397 2500 1875;" xml:space="preserve"> + <path style="fill:#5DBEBB" d="M2150,170.1c-85.6,46.1-167.6,92.4-211.3,180C1938.6,239,2050.2,190.1,2150,170.1 M1921.6-48.4 + c-63.6,43.3-108.5,130.8-102.9,216c-20.7-73.8-13.4-143.5,50.2-194.5c10.7-5.2,21.5-10.4,32.2-15.6 + C1908-44.5,1914.8-46.4,1921.6-48.4" /> + <path style="fill:#5DBEBB" + d="M2777,152.8c-11.5-72.7-30.6-143.2-57.2-194c-3.2-6.2-8.1-12.5-14.2-18.5c-13.2-13-32.7-25.3-52.8-32.2 + c-21.3-7.3-43.9-8.8-61.7,0.5c-4.6,2.4-9,5.6-12.8,9.5c-11.6,11.7-21.3,26-31.1,40.2c-10.9,15.9-21.8,31.9-34.9,43 + c-15.2,13-34.1,20.8-52,28c-7.5-18.3-16.6-35.9-27.1-52.6c-12.2-19.5-26.2-37.8-41.5-56.1c-11.2-13.5-23.9-25.6-37.9-36.2 + c-13.2-10.1-26.8-18.6-42.5-28.4c-42.3-26.5-78.2-58-114.9-90.2c-16.7-14.6-33.5-29.4-50-43c-87.4-72.1-168.9-107-256.1-112.5 + c-86.6-5.4-178,18.3-286,63.8c-52.1,21.9-90.8,47.8-124.5,79c-32.2,29.8-59.5,64.1-89.6,104.1c-17.5,1.2-33,3.8-48.8,10.2 + c-17.4,7-35,18.3-56,36.8c-14.6,12.9-29,26.1-43,39.7c-12.8,12.5-25.5,25.1-37.8,38.1c-98.3,15.8-178.4,33.2-250.1,61 + c-73.3,28.4-138,67.5-204.4,126.4c-26.1,23.1-50,48.7-71.2,76.4c-20.2,26.5-37.5,54.3-52.6,83.6c-13.3,14.7-26.6,29.5-41,42.5 + c-14,12.6-29,23.3-45.8,29.8l0,0c-9.8,3.8-13.8,6-14.2,5.8c-0.5-0.3-0.8-1.7-1.4-4.4c24.1-23,27.9-56.8,30.1-90.3 + c2.9,3.5,5.7,7.7,8.5,12.2c3.2,4.9,6.4,10,10.4,14.9l16.4,20.6l5.7-25.7c4.8-21.6,8.4-50.3,2.8-75.2c-3.6-16.2-11.1-30.6-24.2-40.8 + c1.2-3.3,2.4-6.3,3.6-9.2c4.1-10.5,8.3-21.3,11.9-31.4l7.1-20.2l-21.1,3.7c-28.1,4.9-88.4,38-130.9,82.1 + c-15.8,16.4-29.3,34.5-38.2,53.5c-9.3,19.8-13.4,40.4-9.8,61.1c3.1,18.1,12.2,35.8,28.6,52.6c3,12.1,5.8,22.6,8.7,32 + c3.4,10.8,7,20.4,11.6,29.8c12.4,25.7,32.1,41.4,54.9,48.7c18.3,5.9,38.6,6.2,58.5,1.8c-4,23.7-6.5,47.6-7.3,71.6 + c-1.3,33.5,0,70.6,3.7,113.6c0.8,9.4,2,19.8,3.6,31.1c1.4,9.6,3,19.1,4.7,28.5c-3.7,10.1-7.5,20.3-11.2,30.4l-17.4,47.2l-38.2,37.8 + c-11.9,11.7-23.8,23.5-35.6,35.3c-1,1-5,4.8-8.6,8.3c-24.1,23.2-28.8,27.8-22,68.5c4.4,26.1,12.9,51.3,25.2,74.7 + c11.8,22.5,27.7,44.4,48,64.8c25.4,25.4,67,57.1,110.6,73.6c24.9,9.5,50.6,14.1,74.7,10.2c-1.2,3.7-2.4,7.4-3.8,11.1 + c-3.8,10.6-8,21-12.7,31.2c-29.6,64.8,0.8,98.6,48,120.2c23.6,10.7,51.6,18,77.7,24.8c5.3,1.4,10.7,2.8,17.4,4.6 + c30.9,8.3,84.2,23.7,132.9,26.7c53.2,3.4,101.1-7.6,114-55.3c5.1-18.9,8-33.4,9.2-47.6c1.1-13.2,0.7-26.5-0.9-42.9 + c15.2-33.6,21.6-43,32.7-59.2c2.2-3.2,4.8-7,5.6-8.2c11.9-17.6,17.5-30.1,19.5-44.2c2-13.6,0.3-27.1-2.2-47.8 + c-0.2-2-0.6-4.8-1.1-8.6c30.6,4,61.4,6.1,92.3,6.3c15.5,0.1,31-0.4,46.4-1.2c-4,2-7.8,4-12.1,6.2l-5.8,3 + c-41.1,21.1-42.8,61.1-29.9,102.2c11.6,37.1,35.4,75,50.4,98c31.4,48.5,61.5,89.5,97.8,111.8c38.1,23.4,81.7,26.1,137.9-4.3 + c28.6-15.5,37.6-31.3,49.8-52.6c3.7-6.5,7.8-13.6,12.4-20.6c11.8-7.8,41.2-32.1,70.1-56c9.8-8.1,19.7-16.2,30.7-25.2 + c7.6,5.6,16.9,9.5,28,12.2c14.5,3.5,31.7,5,52.4,6.5c15.5,1.1,65.9,1.1,98.4,1.1c10.1,0,18.4,0,23.4,0c33.6,0.2,60.8-1.6,81.3-13.2 + c21.9-12.4,34.8-34.3,37.6-73.7c1.2-17.5,1.5-28.3-1-39.3c-2.3-10.3-6.7-19.7-14.3-33.3c-0.5-17-0.9-34-1.4-51 + c-0.5-18-1-36.1-1.4-54.1c-0.6-21.3-2.9-38.6-7.2-55.6c-4.3-16.9-10.4-33.1-18.6-52.6c-5.1-12.3-9.9-24.7-14.4-37.2l-11.8,4.3 + l1.8-0.7l10-3.7l0,0c-7-19-14-37.4-23.7-57.2c0.6-3.8,1.3-7.9,1.9-12.3l18.7,18.1l27.6,26.6c21.1,20.3,40.3,38.8,63,52.1 + c23.4,13.8,49.7,21.8,83.8,20.2c35.7-1.7,73.9-16.7,105.3-39.9c30.4-22.5,54.8-52.7,65-86.2l8.8-29.1l7.1-23.2 + c50,8.5,103.7,11.2,155.6,5.8c50.1-5.3,98.4-18,140.1-40.3c61.3-32.7,107.3-80.9,140.3-138.1l0,0c36.9-63.9,57.6-139.3,65.4-216.8 + C2793.4,318.9,2789.9,234.3,2777,152.8L2777,152.8z M2128.7,675.5c-28.8-9.7-48.9-23.9-74.2-39.8c6.9,31.1,10,64,0.8,95 + c-14.6,49.2-38.1,129.8,28.7,144.6c25.4,5.6,37,4.8,72.9-13.7c-29.1,6.6-43.7,5-63.7,1.3c-18.1-3.3-27.7-14.8-32.8-28.4 + c6.3,4.6,16.6,7,34.3,11.3c49.6,12,96.8-11.9,106-46.3c5.4-20.1,4.5-30.6,15.9-58c10.3,3.2,20.8,6.1,31.7,8.7l-18.4,60 + c-15.9,52-78,93.8-132.8,92.9c-50.6-0.9-82.8-32.6-117.7-63.7c-24.1-21.4-47.3-41.9-70.2-62.3c-63-19.9-113.6-43.1-172.1-86.4 + c41.6,48.9,69.9,76,127.9,100.4c-8.4,86.1-38.4,148.9-63.9,231.4c-11.6,37.3-102.7,186.6-128,201.2c-18,10.4-130.9,105.4-152.1,118 + c-15.8,21-29.7,50-53.5,62.6c-72.4,38.3-119-35-158-97c-17.7-28.2-67-109.5-24.1-132.3c40.6-21.5,63.4-36.9,104.8-64.1 + c6.1,11.1,16.5,21.8,23.3,32.9l-4.5-36.4c-2.7-22-2.6-39.8-0.9-61.9c1.7-21.4,3.4-42.8,5.1-64.2c-6.2,21.8-18.7,43.5-24.9,65.3 + c-2.5,8.7-4.6,15.7-5.7,22.3c-93,19-185.3,20.2-278.4,3.6c-5.9-34.4-13.2-70.3-19.2-96.1c-1.8,28.8-0.7,108.5-0.8,153.1 + c-0.1,34.6-1.6,46.4-19.4,75.8c-16.7,27.5-23.7,33.8-47.1,80.3c2,29.3,2,48.7-5.8,76.6c-13,46.3-143.8,10.4-178.2,1 + c-42.5-11.6-130.3-28.9-108.2-85.5c19.4-49.8,31.8-102.4,41.3-172.1c-77.8-112.1-150.2-265.8-164.1-402 + c-10.8-105.7-4.3-170.8,18.6-235.4c36.2-102.5,87-191.2,168.3-262.6c109.8-96.3,212.4-135,373-159.5c-38.6,43.3-76.9,89-118.5,138 + c-42.2,49.6-67.2,99.8-94,154.1c-37,75-36.2,103.5,12.8,169.4c42.3,56.7,65.1,82.3,83.5,137.8c-15.2,31.4-20.8,58-25.9,100.8 + c51.7,56.6,90.2,95.3,140.4,107.3c49.3,11.7,90.4,9.5,134.5-13.1c97.9-50.1,188.5-114.7,299-117.4c51.1-125.6,45.9-230.6,21.4-352.2 + c-16.8-83-23.5-161.6-28.7-246.2c-20.7,87.2-24.6,163.8-9.2,250.6c18.5,104.6,32.9,220.2-18.6,312.2c-99.9,7.6-185.5,68.4-275.5,115 + c-36.2,18.8-73.9,20.6-113.9,9.6c-37.2-10.2-62.3-34.8-102.3-81c-0.6-46.4,9.8-67.8,31.1-109.8c34.2-67.5,72-130.2,113.4-196.6 + c-50.7,61.3-98.8,112.4-138.8,174C1058,555.1,1036.2,533,1000,484c-35.3-47.8-39-68.8-12.6-124.2c26.6-55.6,49.1-104.5,94.3-153.3 + c78.1-84.3,149.6-178.2,235.1-261.3c46.4-45.1,65.2-43.5,126.7-52.9c55.6-8.4,109.9-19.1,166.6-32.2c-54.8,5.1-107.8,7-161.2,8.3 + h-1.7c52.5-67.1,83-104.5,168.3-141.5c210-91.2,343.5-101.1,508.5,37.6c42.8,36,80.1,70.8,123.5,101.9c-15.7,1.3-29.3,4.2-47.2,11.2 + c21.8-4.2,47,0,69.6,4.1c6.3,4.1,12.9,8.1,19.6,12.1c30.6,18,48,28,68.7,56.8c21.9,30.5,40.1,60.9,56.2,94.5 + c-10.5-3.8-19.4-6.9-27.2-9.3c-17.8-8.2-38.6-6.9-55.2,3.4l-1.3,0.6c-16.9,8.3-43.2,17.6-60.7,20.5c9,3.1,28.8,4.2,38.1,0.5 + c1.2-0.5,2.5-0.9,3.8-1.2c-4.3,7.4-7,15.6-7.8,24.1c-1.1,11.2,1.1,22.5,6.3,32.6v0.1c1.6,3.7,3.8,7.2,6.2,9.6c-8,3-16.2,6.3-24.7,10 + c39.2-6,74.4-7,112.6-2c2.5,12,5.1,24.8,7.4,37.8l-14.2,1.1c-0.4,0-0.8,0.1-1.1,0.1c-18.1-14.4-38.2-12-65.7-5.7 + c-83.7,19.1-64,66-102.5,136.8c40-48.8,37-100,102.1-115.4c15.2-3.6,25.5-8.1,35.8-6.5c-18.5,9.3-34.5,24.7-40.8,42.6 + c-17.9,50.5-6.8,93-26.4,140.2c24.3-42.1,25.8-83.3,47.5-127.6c7.8-15.9,36.8-41.4,54.6-41.8l14.6-0.3c4.3,28,6.9,55.9,5.2,79 + c-3,42.2-14,104.8-20.5,128.7c22-28.3,32.1-88.3,41.7-130.6c10.1-44,7.5-96.7-1.3-144c-12.1-64.8,54.6-54.3,93.4-84.8 + c28.5-22.5,48.1-58.3,74.2-83.7c25.9-25.2,66.7,11.8,76.9,36.4c44.2,106.9,64.3,275.1,52.6,382.8 + c-13.1,120.9-71.5,252.9-178.2,312.5C2424.1,767.3,2263.8,721,2128.7,675.5L2128.7,675.5z M1935.5,1212.5 + c-4.4,49.9-21.1,53.2-64.9,52.4c-19.9-0.4-99.2-0.7-119.3-2.4c-28.4-2.5-44.4-5-53.1-11.5c44.6-32.8,120.5-168.1,135.3-214.7 + c15.6-49.2,32.8-92.2,45.5-137.7c5.9,19,10.5,37.9,19,58c14.2,33.7,21.2,54.6,22.2,90.8l3.2,114.6 + C1935.7,1183.5,1937.7,1188.1,1935.5,1212.5L1935.5,1212.5z M591.8,834.6c28.3,98.1,76.7,194.5,130.2,275.5v1.4 + c-3.4,13.9-7.2,27.5-15.4,38.4c-38.3,51.2-135.6-24-163.8-52.7c-30.8-31.5-51.4-68.7-56.3-103.6c-3.6-25.5-0.1-26.1,17.7-44.1 + l71.9-72.8L591.8,834.6L591.8,834.6z M537.7,217.8c-7.3,15.6-12.4,27.4-15.9,39.6c-15.3,52.7,6.9,99.8-41,138 + c22.5,45.4,21.5,63.5,73.8,42.5c20.2-8.1,36.8-19.4,51.7-32.9c-7.2,18.7-13.8,37.6-19.8,56.7c-1,3.2-2,6.5-3,9.7 + c-37.4,15.9-86.6,26-105.4-13.3c-9.1-19.1-14.3-37.8-21-61.9C395.4,332.3,487.5,248,537.7,217.8L537.7,217.8z M567.9,285.4 + c-7.6-7.6-13.7-12.8-23.5-11.7c0.8-6.4,1.9-12.7,3.5-18.5c0.8-3,1.6-6,2.5-8.9C563.2,253.7,566.5,267.2,567.9,285.4L567.9,285.4z + M2415.4,47c2.3,4.9,4.6,9.9,6.9,14.9c-1.9,1.4-3.6,2.8-5.3,4.3c-3-7.1-7.4-13.5-12.9-18.9C2407.7,47.2,2411.5,47,2415.4,47 + L2415.4,47z M636.6,336.7L636.6,336.7L636.6,336.7L636.6,336.7z M1110.2,1109.2L1110.2,1109.2L1110.2,1109.2z M1665.6,1275 + L1665.6,1275L1665.6,1275z M1891.2,846L1891.2,846L1891.2,846L1891.2,846z M544,413.4L544,413.4l-0.4-1.1L544,413.4L544,413.4z + M2710.6,591.5l0.3,0.2L2710.6,591.5z M326.6,398.1c9.8-111,31.4-158.9,110.3-242.5C337.9,225.3,313.3,257,326.6,398.1" /> + <path style="fill:#5DBEBB" d="M301.1,307.4c10.9-50,21-68.8,51.9-109.8C303,232.5,296.5,246.8,301.1,307.4 M1461.7-389.1 + c-59.3,14.3-70.6,25.2-88.3,83.3C1401.8-348.3,1418.1-362.1,1461.7-389.1" /> + <path style="fill:#5DBEBB" d="M1555.2-397.5c-117.5,28.8-152.1,49.3-191.1,185.5C1413.7-311.8,1451.3-348.5,1555.2-397.5 M1808.4,99.1 + c12.5-55.5,34.8-109,121-150.4C1815.1-22.7,1793.7,25.3,1808.4,99.1 M2535.4,102.9c67.7-24.1,100.3-78.5,116.5-142.5 + c-26.5,53.6-67.4,98.5-122.9,126c-29.8,14.7-48.8,9.6-82.1,6.4C2480.7,102.6,2502.2,114.8,2535.4,102.9 M2074.4,157.3 + c-8.7-18.2-24.2-32.3-43.1-39.2c16.6-8.9,32.9-18.2,45.6-29.7c-37.3,17.2-80.6,13-112.6,34.6c-28.2,19-67,79.3-95.6,104.9 + c20.7-8,40.7-22,59.1-36.6c0.2,28.4,16.1,54.3,41.2,67.4c-10.6,13.9-19,29.2-25,45.6c54.5-64.6,133.5-113.3,207.8-134.2 + c-20.8-0.3-45.3,3.6-70.4,11.8C2080.5,173.4,2078.1,165.1,2074.4,157.3 M1996,645.2c-2.6,16.7-6.3,37.5-8.9,54.2 + c7.1-18.9,15.6-40.9,23.8-59c8.7-19.1,13.6-20.9,32.2-31c13.1-7.1,37-17,50.1-24.1c-13.5,2.3-37.7,7.2-51.2,9.5 + C2005.9,601,2001.6,609.7,1996,645.2 M1379.5-0.3c-41.9,41.4-82.6,183.5-95.6,240.4c20.5-47.2,71.7-179.3,111-212.9 + c10.9-9.3,18.4-15,26.6-19.1c-28.1,47.2-26.1,58.9-16.2,122.2c8.4-64.3,30.6-89.1,67.1-137.1c40-10,77.4-22.1,118.4-38 + c-46.2,5.2-92.4,10-138.7,14.4C1413.3-26.9,1407-27.5,1379.5-0.3" /> + <path style="fill: #FFFFFF" + d="M1950.2,241.6c-7.6-16-0.8-35.2,15.2-42.8c16.1-7.6,35.4-0.8,43,15.3c0.7,1.4,1.3,2.9,1.7,4.5 + c-15.3,11.4-29.3,24.7-41.1,40.2C1961.1,255.6,1954.1,249.8,1950.2,241.6 M2307.9,103.2c1.3-13.2,12.6-23,25.8-21.7 + c13.3,1.3,23,13.1,21.7,26.3c-0.3,2.7-1,5.4-2.2,7.9c-12.1,2.1-24.2,5.6-36.7,10.2C2311.3,120.6,2307.2,110.8,2307.9,103.2" /> + </svg> + + </span> + <!-- HDFS disable --> + <span *ngIf="!row.sinkdbs.includes('HDFS')" class="pr-1" placement="bottom" ngbTooltip="HDFS" + container="body" tooltipClass="dl-db-icon-hover-disable" [openDelay]="300" [closeDelay]="300"> + <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" + y="0px" width="20" height="20" viewBox="290 -397 2500 1875" + style="enable-background:new 290 -397 2500 1875;" xml:space="preserve"> + <path style="fill: #d2d3d5" d="M2150,170.1c-85.6,46.1-167.6,92.4-211.3,180C1938.6,239,2050.2,190.1,2150,170.1 M1921.6-48.4 + c-63.6,43.3-108.5,130.8-102.9,216c-20.7-73.8-13.4-143.5,50.2-194.5c10.7-5.2,21.5-10.4,32.2-15.6 + C1908-44.5,1914.8-46.4,1921.6-48.4" /> + <path style="fill: #d2d3d5" + d="M2777,152.8c-11.5-72.7-30.6-143.2-57.2-194c-3.2-6.2-8.1-12.5-14.2-18.5c-13.2-13-32.7-25.3-52.8-32.2 + c-21.3-7.3-43.9-8.8-61.7,0.5c-4.6,2.4-9,5.6-12.8,9.5c-11.6,11.7-21.3,26-31.1,40.2c-10.9,15.9-21.8,31.9-34.9,43 + c-15.2,13-34.1,20.8-52,28c-7.5-18.3-16.6-35.9-27.1-52.6c-12.2-19.5-26.2-37.8-41.5-56.1c-11.2-13.5-23.9-25.6-37.9-36.2 + c-13.2-10.1-26.8-18.6-42.5-28.4c-42.3-26.5-78.2-58-114.9-90.2c-16.7-14.6-33.5-29.4-50-43c-87.4-72.1-168.9-107-256.1-112.5 + c-86.6-5.4-178,18.3-286,63.8c-52.1,21.9-90.8,47.8-124.5,79c-32.2,29.8-59.5,64.1-89.6,104.1c-17.5,1.2-33,3.8-48.8,10.2 + c-17.4,7-35,18.3-56,36.8c-14.6,12.9-29,26.1-43,39.7c-12.8,12.5-25.5,25.1-37.8,38.1c-98.3,15.8-178.4,33.2-250.1,61 + c-73.3,28.4-138,67.5-204.4,126.4c-26.1,23.1-50,48.7-71.2,76.4c-20.2,26.5-37.5,54.3-52.6,83.6c-13.3,14.7-26.6,29.5-41,42.5 + c-14,12.6-29,23.3-45.8,29.8l0,0c-9.8,3.8-13.8,6-14.2,5.8c-0.5-0.3-0.8-1.7-1.4-4.4c24.1-23,27.9-56.8,30.1-90.3 + c2.9,3.5,5.7,7.7,8.5,12.2c3.2,4.9,6.4,10,10.4,14.9l16.4,20.6l5.7-25.7c4.8-21.6,8.4-50.3,2.8-75.2c-3.6-16.2-11.1-30.6-24.2-40.8 + c1.2-3.3,2.4-6.3,3.6-9.2c4.1-10.5,8.3-21.3,11.9-31.4l7.1-20.2l-21.1,3.7c-28.1,4.9-88.4,38-130.9,82.1 + c-15.8,16.4-29.3,34.5-38.2,53.5c-9.3,19.8-13.4,40.4-9.8,61.1c3.1,18.1,12.2,35.8,28.6,52.6c3,12.1,5.8,22.6,8.7,32 + c3.4,10.8,7,20.4,11.6,29.8c12.4,25.7,32.1,41.4,54.9,48.7c18.3,5.9,38.6,6.2,58.5,1.8c-4,23.7-6.5,47.6-7.3,71.6 + c-1.3,33.5,0,70.6,3.7,113.6c0.8,9.4,2,19.8,3.6,31.1c1.4,9.6,3,19.1,4.7,28.5c-3.7,10.1-7.5,20.3-11.2,30.4l-17.4,47.2l-38.2,37.8 + c-11.9,11.7-23.8,23.5-35.6,35.3c-1,1-5,4.8-8.6,8.3c-24.1,23.2-28.8,27.8-22,68.5c4.4,26.1,12.9,51.3,25.2,74.7 + c11.8,22.5,27.7,44.4,48,64.8c25.4,25.4,67,57.1,110.6,73.6c24.9,9.5,50.6,14.1,74.7,10.2c-1.2,3.7-2.4,7.4-3.8,11.1 + c-3.8,10.6-8,21-12.7,31.2c-29.6,64.8,0.8,98.6,48,120.2c23.6,10.7,51.6,18,77.7,24.8c5.3,1.4,10.7,2.8,17.4,4.6 + c30.9,8.3,84.2,23.7,132.9,26.7c53.2,3.4,101.1-7.6,114-55.3c5.1-18.9,8-33.4,9.2-47.6c1.1-13.2,0.7-26.5-0.9-42.9 + c15.2-33.6,21.6-43,32.7-59.2c2.2-3.2,4.8-7,5.6-8.2c11.9-17.6,17.5-30.1,19.5-44.2c2-13.6,0.3-27.1-2.2-47.8 + c-0.2-2-0.6-4.8-1.1-8.6c30.6,4,61.4,6.1,92.3,6.3c15.5,0.1,31-0.4,46.4-1.2c-4,2-7.8,4-12.1,6.2l-5.8,3 + c-41.1,21.1-42.8,61.1-29.9,102.2c11.6,37.1,35.4,75,50.4,98c31.4,48.5,61.5,89.5,97.8,111.8c38.1,23.4,81.7,26.1,137.9-4.3 + c28.6-15.5,37.6-31.3,49.8-52.6c3.7-6.5,7.8-13.6,12.4-20.6c11.8-7.8,41.2-32.1,70.1-56c9.8-8.1,19.7-16.2,30.7-25.2 + c7.6,5.6,16.9,9.5,28,12.2c14.5,3.5,31.7,5,52.4,6.5c15.5,1.1,65.9,1.1,98.4,1.1c10.1,0,18.4,0,23.4,0c33.6,0.2,60.8-1.6,81.3-13.2 + c21.9-12.4,34.8-34.3,37.6-73.7c1.2-17.5,1.5-28.3-1-39.3c-2.3-10.3-6.7-19.7-14.3-33.3c-0.5-17-0.9-34-1.4-51 + c-0.5-18-1-36.1-1.4-54.1c-0.6-21.3-2.9-38.6-7.2-55.6c-4.3-16.9-10.4-33.1-18.6-52.6c-5.1-12.3-9.9-24.7-14.4-37.2l-11.8,4.3 + l1.8-0.7l10-3.7l0,0c-7-19-14-37.4-23.7-57.2c0.6-3.8,1.3-7.9,1.9-12.3l18.7,18.1l27.6,26.6c21.1,20.3,40.3,38.8,63,52.1 + c23.4,13.8,49.7,21.8,83.8,20.2c35.7-1.7,73.9-16.7,105.3-39.9c30.4-22.5,54.8-52.7,65-86.2l8.8-29.1l7.1-23.2 + c50,8.5,103.7,11.2,155.6,5.8c50.1-5.3,98.4-18,140.1-40.3c61.3-32.7,107.3-80.9,140.3-138.1l0,0c36.9-63.9,57.6-139.3,65.4-216.8 + C2793.4,318.9,2789.9,234.3,2777,152.8L2777,152.8z M2128.7,675.5c-28.8-9.7-48.9-23.9-74.2-39.8c6.9,31.1,10,64,0.8,95 + c-14.6,49.2-38.1,129.8,28.7,144.6c25.4,5.6,37,4.8,72.9-13.7c-29.1,6.6-43.7,5-63.7,1.3c-18.1-3.3-27.7-14.8-32.8-28.4 + c6.3,4.6,16.6,7,34.3,11.3c49.6,12,96.8-11.9,106-46.3c5.4-20.1,4.5-30.6,15.9-58c10.3,3.2,20.8,6.1,31.7,8.7l-18.4,60 + c-15.9,52-78,93.8-132.8,92.9c-50.6-0.9-82.8-32.6-117.7-63.7c-24.1-21.4-47.3-41.9-70.2-62.3c-63-19.9-113.6-43.1-172.1-86.4 + c41.6,48.9,69.9,76,127.9,100.4c-8.4,86.1-38.4,148.9-63.9,231.4c-11.6,37.3-102.7,186.6-128,201.2c-18,10.4-130.9,105.4-152.1,118 + c-15.8,21-29.7,50-53.5,62.6c-72.4,38.3-119-35-158-97c-17.7-28.2-67-109.5-24.1-132.3c40.6-21.5,63.4-36.9,104.8-64.1 + c6.1,11.1,16.5,21.8,23.3,32.9l-4.5-36.4c-2.7-22-2.6-39.8-0.9-61.9c1.7-21.4,3.4-42.8,5.1-64.2c-6.2,21.8-18.7,43.5-24.9,65.3 + c-2.5,8.7-4.6,15.7-5.7,22.3c-93,19-185.3,20.2-278.4,3.6c-5.9-34.4-13.2-70.3-19.2-96.1c-1.8,28.8-0.7,108.5-0.8,153.1 + c-0.1,34.6-1.6,46.4-19.4,75.8c-16.7,27.5-23.7,33.8-47.1,80.3c2,29.3,2,48.7-5.8,76.6c-13,46.3-143.8,10.4-178.2,1 + c-42.5-11.6-130.3-28.9-108.2-85.5c19.4-49.8,31.8-102.4,41.3-172.1c-77.8-112.1-150.2-265.8-164.1-402 + c-10.8-105.7-4.3-170.8,18.6-235.4c36.2-102.5,87-191.2,168.3-262.6c109.8-96.3,212.4-135,373-159.5c-38.6,43.3-76.9,89-118.5,138 + c-42.2,49.6-67.2,99.8-94,154.1c-37,75-36.2,103.5,12.8,169.4c42.3,56.7,65.1,82.3,83.5,137.8c-15.2,31.4-20.8,58-25.9,100.8 + c51.7,56.6,90.2,95.3,140.4,107.3c49.3,11.7,90.4,9.5,134.5-13.1c97.9-50.1,188.5-114.7,299-117.4c51.1-125.6,45.9-230.6,21.4-352.2 + c-16.8-83-23.5-161.6-28.7-246.2c-20.7,87.2-24.6,163.8-9.2,250.6c18.5,104.6,32.9,220.2-18.6,312.2c-99.9,7.6-185.5,68.4-275.5,115 + c-36.2,18.8-73.9,20.6-113.9,9.6c-37.2-10.2-62.3-34.8-102.3-81c-0.6-46.4,9.8-67.8,31.1-109.8c34.2-67.5,72-130.2,113.4-196.6 + c-50.7,61.3-98.8,112.4-138.8,174C1058,555.1,1036.2,533,1000,484c-35.3-47.8-39-68.8-12.6-124.2c26.6-55.6,49.1-104.5,94.3-153.3 + c78.1-84.3,149.6-178.2,235.1-261.3c46.4-45.1,65.2-43.5,126.7-52.9c55.6-8.4,109.9-19.1,166.6-32.2c-54.8,5.1-107.8,7-161.2,8.3 + h-1.7c52.5-67.1,83-104.5,168.3-141.5c210-91.2,343.5-101.1,508.5,37.6c42.8,36,80.1,70.8,123.5,101.9c-15.7,1.3-29.3,4.2-47.2,11.2 + c21.8-4.2,47,0,69.6,4.1c6.3,4.1,12.9,8.1,19.6,12.1c30.6,18,48,28,68.7,56.8c21.9,30.5,40.1,60.9,56.2,94.5 + c-10.5-3.8-19.4-6.9-27.2-9.3c-17.8-8.2-38.6-6.9-55.2,3.4l-1.3,0.6c-16.9,8.3-43.2,17.6-60.7,20.5c9,3.1,28.8,4.2,38.1,0.5 + c1.2-0.5,2.5-0.9,3.8-1.2c-4.3,7.4-7,15.6-7.8,24.1c-1.1,11.2,1.1,22.5,6.3,32.6v0.1c1.6,3.7,3.8,7.2,6.2,9.6c-8,3-16.2,6.3-24.7,10 + c39.2-6,74.4-7,112.6-2c2.5,12,5.1,24.8,7.4,37.8l-14.2,1.1c-0.4,0-0.8,0.1-1.1,0.1c-18.1-14.4-38.2-12-65.7-5.7 + c-83.7,19.1-64,66-102.5,136.8c40-48.8,37-100,102.1-115.4c15.2-3.6,25.5-8.1,35.8-6.5c-18.5,9.3-34.5,24.7-40.8,42.6 + c-17.9,50.5-6.8,93-26.4,140.2c24.3-42.1,25.8-83.3,47.5-127.6c7.8-15.9,36.8-41.4,54.6-41.8l14.6-0.3c4.3,28,6.9,55.9,5.2,79 + c-3,42.2-14,104.8-20.5,128.7c22-28.3,32.1-88.3,41.7-130.6c10.1-44,7.5-96.7-1.3-144c-12.1-64.8,54.6-54.3,93.4-84.8 + c28.5-22.5,48.1-58.3,74.2-83.7c25.9-25.2,66.7,11.8,76.9,36.4c44.2,106.9,64.3,275.1,52.6,382.8 + c-13.1,120.9-71.5,252.9-178.2,312.5C2424.1,767.3,2263.8,721,2128.7,675.5L2128.7,675.5z M1935.5,1212.5 + c-4.4,49.9-21.1,53.2-64.9,52.4c-19.9-0.4-99.2-0.7-119.3-2.4c-28.4-2.5-44.4-5-53.1-11.5c44.6-32.8,120.5-168.1,135.3-214.7 + c15.6-49.2,32.8-92.2,45.5-137.7c5.9,19,10.5,37.9,19,58c14.2,33.7,21.2,54.6,22.2,90.8l3.2,114.6 + C1935.7,1183.5,1937.7,1188.1,1935.5,1212.5L1935.5,1212.5z M591.8,834.6c28.3,98.1,76.7,194.5,130.2,275.5v1.4 + c-3.4,13.9-7.2,27.5-15.4,38.4c-38.3,51.2-135.6-24-163.8-52.7c-30.8-31.5-51.4-68.7-56.3-103.6c-3.6-25.5-0.1-26.1,17.7-44.1 + l71.9-72.8L591.8,834.6L591.8,834.6z M537.7,217.8c-7.3,15.6-12.4,27.4-15.9,39.6c-15.3,52.7,6.9,99.8-41,138 + c22.5,45.4,21.5,63.5,73.8,42.5c20.2-8.1,36.8-19.4,51.7-32.9c-7.2,18.7-13.8,37.6-19.8,56.7c-1,3.2-2,6.5-3,9.7 + c-37.4,15.9-86.6,26-105.4-13.3c-9.1-19.1-14.3-37.8-21-61.9C395.4,332.3,487.5,248,537.7,217.8L537.7,217.8z M567.9,285.4 + c-7.6-7.6-13.7-12.8-23.5-11.7c0.8-6.4,1.9-12.7,3.5-18.5c0.8-3,1.6-6,2.5-8.9C563.2,253.7,566.5,267.2,567.9,285.4L567.9,285.4z + M2415.4,47c2.3,4.9,4.6,9.9,6.9,14.9c-1.9,1.4-3.6,2.8-5.3,4.3c-3-7.1-7.4-13.5-12.9-18.9C2407.7,47.2,2411.5,47,2415.4,47 + L2415.4,47z M636.6,336.7L636.6,336.7L636.6,336.7L636.6,336.7z M1110.2,1109.2L1110.2,1109.2L1110.2,1109.2z M1665.6,1275 + L1665.6,1275L1665.6,1275z M1891.2,846L1891.2,846L1891.2,846L1891.2,846z M544,413.4L544,413.4l-0.4-1.1L544,413.4L544,413.4z + M2710.6,591.5l0.3,0.2L2710.6,591.5z M326.6,398.1c9.8-111,31.4-158.9,110.3-242.5C337.9,225.3,313.3,257,326.6,398.1" /> + <path style="fill: #d2d3d5" d="M301.1,307.4c10.9-50,21-68.8,51.9-109.8C303,232.5,296.5,246.8,301.1,307.4 M1461.7-389.1 + c-59.3,14.3-70.6,25.2-88.3,83.3C1401.8-348.3,1418.1-362.1,1461.7-389.1" /> + <path style="fill: #d2d3d5" d="M1555.2-397.5c-117.5,28.8-152.1,49.3-191.1,185.5C1413.7-311.8,1451.3-348.5,1555.2-397.5 M1808.4,99.1 + c12.5-55.5,34.8-109,121-150.4C1815.1-22.7,1793.7,25.3,1808.4,99.1 M2535.4,102.9c67.7-24.1,100.3-78.5,116.5-142.5 + c-26.5,53.6-67.4,98.5-122.9,126c-29.8,14.7-48.8,9.6-82.1,6.4C2480.7,102.6,2502.2,114.8,2535.4,102.9 M2074.4,157.3 + c-8.7-18.2-24.2-32.3-43.1-39.2c16.6-8.9,32.9-18.2,45.6-29.7c-37.3,17.2-80.6,13-112.6,34.6c-28.2,19-67,79.3-95.6,104.9 + c20.7-8,40.7-22,59.1-36.6c0.2,28.4,16.1,54.3,41.2,67.4c-10.6,13.9-19,29.2-25,45.6c54.5-64.6,133.5-113.3,207.8-134.2 + c-20.8-0.3-45.3,3.6-70.4,11.8C2080.5,173.4,2078.1,165.1,2074.4,157.3 M1996,645.2c-2.6,16.7-6.3,37.5-8.9,54.2 + c7.1-18.9,15.6-40.9,23.8-59c8.7-19.1,13.6-20.9,32.2-31c13.1-7.1,37-17,50.1-24.1c-13.5,2.3-37.7,7.2-51.2,9.5 + C2005.9,601,2001.6,609.7,1996,645.2 M1379.5-0.3c-41.9,41.4-82.6,183.5-95.6,240.4c20.5-47.2,71.7-179.3,111-212.9 + c10.9-9.3,18.4-15,26.6-19.1c-28.1,47.2-26.1,58.9-16.2,122.2c8.4-64.3,30.6-89.1,67.1-137.1c40-10,77.4-22.1,118.4-38 + c-46.2,5.2-92.4,10-138.7,14.4C1413.3-26.9,1407-27.5,1379.5-0.3" /> + <path style="fill: #FFFFFF" + d="M1950.2,241.6c-7.6-16-0.8-35.2,15.2-42.8c16.1-7.6,35.4-0.8,43,15.3c0.7,1.4,1.3,2.9,1.7,4.5 + c-15.3,11.4-29.3,24.7-41.1,40.2C1961.1,255.6,1954.1,249.8,1950.2,241.6 M2307.9,103.2c1.3-13.2,12.6-23,25.8-21.7 + c13.3,1.3,23,13.1,21.7,26.3c-0.3,2.7-1,5.4-2.2,7.9c-12.1,2.1-24.2,5.6-36.7,10.2C2311.3,120.6,2307.2,110.8,2307.9,103.2" /> + </svg> + + </span> + </ng-template> </ngx-datatable-column> diff --git a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json index e928ccc2..b9a26f6a 100644 --- a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json +++ b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json @@ -3,6 +3,9 @@ "FEDDFER": "DataLake Feeder", "TOPICS": "Topics", "DATABASE": "Database", + "DASHBOARD":"Dashboard Setting", + "DASHBOARDLIST":"Dashboard List", + "TEMPLATE":"Template", "ABOUT": "About" }, @@ -33,5 +36,27 @@ "DELETE": "Delete", "ERROR_CODE": "Error Code", "SUCCESS_UPDATED": "Success updated", - "TOPIC_DEFAULT_CONF_NOTICE": "Notice: This topic uses the default topics settings." + "TOPIC_DEFAULT_CONF_NOTICE": "Notice: This topic uses the default topics settings.", + + "HOME":"Home", + "ConfigDashboard":"Config Dashboard", + "EDIT":"Edit", + "OK":"OK", + "Save":"Save", + "Cancel":"Cancel", + "NewDashboard":"New dashboard", + "DestinationType":"Destination type", + "InputValue":"input value", + "Username":"Username", + "Password":"Password", + + + "No":"No", + "TEMPLATE_NAME":"Template name", + "TEMPLATE_TYPE":"Template type", + "TOPICS_NAME":"Topics name", + "DEPLOY_TO_DASHBOARD":"Deploy to dashboard", + "DEPLOY":"Deploy", + "NEW_TEMPLATE":"New template", + "TEMPLATE_BODY":"Template Body" } diff --git a/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json b/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json index 964e028d..0319443b 100644 --- a/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json +++ b/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json @@ -3,6 +3,9 @@ "FEDDFER": "DataLake Feeder", "TOPICS": "Topics", "DATABASE": "Database", + "DASHBOARD":"仪表板设置", + "DASHBOARDLIST":"仪表板列表", + "TEMPLATE":"模板", "ABOUT": "About" }, @@ -33,5 +36,26 @@ "DELETE": "删除", "ERROR_CODE": "错误代码", "SUCCESS_UPDATED": "更新成功", - "TOPIC_DEFAULT_CONF_NOTICE": "注意: 本Topic使用默认Topic设置。" + "TOPIC_DEFAULT_CONF_NOTICE": "注意: 本Topic使用默认Topic设置。", + + "HOME":"首页", + "ConfigDashboard":"配置仪表板", + "EDIT":"编辑", + "OK":"确认", + "Save":"保存", + "Cancel":"取消", + "NewDashboard":"新建仪表板", + "DestinationType":"目标类型", + "InputValue":"输入值", + "Username":"用户名", + "Password":"密码", + + "No":"No", + "TEMPLATE_NAME":"模板名称", + "TEMPLATE_TYPE":"模板类型", + "TOPICS_NAME":"Topics名称", + "DEPLOY_TO_DASHBOARD":"部署到仪表盘", + "DEPLOY":"部署", + "NEW_TEMPLATE":"新建模板", + "TEMPLATE_BODY":"模板体" } diff --git a/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json b/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json index f91ba785..a52739ff 100644 --- a/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json +++ b/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json @@ -3,6 +3,9 @@ "FEDDFER": "DataLake Feeder", "TOPICS": "Topics", "DATABASE": "Database", + "DASHBOARD":"儀表板設置", + "DASHBOARDLIST":"儀表板列表", + "TEMPLATE":"模板", "ABOUT": "About" }, @@ -34,5 +37,26 @@ "DELETE": "刪除", "ERROR_CODE": "錯誤代碼", "SUCCESS_UPDATED": "更新成功", - "TOPIC_DEFAULT_CONF_NOTICE": "注意:此Topic目前使用預設配置。" + "TOPIC_DEFAULT_CONF_NOTICE": "注意:此Topic目前使用預設配置。", + + "HOME":"首頁", + "ConfigDashboard":"配置儀表板", + "EDIT":"編輯", + "OK":"確認", + "Save":"保存", + "Cancel":"取消", + "NewDashboard":"新建儀表板", + "DestinationType":"目標類型", + "InputValue":"輸入值", + "Username":"用戶名", + "Password":"密碼", + + "No":"No", + "TEMPLATE_NAME":"模板名稱", + "TEMPLATE_TYPE":"模板類型", + "TOPICS_NAME":"Topics名稱", + "DEPLOY_TO_DASHBOARD":"部署到儀表板", + "DEPLOY":"部署", + "NEW_TEMPLATE":"新建模板", + "TEMPLATE_BODY":"模板體" } diff --git a/components/datalake-handler/admin/src/src/styles.css b/components/datalake-handler/admin/src/src/styles.css index 04479213..ef3295b3 100644 --- a/components/datalake-handler/admin/src/src/styles.css +++ b/components/datalake-handler/admin/src/src/styles.css @@ -380,6 +380,10 @@ hr { } /* Input: checkbox */ +.input-group-text { + padding: .375rem 16px; +} + .dl-input-chk { font-family: "Open Sans", sans-serif; font-weight: 400; @@ -585,3 +589,12 @@ input#switch:checked+.dl-slider:before { border-radius: 6px; padding: 4px 4px 4px 10px; } +.p-1.alert-delete-model{ + padding: 0.25rem 0.5rem; +} +.p-1 .alert-delete-title{ + padding: 1.25rem 1.5rem!important; +} +.p-1 .alert-delete-content{ + padding: 1.25rem 4.5rem!important; +} diff --git a/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql b/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql index fd9b3dc3..ad142dcf 100644 --- a/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql +++ b/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql @@ -7,6 +7,8 @@ CREATE TABLE `topic` ( `enabled` bit(1) DEFAULT 0,
`login` varchar(255) DEFAULT NULL,
`message_id_path` varchar(255) DEFAULT NULL,
+ `aggregate_array_path` varchar(2000) DEFAULT NULL,
+ `flatten_array_path` varchar(2000) DEFAULT NULL,
`pass` varchar(255) DEFAULT NULL,
`save_raw` bit(1) DEFAULT NULL,
`ttl` int(11) DEFAULT NULL,
@@ -86,6 +88,12 @@ insert into db (`name`,`host`,`login`) values ('HDFS','dlhdfs','dl'); -- in production, default enabled should be off
insert into `topic`(`name`,`enabled`,`save_raw`,`ttl`,`data_format`) values ('_DL_DEFAULT_',1,0,3650,'JSON');
+insert into `topic`(`name`,correlate_cleared_message,`enabled`, message_id_path,`data_format`) values ('unauthenticated.SEC_FAULT_OUTPUT',1,1,'/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName,/event/faultFields/specificProblem,/event/commonEventHeader/eventId','JSON');
+insert into `topic`(`name`,`enabled`, aggregate_array_path,flatten_array_path,`data_format`)
+values ('unauthenticated.VES_MEASUREMENT_OUTPUT',1,
+'/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray',
+'/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface',
+'JSON');
insert into `map_db_topic`(`db_name`,`topic_name`) values ('Couchbase','_DL_DEFAULT_');
insert into `map_db_topic`(`db_name`,`topic_name`) values ('Elasticsearch','_DL_DEFAULT_');
@@ -93,14 +101,17 @@ insert into `map_db_topic`(`db_name`,`topic_name`) values ('MongoDB','_DL_DEFAUL insert into `map_db_topic`(`db_name`,`topic_name`) values ('Druid','_DL_DEFAULT_');
insert into `map_db_topic`(`db_name`,`topic_name`) values ('HDFS','_DL_DEFAULT_');
-insert into `topic`(`name`,correlate_cleared_message,`enabled`, message_id_path,`data_format`) values ('unauthenticated.SEC_FAULT_OUTPUT',1,1,'/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName,/event/faultFields/specificProblem,/event/commonEventHeader/eventId','JSON');
-
insert into `map_db_topic`(`db_name`,`topic_name`) values ('Couchbase','unauthenticated.SEC_FAULT_OUTPUT');
insert into `map_db_topic`(`db_name`,`topic_name`) values ('Elasticsearch','unauthenticated.SEC_FAULT_OUTPUT');
insert into `map_db_topic`(`db_name`,`topic_name`) values ('MongoDB','unauthenticated.SEC_FAULT_OUTPUT');
insert into `map_db_topic`(`db_name`,`topic_name`) values ('Druid','unauthenticated.SEC_FAULT_OUTPUT');
insert into `map_db_topic`(`db_name`,`topic_name`) values ('HDFS','unauthenticated.SEC_FAULT_OUTPUT');
+insert into `map_db_topic`(`db_name`,`topic_name`) values ('Couchbase','unauthenticated.VES_MEASUREMENT_OUTPUT');
+insert into `map_db_topic`(`db_name`,`topic_name`) values ('Elasticsearch','unauthenticated.VES_MEASUREMENT_OUTPUT');
+insert into `map_db_topic`(`db_name`,`topic_name`) values ('MongoDB','unauthenticated.VES_MEASUREMENT_OUTPUT');
+insert into `map_db_topic`(`db_name`,`topic_name`) values ('Druid','unauthenticated.VES_MEASUREMENT_OUTPUT');
+insert into `map_db_topic`(`db_name`,`topic_name`) values ('HDFS','unauthenticated.VES_MEASUREMENT_OUTPUT');
insert into portal (`name`,`related_db`, host) values ('Kibana', 'Elasticsearch', 'dl_es');
insert into portal (`name`,`related_db`) values ('Elasticsearch', 'Elasticsearch');
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/FeederController.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/FeederController.java index 4fc9b7b6..6a44c4f2 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/FeederController.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/FeederController.java @@ -86,7 +86,7 @@ public class FeederController { @ApiOperation(value="Retrieve feeder status.") public String status() { String status = "Feeder is running: "+pullService.isRunning(); - log.info("senting feeder status ...");//TODO we can send what topics are monitored, how many messages are sent, etc. + log.info("sending feeder status ...");//TODO we can send what topics are monitored, how many messages are sent, etc. return "{\"version\": \""+config.getDatalakeVersion()+"\", \"running\": "+pullService.isRunning()+"}"; } diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Topic.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Topic.java index 30737162..acb48aef 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Topic.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Topic.java @@ -100,6 +100,15 @@ public class Topic { @Column(name = "`message_id_path`") private String messageIdPath; + //paths to the array that need aggregation, comma separated, example: "/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray" + @Column(name = "`aggregate_array_path`") + private String aggregateArrayPath; + + //paths to the element in array that need flatten, this element is used as label, comma separated, + //example: "/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface,..." + @Column(name = "`flatten_array_path`") + private String flattenArrayPath; + public Topic() { } @@ -149,6 +158,8 @@ public class Topic { tConfig.setSaveRaw(isSaveRaw()); tConfig.setCorrelateClearedMessage(isCorrelateClearedMessage()); tConfig.setMessageIdPath(getMessageIdPath()); + tConfig.setAggregateArrayPath(getAggregateArrayPath()); + tConfig.setFlattenArrayPath(getFlattenArrayPath()); tConfig.setTtl(getTtl()); Set<Db> topicDb = getDbs(); List<String> dbList = new ArrayList<>(); diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/dto/TopicConfig.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/dto/TopicConfig.java index deaa0969..8dfe1b16 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/dto/TopicConfig.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/dto/TopicConfig.java @@ -51,6 +51,8 @@ public class TopicConfig { private int ttl; private boolean correlateClearedMessage; private String messageIdPath; + private String aggregateArrayPath; + private String flattenArrayPath; public DataFormat getDataFormat2() { if (dataFormat != null) { @@ -60,7 +62,6 @@ public class TopicConfig { } } - public boolean supportHdfs() { return containDb("HDFS"); } @@ -105,6 +106,26 @@ public class TopicConfig { return id; } + public String[] getAggregateArrayPath2() { + String[] ret = null; + + if (StringUtils.isNotBlank(aggregateArrayPath)) { + ret = aggregateArrayPath.split(","); + } + + return ret; + } + + public String[] getFlattenArrayPath2() { + String[] ret = null; + + if (StringUtils.isNotBlank(flattenArrayPath)) { + ret = flattenArrayPath.split(","); + } + + return ret; + } + @Override public String toString() { return name; diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DmaapService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DmaapService.java index 2274ce99..3be5be6e 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DmaapService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DmaapService.java @@ -58,11 +58,13 @@ public class DmaapService { @Autowired private TopicService topicService; - ZooKeeper zk; + private ZooKeeper zk; @PreDestroy public void cleanUp() throws InterruptedException { - zk.close(); + if (zk != null) { + zk.close(); + } } @PostConstruct @@ -71,6 +73,7 @@ public class DmaapService { } //get all topic names from Zookeeper + //This method returns empty list if nothing found. public List<String> getTopics() { try { if (zk == null) { @@ -84,7 +87,7 @@ public class DmaapService { return topics; } catch (Exception e) { zk = null; - log.error("Can not get topic list from Zookeeper, for testing, going to use hard coded topic list.", e); + log.error("Can not get topic list from Zookeeper, return empty list.", e); return Collections.emptyList(); } } @@ -119,9 +122,6 @@ public class DmaapService { public List<TopicConfig> getActiveTopicConfigs() throws IOException { log.debug("entering getActiveTopicConfigs()..."); List<String> allTopics = getTopics(); - if (allTopics == null) { - return Collections.emptyList(); - } List<TopicConfig> ret = new ArrayList<>(allTopics.size()); for (String topicStr : allTopics) { diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/StoreService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/StoreService.java index 126e23b2..2a2f997e 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/StoreService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/StoreService.java @@ -27,12 +27,14 @@ import java.util.List; import javax.annotation.PostConstruct; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.json.JSONObject; import org.json.XML; import org.onap.datalake.feeder.config.ApplicationConfiguration; import org.onap.datalake.feeder.dto.TopicConfig; import org.onap.datalake.feeder.enumeration.DataFormat; +import org.onap.datalake.feeder.util.JsonUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -91,15 +93,16 @@ public class StoreService { for (Pair<Long, String> pair : messages) { try { docs.add(messageToJson(topicConfig, pair)); - } catch (IOException e) { - log.error(pair.getRight(), e); + } catch (Exception e) { + //may see org.json.JSONException. + log.error("Error when converting this message to JSON: " + pair.getRight(), e); } } saveJsons(topicConfig, docs, messages); } - private JSONObject messageToJson(TopicConfig topic, Pair<Long, String> pair) throws IOException { + private JSONObject messageToJson(TopicConfig topicConfig, Pair<Long, String> pair) throws IOException { long timestamp = pair.getLeft(); String text = pair.getRight(); @@ -110,11 +113,11 @@ public class StoreService { // log.debug("{} ={}", topicStr, text); //} - boolean storeRaw = topic.isSaveRaw(); + boolean storeRaw = topicConfig.isSaveRaw(); JSONObject json = null; - DataFormat dataFormat = topic.getDataFormat2(); + DataFormat dataFormat = topicConfig.getDataFormat2(); switch (dataFormat) { case JSON: @@ -145,6 +148,20 @@ public class StoreService { json.put(config.getRawDataLabel(), text); } + if (StringUtils.isNotBlank(topicConfig.getAggregateArrayPath())) { + String[] paths = topicConfig.getAggregateArrayPath2(); + for (String path : paths) { + JsonUtil.arrayAggregate(path, json); + } + } + + if (StringUtils.isNotBlank(topicConfig.getFlattenArrayPath())) { + String[] paths = topicConfig.getFlattenArrayPath2(); + for (String path : paths) { + JsonUtil.flattenArray(path, json); + } + } + return json; } @@ -167,9 +184,9 @@ public class StoreService { } public void flush() { //force flush all buffer - hdfsService.flush(); + hdfsService.flush(); } - + public void flushStall() { //flush stall buffer hdfsService.flushStall(); } diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicConfigPollingService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicConfigPollingService.java index 80da55fd..58b27834 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicConfigPollingService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicConfigPollingService.java @@ -102,6 +102,7 @@ public class TopicConfigPollingService implements Runnable { Thread.sleep(config.getDmaapCheckNewTopicInterval()); } catch (InterruptedException e) { log.error("Thread.sleep(config.getDmaapCheckNewTopicInterval())", e); + Thread.currentThread().interrupt(); } try { diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java index f0b000bc..64e8b8b1 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java @@ -123,6 +123,8 @@ public class TopicService { topic.setCorrelateClearedMessage(tConfig.isCorrelateClearedMessage()); topic.setDataFormat(tConfig.getDataFormat()); topic.setMessageIdPath(tConfig.getMessageIdPath()); + topic.setAggregateArrayPath(tConfig.getAggregateArrayPath()); + topic.setFlattenArrayPath(tConfig.getFlattenArrayPath()); if(tConfig.getSinkdbs() != null) { for (String item : tConfig.getSinkdbs()) { diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/util/JsonUtil.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/util/JsonUtil.java new file mode 100644 index 00000000..db4dcfae --- /dev/null +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/util/JsonUtil.java @@ -0,0 +1,158 @@ +/* +* ============LICENSE_START======================================================= +* ONAP : DCAE +* ================================================================================ +* Copyright 2019 China Mobile +*================================================================================= +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============LICENSE_END========================================================= +*/ + +package org.onap.datalake.feeder.util; + +import java.util.HashMap; + +import org.apache.commons.collections.CollectionUtils; +import org.json.JSONArray; +import org.json.JSONObject; + +import lombok.Getter; + +/** + * utils for JSON + * + * @author Guobiao Mo + * + */ +public class JsonUtil { + + @Getter + enum AggregateType { + ALL("aggregate"), AVEARGE("average"), SUM("sum"), MAX("max"), MIN("min"), COUNT("count"); + private final String name; + + AggregateType(String name) { + this.name = name; + } + + public String getLabel(String path) { + return path.substring(path.lastIndexOf('/') + 1) + "_" + name; + } + } + + public static void flattenArray(String path, JSONObject json) { + //path = /event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface + + int index1 = path.lastIndexOf('/'); + + String arrayPath = path.substring(0, index1);// /event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray + + Object obj; + try { + obj = json.query(arrayPath); + } catch (org.json.JSONPointerException e) { + return; + } + if (obj == null || !(obj instanceof JSONArray)) { + return; + } + Iterable<JSONObject> subjsonaArray = (Iterable<JSONObject>) obj; + + String tagName = path.substring(index1 + 1);//astriInterface + + int index2 = path.lastIndexOf('/', index1 - 1); + String arrayName = path.substring(index2 + 1, index1);//astriDPMeasurementArray + + String parentPath = path.substring(0, index2);// /event/measurementsForVfScalingFields/astriMeasurement + JSONObject parent = (JSONObject) json.query(parentPath); + + for (JSONObject element : subjsonaArray) { + String tagValue = element.get(tagName).toString(); + String label = arrayName + "_" + tagName + "_" + tagValue; + + parent.put(label, element); + } + } + + /** + * json got modified. + * + * @param aggregateType + * @param path + * @param json + */ + public static void arrayAggregate(String path, JSONObject json) { + HashMap<String, Double> sumHashMap = new HashMap<>(); + HashMap<String, Double> maxHashMap = new HashMap<>(); + HashMap<String, Double> minHashMap = new HashMap<>(); + + Object obj; + try { + obj = json.query(path); + } catch (org.json.JSONPointerException e) { + return; + } + if (obj == null || !(obj instanceof JSONArray)) { + return; + } + Iterable<JSONObject> subjsonaArray = (Iterable<JSONObject>) obj; + + int count = 0; + for (JSONObject element : subjsonaArray) { + String[] names = JSONObject.getNames(element); + for (String name : names) { + Number value = element.optNumber(name); + if (value != null) { + double existing = sumHashMap.computeIfAbsent(name, k -> 0.0); + sumHashMap.put(name, existing + value.doubleValue()); + + existing = maxHashMap.computeIfAbsent(name, k -> Double.MIN_VALUE); + maxHashMap.put(name, Math.max(existing, value.doubleValue())); + + existing = minHashMap.computeIfAbsent(name, k -> Double.MAX_VALUE); + minHashMap.put(name, Math.min(existing, value.doubleValue())); + } + } + count++; + } + + if (count == 0) { + return; + } + + JSONObject parentJson = (JSONObject) json.query(path.substring(0, path.lastIndexOf('/'))); + + //sum + JSONObject aggJson = new JSONObject(sumHashMap); + parentJson.put(AggregateType.SUM.getLabel(path), aggJson); + + //AVEARGE + int c = count;//need to be Effectively Final + sumHashMap.replaceAll((k, v) -> v / c); + aggJson = new JSONObject(sumHashMap); + parentJson.put(AggregateType.AVEARGE.getLabel(path), aggJson); + + //Count + parentJson.put(AggregateType.COUNT.getLabel(path), count); + + //Max + aggJson = new JSONObject(maxHashMap); + parentJson.put(AggregateType.MAX.getLabel(path), aggJson); + + //Min + aggJson = new JSONObject(minHashMap); + parentJson.put(AggregateType.MIN.getLabel(path), aggJson); + + } + +} diff --git a/components/datalake-handler/feeder/src/main/resources/application.properties b/components/datalake-handler/feeder/src/main/resources/application.properties index ed167f33..faf27583 100644 --- a/components/datalake-handler/feeder/src/main/resources/application.properties +++ b/components/datalake-handler/feeder/src/main/resources/application.properties @@ -42,7 +42,7 @@ dmaapCheckNewTopicInterval=60000 kafkaConsumerCount=3 #####################Elasticsearch -elasticsearchType=doc +elasticsearchType=_doc #####################HDFS hdfsBufferSize=4096 diff --git a/components/datalake-handler/feeder/src/main/resources/elasticsearch/mappings/readme.txt b/components/datalake-handler/feeder/src/main/resources/elasticsearch/mappings/readme.txt new file mode 100644 index 00000000..88513539 --- /dev/null +++ b/components/datalake-handler/feeder/src/main/resources/elasticsearch/mappings/readme.txt @@ -0,0 +1,4 @@ +before creating index
+PUT http://dl_es:9200/unauthenticated.ves_measurement_output
+application/json
+body from unauthenticated.ves_measurement_output.json
\ No newline at end of file diff --git a/components/datalake-handler/feeder/src/main/resources/elasticsearch/mappings/unauthenticated.ves_measurement_output.json b/components/datalake-handler/feeder/src/main/resources/elasticsearch/mappings/unauthenticated.ves_measurement_output.json new file mode 100644 index 00000000..9a53b70c --- /dev/null +++ b/components/datalake-handler/feeder/src/main/resources/elasticsearch/mappings/unauthenticated.ves_measurement_output.json @@ -0,0 +1,31 @@ +{
+ "mappings": {
+ "properties": {
+ "datalake_ts_": {
+ "type": "date",
+ "format": "epoch_millis"
+ },
+ "event.commonEventHeader.internalHeaderFields.collectorTimeStamp": {
+ "type": "date",
+ "format":"EEE, MM dd yyyy HH:mm:ss z"
+ },
+ "event.commonEventHeader.startEpochMicrosec": {
+ "type": "date",
+ "format": "epoch_millis"
+ },
+ "event.commonEventHeader.lastEpochMicrosec": {
+ "type": "date",
+ "format": "epoch_millis"
+ },
+ "event.measurementsForVfScalingFields.diskUsageArray": {
+ "type": "nested"
+ },
+ "event.measurementsForVfScalingFields.cpuUsageArray": {
+ "type": "nested"
+ },
+ "event.measurementsForVfScalingFields.vNicPerformanceArray": {
+ "type": "nested"
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java index 617b50e3..0c56d5af 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java @@ -68,6 +68,7 @@ public class ApplicationConfigurationTest { assertNotNull(config.getRawDataLabel()); assertNotNull(config.getTimestampLabel()); assertNotNull(config.getElasticsearchType()); + assertNotNull(config.getDatalakeVersion()); //HDFS assertTrue(config.getHdfsBatchSize()>0); diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/controller/FeederControllerTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/controller/FeederControllerTest.java index 05295f71..84d7d0a9 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/controller/FeederControllerTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/controller/FeederControllerTest.java @@ -19,100 +19,58 @@ */ package org.onap.datalake.feeder.controller; -import org.apache.kafka.clients.consumer.ConsumerRecords; -import org.apache.kafka.clients.consumer.KafkaConsumer; -import org.junit.Before; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +import java.io.IOException; + import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.datalake.feeder.config.ApplicationConfiguration; -import org.onap.datalake.feeder.service.DmaapService; import org.onap.datalake.feeder.service.PullService; -import org.onap.datalake.feeder.service.Puller; -import org.springframework.context.ApplicationContext; - -import java.io.IOException; -import java.lang.reflect.Field; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; - +@RunWith(MockitoJUnitRunner.class) public class FeederControllerTest { + @Mock + private PullService pullService1; - @InjectMocks - private PullService pullService1; - - @Mock - private ApplicationConfiguration config; - - @Mock - private ApplicationContext context; + @Mock + private ApplicationConfiguration config; - @Mock - private DmaapService dmaapService1; + @InjectMocks + private FeederController feederController; - @Mock - private KafkaConsumer<String, String> kafkaConsumer; + @Test + public void testStart() throws IOException { + when(pullService1.isRunning()).thenReturn(true); + String start = feederController.start(); + assertEquals("{\"running\": true}", start); - @Before - public void setupTest() { - MockitoAnnotations.initMocks(this); - } + when(pullService1.isRunning()).thenReturn(false); + start = feederController.start(); + assertEquals("{\"running\": true}", start); + } - private void setAccessPrivateFields(FeederController feederController) throws NoSuchFieldException, - IllegalAccessException { - Field pullService = feederController.getClass().getDeclaredField("pullService"); - pullService.setAccessible(true); - pullService.set(feederController, pullService1); - } + @Test + public void testStop() { + when(pullService1.isRunning()).thenReturn(true); + String stop = feederController.stop(); + assertEquals("{\"running\": false}", stop); - @Test - public void testStart() throws IOException, NoSuchFieldException, IllegalAccessException { - FeederController feederController = new FeederController(); - setAccessPrivateFields(feederController); - PullService pullService2 = new PullService(); - Field applicationConfig = pullService2.getClass().getDeclaredField("config"); - applicationConfig.setAccessible(true); - applicationConfig.set(pullService2, config); -/* Field applicationContext = pullService2.getClass().getDeclaredField("context"); - applicationContext.setAccessible(true); - applicationContext.set(pullService2, context); - when(config.getKafkaConsumerCount()).thenReturn(1); - Puller pullThread = new Puller(); - Field dmaapService = pullThread.getClass().getDeclaredField("dmaapService"); - dmaapService.setAccessible(true); - dmaapService.set(pullThread, dmaapService1); - /*Field kafkaConsumer1 = pullThread.getClass().getDeclaredField("consumer"); - kafkaConsumer1.setAccessible(true); - kafkaConsumer1.set(pullThread, kafkaConsumer); - applicationConfig = pullThread.getClass().getDeclaredField("config"); - applicationConfig.setAccessible(true); - applicationConfig.set(pullThread, config); - when(context.getBean(Puller.class, 0)).thenReturn(pullThread); - ConsumerRecords<String, String> records = ConsumerRecords.empty(); - when(kafkaConsumer.poll(2)).thenReturn(records); - String start = feederController.start(); - assertEquals("{\"running\": true}", start);*/ - } + when(pullService1.isRunning()).thenReturn(false); + stop = feederController.stop(); + assertEquals("{\"running\": false}", stop); + } - @Test - public void testStop() throws NoSuchFieldException, IllegalAccessException { - FeederController feederController = new FeederController(); - setAccessPrivateFields(feederController); - String stop = feederController.stop(); - assertEquals("{\"running\": false}", stop); - } + @Test + public void testStatus() { + when(pullService1.isRunning()).thenReturn(false); + when(config.getDatalakeVersion()).thenReturn("0.0.1"); - @Test - public void testStatus() throws NoSuchFieldException, IllegalAccessException { - ApplicationConfiguration conf = new ApplicationConfiguration(); - conf.setDatalakeVersion("0.0.1"); - FeederController feederController = new FeederController(); - feederController.config = conf; - setAccessPrivateFields(feederController); - String status = feederController.status(); - assertEquals("{\"version\": \"0.0.1\", \"running\": false}", status); - } + String status = feederController.status(); + assertEquals("{\"version\": \"0.0.1\", \"running\": false}", status); + } } diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java index bb31cd74..f52332a5 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java @@ -77,6 +77,23 @@ public class TopicConfigTest { } @Test + public void testArrayPath() { + Topic topic = new Topic("testArrayPath"); + topic.setAggregateArrayPath("/data/data2/value,/data/data3"); + topic.setFlattenArrayPath("/data/data2/value,/data/data3"); + + TopicConfig topicConfig = topic.getTopicConfig(); + + String[] value = topicConfig.getAggregateArrayPath2(); + assertEquals(value[0], "/data/data2/value"); + assertEquals(value[1], "/data/data3"); + + value = topicConfig.getFlattenArrayPath2(); + assertEquals(value[0], "/data/data2/value"); + assertEquals(value[1], "/data/data3"); + } + + @Test public void testIs() { Topic testTopic = new Topic("test"); diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DmaapServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DmaapServiceTest.java index 31de53a8..81c37185 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DmaapServiceTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DmaapServiceTest.java @@ -20,25 +20,24 @@ package org.onap.datalake.feeder.service; +import static org.junit.Assert.assertNotEquals; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.onap.datalake.feeder.config.ApplicationConfiguration; -import org.onap.datalake.feeder.domain.Topic; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static org.mockito.Mockito.when; -import static org.junit.Assert.*; @RunWith(MockitoJUnitRunner.class) public class DmaapServiceTest { - static String DMAPP_ZOOKEEPER_HOST_PORT = "message-router-zookeeper:2181"; + static String DMAPP_ZOOKEEPER_HOST_PORT = "test:2181"; @InjectMocks private DmaapService dmaapService; @@ -47,22 +46,23 @@ public class DmaapServiceTest { private ApplicationConfiguration config; @Mock private TopicService topicService; - + @Test - public void testGetTopics() { - + public void testGetTopics() throws InterruptedException { List<String> list = new ArrayList<>(); list.add("unauthenticated.DCAE_CL_OUTPUT"); list.add("AAI-EVENT"); list.add("__consumer_offsets"); list.add("unauthenticated.SEC_FAULT_OUTPUT"); list.add("msgrtr.apinode.metrics.dmaap"); +// when(config.getDmaapKafkaExclude()).thenReturn(new String[] { "AAI-EVENT" }); when(config.getDmaapZookeeperHostPort()).thenReturn(DMAPP_ZOOKEEPER_HOST_PORT); assertNotEquals(list, dmaapService.getTopics()); + dmaapService.cleanUp(); } - /*@Test - public void testGetActiveTopics() throws IOException { + @Test + public void testGetActiveTopicConfigs() throws IOException { List<String> list = new ArrayList<>(); list.add("unauthenticated.DCAE_CL_OUTPUT"); @@ -73,9 +73,9 @@ public class DmaapServiceTest { when(config.getDmaapZookeeperHostPort()).thenReturn(DMAPP_ZOOKEEPER_HOST_PORT); try { - assertNotEquals(list, dmaapService.getActiveTopics()); + assertNotEquals(list, dmaapService.getActiveTopicConfigs()); } catch (Exception e) { e.printStackTrace(); } - }*/ + } }
\ No newline at end of file diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/HdfsServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/HdfsServiceTest.java new file mode 100644 index 00000000..23ad794f --- /dev/null +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/HdfsServiceTest.java @@ -0,0 +1,78 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : DATALAKE + * ================================================================================ + * Copyright 2019 China Mobile + *================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.datalake.feeder.service; + +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; + +import org.apache.commons.lang3.tuple.Pair; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.onap.datalake.feeder.config.ApplicationConfiguration; +import org.onap.datalake.feeder.dto.TopicConfig; +import org.springframework.context.ApplicationContext; + +/** + * Test HdfsService + * + * @author Guobiao Mo + * + */ +@RunWith(MockitoJUnitRunner.class) +public class HdfsServiceTest { + + @InjectMocks + private HdfsService hdfsService; + + @Mock + private ApplicationContext context; + + @Mock + private ApplicationConfiguration config; + + @Mock + private ExecutorService executorService; + + @Test(expected = NullPointerException.class) + public void saveMessages() { + TopicConfig topicConfig = new TopicConfig(); + topicConfig.setName("test"); + + List<Pair<Long, String>> messages = new ArrayList<>(); + messages.add(Pair.of(100L, "test message")); + + when(config.getHdfsBufferSize()).thenReturn(1000); + hdfsService.saveMessages(topicConfig, messages); + } + + @Test(expected = NullPointerException.class) + public void cleanUp() { + hdfsService.flush(); + hdfsService.flushStall(); + hdfsService.cleanUp(); + } +}
\ No newline at end of file diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/PullerTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/PullerTest.java new file mode 100644 index 00000000..fab5d4cd --- /dev/null +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/PullerTest.java @@ -0,0 +1,86 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : DATALAKE + * ================================================================================ + * Copyright 2019 China Mobile + *================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.datalake.feeder.service; + +import static org.mockito.Mockito.when; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.onap.datalake.feeder.config.ApplicationConfiguration; +import org.springframework.context.ApplicationContext; + +/** + * Test Puller + * + * Without a Kafka server, the coverage is low. + * + * @author Guobiao Mo + * + */ +@RunWith(MockitoJUnitRunner.class) +public class PullerTest { + + @InjectMocks + private Puller puller = new Puller(); + + @Mock + private ApplicationContext context; + + @Mock + private ApplicationConfiguration config; + + @Mock + private StoreService storeService; + + @Mock + private TopicConfigPollingService topicConfigPollingService; + + public void testInit() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException { + when(config.isAsync()).thenReturn(true); + + Method init = puller.getClass().getDeclaredMethod("init"); + init.setAccessible(true); + init.invoke(puller); + } + + @Test + public void testRun() throws InterruptedException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException { + testInit(); + + when(config.getDmaapKafkaHostPort()).thenReturn("test:1000"); + when(config.getDmaapKafkaGroup()).thenReturn("test"); + + Thread thread = new Thread(puller); + thread.start(); + + Thread.sleep(50); + puller.shutdown(); + thread.join(); + + } + +}
\ No newline at end of file diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java new file mode 100644 index 00000000..fc05d1d4 --- /dev/null +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java @@ -0,0 +1,150 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : DATALAKE + * ================================================================================ + * Copyright 2019 China Mobile + *================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.datalake.feeder.service; + +import static org.mockito.Mockito.when; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.tuple.Pair; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.onap.datalake.feeder.config.ApplicationConfiguration; +import org.onap.datalake.feeder.dto.TopicConfig; +import org.springframework.context.ApplicationContext; + +/** + * Test StoreService + * + * @author Guobiao Mo + * + */ +@RunWith(MockitoJUnitRunner.class) +public class StoreServiceTest { + + @InjectMocks + private StoreService storeService = new StoreService(); + + @Mock + private ApplicationContext context; + + @Mock + private ApplicationConfiguration config; + + @Mock + private TopicConfigPollingService configPollingService; + + @Mock + private MongodbService mongodbService; + + @Mock + private CouchbaseService couchbaseService; + + @Mock + private ElasticsearchService elasticsearchService; + + @Mock + private HdfsService hdfsService; + + public void testInit() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException { + Method init = storeService.getClass().getDeclaredMethod("init"); + init.setAccessible(true); + init.invoke(storeService); + } + + private TopicConfig createTopicConfig(String topicStr, String type) { + + TopicConfig topicConfig = new TopicConfig(); + topicConfig.setName(topicStr); + topicConfig.setDataFormat(type); + topicConfig.setSaveRaw(true); + + when(configPollingService.getEffectiveTopicConfig(topicStr)).thenReturn(topicConfig); + + return topicConfig; + } + + @Test + public void saveMessages() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException { + testInit(); + + TopicConfig topicConfig = createTopicConfig("test1", "JSON"); + topicConfig.setAggregateArrayPath("/test"); + topicConfig.setFlattenArrayPath("/test"); + + topicConfig = createTopicConfig("test2", "XML"); + topicConfig.setSaveRaw(false); + + topicConfig = createTopicConfig("test3", "YAML"); + + topicConfig.setSinkdbs(new ArrayList<>()); + topicConfig.getSinkdbs().add("Elasticsearch"); + topicConfig.getSinkdbs().add("Couchbase"); + topicConfig.getSinkdbs().add("Druid"); + topicConfig.getSinkdbs().add("MongoDB"); + topicConfig.getSinkdbs().add("HDFS"); + + createTopicConfig("test4", "TEXT"); + + when(config.getTimestampLabel()).thenReturn("ts"); + when(config.getRawDataLabel()).thenReturn("raw"); + + //JSON + List<Pair<Long, String>> messages = new ArrayList<>(); + messages.add(Pair.of(100L, "{test: 1}")); + + storeService.saveMessages("test1", messages); + + //XML + List<Pair<Long, String>> messagesXml = new ArrayList<>(); + messagesXml.add(Pair.of(100L, "<test></test>")); + messagesXml.add(Pair.of(100L, "<test></test"));//bad xml to trigger exception + + storeService.saveMessages("test2", messagesXml); + + //YAML + List<Pair<Long, String>> messagesYaml = new ArrayList<>(); + messagesYaml.add(Pair.of(100L, "test: yes")); + + storeService.saveMessages("test3", messagesYaml); + + //TEXT + List<Pair<Long, String>> messagesText = new ArrayList<>(); + messagesText.add(Pair.of(100L, "test message")); + + storeService.saveMessages("test4", messagesText); + + //Null mesg + storeService.saveMessages("test", null); + } + + @Test + public void testFlush() { + storeService.flush(); + storeService.flushStall(); + } +}
\ No newline at end of file diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/TopicConfigPollingServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/TopicConfigPollingServiceTest.java new file mode 100644 index 00000000..a341d2a6 --- /dev/null +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/TopicConfigPollingServiceTest.java @@ -0,0 +1,106 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : DATALAKE + * ================================================================================ + * Copyright 2019 China Mobile + *================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.datalake.feeder.service; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.onap.datalake.feeder.config.ApplicationConfiguration; + +/** + * Test TopicConfigPollingService + * + * @author Guobiao Mo + * + */ +@RunWith(MockitoJUnitRunner.class) +public class TopicConfigPollingServiceTest { + @Mock + private ApplicationConfiguration config; + + @Mock + private DmaapService dmaapService; + + @InjectMocks + private TopicConfigPollingService topicConfigPollingService = new TopicConfigPollingService(); + + public void testInit() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException { + Method init = topicConfigPollingService.getClass().getDeclaredMethod("init"); + init.setAccessible(true); + init.invoke(topicConfigPollingService); + + List<String> activeTopics = Arrays.asList("test"); + Field activeTopicsField = topicConfigPollingService.getClass().getDeclaredField("activeTopics"); + activeTopicsField.setAccessible(true); + activeTopicsField.set(topicConfigPollingService, activeTopics); + } + + @Test + public void testRun() throws InterruptedException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException { + testInit(); + + when(config.getDmaapCheckNewTopicInterval()).thenReturn(1); + + Thread thread = new Thread(topicConfigPollingService); + thread.start(); + + Thread.sleep(50); + topicConfigPollingService.shutdown(); + thread.join(); + + assertTrue(topicConfigPollingService.isActiveTopicsChanged(true)); + } + + @Test + public void testRunNoChange() throws InterruptedException { + + when(config.getDmaapCheckNewTopicInterval()).thenReturn(1); + + Thread thread = new Thread(topicConfigPollingService); + thread.start(); + + Thread.sleep(50); + topicConfigPollingService.shutdown(); + thread.join(); + + assertFalse(topicConfigPollingService.isActiveTopicsChanged(false)); + } + + @Test + public void testGet() { + assertNull(topicConfigPollingService.getEffectiveTopicConfig("test")); + assertNull(topicConfigPollingService.getActiveTopics()); + + } +}
\ No newline at end of file diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/TopicServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/TopicServiceTest.java index 265ec963..774cd229 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/TopicServiceTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/TopicServiceTest.java @@ -21,6 +21,7 @@ package org.onap.datalake.feeder.service; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -70,6 +71,8 @@ public class TopicServiceTest { String name = "a"; when(topicRepository.findById(name)).thenReturn(Optional.of(new Topic(name))); assertEquals(topicService.getTopic(name), new Topic(name)); + + assertFalse(topicService.istDefaultTopic(new Topic(name))); } @Test diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/UtilTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/UtilTest.java index 918c0701..753087e4 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/UtilTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/UtilTest.java @@ -25,6 +25,8 @@ import org.junit.Test; import java.io.IOException; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * test utils @@ -48,4 +50,17 @@ public class UtilTest { public void validateNull() throws IOException { Util.getTextFromFile("no_such_file"); } + + @Test + //only dot(.) in key got replaced + public void isStall() { + long lastTime = 10L; + long checkInterval = 10000L; + + assertTrue(Util.isStall(lastTime, checkInterval)); + + lastTime = System.currentTimeMillis(); + assertFalse(Util.isStall(lastTime, checkInterval)); + } + } diff --git a/components/datalake-handler/feeder/src/test/resources/application.properties b/components/datalake-handler/feeder/src/test/resources/application.properties index 189adece..64ecdee9 100644 --- a/components/datalake-handler/feeder/src/test/resources/application.properties +++ b/components/datalake-handler/feeder/src/test/resources/application.properties @@ -14,36 +14,37 @@ rawDataLabel=datalake_text_ defaultTopicName=_DL_DEFAULT_ -#how often do we check topic setting update, in millisecond -topicCheckInterval=60000 #####################DMaaP #dmaapZookeeperHostPort=127.0.0.1:2181 #dmaapKafkaHostPort=127.0.0.1:9092 dmaapZookeeperHostPort=message-router-zookeeper:2181 dmaapKafkaHostPort=message-router-kafka:9092 -dmaapKafkaGroup=dlgroup19 +dmaapKafkaGroup=dlgroup44 #in second dmaapKafkaTimeout=60 dmaapKafkaExclude[0]=__consumer_offsets dmaapKafkaExclude[1]=__transaction_state -dmaapKafkaExclude[2]=msgrtr.apinode.metrics.dmaap +#dmaapKafkaExclude[2]=msgrtr.apinode.metrics.dmaap #check for new topics , in millisecond -dmaapCheckNewTopicInterval=300000 +dmaapCheckNewTopicInterval=60000 -kafkaConsumerCount=1 +kafkaConsumerCount=3 #####################Elasticsearch -elasticsearchType=doc +elasticsearchType=_doc #####################HDFS hdfsBufferSize=4096 #how often we flush stall updates, in millisecond -hdfsFlushInterval=10000 -hdfsBatchSize=250 +hdfsFlushInterval=30000 +hdfsBatchSize=500 #####################Logging logging.level.org.springframework.web=ERROR logging.level.com.att.nsa.apiClient.http=ERROR logging.level.org.onap.datalake=DEBUG + +#####################Verison +datalakeVersion=0.0.1 diff --git a/components/datalake-handler/pom.xml b/components/datalake-handler/pom.xml index 0a48af62..d8caee82 100644 --- a/components/datalake-handler/pom.xml +++ b/components/datalake-handler/pom.xml @@ -33,7 +33,7 @@ <springcouchbase.version>3.1.2.RELEASE</springcouchbase.version> <jackson.version>2.9.8</jackson.version> <kafka.version>2.0.0</kafka.version> - <elasticsearchjava.version>7.0.0</elasticsearchjava.version> + <elasticsearchjava.version>7.1.1</elasticsearchjava.version> <hadoop.version>3.2.0</hadoop.version> </properties> |