Fix instance instantiation for CCVPN 28/87228/1
authorguochuyicmri <guochuyi@chinamobile.com>
Wed, 8 May 2019 10:20:13 +0000 (18:20 +0800)
committerguochuyicmri <guochuyi@chinamobile.com>
Wed, 8 May 2019 10:20:17 +0000 (18:20 +0800)
Change-Id: I1b79ec5fd5ab16d93c254b3384c84e841083b05f
Issue-ID: USECASEUI-220
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.css
usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html
usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts

index 5d65e55..ce546cb 100644 (file)
@@ -63,7 +63,7 @@ hr {
 }
 .model .submit{
     position: absolute;
-    width:116px;
+    width:90px;
     height: 35px;
     top: 10px;
     right: 85px;
index 3ae5af2..6fe6825 100644 (file)
 <div class="model creation-model">
     
     <div class="top-title">
-        <h3 class="title fl">{{createParams.commonParams.templateType}} Instance Creation</h3>
+        <h3 class="title fl">{{createParams.commonParams.templateType}}  {{"i18nTextDefine_InstanceCreation" | translate}} </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="submit" nz-button (click)="submit()"><span> {{"i18nTextDefine_Create" | translate}} </span>
+            </button>
             <button class="back" nz-button (click)="goback()">
                <i class="anticon anticon-arrow-left" style="transform: scale(1.5)"></i>
             </button>
     <!-- chart -->
     <div class="chart">
        <span style="padding: 25px;display: inline-block;">
-            Instance Topology
+            {{"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>
-            <!-- <p class="siteNameP" [ngStyle]="siteNameStyle">{{ siteName }}</p> -->
         </div>
     </div>
     <div class="creation">
@@ -56,7 +55,7 @@
                         <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
+                                                                           style="transform: scale(1.2);font-weight: 700"></i> {{"i18nTextDefine_Add" | translate}}
                         </button>
                     </div>
                     <nz-table #sotnVpnTable [nzData]="sotnVpnTableData"
             </nz-tab>
             <nz-tab nzTitle="Sdwansiteresource List">
                 <div class="site">
-                    <div>
+                    <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>Add
+                                                                           style="transform: scale(1.2);font-weight: 700"></i>{{"i18nTextDefine_Add" | translate}}
                         </button>
                     </div>
                     <nz-table #siteTable [nzData]="siteTableData"
     </div>
     <!-- sotnVpnmodel -->
     <div class="sotnnpnmodel" *ngIf="sotnVpnModelShow">
-        <h3>Base</h3>
+        <h3> {{"i18nTextDefine_Base" | translate}} </h3>
         <div class="inputs">
             <ul>
                 <li *ngFor="let item of this.templateParameters.sotnvpn.sdwanvpnresource_list">
             <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
+                                                                                   style="transform: scale(1.2);font-weight: 700;"></i>{{"i18nTextDefine_Add" | translate}}
                     </button>
                 </div>
                 <table class="siteWanTab">
         </div>
 
         <div class="action">
-            <button nz-button nzType="primary" (click)="addSotnVpn_cancel()">Cancel</button>
-            <button nz-button nzType="primary" (click)="addSotnVpn_OK()">Add</button>
+            <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>Base</h3>
+        <h3> {{"i18nTextDefine_Base" | translate}} </h3>
         <div class="inputs">
             <ul>
                 <li *ngFor="let item of this.templateParameters.site.sdwansiteresource_list">
             <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
+                                                                                   style="transform: scale(1.2);font-weight: 700;"></i>{{"i18nTextDefine_Add" | translate}}
                     </button>
                 </div>
                 <table class="siteWanTab">
         </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)="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>
index 0200de8..258e69d 100644 (file)
@@ -17,6 +17,7 @@ import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
 import * as d3 from 'd3';
 import * as $ from 'jquery';
 import { MyhttpService } from '../myhttp.service';
+import {el} from "@angular/platform-browser/testing/src/browser_util";
 
 @Component({
   selector: 'app-ccvpn-creation',
@@ -32,7 +33,6 @@ export class CcvpnCreationComponent implements OnInit {
   }
 
   @Input() createParams;
-  @Input() namesTranslate;  //Input parameter name conversion
   @Output() closeCreate = new EventEmitter();
 
   //tabBarStyle
@@ -244,6 +244,12 @@ export class CcvpnCreationComponent implements OnInit {
         console.log(sotnSdwansitelanData);
     }
     deleteSotnSdwansitelan(num, item, sotnSdwansitelanData){
+        if(this.sotnSdwansitelanData.length <= 1){
+            console.log("num>=1","sotnSdwansitelanData");
+            return false;
+        }else {
+
+        }
         this.sotnSdwansitelanData = this.sotnSdwansitelanData.filter((d, i) => i !== num - 1);
         console.log(this.sotnSdwansitelanData)
     }
@@ -275,6 +281,10 @@ export class CcvpnCreationComponent implements OnInit {
         console.log(siteWanData);
     }
     deleteWanPort(num, item, siteWanData){
+        if(this.siteWanData.length <= 1){
+            console.log("num>=1","siteWanData");
+            return false;
+        }
         this.siteWanData = this.siteWanData.filter((d, i) => i !== num - 1);
         console.log(this.siteWanData)
     }