aboutsummaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html
blob: 8aa7bd61ab4bc4de851b1dbf6fb9163a84d1a247 (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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!--
    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.
-->
<!--<h3 class="title"> Services List </h3>-->
<!--<hr>-->
<div class="model creation-model">
    
    <div class="top-title">
        <h3 class="title fl">{{createParams.commonParams.templateType}} Instance Creation</h3>
        <div class="fl" style="width: 20%">
            <button class="submit" nz-button (click)="submit()"><i
                    class="anticon anticon-plus" style="transform: scale(1.5);line-height: 15px;margin-right: 5px;"></i><span>Create</span></button>
            <button class="back" nz-button (click)="goback()">
               <i class="anticon anticon-arrow-left" style="transform: scale(1.5)"></i>
            </button>
        </div>
    </div>
    <!-- chart -->
    <div class="chart">
       <span style="padding: 25px;display: inline-block;">
            Instance Topology
       </span>
        <div id="createChart">
            <svg width="100%" height="100%">
                <image id="domain" xlink:href="../../assets/images/domain1.png" style="width: 15%"
                       x="40%" y="0"/>
            </svg>
            <!-- <p class="siteNameP" [ngStyle]="siteNameStyle">{{ siteName }}</p> -->
        </div>
    </div>
    <div class="creation">
        <nz-tabset [nzTabPosition]="'top'" [nzShowPagination]=false [nzTabBarGutter]="'2'" [nzTabBarStyle]=tabBarStyle>
            <nz-tab nzTitle="sdwanvpnresource_list">
                <div class="sotnvpn clearfix">
                    <div class="service-title" style="clear: both">
                        <span style="color: red;">*</span><span class="lable" style="width: 50px">name:</span>
                        <input nz-input [(ngModel)]="this.templateParameters.service['name']" required="required">
                        <span style="color: red;">*</span><span class="lable">description:</span>
                        <input nz-input [(ngModel)]="this.templateParameters.service['description']">
                    </div>
                    <div style="clear: both;height: 10px">
                        <h3 style="float: left;color: #3C4F8C">sdwanVPN List</h3>
                        <button nz-button (click)="addSotnvpn()" class="addListBtn"
                                style="float: right;margin-right: 10px"><i class="anticon anticon-plus"
                                                                           style="transform: scale(1.2);font-weight: 700"></i>Add
                        </button>
                    </div>
                    <nz-table #sotnVpnTable [nzData]="sotnVpnTableData"
                              [nzShowPagination]="false"
                              nzSize="small">
                        <thead>
                        <tr>
                            <th width="30%"> NO.</th>
                            <th width="30%"> Name</th>
                            <th width="30%"> topology</th>
                            <th width="10%"> Action</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!-- <ng-template ngFor let-data [ngForOf]="siteTable.data" let-i="index"> -->
                        <tr *ngFor="let item of sotnVpnTable.data; let i = index; ">
                            <td>{{i+1}}</td>
                            <td>{{item.sdwanvpn_name}}</td>
                            <td>{{item.sdwanvpn_topology}}</td>
                            <td>
                                <span class="action" (click)="editSotnVpn(i+1)"><i class="anticon anticon-edit"></i></span>
                                &nbsp;
                                <span class="action" (click)="deleteSotnVpn(i+1)"><i
                                        class="anticon anticon-delete"></i></span>
                            </td>
                        </tr>
                        <!-- </ng-template> -->
                        </tbody>
                    </nz-table>
                </div>
            </nz-tab>
            <nz-tab nzTitle="sdwansiteresource_list">
                <div class="site">
                    <div>
                        <h3 style="float: left;color: #3C4F8C">Site List</h3>
                        <button nz-button (click)="addSite()" class="addListBtn"
                                style="float: right;margin-right: 10px"><i class="anticon anticon-plus"
                                                                           style="transform: scale(1.2);font-weight: 700"></i>Add
                        </button>
                    </div>
                    <nz-table #siteTable [nzData]="siteTableData"
                              [nzShowPagination]="false"
                              nzSize="small">
                        <thead>
                        <tr>
                            <th nzWidth="10%"> NO.</th>
                            <th nzWidth="15%"> Name</th>
                            <th nzWidth="15%"> Description</th>
                            <th nzWidth="15%"> Post Code</th>
                            <th nzWidth="15%"> Address</th>
                            <th nzWidth="15%"> emails</th>
                            <th nzWidth="15%"> Action</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!-- <ng-template ngFor let-data [ngForOf]="siteTable.data" let-i="index"> -->
                        <tr *ngFor="let item of siteTable.data; let i = index; ">
                            <td>{{i+1}}</td>
                            <td>{{item.sdwandevice_list[0].name}}</td>
                            <td>{{item.sdwansite_description}}</td>
                            <td>{{item.sdwansite_postcode}}</td>
                            <td>{{item.sdwansite_address}}</td>
                            <td>{{item.sdwansite_emails}}</td>
                            <td>
                                <span class="action" (click)="editSite(i+1)"><i class="anticon anticon-edit"></i></span>
                                &nbsp;
                                <span class="action" (click)="deleteSite(i+1)"><i
                                        class="anticon anticon-delete"></i></span>
                            </td>
                        </tr>
                        <!-- </ng-template> -->
                        </tbody>
                    </nz-table>
                </div>
            </nz-tab>
        </nz-tabset>
    </div>
    <!-- sotnVpnmodel -->
    <div class="sotnnpnmodel" *ngIf="sotnVpnModelShow">
        <h3>sdwanvpnresource_list</h3>
        <div class="inputs">
            <ul>
                <li *ngFor="let item of this.templateParameters.sotnvpn.sdwanvpnresource_list">
                    <span *ngIf="item.required" style="color: red;margin: 0;margin-right: -5px;">*</span><span>{{item.lableShow}}:</span>
                    <input nz-input [(ngModel)]="sotnInfo[item.lable]" title="{{item.description ? item.description:null }}"
                           required="{{item.required==true ? 'required':null}}"></li>
            </ul>
        </div>
        <div>
            <h3>sdwansitelan_list</h3>
            <div>
                <div style="width: 100%;text-align: right">
                    <button nz-button (click)="addSotnSdwansitelan()" class="addListBtn"><i class="anticon anticon-plus"
                                                                                   style="transform: scale(1.2);font-weight: 700;"></i>Add
                    </button>
                </div>
                <table class="siteWanTab">
                    <thead>
                    <tr>
                        <th width="4%"> NO.</th>
                        <th *ngFor="let key of getKeys(this.sotnSdwansitelanParams)">{{key}}</th>
                        <th width="7%"> Action</th>
                    </tr>
                    </thead>
                    <tbody>
                    <!-- <ng-template ngFor let-data [ngForOf]="siteModalTable.data" let-i="index"> -->
                    <tr *ngFor="let item of sotnSdwansitelanData; let i = index;"
                        [ngClass]="{'tr-border':item.tabInputShowSdwansitelan ==false}">
                        <td>{{i+1}}</td>
                        <td *ngFor="let key of getKeys(item);let a = index;">
                            <span *ngIf="!tabInputShowSdwansitelan[i]"
                                  title="{{this.templateParameters.sotnvpn.sdwansitelan_list[a]['lable']==getKeys(item)[a] ? this.templateParameters.site.sdwansitewan_list[a].description:null}}">{{item[key]}}</span>
                            <input nz-input [(ngModel)]="item[key]" *ngIf="tabInputShowSdwansitelan[i] "
                                   title="{{this.templateParameters.sotnvpn.sdwansitelan_list[a]['lable']==getKeys(item)[a] ? this.templateParameters.site.sdwansitewan_list[a].description:null}}"
                                   required="{{item.required==true ? 'required':null}}">
                        </td>
                        <td>
                            <span class="action" (click)="editSotnSdwansitelan(i+1,item,sotnSdwansitelanData)"><i
                                    class="anticon anticon-edit" style="margin: 0 5px;"></i></span>
                            <span class="action" (click)="deleteSotnSdwansitelan(i+1,item,sotnSdwansitelanData)"><i
                                    class="anticon anticon-delete"></i></span>
                        </td>
                    </tr>
                    <!-- </ng-template> -->
                    </tbody>
                </table>
            </div>
        </div>

        <div class="action">
            <button nz-button nzType="primary" (click)="addSotnVpn_cancel()">Cancel</button>
            <button nz-button nzType="primary" (click)="addSotnVpn_OK()">Add</button>
        </div>
    </div>
    <!-- sitemodel -->
    <div class="sitemodel" *ngIf="siteModelShow">
        <h3>sdwansiteresource_list</h3>
        <div class="inputs">
            <ul>
                <li *ngFor="let item of this.templateParameters.site.sdwansiteresource_list">
                    <span *ngIf="item.required" style="color: red;margin: 0;margin-right: -5px;">*</span><span>{{item.lableShow}}:</span>
                    <input nz-input [(ngModel)]="siteBaseData[item.lable]" title="{{item.description}}"
                           required="{{item.required==true ? 'required':null}}"></li>
            </ul>
        </div>
        <div>
            <h3>sdwandevice_list</h3>
            <div class="inputs">
                <ul>
                    <li *ngFor="let item of this.templateParameters.site.sdwandevice_list">
                        <span *ngIf="item.required" style="color: red;margin: 0;margin-right: -5px;">*</span><span>{{item.lable}}:</span>
                        <input nz-input [(ngModel)]="siteCpeData[item.lable]" title="{{item.description}}"
                               required="{{item.required==true ? 'required':null}}"></li>
                </ul>
            </div>
            <h3>sdwansitewan_list</h3>
            <div>
                <div style="width: 100%;text-align: right">
                    <button nz-button (click)="addSiteWan()" class="addListBtn"><i class="anticon anticon-plus"
                                                                                   style="transform: scale(1.2);font-weight: 700;"></i>Add
                    </button>
                </div>
                <table class="siteWanTab">
                    <thead>
                    <tr>
                        <th width="4%"> NO.</th>
                        <th *ngFor="let key of getKeys(this.siteWanParams)">{{key}}</th>
                        <th width="7%"> Action</th>
                    </tr>
                    </thead>
                    <tbody>
                    <!-- <ng-template ngFor let-data [ngForOf]="siteModalTable.data" let-i="index"> -->
                    <tr *ngFor="let item of siteWanData; let i = index;"
                        [ngClass]="{'tr-border':item.tabInputShowWanPort ==false}">
                        <td>{{i+1}}</td>
                        <td *ngFor="let key of getKeys(item);let a = index;">
                            <span *ngIf="!tabInputShowWanPort[i]"
                                  title="{{this.templateParameters.site.sdwansitewan_list[a]['lable']==getKeys(item)[a] ? this.templateParameters.site.sdwansitewan_list[a].description:null}}">{{item[key]}}</span>
                            <input nz-input [(ngModel)]="item[key]" *ngIf="tabInputShowWanPort[i] "
                                   title="{{this.templateParameters.site.sdwansitewan_list[a]['lable']==getKeys(item)[a] ? this.templateParameters.site.sdwansitewan_list[a].description:null}}"
                                   required="{{item.required==true ? 'required':null}}">
                        </td>
                        <td>
                            <span class="action" (click)="editWanPort(i+1,item,siteWanData)"><i
                                    class="anticon anticon-edit" style="margin: 0 5px;"></i></span>
                            <span class="action" (click)="deleteWanPort(i+1,item,siteWanData)"><i
                                    class="anticon anticon-delete"></i></span>
                        </td>
                    </tr>
                    <!-- </ng-template> -->
                    </tbody>
                </table>
            </div>
        </div>

        <div class="action">
            <button nz-button nzType="primary" (click)="addsite_cancel()">Cancel</button>
            <button nz-button nzType="primary" (click)="addsite_OK()">Add</button>
        </div>
    </div>
    <div class="mask" *ngIf="siteModelShow || sotnVpnModelShow"></div>
</div>