summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/onboard-vnf-vm/onboard-vnf-vm.component.html
blob: c48d68f9d658ecab2470f212164619b9cf61434e (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
<!--
    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.
-->

<!-- tab -->
<nz-tabset [nzTabPosition]="'top'" [nzType]="'card'">
    <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab" (nzClick)="handleTabChange(tab)"></nz-tab>
</nz-tabset>
<div class="list">
    <!-- upload -->
    <div  class="listUploadContainer">
        <div class="listupload">
            <nz-upload nzType="drag" [(nzFileList)]="fileList" [nzBeforeUpload]="beforeUpload">
                <p class="ant-upload-drag-icon">
                    <i nz-icon type="inbox" class="anticon anticon-inbox"></i>
                </p>
                <p class="ant-upload-text"> {{"i18nTextDefine_Click_CSAR_File" | translate}} </p>
                <p class="ant-upload-hint"></p>
            </nz-upload>
            <button nz-button [nzLoading]="uploading" (click)="onClick()" [disabled]="fileList.length == 0" class="upload">
                {{ uploading ? 'Uploading' : 'Start Upload' }}
            </button>
        </div>
        <div class="listlin"></div>
        <div class="listfile">
            <div class="listFileTitle"> {{"i18nTextDefine_Uploaded_files" | translate}} </div>
            <div class="nouploadfile" [style.display]="display">{{"i18nTextDefine_Nofileuploading" | translate}}</div>
            <div class="listfilebgc" *ngIf="file">
                <i class="anticon anticon-link icon"></i>
                <div class="color" [ngClass]="{'progress':file.status}">{{file.name}}</div>
                <div class="color" *ngIf="file.status">
                    <nz-progress [nzPercent]="file.progress" [nzShowInfo]="false"></nz-progress>
                </div>
                <div class="color" *ngIf="!file.status">
                    <span *ngIf="file.success === 0">{{"i18nTextDefine_File_upload_completed" | translate}}</span>
                    <span *ngIf="file.success === 1">{{"i18nTextDefine_File_upload_failed" | translate}}</span>
                </div>
                <div *ngIf="!file.status">
                    <i class="anticon anticon-check-circle success" *ngIf="file.success === 0"></i>
                    <i class="anticon anticon-exclamation-circle fail"  *ngIf="file.success === 1"></i>
                </div>
            </div>
        </div>
    </div>
    <!-- table -->
    <nz-spin [nzSpinning]="isSpinning" class="listContainer">
        <div class="mask" *ngIf="isSpinning"></div>
        <nz-table #nzTable [nzData]="currentTab === 'NS'? nsTableData: (currentTab === 'VNF'? vnfTableData : pnfTableData)" nzShowSizeChanger [nzFrontPagination]="true"
            [nzShowQuickJumper]="true" [nzPageSizeOptions]="[5,10,15,20]" [(nzPageSize)]="pageSize"
            [(nzPageIndex)]='pageIndex' nzSize="middle">
            <thead>
                <tr class="theadColor">
                    <th nzWidth="15%"> {{"i18nTextDefine_NO" | translate}} </th>
                    <th nzWidth="15%"> {{"i18nTextDefine_Name" | translate}} </th>
                    <th nzWidth="15%"> {{"i18nTextDefine_Version" | translate}} </th>
                    <th nzWidth="15%"> {{"i18nTextDefine_OnboardingState" | translate}} </th>
                    <th nzWidth="15%" *ngIf="currentTab !== 'PNF'"> {{"i18nTextDefine_OperationalState" | translate}} </th>
                    <th nzWidth="10%"> {{"i18nTextDefine_UsageState" | translate}} </th>
                    <th nzWidth="15%"> {{"i18nTextDefine_Operationbutton" | translate}} </th>
                </tr>
            </thead>
            <tbody *ngIf="currentTab === 'NS'">
                <tr *ngFor="let item of nzTable.data;let i = index;">
                    <td>{{i+1}}</td>    
                    <td>{{item.nsdName || item.name }}</td>     
                    <td>{{item.nsdVersion || item.version}}</td>
                    <td>{{item.nsdOnboardingState ? item.nsdOnboardingState : status}}</td>                       
                    <td>{{item.nsdOperationalState}}</td>
                    <td>{{item.nsdUsageState}}</td>
                    <td>
                        <i [ngClass]="{'cannotclick': isUpdate}"
                            class="anticon anticon-upload upicon" #upload_icon (click)="updataService(item.uuid)"
                            *ngIf="item.uuid"></i>
                        <i class="anticon anticon-delete" (click)="showDeleteConfirm(item.id)"
                            *ngIf="item.id"></i>
                    </td>
                </tr>
            </tbody>
            <tbody *ngIf="currentTab === 'VNF'">
                <tr *ngFor="let item of nzTable.data;let i = index;">
                    <td>{{i+1}}</td>
                    <td>{{item.vnfProductName || item.name }}</td>     
                    <td>{{item.vnfdVersion || item.version}}</td>
                    <td>{{item.onboardingState}}</td>
                    <td>{{item.operationalState}}</td>
                    <td>{{item.usageState}}</td>
                    <td>
                        <i [ngClass]="{'cannotclick': isUpdate}"
                            class="anticon anticon-upload upicon" #upload_icon (click)="updataService(item.uuid)"
                            *ngIf="item.uuid"></i>
                        <i class="anticon anticon-delete" (click)="showDeleteConfirm(item.id)"
                            *ngIf="item.id"></i>
                    </td>
                </tr>
            </tbody>
            <tbody *ngIf="currentTab === 'PNF'" >
                <tr *ngFor="let item of nzTable.data; let i = index;">
                    <td>{{i+1}}</td>
                    <td>{{item.pnfdName}}</td>
                    <td>{{item.pnfdVersion}}</td>
                    <td>{{item.pnfdOnboardingState}}</td>
                    <td>{{item.pnfdUsageState}}</td>
                    <td>
                        <i class="anticon anticon-delete" (click)="showDeleteConfirm(item.id)"></i>
                    </td>
                </tr> 
            </tbody>
        </nz-table>
    </nz-spin>
</div>
<app-notification #notification [isServicesList]="false"></app-notification>