summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html
blob: c552ba73c4edbd76d22ce83652a877d4c5320e01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!--
    Copyright (C) 2018 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.
-->

<!-- <button nz-button nzType="primary" (click)="showModal()">
    <i class="anticon anticon-plus-circle-o"></i><span> Create </span>
</button>
<nz-modal [(nzVisible)]="isVisible" nzTitle="Modal Title" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"
    [nzOkLoading]="isOkLoading">
    <p>
        <input nz-input placeholder="请输入key" [(ngModel)]="value1">
    </p>
    <p>
        <input nz-input placeholder="请输入value" [(ngModel)]="value2">
    </p>
</nz-modal> -->

<!-- <nz-tabset [nzTabPosition]="'top'" [nzType]="'card'">
    <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab">
        Content of Tab Pane {{ tab }}
    </nz-tab>
</nz-tabset> -->

<nz-tabset [nzTabPosition]="'top'" [nzType]="'card'">
    <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab" (nzClick)="handleTabChange(tab,nsdInfoId,url)">
        <!-- nsList -->
        <div class="list" *ngIf="tab === 'NS'">
            <h3 class="title"> Onboard {{tabTitle}} </h3>
            <nz-upload nzType="drag" [(nzFileList)]="fileListNS" [nzBeforeUpload]="beforeUploadNS">
                <p class="ant-upload-drag-icon">
                    <i nz-icon type="inbox" class="anticon anticon-inbox"></i>
                </p>
                <p class="ant-upload-text">Click or drag file to this area to upload</p>
                <p class="ant-upload-hint">Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files</p>
            </nz-upload>
            <button nz-button [nzLoading]="uploading" (click)="onClick(tab)" [disabled]="fileListNS.length == 0"
                style="margin-top: 16px">
                {{ uploading ? 'Uploading' : 'Start Upload' }}
            </button>
            <!-- tablist -->
            <nz-table #nzTable [nzData]="tableData" 
                nzShowSizeChanger [nzFrontPagination]="true" 
                [nzShowQuickJumper]="true"
                [nzPageSizeOptions]="[5,10,15,20]" 
                [nzTotal]='total' [(nzPageSize)]="pageSize" 
                [(nzPageIndex)]='pageIndex'
                [nzLoading]="loading" 
                nzSize="middle" 
                (nzPageSizeChange)="searchNsData(true)">
                <!-- (nzPageIndexChange)="searchNsData()"  -->
                <thead (nzSortChange)="sort($event)" nzSingleSort>
                    <tr>
                        <th nzWidth="5%">NO</th>
                        <th nzWidth="15%" nzShowSort nzSortKey="name"> Name </th>
                        <!-- <th nzWidth="20%">Type</th> -->
                        <th nzWidth="10%">Version</th>
                        <th nzWidth="15%">Onboarding State</th>
                        <th nzWidth="20%">Operational State</th>
                        <th nzWidth="20%">Usage State</th>
                        <th nzWidth="15%">Operation button</th>
                    </tr>
                </thead>
                <tbody>
                    <tr *ngFor="let item of nzTable.data; let i = index; ">
                        <td *ngIf="item.nsdId">{{item.nsdId}}</td>
                        <td *ngIf="item.uuid">{{item.uuid}}</td>

                        <td *ngIf="item.nsdName">{{item.nsdName}}</td>
                        <td *ngIf="item.name">{{item.name}}</td>

                        <!-- <td>{{item.onboardingFailureDetails.type}}</td> -->
                        <td *ngIf="item.nsdVersion">{{item.nsdVersion}}</td>
                        <td *ngIf="item.version">{{ item.version }}</td>
                        <td>
                            <span [ngClass]="{'onboarding':item.status=='Onboarding','onboarded':item.status=='Onboarded',
                        'updating':item.status=='Updating','deleting':item.status=='Deleting','invalid':item.status=='Invalid'}">{{item.nsdOnboardingState}}</span>
                            <!-- <nz-progress *ngIf="item.status!='Onboarded' && item.status!='Invalid'" [nzPercent]="item.progress"></nz-progress> -->
                        </td>
                        <td>{{item.nsdOperationalState}}</td>
                        <td>{{item.nsdUsageState}}</td>
                        <td>
                            <!-- <i class="anticon anticon-cloud-upload-o" (click)="updataService()"></i> -->
                            <i class="anticon anticon-upload upicon" #upload_icon (click)="updataNsService(item.uuid)" *ngIf="item.uuid"></i>
                            <!-- <i class="anticon anticon-download" (click)="downloadNsService(item.id)"></i> -->
                            <i class="anticon anticon-delete" (click)="deleteNsService(i,item.id)" *ngIf="item.id"></i>
                            <!-- <i class="anticon anticon-delete" *ngIf="item.uuid" (click)="deleteNsSdcService(i,item.uuid)"></i> -->
                        </td>
                    </tr>
                </tbody>
            </nz-table>
        </div>
        <!-- VNFList -->
        <div class="list" *ngIf="tab === 'VNF'">
            <h3 class="title"> Onboard {{tabTitle}} </h3>
            <nz-upload nzType="drag" [(nzFileList)]="fileListVNF" [nzBeforeUpload]="beforeUploadVNF">
                <p class="ant-upload-drag-icon">
                    <i nz-icon type="inbox" class="anticon anticon-inbox"></i>
                </p>
                <p class="ant-upload-text">Click or drag file to this area to upload</p>
                <p class="ant-upload-hint">Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files</p>
            </nz-upload>
            <button nz-button [nzLoading]="uploading" (click)="onClick(tab)" [disabled]="fileListVNF.length == 0"
                style="margin-top: 16px">
                {{ uploading ? 'Uploading' : 'Start Upload' }}
            </button>
            <!-- tabList -->
            <nz-table #nzTable [nzData]="tableData" 
                nzShowSizeChanger
                [nzFrontPagination]="true" 
                [nzShowQuickJumper]="true" 
                [nzPageSizeOptions]="[5,10,15,20]" 
                [nzTotal]= 'total'
                [(nzPageSize)]="pageSize" 
                [(nzPageIndex)]='pageIndex'
                [nzLoading]="loading"
                nzSize="middle"
                (nzPageSizeChange)="searchVnfData(true)">
                 <!--(nzPageIndexChange)="searchVnfData()" -->
                <thead (nzSortChange)="sort($event)" nzSingleSort>
                    <tr>
                        <th nzWidth="5%">NO</th>
                        <th nzWidth="10%" nzShowSort nzSortKey="name"> Name </th>
                        <th nzWidth="10%">Version</th>
                        <th nzWidth="20%">Onboarding State</th>
                        <th nzWidth="15%">usageState</th>
                        <th nzWidth="20%">Operational State</th>
                        <th nzWidth="20%">Operation button</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index"> -->
                    <tr *ngFor="let item of nzTable.data; let i = index; ">
                        <!-- <td>{{i+1}}</td> -->
                        <td *ngIf="item.id">{{item.id}}</td>
                        <td *ngIf="item.uuid">{{item.uuid}}</td>
                        <td *ngIf="item.vnfProductName">{{item.vnfProductName}}</td>
                        <td *ngIf="item.name">{{item.name}}</td>
                        <td  *ngIf="item.vnfdVersion">{{item.vnfdVersion}}</td>
                        <td  *ngIf="item.version">{{item.version}}</td>
                        <td>{{item.onboardingState}}</td>
                        <td>{{item.usageState}}</td>
                        <td>{{item.operationalState}}</td>
                        <!-- <td>
                            <span [ngClass]="{'onboarding':item.status=='Onboarding','onboarded':item.status=='Onboarded',
                                'updating':item.status=='Updating','deleting':item.status=='Deleting','invalid':item.status=='Invalid'}">{{item.operationalState}}</span>
                            <nz-progress *ngIf="item.status!='Onboarded' && item.status!='Invalid'" [nzPercent]="item.progress"></nz-progress>
                        </td> -->
                        <td>
                            <!-- <i class="anticon anticon-cloud-upload-o" (click)="updataService()"></i> -->
                            <i class="anticon anticon-upload upicon" #upload_icon (click)="updataVnfService(item.uuid)" *ngIf="item.uuid"></i>
                            <!-- <i class="anticon anticon-download" (click)="downloadVnfService()"></i> -->
                            <i class="anticon anticon-delete" (click)="deleteVnfService(i,item.id)" id="{{ item.id}}" *ngIf="item.id"></i>
                        </td>
                    </tr>
                    <!-- </ng-template> -->
                </tbody>
            </nz-table>
        </div>
        <!-- PNFList -->
        <div class="list" *ngIf="tab === 'PNF'">
            <h3 class="title"> Onboard {{tabTitle}} </h3>
            <nz-upload nzType="drag" [(nzFileList)]="fileListPNF" [nzBeforeUpload]="beforeUploadPNF">
                <p class="ant-upload-drag-icon">
                    <i nz-icon type="inbox" class="anticon anticon-inbox"></i>
                </p>
                <p class="ant-upload-text">Click or drag file to this area to upload</p>
                <p class="ant-upload-hint">Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files</p>
            </nz-upload>
            <button nz-button [nzLoading]="uploading" (click)="onClick(tab)" [disabled]="fileListPNF.length == 0"
                style="margin-top: 16px">
                {{ uploading ? 'Uploading' : 'Start Upload' }}
            </button>
            <!-- tabList -->
            <nz-table #nzTable [nzData]="tableData" 
                nzShowSizeChanger
                [nzFrontPagination]="true" 
                [nzShowQuickJumper]="true" 
                [nzPageSizeOptions]="[5,10,15,20]" 
                [nzTotal]= 'total'
                [(nzPageSize)]="pageSize" 
                [(nzPageIndex)]='pageIndex'
                [nzLoading]="loading"
                nzSize="middle"
                (nzPageSizeChange)="searchPnfData(true)">
                 <!-- (nzPageIndexChange)="searchPnfData()"  -->
                <thead (nzSortChange)="sort($event)" nzSingleSort>
                    <tr>
                        <th nzWidth="5%">NO</th>
                        <th nzWidth="15%" nzShowSort nzSortKey="name"> Name </th>
                        <th nzWidth="15%">Version</th>
                        <th nzWidth="20%">Onboarding State</th>
                        <th nzWidth="20%">usageState</th>
                        <th nzWidth="25%">Operation button</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index"> -->
                    <tr *ngFor="let item of nzTable.data; let i = index; ">
                        <!-- <td>{{i+1}}</td> -->
                        <td>{{item.id}}</td>
                        <td>{{item.pnfdName}}</td>
                        <td>{{item.pnfdVersion}}</td>
                        <td>{{item.pnfdOnboardingState}}</td>
                        <td>{{item.pnfdUsageState}}</td>
                        <!-- <td>
                            <span [ngClass]="{'onboarding':item.status=='Onboarding','onboarded':item.status=='Onboarded',
                                'updating':item.status=='Updating','deleting':item.status=='Deleting','invalid':item.status=='Invalid'}">{{item.status}}</span>
                            <nz-progress *ngIf="item.status!='Onboarded' && item.status!='Invalid'" [nzPercent]="item.progress"></nz-progress>
                        </td> -->
                        <td>
                            <!-- <i class="anticon anticon-cloud-upload-o" (click)="updataService()"></i> -->
                            <!-- <i class="anticon anticon-upload upicon" #upload_icon (click)="updataService(item.id)" *ngIf="item.id"></i> -->
                            <!-- <i class="anticon anticon-download" (click)="downloadPnfService(item.id)"></i> -->
                            <i class="anticon anticon-delete" (click)="deletePnfService(i,item.id)"></i>
                        </td>
                    </tr>
                    <!-- </ng-template> -->
                </tbody>
            </nz-table>
        </div>
    </nz-tab>
</nz-tabset>