aboutsummaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/services/services-list/services-list.component.html
blob: 616d5b39530658a6f86216647708423aeef0d362 (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
<!--
    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.
-->
<h3 class="title"> Services List </h3>
<hr>
<div class="action">
  <span>Customer: </span>
  <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'">
    <button nz-button nz-dropdown><span>{{customerSelected.name}}</span> <i class="anticon anticon-down"></i></button>
    <ul nz-menu style="max-height: 200px; overflow: auto;">
      <li nz-menu-item (click)="choseCustomer(item)" *ngFor="let item of customerList">
        <a title="{{item.name}}" style="max-width: 165px; overflow: hidden; text-overflow: ellipsis;">{{item.name}}</a>
      </li>
    </ul>
  </nz-dropdown>
  
  &nbsp;&nbsp;
  <span>Service Type: </span>
  <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'">
    <button nz-button nz-dropdown><span>{{serviceTypeSelected.name}}</span> <i class="anticon anticon-down"></i></button>
    <ul nz-menu style="max-height: 200px; overflow: auto;">
      <li nz-menu-item (click)="choseServiceType(item)" *ngFor="let item of serviceTypeList">
        <a title="{{item.name}}" style="max-width: 165px; overflow: hidden; text-overflow: ellipsis;">{{item.name}}</a>
      </li>
    </ul>
  </nz-dropdown>

  <button class="create" nz-button [nzType]="'primary'" (click)="createModal()"><i class="anticon anticon-plus-circle-o"></i><span> Create </span></button>
  <nz-modal [(nzVisible)]="isVisible" nzTitle="Create" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
    <span style="display:inline-block;width:70px;">Service: </span>
    <nz-select style="width: 165px;" [(ngModel)]="templateTypeSelected" nzAllowClear (ngModelChange)="choseTemplateType()">
      <!-- <nz-option *ngFor="let item of templateType" [nzValue]="item" [nzLabel]="item"></nz-option> -->
      <nz-option nzValue="SOTN" nzLabel="SOTN"></nz-option>
      <nz-option nzValue="CCVPN" nzLabel="CCVPN"></nz-option>
      <nz-option nzValue="E2E Service" nzLabel="E2E Service"></nz-option>
      <nz-option nzValue="Network Service" nzLabel="Network Service"></nz-option>
    </nz-select>

    <hr>
    <div *ngIf="templateTypeSelected == 'SOTN'||templateTypeSelected == 'CCVPN'">
      <span>SOTN VPN: </span>
      <nz-select style="width: 165px;" [(ngModel)]="template1" nzAllowClear >
        <nz-option *ngFor="let item of templates" [nzValue]="item" [nzLabel]="item.name"></nz-option>
      </nz-select>

      <br><br>
      <span style="display:inline-block;width:70px;"> SITE: </span>
      <nz-select style="width: 165px;" [(ngModel)]="template2" nzAllowClear >
        <nz-option *ngFor="let item of templates" [nzValue]="item" [nzLabel]="item.name"></nz-option>
      </nz-select>
      
      <div *ngIf="templateTypeSelected == 'CCVPN'">
        <br>
        <span style="display:inline-block;width:70px;">SD-WAN: </span>
        <nz-select style="width: 165px;" [(ngModel)]="template3" nzAllowClear >
          <nz-option *ngFor="let item of templates" [nzValue]="item" [nzLabel]="item.name"></nz-option>
        </nz-select>
      </div>
    </div>

    <div *ngIf="templateTypeSelected == 'E2E Service'||templateTypeSelected == 'Network Service'">
      <span style="display:inline-block;width:70px;">TEMPLATE: </span>
      <nz-select style="width: 165px;" [(ngModel)]="template4" nzAllowClear >
        <nz-option *ngFor="let item of templates" [nzValue]="item" [nzLabel]="item.name"></nz-option>
      </nz-select>
    </div>
  </nz-modal>
</div>
<div class="list">
    <nz-table *ngIf="1"
      #nzTable [nzData]="tableData" 
      nzShowSizeChanger 
      [nzFrontPagination]="false" 
      [nzShowQuickJumper]="true" 
      [nzPageSizeOptions]="[5,10,15,20]" 
      [nzTotal]= 'total'
      [(nzPageSize)]="pageSize" 
      [(nzPageIndex)]='pageIndex'
      [nzLoading]="loading"
      [nzSize]="'middle'"
      [nzScroll]="{ y: '58vh' }"
      (nzPageIndexChange)="searchData()"
      (nzPageSizeChange)="searchData(true)">
      <thead>
        <tr>
          <th nzWidth="5%">NO</th>
          <th nzWidth="5%"></th>
          <th nzWidth="20%">Service Instance Id</th>
          <th nzWidth="20%">Name</th>
          <th nzWidth="15%">Type</th>
          <th nzWidth="20%">Status</th>
          <th nzWidth="15%">Action</th>
        </tr>
      </thead>
      <tbody>
        <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index">
          <tr>
            <td>{{pageSize*(pageIndex-1) + i+1}}</td>
            <td [nzShowExpand]="data.childServiceInstances[0]" [(nzExpand)]="data.expand"></td>
            <td>{{data["service-instance-id"] || data.nsInstanceId}}</td>
            <td>{{data["service-instance-name"] || data.nsName}}</td>
            <td>{{data.serviceDomain}}</td>
            <td>
              <span [ngClass]="{'active':data.status=='Active','closed':data.status=='Closed','onboarding':data.status=='Onboarding',
                    'updating':data.status=='Updating','deleting':data.status=='Deleting','creating':data.status=='Creating',
                    'stopping':data.status=='Stopping','healing':data.status=='Healing'}">{{data.status || "Active"}}</span>
              <nz-progress *ngIf="data.status == 'Creating' || data.status == 'Deleting' ||  data.status == 'Stopping' || data.status == 'Healing' " [nzPercent]="data.rate"></nz-progress>
            </td>
            <td>
              <i [ngClass]="{'cannotclick':data.status=='Deleting'||data.status=='Creating'||data.status=='Healing'}"
                *ngIf="data.serviceDomain=='E2E Service'||data.serviceDomain=='Network Service' " class="anticon anticon-setting" (click)="scaleService(data)"></i>
              <!-- <i *ngIf="data.serviceDomain=='E2E Service'||data.serviceDomain=='Network Service' " class="anticon anticon-cloud-upload-o" (click)="updataService(data)"></i> -->
              <i [ngClass]="{'cannotclick':data.status=='Deleting'||data.status=='Creating'||data.status=='Healing'}" 
                *ngIf="data.serviceDomain=='Network Service' " class="anticon anticon-reload" (click)="healService(data)"></i>
              <i *ngIf="data.serviceDomain=='SOTN'||data.serviceDomain=='CCVPN' " class="anticon anticon-ellipsis" (click)="serviceDetail(data)"></i>
              <i [ngClass]="{'cannotclick':data.status=='Deleting'||data.status=='Creating'||data.status=='Healing'}"  class="anticon anticon-delete" (click)="deleteModel(data)"></i>
            </td>
          </tr>
          <tr class="childtr" [nzExpand]="data.expand" *ngFor="let item of data.childServiceInstances">
            <td></td>
            <td></td>
            <td>{{item["service-instance-id"] || item.nsInstanceId || item.vnfInstanceId}}</td>
            <td>{{item["service-instance-name"] || item.nsName || item.vnfInstanceName}}</td>
            <td>{{item.serviceDomain}}</td>
            <td>
              <span [ngClass]="{'healing':item.status=='Healing'}">{{item.status || "Active"}}</span>
              <nz-progress *ngIf=" item.status == 'Healing' " [nzPercent]="item.rate"></nz-progress>
            </td>
            <td>
              <i *ngIf="item.serviceDomain=='vnf'" [ngClass]="{'cannotclick':item.status=='Healing'}"  class="anticon anticon-reload" (click)="healService(item)"></i>
            </td>
          </tr>
        </ng-template>
      </tbody>
    </nz-table>
    <nz-modal [(nzVisible)]="deleteModelVisible" nzTitle="Delete" (nzOnCancel)="deleteCancel()" (nzOnOk)="deleteOk()">
      <h3><i class="anticon anticon-question-circle" style="color:yellow;"></i>Are you sure delete this instance?</h3>
      Instance ID: <b class="deleteModelContent"> {{ thisService["service-instance-id"] || thisService["nsInstanceId"] }}</b>
      <div *ngIf="thisService['serviceDomain'] == 'Network Service'">
        <span style="display:inline-block;width:50%;">terminationType:</span>
        <nz-select style="width: 165px;" [(ngModel)]="terminationType" >
          <nz-option nzValue="graceful" nzLabel="graceful"></nz-option>
          <nz-option nzValue="forceful" nzLabel="forceful"></nz-option>
        </nz-select>
        <span *ngIf="terminationType=='graceful'" style="display:inline-block;width:50%;">gracefulTerminationTimeout:</span>
        <input *ngIf="terminationType=='graceful'" style="width: 165px;" nz-input [(ngModel)]="gracefulTerminationTimeout">
      </div>
    </nz-modal>
    <nz-modal [nzVisible]="healModelVisible" nzTitle="Heal" (nzOnCancel)="healCancel()" (nzOnOk)="healOk()">
      <h3><i class="anticon anticon-question-circle" style="color:yellow;"></i>Are you sure heal this instance?</h3>
      Instance ID: <b style="color:green"> {{ thisService["service-instance-id"] || thisService["nsInstanceId"] || thisService["vnfInstanceId"]}}</b>
      <!-- NS -->
      <div *ngIf="thisService['serviceDomain'] == 'Network Service'">
        <span style="display:inline-block;width:50%;">degreeHealing:</span>
        <nz-select style="width: 165px;" [(ngModel)]="nsParams.degreeHealing" >
          <nz-option nzValue="HEAL_RESTORE" nzLabel="HEAL_RESTORE"></nz-option>
          <nz-option nzValue="HEAL_QOS" nzLabel="HEAL_QOS"></nz-option>
          <nz-option nzValue="HEAL_RESET" nzLabel="HEAL_RESET"></nz-option>
          <nz-option nzValue="PARTIAL_HEALING" nzLabel="PARTIAL_HEALING"></nz-option>
        </nz-select> 
        <div>
          <span  style="display:inline-block;">actionsHealing:</span>
          <button nz-button [nzType]="'default'" (click)="addActionsHealing()"><i class="anticon anticon-plus-circle-o"></i></button>
          <br>
          <div *ngFor="let item of healActions;let i = index;" style="display:inline-block;">
              <input style="width: 165px;" nz-input [(ngModel)]="item.value"><button nz-button [nzType]="'dashed'" (click)="minusActionsHealing(i)"><i class="anticon anticon-minus-circle-o"></i></button>
              &nbsp;
          </div>
        </div>
        <span  style="display:inline-block;width:50%;">healScript:</span>
        <input style="width: 165px;" nz-input [(ngModel)]="nsParams.healScript"> 
        <div>
          <span  style="display:inline-block;">additionalParamsforNs:</span>
          <button nz-button [nzType]="'default'" (click)="addNsAdditional()"><i class="anticon anticon-plus-circle-o"></i></button>
          <br>
          <div *ngFor="let item of nsAdditional;let i = index;">
              Key: <input style="width: 165px;" nz-input [(ngModel)]="item.key"> &nbsp;
              Value: <input style="width: 165px;" nz-input [(ngModel)]="item.value">
              <button nz-button [nzType]="'dashed'" (click)="minusNsAdditional(i)"><i class="anticon anticon-minus-circle-o"></i></button>
          </div>
        </div>
      </div>
      <!-- vnf -->
      <div *ngIf="thisService['serviceDomain'] == 'vnf'">
          <span style="display:inline-block;width:50%;">cause:</span>
          <input style="width: 165px;" nz-input [(ngModel)]="vnfParams.cause">
          <span style="display:inline-block;width:50%;">action:</span>
          <input style="width: 165px;" nz-input [(ngModel)]="vnfParams.additionalParams.action">
          <span style="display:inline-block;width:50%;">actionvminfo:</span>
          <nz-select style="width: 165px;" [(ngModel)]="vmSelected" >
            <nz-option *ngFor="let item of vnfVms" [nzValue]="item" [nzLabel]="item.vmName"></nz-option>
          </nz-select>
      </div>
    </nz-modal>
</div>

<div class="detailComponent" *ngIf="detailshow">
  <app-ccvpn-detail [namesTranslate]="namesTranslate" [detailParams]="detailData" (closeDetail)="detailshow = false;"></app-ccvpn-detail>
</div>
<div class="createComponent" *ngIf="createshow">
  <app-ccvpn-creation 
    [createParams]="createData" 
    [namesTranslate]="namesTranslate" 
    (closeCreate)="closeCreate($event)">
  </app-ccvpn-creation>
</div>
<div class="createComponent" *ngIf="createshow2">
  <app-e2e-creation
    [createParams]="createData" 
    (nsCloseCreate)="nsCloseCreate($event)" 
    (e2eCloseCreate)="e2eCloseCreate($event)">
  </app-e2e-creation>
</div>