diff options
author | 2019-12-06 13:11:59 +0800 | |
---|---|---|
committer | 2019-12-06 13:21:53 +0800 | |
commit | bc566b0599d6150d3a24f84ca2b80f956ece4e52 (patch) | |
tree | 6127ef80d0b53bd65cc27c20997f57f8411963d2 /usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management | |
parent | b2fc2767b0f5e3675da8d5dec8f96682113b2339 (diff) |
feat: add slicing nssi page basic business code
Change-Id: I5d5034a7038b628db4fa94ec13ec6361b83839f9
Issue-ID: USECASEUI-369
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management')
5 files changed, 139 insertions, 1 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-management.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-management.component.html index dde0abcc..1e81aa39 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-management.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-management.component.html @@ -1,3 +1,3 @@ <p> - nssi-management works! + <app-nssi-table></app-nssi-table> </p> 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){ + + } +} |