diff options
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table')
4 files changed, 138 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.html new file mode 100644 index 00000000..c2408a81 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.html @@ -0,0 +1,51 @@ +<div class="slicing-resource-table"> + <div nz-row> + <div nz-col nzSpan="12" class="task_status"> + <span>Status : </span> + <nz-select nzShowSearch nzPlaceHolder="Select a processing status" [(ngModel)]="selectedValue" + (ngModelChange)="getListOfProcessingStatus()"> + <nz-option *ngFor="let item of statusOptions" [nzLabel]="item" [nzValue]="item"></nz-option> + </nz-select> + </div> + </div> + <div class="slicing-resource-table-list"> + <nz-table + #nsiTable + [nzData]="listOfData" + [nzFrontPagination]="false" + nzShowSizeChanger + [nzPageSizeOptions]="[5,10,15,20]" + [nzTotal]='total' + [(nzPageSize)]="pageSize" + [(nzPageIndex)]='pageIndex' + [nzLoading]="loading" + (nzPageIndexChange)="searchData()" + (nzPageSizeChange)="searchData(true)" + > + <thead> + <tr> + <th>Service Instance Id</th> + <th>Service Instance Name</th> + <th>Service Type</th> + <th>Context</th> + <th>Status</th> + <th width="140px">Detail</th> + </tr> + </thead> + <tbody> + <ng-template ngFor let-data [ngForOf]="nsiTable.data" let-i="index"> + <tr> + <td>{{ data.service_instance_id }}</td> + <td>{{ data.service_instance_name }}</td> + <td>{{ data.service_type }}</td> + <td>{{data.environment_context}}</td> + <td>{{data.orchestration_status}}</td> + <td> + <a (click)="showdetail(data)">detail</a> + </td> + </tr> + </ng-template> + </tbody> + </nz-table> + </div> +</div>
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.less b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.less new file mode 100644 index 00000000..3a7c3d0a --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.less @@ -0,0 +1,3 @@ +nz-select { + width: 200px; +}
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.spec.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.spec.ts new file mode 100644 index 00000000..b90e60ac --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NssiTableComponent } from './nssi-table.component'; + +describe('NssiTableComponent', () => { + let component: NssiTableComponent; + let fixture: ComponentFixture<NssiTableComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NssiTableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NssiTableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts new file mode 100644 index 00000000..926350b9 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts @@ -0,0 +1,59 @@ +import { Component, OnInit } from '@angular/core'; +import {BUSINESS_STATUS} from '../../../../../../../constants/constants'; +import {SlicingTaskServices} from "../../../../../../core/services/slicingTaskServices"; +@Component({ + selector: 'app-nssi-table', + templateUrl: './nssi-table.component.html', + styleUrls: ['./nssi-table.component.less'] +}) +export class NssiTableComponent implements OnInit { + + constructor( + private myhttp: SlicingTaskServices + ) { + } + + ngOnInit() { + this.getNssiList() + } + selectedValue:string = BUSINESS_STATUS[0]; + listOfData: any[] = []; + pageIndex: number = 1; + pageSize: number = 10; + total: number = 100; + loading = false; + isSelect: boolean = false; + statusOptions: any[] = BUSINESS_STATUS; + + getNssiList (): void{ + this.loading = true; + this.isSelect = false; + let paramsObj = { + pageNo: this.pageIndex, + pageSize: this.pageSize + }; + if(this.selectedValue !== BUSINESS_STATUS[0]){ + paramsObj["instanceStatus"] = this.selectedValue; + this.isSelect = true; + } + this.myhttp.getSlicingNssiList(paramsObj,this.isSelect).subscribe (res => { + const { result_header: { result_code }, result_body: { nssi_service_instances } } = res; + if (+result_code === 200) { + this.total = nssi_service_instances.length; + this.loading = false; + this.listOfData = nssi_service_instances; + } + }) + } + getListOfProcessingStatus(){ + this.pageIndex = 1; + this.pageSize = 10; + this.getNssiList(); + } + searchData(reset: boolean = false) { + this.getNssiList(); + } + showdetail(data){ + + } +} |