summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/ccvpn-creation/ccvpn-creation.component.html
blob: 1fc9a5002c012ef47bd872d8a3f2282ed0038e9b (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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!--
    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.
-->
<div class="model creation-model">

    <div class="top-title">
        <h3 class="title fl">{{createParams.commonParams.templateType}}
            {{"i18nTextDefine_InstanceCreation" | translate}} </h3>
        <div class="fl" style="width: 20%">
            <button class="submit" nz-button (click)="submit()"><span> {{"i18nTextDefine_Create" | translate}} </span>
            </button>
            <button class="back" nz-button (click)="goback()"></button>
        </div>
    </div>
    <!-- chart -->
    <div class="chart">
        <span style="padding: 25px;display: inline-block;">
            {{"i18nTextDefine_InstanceTopology" | translate}}
        </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>
        </div>
    </div>
    <!--Template resolution : Three major items-->
    <div class="creation">
        <nz-tabset [nzTabPosition]="'top'" [nzShowPagination]=false [nzTabBarGutter]="'2'" [nzTabBarStyle]=tabBarStyle>
            <nz-tab nzTitle="Service Info">
                <div class="service-title" style="clear: both">
                    <span style="color: red;">*</span><span class="lable" style="width: 60px">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>
            </nz-tab>
            <nz-tab nzTitle="Sdwanvpnresource List">
                <div class="sotnvpn clearfix">
                    <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> {{"i18nTextDefine_Add" | translate}}
                        </button>
                    </div>
                    <nz-table #sotnVpnTable [nzData]="sotnVpnTableData" [nzShowPagination]="false" nzSize="small">
                        <thead>
                            <tr>
                                <th width="30%"> NO.</th>
                                <th *ngFor="let key of getKeys(this.sotnInfo)">{{key.split("_")[1] || key}}</th>
                                <th width="10%"> Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr *ngFor="let item of sotnVpnTable.data; let i = index; ">
                                <td>{{i+1}}</td>
                                <td *ngFor="let keys of getKeys(this.sotnInfo);let a = index;">
                                    {{item[keys]}}
                                </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>
                        </tbody>
                    </nz-table>
                </div>
            </nz-tab>
            <nz-tab nzTitle="Sdwansiteresource List">
                <div class="site">
                    <div style="height: 10px">
                        <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>{{"i18nTextDefine_Add" | translate}}
                        </button>
                    </div>
                    <nz-table #siteTable [nzData]="siteTableData" [nzShowPagination]="false" nzSize="small">
                        <thead>
                            <tr>
                                <th nzWidth="10%"> NO.</th>
                                <th *ngFor="let key of getKeys(this.siteBaseData)">{{key.split("_")[1] || key}}</th>
                                <th nzWidth="20%" style="text-align: center"> Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr *ngFor="let item of siteTable.data; let i = index; ">
                                <td>{{i+1}}</td>
                                <td *ngFor="let keys of getKeys(this.siteBaseData);let a = index;">
                                    {{item[keys]}}
                                </td>
                                <td style="text-align: center">
                                    <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>
                        </tbody>
                    </nz-table>
                </div>
            </nz-tab>
        </nz-tabset>
    </div>
    <!-- sotnVpnmodel -->
    <div class="sotnnpnmodel" *ngIf="sotnVpnModelShow">
        <h3> {{"i18nTextDefine_Base" | translate}} </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>{{"i18nTextDefine_Add" | translate}}
                    </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>
                        <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>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="action">
            <button nz-button nzType="primary"
                (click)="addSotnVpn_cancel()">{{"i18nTextDefine_Cancel" | translate}}</button>
            <button nz-button nzType="primary" (click)="addSotnVpn_OK()">{{"i18nTextDefine_Add" | translate}}</button>
        </div>
    </div>
    <!-- sitemodel -->
    <div class="sitemodel" *ngIf="siteModelShow">
        <h3> {{"i18nTextDefine_Base" | translate}} </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</h3>
            <div>
                <div style="width: 100%;text-align: right">
                    <button nz-button (click)="addSdwanDevice()" class="addListBtn"><i class="anticon anticon-plus"
                            style="transform: scale(1.2);font-weight: 700;"></i>{{"i18nTextDefine_Add" | translate}}
                    </button>
                </div>
                <table class="siteWanTab">
                    <thead>
                        <tr>
                            <th width="4%"> NO.</th>
                            <th *ngFor="let key of getKeys(this.siteCpeData)">{{key}}</th>
                            <th width="7%"> Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let item of siteSdwanDevice; let i = index;"
                            [ngClass]="{'tr-border':item.tabInputShowDevice ==false}">
                            <td>{{i+1}}</td>
                            <td *ngFor="let key of getKeys(item);let a = index;">
                                <span *ngIf="!tabInputShowDevice[i]"
                                    title="{{this.templateParameters.site.sdwandevice_list[a]['lable']==getKeys(item)[a] ? this.templateParameters.site.sdwandevice_list[a].description:null}}">{{item[key]}}</span>
                                <input nz-input [(ngModel)]="item[key]" *ngIf="tabInputShowDevice[i] "
                                    title="{{this.templateParameters.site.sdwandevice_list[a]['lable']==getKeys(item)[a] ? this.templateParameters.site.sdwandevice_list[a].description:null}}"
                                    required="{{item.required==true ? 'required':null}}">
                            </td>
                            <td>
                                <span class="action" (click)="editDevicePort(i+1,item,siteSdwanDevice)"><i
                                        class="anticon anticon-edit" style="margin: 0 5px;"></i></span>
                                <span class="action" (click)="deleteDevicePort(i+1,item,siteSdwanDevice)"><i
                                        class="anticon anticon-delete"></i></span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </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>{{"i18nTextDefine_Add" | translate}}
                    </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>
                        <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>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="action">
            <button nz-button nzType="primary"
                (click)="addsite_cancel()">{{"i18nTextDefine_Cancel" | translate}}</button>
            <button nz-button nzType="primary" (click)="addsite_OK()">{{"i18nTextDefine_Add" | translate}}</button>
        </div>
    </div>
    <div class="mask" *ngIf="siteModelShow || sotnVpnModelShow"></div>
</div>