summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2019-04-30 11:05:47 +0800
committerguochuyicmri <guochuyi@chinamobile.com>2019-04-30 11:31:10 +0800
commit155cbcf3ecc4157466dee09fe384787d65d58269 (patch)
tree6e21f29b894d7f36ae509e196dce02e8f6f46bc4
parent5978085f3b08b836e9db75c83791379b1592dd93 (diff)
Fix instance instantiation for CCVPN
Change-Id: I4261d248704e498565e8337ea5672b16e89e1f8f Issue-ID: USECASEUI-220 Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
-rw-r--r--usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html441
-rw-r--r--usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts960
-rw-r--r--usecaseui-portal/src/app/myhttp.service.ts4
-rw-r--r--usecaseui-portal/src/app/services/services-list/services-list.component.html1
-rw-r--r--usecaseui-portal/src/app/services/services-list/services-list.component.ts153
5 files changed, 631 insertions, 928 deletions
diff --git a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html
index 2f0469c2..8aa7bd61 100644
--- a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html
+++ b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html
@@ -34,123 +34,50 @@
</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" />
- <!--<line *ngFor="let item of lines" [attr.x1]="item.x1" [attr.y1]="item.y1" [attr.x2]="item.x2" [attr.y2]="item.y2"-->
- <!--style="stroke:#3fa8eb;stroke-width:2"/>-->
-
- <!--&lt;!&ndash; <text dx="42%" dy="45%" style="font:700 18px 'Arial';fill:#666">{{createParams.commonParams.templateType}}</text> &ndash;&gt;-->
- <!--&lt;!&ndash;<text dx="42%" dy="45%" style="font:700 18px 'Arial';fill:#666"></text>&ndash;&gt;-->
- <!--<g *ngFor="let item of siteImage"-->
- <!--(mouseover)="showSite($event,item)"-->
- <!--(mousemove)="moveSite($event,item)"-->
- <!--(mouseout)="hideSite($event)">-->
- <!--<image-->
- <!--xlink:href="../../assets/images/site.png"-->
- <!--[attr.x]="item.x" [attr.y]="item.y" width="50px"/>-->
- <!--&lt;!&ndash;<text [attr.dx]="item.x + 25" dy="72%" style="font:700 16px 'Arial';fill:#666">{{ item.name }}&ndash;&gt;-->
- <!--&lt;!&ndash;</text>&ndash;&gt;-->
- <!--</g>-->
- <!--<g *ngFor="let item of siteImage"-->
- <!--(mouseover)="showSite($event,item)"-->
- <!--(mousemove)="moveSite($event,item)"-->
- <!--(mouseout)="hideSite($event)">-->
- <!--<image-->
- <!--xlink:href="../../assets/images/site.png"-->
- <!--[attr.x]="item.x" [attr.y]="item.y" width="50px"/>-->
- <!--&lt;!&ndash;<text [attr.dx]="item.x + 25" dy="72%" style="font:700 16px 'Arial';fill:#666">{{ item.name }}&ndash;&gt;-->
- <!--&lt;!&ndash;</text>&ndash;&gt;-->
- <!--</g>-->
-
+ <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="SOTN VPN Info">
+ <nz-tab nzTitle="sdwanvpnresource_list">
<div class="sotnvpn clearfix">
- <!--<h3>SOTN VPN Info</h3>-->
- <ul>
- <li><span>Name:</span> <input nz-input [(ngModel)]="sotnInfo.name"></li>
- <li><span>Description:</span> <input nz-input [(ngModel)]="sotnInfo.description"></li>
- <li><span>Start Time:</span>
- <nz-date-picker [(ngModel)]="sotnInfo.startTime"
- (ngModelChange)="startTimeChange($event)"
- nzPlaceHolder="start time"
- nzShowTime>
- </nz-date-picker>
- </li>
- <li><span>End Time:</span>
- <nz-date-picker [(ngModel)]="sotnInfo.endTime"
- (ngModelChange)="endTimeChange($event)"
- nzPlaceHolder="end time"
- nzShowTime>
- </nz-date-picker>
- </li>
- <li><span>COS:</span>
- <nz-select style="width: 234px;height: 40px" [(ngModel)]="sotnInfo.COS" nzAllowClear nzPlaceHolder="Choose">
- <nz-option nzValue="premium" nzLabel="premium"></nz-option>
- <nz-option nzValue="standard" nzLabel="standard"></nz-option>
- </nz-select>
- </li>
- <li><span>Service Level Specification:</span> <input nz-input [(ngModel)]="sotnInfo.SLS"></li>
- <li><span>Dual Link:</span>
- <nz-select style="width: 234px;height: 40px" [(ngModel)]="sotnInfo.dualLink" nzAllowClear
- nzPlaceHolder="Choose">
- <nz-option nzValue="no_protection" nzLabel="no_protection"></nz-option>
- <nz-option nzValue="static_1+1" nzLabel="static_1+1"></nz-option>
- <nz-option nzValue="permanent_1+1" nzLabel="permanent_1+1"></nz-option>
- </nz-select>
- </li>
- <li><span>CIR:</span> <input nz-input [(ngModel)]="sotnInfo.CIR"></li>
- <li><span>EIR:</span> <input nz-input [(ngModel)]="sotnInfo.EIR"></li>
- <li><span>CBS:</span> <input nz-input [(ngModel)]="sotnInfo.CBS"></li>
- <li><span>EBS:</span> <input nz-input [(ngModel)]="sotnInfo.EBS"></li>
- <li><span style="width: 130px">Reroute Enabled:</span>
- <nz-switch [(ngModel)]="sotnInfo.reroute"></nz-switch>
- </li>
- <li><span>Color Aware:</span>
- <nz-switch [(ngModel)]="sotnInfo.colorAware"></nz-switch>
- </li>
- <li><span style="width: 130px">Coupling Flag:</span>
- <nz-switch [(ngModel)]="sotnInfo.couplingFlag"></nz-switch>
- </li>
- </ul>
- </div>
- </nz-tab>
- <nz-tab nzTitle="Site List">
- <div class="site">
- <!--<h3>Site List</h3>-->
- <button nz-button (click)="addSite()"><i class="anticon anticon-plus"
- style="transform: scale(1.2)"></i></button>
- <nz-table #siteTable [nzData]="siteTableData"
+ <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 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%"> VLAN</th>
- <th nzWidth="15%"> Action</th>
+ <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 siteTable.data; let i = index; ">
+ <tr *ngFor="let item of sotnVpnTable.data; let i = index; ">
<td>{{i+1}}</td>
- <td>{{item.baseData.name}}</td>
- <td>{{item.baseData.description}}</td>
- <td>{{item.baseData.postcode}}</td>
- <td>{{item.baseData.address}}</td>
- <td>{{item.baseData.vlan}}</td>
+ <td>{{item.sdwanvpn_name}}</td>
+ <td>{{item.sdwanvpn_topology}}</td>
<td>
- <span class="action" (click)="editSite(i+1)"><i class="anticon anticon-edit"></i></span>
+ <span class="action" (click)="editSotnVpn(i+1)"><i class="anticon anticon-edit"></i></span>
&nbsp;
- <span class="action" (click)="deleteSite(i+1)"><i
+ <span class="action" (click)="deleteSotnVpn(i+1)"><i
class="anticon anticon-delete"></i></span>
</td>
</tr>
@@ -159,37 +86,42 @@
</nz-table>
</div>
</nz-tab>
- <nz-tab nzTitle="Site_Group List" *ngIf="createParams.commonParams.templateType == 'CCVPN'">
- <div class="sitegroup" >
- <!--<h3>Site_Group List</h3>-->
- <button nz-button (click)="addSiteGroup()"><i class="anticon anticon-plus"
- style="transform: scale(1.2)"></i></button>
- <nz-table #siteGroupTable [nzData]="siteGroupTableData"
- [nzLoading]="loading"
+ <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="20%"> Group Name</th>
- <th nzWidth="20%"> Topology</th>
- <th nzWidth="20%"> Sites</th>
- <th nzWidth="15%"> Role</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]="siteGroupTable.data" let-i="index"> -->
- <tr *ngFor="let item of siteGroupTable.data; let i = index; ">
+ <!-- <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.name}}</td>
- <td>{{item.topology}}</td>
- <td>{{item.sites}}</td>
- <td>{{item.role}}</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)="editGroupSite(i+1)"><i class="anticon anticon-edit"></i></span>
+ <span class="action" (click)="editSite(i+1)"><i class="anticon anticon-edit"></i></span>
&nbsp;
- <span class="action" (click)="deleteGroupSite(i+1)"><i
+ <span class="action" (click)="deleteSite(i+1)"><i
class="anticon anticon-delete"></i></span>
</td>
</tr>
@@ -200,231 +132,128 @@
</nz-tab>
</nz-tabset>
</div>
- <!-- site model-->
- <div class="sitemodel" *ngIf="siteModelShow">
- <h3>Site_Enterprise Service</h3>
+ <!-- sotnVpnmodel -->
+ <div class="sotnnpnmodel" *ngIf="sotnVpnModelShow">
+ <h3>sdwanvpnresource_list</h3>
<div class="inputs">
<ul>
- <li><span>Name:</span> <input nz-input [(ngModel)]="siteBaseData.name" style=" margin-right: 60px;"></li>
- <li *ngIf="createParams.commonParams.templateType == 'CCVPN'"><span>Type:</span>
- <nz-select [(ngModel)]="siteBaseData.type" nzAllowClear
- nzPlaceHolder="Choose"
- style=" margin-right: 60px;">
- <nz-option nzValue="single-gateway" nzLabel="single-gateway"></nz-option>
- <nz-option nzValue="dual-gateway" nzLabel="dual-gateway"></nz-option>
- </nz-select>
- </li>
- <li><span>PostCode:</span> <input nz-input [(ngModel)]="siteBaseData.postcode"></li>
- <li><span style="margin-left: 50px">Address:</span>
- <nz-select [(ngModel)]="siteBaseData.address" nzAllowClear
- nzPlaceHolder="Choose"
- style="margin-right: 0">
- <nz-option *ngFor="let item of siteModeAddress" nzValue="{{item}}"
- nzLabel="{{item}}"></nz-option>
- </nz-select>
- <!--<input nz-input [(ngModel)]="siteBaseData.address">-->
- </li>
- <li><span>VLAN:</span> <input nz-input [(ngModel)]="siteBaseData.vlan" style=" margin-right: 60px;"></li>
- <li *ngIf="createParams.commonParams.templateType == 'CCVPN'"><span>Role:</span>
- <nz-select [(ngModel)]="siteBaseData.role" nzAllowClear
- nzPlaceHolder="Choose"
- style=" margin-right: 60px;">
- <nz-option nzValue="dsvpn-hub" nzLabel="dsvpn-hub"></nz-option>
- <nz-option nzValue="sd-wan-edge" nzLabel="sd-wan-edge"></nz-option>
- </nz-select>
- </li>
- <li><span>Description:</span> <input nz-input [(ngModel)]="siteBaseData.description"></li>
+ <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 *ngIf="createParams.commonParams.templateType == 'CCVPN'">
- <h3>CPE</h3>
- <div class="inputs">
- <ul>
- <li><span>Name:</span> <input nz-input [(ngModel)]="siteCpeData.device_name" style=" margin-right: 60px;"></li>
- <li><span>Type:</span> <input nz-input [(ngModel)]="siteCpeData.device_type" style=" margin-right: 60px;"></li>
- <li><span>System IP:</span> <input nz-input [(ngModel)]="siteCpeData.device_systemIp"></li>
- <li><span style="margin-left: 50px">Version:</span> <input nz-input [(ngModel)]="siteCpeData.device_version" style="margin-right: 0"></li>
- <li><span>ESN:</span> <input nz-input [(ngModel)]="siteCpeData.device_esn" style=" margin-right: 60px;"></li>
- <li><span>Class:</span>
- <nz-select [(ngModel)]="siteCpeData.device_class" nzAllowClear
- nzPlaceHolder="Choose"
- style=" margin-right: 60px;">
- <nz-option nzValue="VNF" nzLabel="VNF"></nz-option>
- <nz-option nzValue="PNF" nzLabel="PNF"></nz-option>
- </nz-select>
- </li>
- <li><span>Vendor:</span> <input nz-input [(ngModel)]="siteCpeData.device_vendor"></li>
- </ul>
- </div>
- <h3>WAN Port
- <button nz-button><i class="anticon anticon-plus" style="transform: scale(1.2)"></i></button>
- </h3>
+ <div>
+ <h3>sdwansitelan_list</h3>
<div>
- <nz-table #siteModalTable [nzData]="siteWanData"
- [nzLoading]="loading"
- [nzShowPagination]="false"
- nzSize="small">
+ <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 width="6%"> Name</th>
- <th width="9%"> Description</th>
- <th width="7%"> PortType</th>
- <th width="10%"> PortNumber</th>
- <th width="8%"> IPAddress</th>
- <th width="14%"> Provider IP Address</th>
- <th width="13%"> Transport Nerwork</th>
- <th width="12%"> Input Bandwidth</th>
- <th width="13%"> Output Bandwidth</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 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>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_name}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_name" *ngIf="item.tabInputShow">
+ <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 *ngIf="!item.tabInputShow">{{item.sitewanport_description}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_description" *ngIf="item.tabInputShow">
- </td>
- <td>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_portType}}</span>
- <nz-select style="width: 100px;" [(ngModel)]="item.sitewanport_portType" nzAllowClear
- nzPlaceHolder="Choose" *ngIf="item.tabInputShow">
- <nz-option nzValue="GE" nzLabel="GE"></nz-option>
- <nz-option nzValue="FE" nzLabel="FE"></nz-option>
- <nz-option nzValue="XGE" nzLabel="XGE"></nz-option>
- <nz-option nzValue="LTE" nzLabel="LTE"></nz-option>
- <nz-option nzValue="xDSL(ATM)" nzLabel="xDSL(ATM)"></nz-option>
- <nz-option nzValue="xSDL(PTM)" nzLabel="xSDL(PTM)"></nz-option>
- </nz-select>
- </td>
- <td>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_portNumber}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_portNumber" *ngIf="item.tabInputShow">
- </td>
- <td>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_ipAddress}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_ipAddress" *ngIf="item.tabInputShow">
- </td>
- <td>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_providerIpAddress}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_providerIpAddress" *ngIf="item.tabInputShow">
- </td>
- <td>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_transportNetworkName}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_transportNetworkName" *ngIf="item.tabInputShow">
- </td>
- <td>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_inputBandwidth}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_inputBandwidth" *ngIf="item.tabInputShow">
- </td>
- <td>
- <span *ngIf="!item.tabInputShow">{{item.sitewanport_outputBandwidth}}</span>
- <input nz-input [(ngModel)]="item.sitewanport_outputBandwidth" *ngIf="item.tabInputShow">
- </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)="deleteModel(i+1,item,siteWanData)"><i class="anticon anticon-delete"></i></span>
+ <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>
- </nz-table>
+ </table>
</div>
- <!--<nz-modal [(nzVisible)]="wanPortModal" nzWidth="400" nzTitle="WAN Port Edit"-->
- <!--(nzOnCancel)="wanPortModal_Cancel()" (nzOnOk)="wanPortModal_Ok()">-->
- <!--<ul class="wanPortModalList">-->
- <!--<li><span>Name:</span> <input nz-input [(ngModel)]="siteWanParams.sitewanport_name"></li>-->
- <!--&lt;!&ndash; <li><span>Device Name:</span> <input nz-input [(ngModel)]="siteWanParams.sitewanport_deviceName"></li> &ndash;&gt;-->
- <!--<li><span>Description:</span> <input nz-input [(ngModel)]="siteWanParams.sitewanport_description">-->
- <!--</li>-->
- <!--<li><span>Port Type:</span>-->
- <!--<nz-select style="width: 165px;" [(ngModel)]="siteWanParams.sitewanport_portType" nzAllowClear-->
- <!--nzPlaceHolder="Choose">-->
- <!--<nz-option nzValue="GE" nzLabel="GE"></nz-option>-->
- <!--<nz-option nzValue="FE" nzLabel="FE"></nz-option>-->
- <!--<nz-option nzValue="XGE" nzLabel="XGE"></nz-option>-->
- <!--<nz-option nzValue="LTE" nzLabel="LTE"></nz-option>-->
- <!--<nz-option nzValue="xDSL(ATM)" nzLabel="xDSL(ATM)"></nz-option>-->
- <!--<nz-option nzValue="xSDL(PTM)" nzLabel="xSDL(PTM)"></nz-option>-->
- <!--</nz-select>-->
- <!--</li>-->
- <!--<li><span>Port Number:</span> <input nz-input [(ngModel)]="siteWanParams.sitewanport_portNumber">-->
- <!--</li>-->
- <!--<li><span>Ip Address:</span> <input nz-input [(ngModel)]="siteWanParams.sitewanport_ipAddress"></li>-->
- <!--<li><span>Provider IP Address:</span> <input nz-input-->
- <!--[(ngModel)]="siteWanParams.sitewanport_providerIpAddress">-->
- <!--</li>-->
- <!--<li><span>Transport Nerwork:</span> <input nz-input-->
- <!--[(ngModel)]="siteWanParams.sitewanport_transportNetworkName">-->
- <!--</li>-->
- <!--<li><span>Input Bandwidth:</span> <input nz-input-->
- <!--[(ngModel)]="siteWanParams.sitewanport_inputBandwidth">-->
- <!--</li>-->
- <!--<li><span>Output Bandwidth:</span> <input nz-input-->
- <!--[(ngModel)]="siteWanParams.sitewanport_outputBandwidth">-->
- <!--</li>-->
- <!--</ul>-->
- <!--</nz-modal>-->
</div>
<div class="action">
- <button nz-button nzType="primary" (click)="addsite_cancel()">Cancel</button>
- <button nz-button nzType="primary" (click)="addsite_OK()">Add</button>
+ <button nz-button nzType="primary" (click)="addSotnVpn_cancel()">Cancel</button>
+ <button nz-button nzType="primary" (click)="addSotnVpn_OK()">Add</button>
</div>
</div>
- <!--sitegroupmodal-->
- <div class="sitegroupmodal" *ngIf="siteGroupModelShow" >
- <h3>Site_Group</h3>
+ <!-- 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">
- <div class="list-div">
- <span class="fl">Group Name:</span>
- <input nz-input [(ngModel)]="siteGroupModelData.name" style="width: 170px" class="fr">
- </div>
- <div class="list-div">
- <span class="fl">Topology:</span>
- <nz-select style="width: 170px;" [(ngModel)]="siteGroupModelData.topology" nzAllowClear
- nzPlaceHolder="Choose" class="fr">
- <nz-option nzValue="full-mesh" nzLabel="full-mesh"></nz-option>
- <nz-option nzValue="hub-spoke" nzLabel="hub-spoke"></nz-option>
- </nz-select>
+ <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>
- <nz-table #groupModalTable [nzData]="siteGroupModalTableData" [nzLoading]="loading"
- [nzShowPagination]="false" nzSize="small">
+ <table class="siteWanTab">
<thead>
<tr>
- <th nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate"
- (nzCheckedChange)="groupModal_checkAll($event)"></th>
- <th> Site Name</th>
- <th> Role</th>
+ <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 groupModalTable.data; let i = index;">
- <td nzShowCheckbox [nzDisabled]="item.disabled" [(nzChecked)]="item.checked"
- (nzCheckedChange)="refreshStatus($event)"></td>
- <td>{{ item.siteName }}</td>
+ <!-- <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>
- <nz-select style="width: 80px;" [(ngModel)]="item.role"
- nzAllowClear nzPlaceHolder="Choose"
- [nzDisabled]="siteGroupModelData.topology != 'hub-spoke'">
- <nz-option nzValue="hub" nzLabel="hub"></nz-option>
- <nz-option nzValue="spoke" nzLabel="spoke"></nz-option>
- </nz-select>
+ <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>
- </nz-table>
- </div>
- <div class="action">
- <button nz-button nzType="primary" (click)="addsitegroup_cancel()">Cancel</button>
- <button nz-button nzType="primary" (click)="addsitegroup_OK()">Add</button>
+ </table>
</div>
</div>
- <div class="mask" *ngIf="siteModelShow || siteGroupModelShow"></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>
diff --git a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts
index 7d0e2986..063d609a 100644
--- a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts
+++ b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts
@@ -28,7 +28,6 @@ export class CcvpnCreationComponent implements OnInit {
constructor(private myhttp:MyhttpService) { }
ngOnInit() {
- this.getSiteAddressList();
this.getTemParameters();
}
@@ -36,46 +35,64 @@ export class CcvpnCreationComponent implements OnInit {
@Input() namesTranslate; //Input parameter name conversion
@Output() closeCreate = new EventEmitter();
- //tabBarStyle
- tabBarStyle = {
- "height": "58px",
- "width": "528px",
- "box-shadow": "none",
- "margin": "0",
- "border-radius": "4px 4px 0px 0px"
- };
- templateParameters={
- service:{},
- sotnvpn:{
- info:{},
- sdwanvpnresource_list:[],
- sdwansitelan_list:[]
- },
- site:{
- info:{},
- sdwansiteresource_list:[],
- sdwandevice_list:[],
- sdwansitewan_list:[]
- }
- };
+ //tabBarStyle
+ tabBarStyle = {
+ "height": "58px",
+ "width": "460px",
+ "box-shadow": "none",
+ "margin": "0",
+ "border-radius": "4px 4px 0px 0px"
+ };
+ templateParameters = {
+ service: {},
+ sotnvpn: {
+ info: {},
+ sdwanvpnresource_list: [],
+ sdwansitelan_list: []
+ },
+ site: {
+ info: {},
+ sdwansiteresource_list: [],
+ sdwandevice_list: [],
+ sdwansitewan_list: []
+ }
+ };
+
+ // SOTN VPN List
+ sotnVpnTableData = [];
+ sotnInfo = {};//sotnmodel The first part of sotnInfo
+ sotnSdwansitelanData = [];//sotnmodel The second part of the data sdwansitelan Table
+ sotnSdwansitelanParams = {};//sdwansitelan Table Detailed parameters of each line of data
+ tabInputShowSdwansitelan = [];//sdwansitelan Table input&span The status identifier of the label switching display
+ // Site List
+ siteTableData = [];
+ siteBaseData = {}; //sitemodel one sdwansiteresource_list
+ // cpe
+ siteCpeData = {}; //sitemodel two sdwandevice_list
+ // Wan Port
+ siteWanData = []; //sitemodel three wan port Table data
+ siteWanParams = {}; //wan port Table Detailed parameters of each line of data
+ tabInputShowWanPort = [];//wan port Table input和span The status identifier of the label switching display
+ getKeys(item) {
+ return Object.keys(item);
+ }
- getTemParameters() { //获取模板参数
+ getTemParameters() { //Get template parameters
let chosedtemplates = this.createParams.template;
let types = this.createParams.commonParams.templateType;
console.log(this.createParams);
- console.log(chosedtemplates); //模板id数组
- if (types == 'SOTN') {
- this.tabBarStyle["width"] = "351px";
- }
+ console.log(chosedtemplates); //Template id array
this.myhttp.getTemplateParameters(types, chosedtemplates)
.subscribe((data) => {
- let inputs=data["inputs"];
- let vnfs=data["vnfs"];
- this.templateParameters.service={
- serviceInvariantUuid:data.metadata.invariantUUID,
- serviceUuid:data.metadata.UUID
+ let inputs = data["inputs"];
+ let vnfs = data["vnfs"];
+ this.templateParameters.service = {
+ name: data.metadata.name,
+ description: data.metadata.description,
+ serviceInvariantUuid: data.metadata.invariantUUID,
+ serviceUuid: data.metadata.UUID
};
- vnfs.map((item) => { //将sotnvpn和site的基本信息添加进来
+ vnfs.map((item) => { //Add basic information about sotnvpn and site
if( item["vnf_id"]=='sdwanvpnresource'){
this.templateParameters["sotnvpn"]["info"]={resourceName: item["vnf_id"], min:item.properties["min_instances"],resourceInvariantUuid: item.metadata["invariantUUID"], resourceUuid: item.metadata["UUID"],resourceCustomizationUuid: item.metadata["customizationUUID"]}
}
@@ -84,231 +101,356 @@ export class CcvpnCreationComponent implements OnInit {
}
});
- //筛选 分离 sotnvpn数据
+ //Screening separation sotnvpn data
inputs["sdwanvpnresource_list"].map((item,index) => {
if(item["required"] !=undefined){
this.templateParameters["sotnvpn"]["sdwanvpnresource_list"].push(item);
}
- if(item["sdwansitelan_list"] !=undefined && item["sdwansitelan_list"] instanceof Array === true){
- console.log(item)
- this.templateParameters["sotnvpn"]["sdwansitelan_list"]=item["sdwansitelan_list"]
+ if (item["sdwansitelan_list"] != undefined && item["sdwansitelan_list"] instanceof Array === true) {
+ this.templateParameters["sotnvpn"]["sdwansitelan_list"] = item["sdwansitelan_list"]
}
});
- //筛选 分离 site数据
+ //Screening separation site data
inputs["sdwansiteresource_list"].map((item,index) => {
if(item["required"] !=undefined){
this.templateParameters["site"]["sdwansiteresource_list"].push(item);
}
- if(item["sdwandevice_list"] !=undefined && item["sdwandevice_list"] instanceof Array === true){
- console.log(item)
- this.templateParameters["site"]["sdwandevice_list"]=item["sdwandevice_list"]
+ if (item["sdwandevice_list"] != undefined && item["sdwandevice_list"] instanceof Array === true) {
+ this.templateParameters["site"]["sdwandevice_list"] = item["sdwandevice_list"]
}
- if(item["sdwansitewan_list"] !=undefined && item["sdwansitewan_list"] instanceof Array === true){
- console.log(item)
- this.templateParameters["site"]["sdwansitewan_list"]=item["sdwansitewan_list"]
+ if (item["sdwansitewan_list"] != undefined && item["sdwansitewan_list"] instanceof Array === true) {
+ this.templateParameters["site"]["sdwansitewan_list"] = item["sdwansitewan_list"]
}
});
- console.log( this.templateParameters)
-
-
-
+ this.showTemParametersSotnVpn();
+ this.showTemParametersSite();
}, (err) => {
});
- }
- // SOTN VPN Info Input parameters
- sotnInfo = {
- name:null,description:null,
- startTime:null,endTime:null,
- COS:"premium",reroute:false,
- SLS:null,dualLink:false,
- CIR:null,EIR:null,
- CBS:null,EBS:null,
- colorAware:false,couplingFlag:false
- }
- sotnNames = [] //Real name
+ }
- startTimeChange(event){
- console.log(event)
- }
- endTimeChange(event){
- console.log(event)
- }
+ //sotnVpn data, after combining the structure, rendering the template data to the page
+ showTemParametersSotnVpn(){
+ //sotn Data analysis, structure assembly
+ this.templateParameters.sotnvpn.sdwanvpnresource_list.map((item, index) => {
+ let input = {};
+ for (var keys in item) {
+ if (keys != "required" && keys != "type" && keys != "description") {
+ input[keys] = item[keys];
+ item["lable"] = keys;
+ item["lableShow"] = keys.split("_")[1];
+ this.sotnInfo = Object.assign(this.sotnInfo, input);
+ }
+ }
+ });
+ this.templateParameters.sotnvpn.sdwansitelan_list.map((item, index) => {
+ let input = {};
+ for (var keys in item) {
+ if (keys != "required" && keys != "type" && keys != "description") {
+ input[keys] = item[keys];
+ item["lable"] = keys;
+ this.sotnSdwansitelanParams = Object.assign(this.sotnSdwansitelanParams, this.sotnSdwansitelanParams, input);
+ }
+ }
+ });
+ this.sotnSdwansitelanData.push(this.sotnSdwansitelanParams);
+ this.sotnSdwansitelanData.map((item, index) => {
+ this.tabInputShowSdwansitelan[index] = true;
+ });
+ }
- // Site List
- siteTableData = [
-
- ]
- siteModeAddress = [];//site Address, filter box data, local configuration file
- siteNames = [];//All real names in the site, not grouped, simulating real request conditions;
-
- siteBaseData = { //Modal box data, input parameters, binding data
- name:null,
- description:null,
- type:null,
- role:null,
- postcode:null,
- address:null,
- vlan:null,
- sotnVpnName:null, //SOTN VPN Info name
- controlPoint:null, //When the Role of the site in the site group is set to spoke, pass the site name to the site name of the hub. Otherwise, pass the blank.
- groupRole:null, //site group role
- groupName:null, //site group name
- emails:null,// Do not show air
- latitude:null,//
- longitude:null,//
- clientSignal:null//
- };
- siteBaseNames = [] //Real name
- // cpe edit
- siteCpeData = {
- device_name:null,
- device_version:null,
- device_esn:null,
- device_class:null,
- device_systemIp:null,
- device_vendor:null,
- device_type:null
- };
- siteCpeNames = [] //Real name
- // Wan Port edit
- siteWanData = []; //wan port Table binding data
- siteWanParams = { //Detailed parameters of each line of data, modal box
- sitewanport_name:null,
- sitewanport_deviceName:null,
- sitewanport_description:null,
- sitewanport_portType:null,
- sitewanport_portNumber:null,
- sitewanport_ipAddress:null,
- sitewanport_providerIpAddress:null,
- sitewanport_transportNetworkName:null,
- sitewanport_inputBandwidth:null,
- sitewanport_outputBandwidth: null,
- tabInputShow:false,
- indexs:null,
- };
- siteWanNames = [] //Real name
- wanPortEditNum = 0;//Which line to edit
- editWanPort(num,item,siteWanData) {
- console.log(this)
- console.log(siteWanData)
- console.log(item)
- siteWanData.map((its) => {
- if(its.indexs==item.indexs){
- if (its.tabInputShow==false) {
- this.wanPortEditNum = num;
- item.tabInputShow=true;
- } else {
- item.tabInputShow=false;
- console.log(this.siteWanData)
+ //Site data, after combining the structure, rendering the template to the page
+ showTemParametersSite() {
+ //site Data analysis, structure assembly
+ this.templateParameters.site.sdwansiteresource_list.map((item, index) => {
+ let input = {};
+ for (var keys in item) {
+ if (keys != "required" && keys != "type" && keys != "description") {
+ input[keys] = item[keys];
+ item["lable"] = keys;
+ item["lableShow"] = keys.split("_")[1];
+ this.siteBaseData = Object.assign(this.siteBaseData, input);
}
}
- })
+ });
+
+ this.templateParameters.site.sdwandevice_list.map((item, index) => {
+ let input = {};
+ for (var keys in item) {
+ if (keys != "required" && keys != "type" && keys != "description") {
+ input[keys] = item[keys];
+ item["lable"] = keys;
+ this.siteCpeData = Object.assign(this.siteCpeData, input);
+ }
+ }
+ });
+
+ this.templateParameters.site.sdwansitewan_list.push(
+ {
+ ipMode: "",
+ description: ""
+ },
+ {
+ publicIP: "",
+ description: ""
+ }
+ );
+
+ this.templateParameters.site.sdwansitewan_list.map((item, index) => {
+ let input = {};
+ for (var keys in item) {
+ if (keys != "required" && keys != "type" && keys != "description") {
+ input[keys] = item[keys];
+ item["lable"] = keys;
+ this.siteWanParams = Object.assign(this.siteWanParams, this.siteWanParams, input);
+ }
+ }
+ });
+ this.siteWanData.push(this.siteWanParams);
+ this.siteWanData.map((item, index) => {
+ this.tabInputShowWanPort[index] = true;
+ });
}
+ //add,edit,delete sotnSdwansitelan
+ addSotnSdwansitelan(){
+ if (this.tabInputShowSdwansitelan.indexOf(true) > -1) {//Adding new rows is not allowed when there is a row of data being edited
+ return false;
+ }
+ let addNum = this.sotnSdwansitelanData.length;
+ let inputsData = Object.assign({}, this.sotnSdwansitelanParams);
+ Object.keys(inputsData).forEach((item) => {//Add a new line of empty data
+ if (item != "description") {
+ inputsData[item] = null;
+ }
+ });
+ this.sotnSdwansitelanData[addNum] = inputsData;
+ this.tabInputShowSdwansitelan[addNum] = true;
+ this.sotnSdwansitelanData = [...this.sotnSdwansitelanData]; //Table refresh
+ console.log(this.sotnSdwansitelanData)
+ }
+ editSotnSdwansitelan(num, item, sotnSdwansitelanData){
+ console.log(item)
+ if (this.tabInputShowSdwansitelan[num - 1] == false) {
+ this.tabInputShowSdwansitelan[num - 1] = true;
+ } else {
+ this.tabInputShowSdwansitelan[num - 1] = false;
+ }
+ console.log(sotnSdwansitelanData);
+ }
+ deleteSotnSdwansitelan(num, item, sotnSdwansitelanData){
+ this.sotnSdwansitelanData = this.sotnSdwansitelanData.filter((d, i) => i !== num - 1);
+ console.log(this.sotnSdwansitelanData)
+ }
- // Get the site address, manual file
- getSiteAddressList(){
- this.myhttp.getSiteAddress()
- .subscribe((data)=>{
- console.log(data);
- this.siteModeAddress = data.map((item)=>{ return item.location});
- },(err)=>{
- console.log(err);
- })
- }
- siteModelShow = false;
- addSite(){
- this.siteModelShow = true;
- this.isEdit = 0;
- }
- // addsite Modal box button
- isEdit = 0; //Edit serial number, No value, 0 means increase
- addsite_OK(){
- this.siteBaseData.sotnVpnName = this.sotnInfo.name;
- // let inputsData = Object.assign({},this.siteBaseData,this.siteCpeData,this.siteWanData); //Create a new object, disconnect the original reference, because you want to empty the modal box later
- let inputs = {};
- inputs["baseData"] = Object.assign({},this.siteBaseData);
- inputs["cpeData"] = Object.assign({},this.siteCpeData);
- inputs["wanportData"] = this.siteWanData.map((item)=>{
- return Object.assign({},item);
- })
- console.log(inputs);
- if(this.isEdit){
- // Edit status does not increase
- this.siteTableData[this.isEdit-1] = inputs;
- this.siteTableData = [...this.siteTableData]; //Table refresh
- this.siteGroupTableData.forEach((item)=>{ //After the site changes the name, update the sites value in the group.
- if(item.sites.split(";").filter((d)=>{return d!=""}).includes(this.lastSiteName)){
- item.sites = item.sites.replace(this.lastSiteName,this.siteBaseData.name);
+ //add,edit,delete siteWanPort
+ addSiteWan() {
+ if (this.tabInputShowWanPort.indexOf(true) > -1) {//Adding new rows is not allowed when there is a row of data being edited
+ return false;
}
- })
- }else{
- // this.siteTableData.push(inputs);//use push or splice modify nzData Invalid When added [nzFrontPagination]="false" ,Effective
- this.siteTableData = [...this.siteTableData,inputs];
+ let addNum = this.siteWanData.length;
+ let inputsData = Object.assign({}, this.siteWanParams);
+ Object.keys(inputsData).forEach((item) => {//Add a new line of empty data
+ if (item != "description") {
+ inputsData[item] = null;
+ }
+ });
+ this.siteWanData[addNum] = inputsData;
+ this.tabInputShowWanPort[addNum] = true;
+ this.siteWanData = [...this.siteWanData]; //Table refresh
+ console.log(this.siteWanData)
}
-
- Object.keys(this.siteBaseData).forEach((item)=>{ //Clear modal box
- this.siteBaseData[item] = null;
- })
- Object.keys(this.siteCpeData).forEach((item)=>{ //Clear modal box
- this.siteCpeData[item] = null;
- })
- this.siteWanData.forEach((item)=>{
- Object.keys(item).forEach((item2)=>{
- item[item2] = null;
- })
- })
- // console.log(this.siteTableData);
- this.lastSiteName = null;
- this.drawImage(this.siteTableData);
- this.siteModelShow = false;
- }
- addsite_cancel(){
- Object.keys(this.siteBaseData).forEach((item)=>{ //Clear modal box
- this.siteBaseData[item] = null;
- })
- Object.keys(this.siteCpeData).forEach((item)=>{ //Clear modal box
- this.siteCpeData[item] = null;
- })
- this.siteWanData.forEach((item)=>{
- Object.keys(item).forEach((item2)=>{
- item[item2] = null;
- })
- })
- this.lastSiteName = null;
- this.siteModelShow = false;
- }
- lastSiteName = null; //After the site is modified, if the name is changed, the name of the sites in the group needs to be updated.
- editSite(num){ //Edit and modify the selected site information
- this.siteModelShow = true;
- this.isEdit=num;
- this.siteBaseData = Object.assign({},this.siteTableData[num-1].baseData);
- this.siteCpeData = Object.assign({},this.siteTableData[num-1].cpeData);
- this.siteWanData = this.siteTableData[num-1].wanportData.map((item)=>{return Object.assign({},item)});
- this.lastSiteName = this.siteBaseData.name;
- }
- deleteSite(num){
- let deleteSiteName = this.siteTableData[num-1].baseData.name; //Deleted site name
- let groupSites = [];
- this.siteGroupTableData.forEach((item)=>{ groupSites.push(...item.sites.split(";").filter((d)=>{return d!=""})) });
- if(groupSites.includes(deleteSiteName)){
- alert("this site has in grouplist;can't delete!")
- return false;
+ editWanPort(num, item, siteWanData) {
+ console.log(item)
+ if (this.tabInputShowWanPort[num - 1] == false) {
+ this.tabInputShowWanPort[num - 1] = true;
+ } else {
+ this.tabInputShowWanPort[num - 1] = false;
+ }
+ console.log(siteWanData);
+ }
+ deleteWanPort(num, item, siteWanData){
+ this.siteWanData = this.siteWanData.filter((d, i) => i !== num - 1);
+ console.log(this.siteWanData)
}
- this.siteTableData = this.siteTableData.filter((d,i) => i !== num-1);
- // this.siteTableData.splice(num-1,1); //Add in template [nzFrontPagination]="false" ,Effective
- this.drawImage(this.siteTableData);
- // let groupIndex = this.siteGroupTableData.findIndex((item)=>{return item.sites.split(";").includes(deleteSiteName)});
- // console.log(groupIndex)
- // this.deleteGroupSite(groupIndex + 1); //The first line number is 1 when deleting
- }
+ //siteModel,sotnVpnModel Display sign
+ siteModelShow = false;
+ sotnVpnModelShow = false;
+ addSotnvpn(){
+ this.sotnVpnModelShow = true;
+ this.isEditSotnVpn = 0;
+ }
+ addSite() {
+ this.siteModelShow = true;
+ this.isEditSite = 0;
+ }
+
+//add sotnVpn model
+ isEditSotnVpn = 0;//Edit serial number, No value, 0 means increase
+ addSotnVpn_OK(){
+ let inputs= {
+ "sdwansitelan_list":[]
+ };
+ inputs = Object.assign(inputs, this.sotnInfo);
+ inputs["sdwansitelan_list"] = this.sotnSdwansitelanData.map((item) => {
+ return Object.assign({}, item);
+ });
+ console.log(inputs);
+ if (this.isEditSotnVpn) {
+ // Edit status does not increase
+ this.sotnVpnTableData[this.isEditSotnVpn - 1] = inputs;
+ this.sotnVpnTableData = [...this.sotnVpnTableData]; //Table refresh
+ } else {
+ this.sotnVpnTableData = [...this.sotnVpnTableData, inputs];
+ }
+ console.log(this.sotnVpnTableData)
+
+ Object.keys(this.sotnInfo).forEach((item) => { //Clear modal box
+ this.sotnInfo[item] = null;
+ });
+ this.sotnSdwansitelanData.forEach((item, index) => {
+ if (index > 0) {
+ this.sotnSdwansitelanData.splice(index, 1);
+ this.tabInputShowSdwansitelan.splice(index, 1);
+ } else {
+ Object.keys(item).forEach((item2) => {
+ item[item2] = null;
+ });
+ this.tabInputShowSdwansitelan[index] = true;
+ }
+
+ });
+ this.sotnVpnModelShow = false;
+ }
+
+ addSotnVpn_cancel(){
+ Object.keys(this.sotnInfo).forEach((item) => { //Clear modal box
+ this.sotnInfo[item] = null;
+ });
+ this.sotnSdwansitelanData.forEach((item, index) => {
+ if (index > 0) {
+ this.sotnSdwansitelanData.splice(index, 1);
+ } else {
+ Object.keys(item).forEach((item2) => {
+ item[item2] = null;
+ });
+ this.tabInputShowSdwansitelan[index] = true;
+ }
+
+ });
+ this.sotnVpnModelShow = false;
+ }
+
+ editSotnVpn(num){
+ this.sotnVpnModelShow = true;
+ this.isEditSotnVpn = num;
+ Object.keys(this.sotnInfo).forEach((item) => { //Clear modal box
+ this.sotnInfo[item] = this.sotnInfo[num - 1][item];
+ });
+ this.sotnSdwansitelanData = this.sotnVpnTableData[num - 1].sdwansitelan_list.map((item) => {
+ return Object.assign({}, item)
+ });
+ this.sotnSdwansitelanData.forEach((item, index) => {
+ this.tabInputShowSdwansitelan[index] = false;
+ });
+ }
+
+ deleteSotnVpn(num){
+ this.sotnVpnTableData = this.sotnVpnTableData.filter((d, i) => i !== num - 1);
+ console.log(this.sotnVpnTableData)
+ }
+
+// addsite model
+ isEditSite = 0; //Edit serial number, No value, 0 means increase
+ addsite_OK() {
+ let inputs = {
+ "sdwandevice_list": [],
+ "sdwansitewan_list": []
+ };
+ inputs = Object.assign(inputs, this.siteBaseData);
+ inputs["sdwandevice_list"][0] = Object.assign({}, this.siteCpeData);
+ inputs["sdwansitewan_list"] = this.siteWanData.map((item) => {
+ return Object.assign({}, item);
+ });
+ console.log(inputs);
+ if (this.isEditSite) {
+ // Edit status does not increase
+ this.siteTableData[this.isEditSite - 1] = inputs;
+ this.siteTableData = [...this.siteTableData]; //Table refresh
+ } else {
+ this.siteTableData = [...this.siteTableData, inputs];
+ }
+
+ Object.keys(this.siteBaseData).forEach((item) => { //Clear modal box
+ this.siteBaseData[item] = null;
+ });
+ Object.keys(this.siteCpeData).forEach((item) => { //Clear modal box
+ this.siteCpeData[item] = null;
+ });
+ this.siteWanData.forEach((item, index) => {
+ if (index > 0) {
+ this.siteWanData.splice(index, 1);
+ this.tabInputShowWanPort.splice(index, 1);
+ } else {
+ Object.keys(item).forEach((item2) => {
+ item[item2] = null;
+ });
+ this.tabInputShowWanPort[index] = true;
+ }
+
+ });
+ console.log(this.siteTableData);
+ this.drawImage(this.siteTableData);
+ this.siteModelShow = false;
+ }
+
+ addsite_cancel() {
+ Object.keys(this.siteBaseData).forEach((item) => { //Clear modal box
+ this.siteBaseData[item] = null;
+ })
+ Object.keys(this.siteCpeData).forEach((item) => { //Clear modal box
+ this.siteCpeData[item] = null;
+ })
+ this.siteWanData.forEach((item, index) => {
+ if (index > 0) {
+ this.siteWanData.splice(index, 1);
+ } else {
+ Object.keys(item).forEach((item2) => {
+ item[item2] = null;
+ });
+ this.tabInputShowWanPort[index] = true;
+ }
+
+ });
+ this.siteModelShow = false;
+ }
+
+ editSite(num) { //Edit and modify the selected site information
+ this.siteModelShow = true;
+ this.isEditSite = num;
+ Object.keys(this.siteBaseData).forEach((item) => { //Clear modal box
+ this.siteBaseData[item] = this.siteTableData[num - 1][item];
+ });
+ this.siteCpeData = Object.assign({}, this.siteTableData[num - 1].sdwandevice_list[0]);
+ this.siteWanData = this.siteTableData[num - 1].sdwansitewan_list.map((item) => {
+ return Object.assign({}, item)
+ });
+ this.siteWanData.forEach((item, index) => {
+ this.tabInputShowWanPort[index] = false;
+ });
+ }
+
+ deleteSite(num) {
+ this.siteTableData = this.siteTableData.filter((d, i) => i !== num - 1);
+ console.log(this.siteTableData)
+ this.drawImage(this.siteTableData);
+ }
// Site node graphic depiction
lines = [];
@@ -321,26 +463,23 @@ export class CcvpnCreationComponent implements OnInit {
drawImage(sitelist) {
let cx = 550;
- let cy = 0;
- let innerx1 = 720;
- let innery1 = 80;
+ let cy = 40;
+ let innerx1 = 720; //Left site pattern coordinate position
+ let innery1 = 40;
let ox = 950;
- let oy = 0;
- let innerx2 = 780;
- let innery2 = 60;
+ let oy = 50;
+ let innerx2 = 780;//Right site pattern coordinate position
+ let innery2 = 50;
let lateX1 = Math.random() * 30 + 55;
- let lateY1 = Math.random() * -20 + 10;
- let lateX2 = 15;
- let lateY2 = 20;
- // let step = sitelist.length > 1 ?sitelist.length: 1;
-
+ let lateX2 = 10;
+ let lateY1 = 15;
this.lines = sitelist.map((item, index) => {
let step = index + 1;
let x = cx;
let y = cy;
let innerX = innerx1;
let innerY = innery1;
- if (step % 2 != 0) {
+ if (step % 2 != 0) { //Left site pattern coordinate position
x = cx;
y = cy;
innerX = innerx1;
@@ -350,11 +489,11 @@ export class CcvpnCreationComponent implements OnInit {
innerY = innery1;
} else {
x = cx - lateX1 * Math.ceil((step / 2)) >= 0 ? cx - lateX1 * Math.ceil((step / 2)) : -(cx - lateX1 * Math.ceil((step / 2)));
- y = cy + lateY1 * step >= 0 ? cy + lateY1 * step : -(cy + lateY1 * step);
+ y = cy + lateY1 * Math.floor((step / 2));
innerX = this.lines[step - 3].innerX - lateX2;
- innerY = this.lines[step - 3].innerY + lateY2;
+ innerY = y;
}
- } else {
+ } else { //Right site pattern coordinate position
x = ox;
y = oy;
innerX = innerx2;
@@ -364,24 +503,22 @@ export class CcvpnCreationComponent implements OnInit {
innerY = innery2;
} else {
x = ox + lateX1 * (step / 2) >= 0 ? ox + lateX1 * (step / 2) : -(ox + lateX1 * (step / 2));
- y = oy + lateY1 * step >= 0 ? oy + lateY1 * step : -(oy + lateY1 * step);
- innerX = this.lines[step - 3].innerX + lateX2;
- innerY = this.lines[step - 3].innerY + lateY2;
+ y = oy + lateY1 * (step / 2 - 1);
+ innerX = this.lines[step - 3].innerX - lateX2;
+ innerY = y;
}
}
return {
img: "line",
- site: item.baseData.name,
- x1: x + 25,
- y1: y + 25,
+ site: item.sdwandevice_list[0].name,
+ x1: x,
+ y1: y,
x2: innerX,
y2: innerY,
innerX: innerX,
innerY: innerY
}
});
-
- console.log(this.lines)
this.render(this.imgmap, this.lines);
}
@@ -439,269 +576,76 @@ export class CcvpnCreationComponent implements OnInit {
}
- siteName=null;
- siteNameStyle = {
- 'display':'none',
- 'left':'0',
- 'top':'0'
- }
- showSite($event,item){
- this.siteName = item.name;
- this.siteNameStyle.display = 'block';
- }
- moveSite($event,item){
- this.siteNameStyle.left = $event.clientX + "px";
- this.siteNameStyle.top = $event.clientY - 35 + "px";
- }
- hideSite($event){
- this.siteNameStyle.display = 'none';
- }
- // siteGroup List
- siteGroupTableData = [
-
- ]
- siteGroupModelData = {
- name:null,
- topology:null,
- sites:null,
- role:null
- }
- siteGroupModelShow = false;
- siteGroupModalTableData = [];// ==> siteTableData?
- siteGroupNames=[]; //sdwanvpn Real name
-
- // Check box
- allChecked = false;
- indeterminate = false;
- groupModal_checkAll(value){
- this.siteGroupModalTableData.forEach(data => {
- if (!data.disabled) {
- data.checked = value;
- }
- });
- this.refreshStatus();
- }
- refreshStatus(){
- const allChecked = this.siteGroupModalTableData.filter(item => !item.disabled).every(item => item.checked === true);
- const allUnChecked = this.siteGroupModalTableData.filter(item => !item.disabled).every(item => !item.checked);
- this.allChecked = allChecked;
- this.indeterminate = (!allChecked) && (!allUnChecked);
- }
+// submit createData
+ submit() {
+ let globalCustomerId = this.createParams.commonParams.customer.id;
+ let globalServiceType = this.createParams.commonParams.serviceType.name;
+ let servicebody={
+ name: this.templateParameters.service["name"],
+ description: this.templateParameters.service["description"],
+ serviceInvariantUuid: this.templateParameters.service["serviceInvariantUuid"],
+ serviceUuid:this.templateParameters.service["serviceUuid"],
+ globalSubscriberId: globalCustomerId, //customer.id
+ serviceType: globalServiceType, //serviceType.value
+ parameters: {
+ locationConstraints: [
+ ],
+ },
+ requestInputs: {
+ },
+ resources:[]
+ };
+
+ let sotnbody = this.sotnVpnTableData.map((sotn) => {
+ let sotninputs = {
+ resourceIndex: 0,
+ resourceName:this.templateParameters["sotnvpn"]["info"]["resourceName"],
+ resourceInvariantUuid: this.templateParameters["sotnvpn"]["info"]["resourceInvariantUuid"],
+ resourceUuid: this.templateParameters["sotnvpn"]["info"]["resourceUuid"],
+ resourceCustomizationUuid:this.templateParameters["sotnvpn"]["info"]["resourceCustomizationUuid"],
+ parameters: {
+ locationConstraints: [
+ ],
+ resources: [
+ ],
+ requestInputs: {}
+ }
+ };
+ sotninputs.parameters.requestInputs=Object.assign({}, sotn);
- addSiteGroup(){
- this.isGroupEdit = 0;
- this.siteGroupModelShow = true;
- let checkedSite = this.siteGroupTableData.map((item)=>{return item.sites}).join(";").split(";").filter((d)=>{return d!=""});//Whether a site has been selected in the loop group, if it exists, the new group is not optional.
- // console.log(checkedSite);
- this.siteTableData.forEach((item,index)=>{
- if(checkedSite.includes(item.baseData.name)){
- this.siteGroupModalTableData.push({siteName:item.baseData.name,role:null,checked:false,disabled:true})
- }else {
- this.siteGroupModalTableData.push({siteName:item.baseData.name,role:null,checked:false,disabled:false})
- }
- })
- }
- // addsiteGroup Modal box button
- addsitegroup_OK(){ //Assign the value in the modal box to the corresponding item in the table ---> update the groupRole, groupName, and controlPoint in the selected site --->
- //Copy data judgment is to add or edit, update the data in the table ---> Clear the data in the modal box, easy to add next time, close the modal box
- console.log(this.siteGroupModalTableData);
- this.siteGroupModelData.sites=""; //Empty group member name,"" Convenience += ,if it's null += Will turn into "null"
- this.siteGroupModelData.role=""; //
- let site_controlPoint = this.siteGroupModalTableData.map((item)=>{ if(item.checked&&item.role=="hub"){ return item.siteName}}).filter((item)=>{return item!=undefined});
- // console.log(site_controlPoint);
- this.siteGroupModalTableData.forEach((item,index)=>{ //The order of the sites in the modal box is the same as the order of the sites in the table.
- if(item.checked){
- this.siteGroupModelData.sites += item.siteName+";";
- this.siteGroupModelData.role += item.role+";";
- this.siteTableData[index].baseData.groupRole = item.role; //site group的role
- this.siteTableData[index].baseData.groupName = this.siteGroupModelData.name; //site group的name
- if(item.role == "spoke"){
- this.siteTableData[index].baseData.controlPoint = site_controlPoint.join(); //When site group site Role it's spoke,Pass the site group inside the Role set to the hub's site name; otherwise pass the blank
- }
- }
- })
-
- let inputsData = {};
- Object.assign(inputsData,this.siteGroupModelData);
- if(this.isGroupEdit){
- // Edit status does not increase
- this.siteGroupTableData[this.isGroupEdit-1] = inputsData;
- this.siteGroupTableData = [...this.siteGroupTableData]; //Table refresh
- }else{
- // this.siteTableData.push(inputsData);//use push or splice modify nzData Invalid
- this.siteGroupTableData = [...this.siteGroupTableData,inputsData];
- }
+ return sotninputs;
+ });
- Object.keys(this.siteGroupModelData).forEach((item)=>{
- this.siteGroupModelData[item] = null;
- })
- this.siteGroupModalTableData = [];
- this.siteGroupModelShow = false;
- }
- addsitegroup_cancel(){
- this.siteGroupModalTableData = [];
- this.siteGroupModelShow = false;
- }
- isGroupEdit = 0; //Edit serial number, No value, 0 means increase
- editGroupSite(num){ //Fill the currently edited row data into the modal box--->Get the current edit item sites name--->Determine the status of the site item in the updated modal box
- this.siteGroupModelShow = true;
- this.isGroupEdit=num;
- this.siteGroupModelData = Object.assign({},this.siteGroupTableData[num-1]);
- console.log(this.siteGroupModelData)
- let editSites = this.siteGroupTableData[num-1].sites.split(";").filter((item)=>{return item!=""}); //Get the site name in the group
- // console.log(editSites);
- let checkedSite = this.siteGroupTableData.map((item)=>{return item.sites}).join(";").split(";").filter((d)=>{return d!=""});//Whether a site has been selected in the loop group,If present, the new group is not optional
- // console.log(checkedSite);
- this.siteTableData.forEach((item,index)=>{
- if(editSites.includes(item.baseData.name)){//First restore these three values in the site in the edit group, otherwise it will not be updated when the site is reduced.
- item.baseData.groupRole = null; //site group的role
- item.baseData.groupName = null; //site group的name
- item.baseData.controlPoint = null;
- this.siteGroupModalTableData.push({siteName:item.baseData.name,role:item.baseData.groupRole,checked:true,disabled:false})
- }else
- if(checkedSite.includes(item.baseData.name)){
- this.siteGroupModalTableData.push({siteName:item.baseData.name,role:null,checked:false,disabled:true})
- }else {
- this.siteGroupModalTableData.push({siteName:item.baseData.name,role:null,checked:false,disabled:false})
- }
- })
-
- }
- deleteGroupSite(num){
- let deleteSiteGroupsites = this.siteGroupTableData[num-1].sites.split(";").filter((item)=>{return item!=""}); //delete site name
- this.siteGroupTableData = this.siteGroupTableData.filter((d,i) => i !== num-1);
- this.siteTableData.forEach((item,index)=>{
- if(deleteSiteGroupsites.includes(item.baseData.name)){
- item.baseData.groupRole = null; //site group role
- item.baseData.groupName = null; //site group name
- item.baseData.controlPoint = null;
- }
- })
- }
+ let sitebody = this.sotnVpnTableData.map((site) => {
+ let siteinputs = {
+ resourceIndex: 0,
+ resourceName:this.templateParameters["site"]["info"]["resourceName"],
+ resourceInvariantUuid: this.templateParameters["site"]["info"]["resourceInvariantUuid"],
+ resourceUuid: this.templateParameters["site"]["info"]["resourceUuid"],
+ resourceCustomizationUuid:this.templateParameters["site"]["info"]["resourceCustomizationUuid"],
+ parameters: {
+ locationConstraints: [
+ ],
+ resources: [
+ ],
+ requestInputs: {}
+ }
+ };
+ siteinputs.parameters.requestInputs=Object.assign({}, site);
+ return siteinputs;
+ });
+ servicebody.resources = sotnbody.concat(sitebody);
+ servicebody.resources.map((item,index) => {
+ item.resourceIndex=index;
+ });
- // Submit creation data
- submit(){
- let globalCustomerId = this.createParams.commonParams.customer.id;
- let globalServiceType = this.createParams.commonParams.serviceType.name;
- let sotnInputs = {};
- // Since the request template is different, the outer layer needs to loop back the real name of the request, the inner loop loops the local parameter, and assigns the current value to the real name.
- this.sotnNames.forEach((name)=>{
- for(let key in this.sotnInfo){
- let nameParts = this.namesTranslate.sotnNameTranslate[key].split("_");
- if(name.startsWith(nameParts[0])&&name.endsWith(nameParts[1])){
- sotnInputs[name] = this.sotnInfo[key];
- break;
- }
- }
- })
- console.log(sotnInputs);
- let vpnbody = {
- service:{
- name:this.sotnInfo.name,
- description:this.sotnInfo.description,
- // serviceInvariantUuid:this.templateParameters["sotnvpn"].invariantUUID, //template.invariantUUID, //serviceDefId
- // serviceUuid:this.templateParameters["sotnvpn"].uuid, //template.uuid, // uuid ?? templateId
- globalSubscriberId:globalCustomerId, //customer.id
- serviceType:globalServiceType, //serviceType.value
- parameters:{
- locationConstraints:[],
- resources:[],
- requestInputs:sotnInputs
- }
- }
- }
-
- let sitebody = this.siteTableData.map((site)=>{
- let siteInputs = {};
- this.siteBaseNames.forEach((basename)=>{
- for(let key in site.baseData){
- let namePart = this.namesTranslate.siteNameTranslate.baseNames[key];
- if(basename.endsWith(namePart)){
- siteInputs[basename] = site.baseData[key];
- break;
- }
- }
- })
- this.siteCpeNames.forEach((cpename)=>{
- for(let key in site.cpeData){
- let namePart = this.namesTranslate.siteNameTranslate.cpeNames[key];
- if(cpename.endsWith(namePart)){
- siteInputs[cpename] = site.cpeData[key];
- break;
- }
- }
- })
- this.siteWanNames.forEach((item,index)=>{
- item.forEach((wanportname)=>{
- for(let key in site.wanportData[index]){
- let namePart = this.namesTranslate.siteNameTranslate.wanportNames[key];
- if(wanportname.endsWith(namePart)){
- siteInputs[wanportname] = site.wanportData[index][key];
- break;
- }
- }
- })
- })
-
- return {
- service:{
- name:site.baseData.name,
- description:site.baseData.description,
- // serviceInvariantUuid:this.templateParameters["site"].invariantUUID,
- // serviceUuid:this.templateParameters["site"].uuid,
- globalSubscriberId:globalCustomerId,
- serviceType:globalServiceType,
- parameters:{
- locationConstraints:[],
- resources:[],
- requestInputs:siteInputs
- }
- }
- }
- });
- console.log(sitebody);
-
- let groupbody = this.siteGroupTableData.map((item)=>{
- let siteGroupInputs = {};
- this.siteGroupNames.forEach((name)=>{
- for(let key in item){
- if(this.namesTranslate.siteGroupNameTranslate[key] == undefined){
- continue;
- }
- let nameParts = this.namesTranslate.siteGroupNameTranslate[key].split("_");
- if(name.startsWith(nameParts[0])&&name.endsWith(nameParts[1])){
- siteGroupInputs[name] = item[key];
- break;
- }
- }
- })
- return {
- service:{
- name:item.name,
- description:item.topology,
- serviceInvariantUuid:this.templateParameters["sdwan"].invariantUUID,
- serviceUuid:this.templateParameters["sdwan"].uuid,
- globalSubscriberId:globalCustomerId,
- serviceType:globalServiceType,
- parameters:{
- locationConstraints:[],
- resources:[],
- requestInputs:siteGroupInputs
- }
- }
- }
- })
- console.log(groupbody);
-
- let createObj = {
- vpnbody:vpnbody,
- sitebody:sitebody,
- groupbody:groupbody
- }
-
- this.closeCreate.emit(createObj);
+ console.log(sotnbody);
+ console.log(sitebody);
+ console.log(servicebody);
+
+ this.closeCreate.emit(servicebody);
}
diff --git a/usecaseui-portal/src/app/myhttp.service.ts b/usecaseui-portal/src/app/myhttp.service.ts
index 0f016a0c..71c0232b 100644
--- a/usecaseui-portal/src/app/myhttp.service.ts
+++ b/usecaseui-portal/src/app/myhttp.service.ts
@@ -108,10 +108,6 @@ export class MyhttpService {
};
return this.http.post<any>(this.url.templateParameters, body);
}
- // siteAddress address
- getSiteAddress() {
- return this.http.get<any>(this.url.addressData);
- }
getVimInfo() {
return this.http.get<any>(this.url.vimInfo);
diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.html b/usecaseui-portal/src/app/services/services-list/services-list.component.html
index bb8e5140..f3378d03 100644
--- a/usecaseui-portal/src/app/services/services-list/services-list.component.html
+++ b/usecaseui-portal/src/app/services/services-list/services-list.component.html
@@ -335,7 +335,6 @@
<div class="createComponent" *ngIf="createshow">
<app-ccvpn-creation
[createParams]="createData"
- [namesTranslate]="namesTranslate"
(closeCreate)="closeCreate($event)">
</app-ccvpn-creation>
</div>
diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.ts b/usecaseui-portal/src/app/services/services-list/services-list.component.ts
index bf1d5d00..0c5c26a9 100644
--- a/usecaseui-portal/src/app/services/services-list/services-list.component.ts
+++ b/usecaseui-portal/src/app/services/services-list/services-list.component.ts
@@ -551,120 +551,55 @@ export class ServicesListComponent implements OnInit {
this.listDisplay = false;
console.log(obj);
let newData; //Newly created service data for the main table
- let stageNum = 0; //Different stages of progress, used to add up subsequent service progress;
- let createParams = "?customerId="+this.customerSelected.id +
- "&serviceType="+this.serviceTypeSelected2.name +
- "&serviceDomain="+this.templateTypeSelected +
- "&parentServiceInstanceId=";
- this.createService(obj.vpnbody,createParams).then((data)=>{
- console.log(data)
- this.parentServiceInstanceId = data["serviceId"]; //------------updata parentServiceInstanceId
- newData = { //
- 'service-instance-id':data["serviceId"],
- 'service-instance-name':obj.vpnbody.service.name,
- serviceDomain:this.templateTypeSelected,
- childServiceInstances:[],
- status:"In Progress",
- rate:0,
- statusClass:1001,
- tips:""
- };
- this.tableData = [newData,...this.tableData];
- let updata = (prodata)=>{
- newData.rate = Math.floor(prodata.progress/3);
- newData.tips = this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==newData["statusClass"] && its["language"]==this.language})["sortValue"]+newData.rate+"%";
- if(newData["rate"] > 100){
- newData["status"]=prodata.status;
- newData.tips = this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==newData["statusClass"] && its["language"]==this.language})["sortValue"]+'\xa0\xa0\xa0'+newData["status"];
- }
- }
- let queryParams = {serviceId:data["serviceId"],operationId:data["operationId"],operationType:"1001"};
- return this.queryProgress(queryParams,updata);
- }).then((data)=>{
- console.log(data);
- stageNum = newData.rate; //Phase progress value update;
- let allprogress = {}; //
- let querypros = []; //All the query
- // Additional parameters
- let createParams = "?customerId="+this.customerSelected.id +
- "&serviceType="+this.serviceTypeSelected2.name +
- "&serviceDomain="+"SDWAN" +
- "&parentServiceInstanceId="+this.parentServiceInstanceId;
-
- let createPros = obj.groupbody.map((group)=>{ //
- return this.createService(group,createParams).then((data)=>{
- console.log(data);
- let updata = (prodata)=>{
- allprogress[prodata.operationId] = prodata.progress;
- let average = ((arr)=>{return eval(arr.join("+"))/arr.length})(Object.values(allprogress))
- newData.rate = Math.floor(average/3) + stageNum;
- newData.tips = newData["status"]+newData.rate+"%";
- if(newData["rate"] > 100){
- newData["status"]=prodata.status;
- newData.tips =this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==newData["statusClass"] && its["language"]==this.language})["sortValue"]+'\xa0\xa0\xa0'+newData["status"];
- }
- }
- let queryParams = {serviceId:data["serviceId"],operationId:data["operationId"],operationType:"1001"};
- querypros.push(this.queryProgress(queryParams,updata))
- })
- })
+ let createParams = "?customerId=" + this.customerSelected.id +
+ "&serviceType=" + this.serviceTypeSelected2.name +
+ "&serviceDomain=" + this.templateTypeSelected;
+ this.createService(obj, createParams).then((data) => {
+ console.log(data)
+ newData = { //Newly created service data in the main form
+ 'service-instance-id': data["serviceId"],
+ 'service-instance-name': obj.service.name,
+ serviceDomain: this.templateTypeSelected,
+ childServiceInstances: [],
+ status: "In Progress",
+ rate: 0,
+ statusClass: 1001,
+ tips: ""
+ };
+ this.tableData = [newData, ...this.tableData];
- return new Promise((res)=>{
- Promise.all(createPros).then(()=>{ //All queries in querypros are added only once created
- Promise.all(querypros).then((data)=>{
+ let updata = (prodata) => {
+ newData.rate = prodata.progress;
+ newData.tips = this.listSortMasters["operationTypes"].find((its) => {
+ return its["sortCode"] == newData["statusClass"] && its["language"] == this.language
+ })["sortValue"] + newData.rate + "%";
+ if (newData["rate"] > 100) {
+ newData["status"] = prodata.status;
+ newData.tips = this.listSortMasters["operationTypes"].find((its) => {
+ return its["sortCode"] == newData["statusClass"] && its["language"] == this.language
+ })["sortValue"] + '\xa0\xa0\xa0' + newData["status"];
+ }
+ };
+ let queryParams = {serviceId: data["serviceId"], operationId: data["operationId"]};
+ return this.queryProgress(queryParams, updata);
+ }).then((data) => {
console.log(data);
- res("site--begin");
- })
- })
- })
- }).then((data)=>{
- console.log(data);
- stageNum = newData.rate; //Phase progress value update;
- let allprogress = {};
- let querypros = []; //All the query
- // Additional parameters
- let createParams = "?customerId="+this.customerSelected.id +
- "&serviceType="+this.serviceTypeSelected2.name +
- "&serviceDomain="+"SITE" +
- "&parentServiceInstanceId="+this.parentServiceInstanceId;
- let createPros = obj.sitebody.map((group)=>{
- return this.createService(group,createParams).then((data)=>{
- console.log(data);
- let updata = (prodata)=>{
- allprogress[prodata.operationId] = prodata.progress;
- let average =((arr)=>{return eval(arr.join("+"))/arr.length})(Object.values(allprogress))
- newData.rate = Math.floor(average/3) + stageNum;
- newData.tips = newData["status"]+newData.rate+"%";
- if(newData["rate"] > 100){
- newData["status"]=prodata.status;
- newData.tips =this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==newData["statusClass"] && its["language"]==this.language})["sortValue"]+'\xa0\xa0\xa0'+newData["status"];
+ newData.rate = 100;
+ newData.status = "Successful";
+ newData.tips = this.listSortMasters["operationTypes"].find((its) => {
+ return its["sortCode"] == newData["statusClass"] && its["language"] == this.language
+ })["sortValue"] + '\xa0\xa0\xa0' + newData["status"];
+ let hasUndone = this.tableData.some((item) => {
+ return item.rate < 100;
+ });
+ if (!hasUndone) {
+ setTimeout(() => {
+ this.getTableData();
+ }, 1000)
}
- }
- let queryParams = {serviceId:data["serviceId"],operationId:data["operationId"], operationType:"1001"};
- querypros.push(this.queryProgress(queryParams,updata))
})
- })
- console.log(createPros);
- Promise.all(createPros).then(()=>{ //
- Promise.all(querypros).then((data)=>{
- console.log(data);
- newData.rate = 100;
- newData.status = "Successful";
- newData.tips =this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==newData["statusClass"] && its["language"]==this.language})["sortValue"]+'\xa0\xa0\xa0'+newData["status"];
- let hasUndone = this.tableData.some((item)=>{
- return item.rate < 100;
- })
- if(!hasUndone){
- setTimeout(()=>{
- this.getTableData();
- },1000)
- }
- })
- })
- })
-
- }
+ }
e2eCloseCreate(obj){
if(!obj){