summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/components/e2e-detail
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2019-03-14 17:32:28 +0800
committerguochuyicmri <guochuyi@chinamobile.com>2019-03-14 17:32:49 +0800
commit96d989b84a7ebb4e288442cf888af3357f961046 (patch)
tree7adf295285254e41f9b12cad9a03896a31fc0971 /usecaseui-portal/src/app/components/e2e-detail
parent8d5ff3d30de0c774fd8048fb36a451b206681f1b (diff)
Service instance topology front-end development
Change-Id: Ie39ede5583468def6ddfdbf6aa15b44aca61b982 Issue-ID: USECASEUI-224 Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/components/e2e-detail')
-rw-r--r--usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.html186
-rw-r--r--usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.less140
-rw-r--r--usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.spec.ts25
-rw-r--r--usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.ts209
4 files changed, 560 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.html b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.html
new file mode 100644
index 00000000..ce5b97c2
--- /dev/null
+++ b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.html
@@ -0,0 +1,186 @@
+<!--
+ Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--<h3 class="title"> Services List </h3>-->
+<div class="model creation-model">
+
+ <div class="top-title">
+ <h3 class="title fl">{{serviceInstanceName}} Instance Detail</h3>
+ <div class="fl" style="width: 20%">
+ <button class="back" nz-button (click)="goback()">
+ <i class="anticon anticon-arrow-left" style="transform: scale(1.5)"></i>
+ </button>
+ </div>
+ </div>
+ <div class="detaildata fl">
+ <div *ngIf="detailParams.serviceDomain == 'E2E Service'" class="baseparms clearfix">
+ <!--2019.02.21 add-->
+ <div class="vnf-box">
+ <h3>Base</h3>
+ <ul class="clearfix">
+ <li><span>Name:</span>Sont L2</li>
+ <li><span>Description:</span>Typen asaa</li>
+ <li><span>COS:</span>standard</li>
+ <li><span>EBS:</span>fince in felis nec e</li>
+ <li>
+ <span style="vertical-align: top;">checkbox</span>
+ <nz-checkbox-wrapper style="width: 100%;" >
+ <div nz-row>
+ <div nz-col style="margin-bottom: 10px"><label nz-checkbox nzValue="A"
+ [nzDisabled]="true">Mauris rutrum quam p
+ </label></div>
+ <div nz-col><label nz-checkbox nzValue="B" [ngModel]="true" [nzDisabled]="true">fince in felis nec e
+ </label></div>
+ </div>
+ </nz-checkbox-wrapper>
+ </li>
+ </ul>
+ </div>
+ <div class="vnf-box">
+ <h3>VNF1</h3>
+ <ul class="clearfix">
+ <li><span>Name:</span>Sont L2</li>
+ <li><span>Description:</span>Typen asaa</li>
+ <li>
+ <span style="vertical-align: top;">radio button</span>
+ <nz-radio-group [(ngModel)]="radioValue1" nzName="radiogroup">
+ <label nz-radio [ngStyle]="{'margin-bottom':'10px'}" nzValue="Selected" [ngModel]="true" [nzDisabled]="true">Selected</label>
+ <br>
+ <label nz-radio [ngStyle]="style" nzValue="Disaled" [nzDisabled]="true">Disaled</label>
+ </nz-radio-group>
+ </li>
+ <li><span>pull down:</span>Heresanoption</li>
+ </ul>
+ </div>
+ <div class="vnf-box">
+ <h3>VNF2</h3>
+ <ul class="clearfix">
+ <li><span>Name:</span>Sont L2</li>
+ <li><span>Description:</span>Typen asaa</li>
+ <li>
+ <span style="vertical-align: top;margin-top: 3px;" nzName="radiogroup2">radio button</span>
+ <nz-radio-group [(ngModel)]="radioValue2">
+ <label nz-radio [ngStyle]="{'margin-bottom':'10px'}" nzValue="Selected2" [ngModel]="true" [nzDisabled]="true">Selected2</label>
+ <br>
+ <label nz-radio [ngStyle]="style" nzValue="Disaled2" [nzDisabled]="true">Disaled2</label>
+ </nz-radio-group>
+ </li>
+ </ul>
+ </div>
+ <!--<div class="vnf-box">-->
+ <!--<h3>template Inputs</h3>-->
+ <!--<ul>-->
+ <!--<li *ngFor="let parameter of templateParameters.inputs; let i = index;">-->
+ <!--<span *ngIf="parameter.type !== 'vf_location' && parameter.type !== 'sdn_controller'">{{parameter.name}}:</span>-->
+ <!--<input *ngIf="parameter.type !== 'vf_location' && parameter.type !== 'sdn_controller'" nz-input-->
+ <!--[(ngModel)]="parameter.value">-->
+
+ <!--<h5 *ngIf="parameter.type === 'vf_location'" style="padding-left:10px;">id:-->
+ <!--{{parameter.name}}</h5>-->
+ <!--<span *ngIf="parameter.type === 'vf_location'"> vf_location: </span>-->
+ <!--<nz-select *ngIf="parameter.type === 'vf_location'" style="width: 165px;"-->
+ <!--[(ngModel)]="parameter.value" nzAllowClear>-->
+ <!--<nz-option *ngFor="let vim of vimInfos" [nzValue]="vim" [nzLabel]="vim.name"></nz-option>-->
+ <!--</nz-select>-->
+ <!--&lt;!&ndash; <nz-select *ngIf="parameter.type === 'sdn_controller'" style="width: 165px;" [(ngModel)]="parameter.value" nzAllowClear >-->
+ <!--<nz-option *ngFor="let control of sdnControllers" [nzValue]="control" [nzLabel]="control.name"></nz-option>-->
+ <!--</nz-select> &ndash;&gt;-->
+ <!--</li>-->
+ <!--</ul>-->
+ <!--<h4>nestedTemplate Inputs</h4>-->
+ <!--<div *ngFor="let template of templateParameters.nestedTemplates;">-->
+ <!--<h4 style="font:400 14px 'Arial';color:#aaa;">templateName: {{template.name}}</h4>-->
+ <!--<ul>-->
+ <!--<li *ngFor="let input of template.inputs; let i = index;">-->
+ <!--<span *ngIf="input.type !== 'vf_location' && input.type !== 'sdn_controller'"> {{input.name}}: </span>-->
+ <!--<input *ngIf="input.type !== 'vf_location' && input.type !== 'sdn_controller'" nz-input-->
+ <!--[(ngModel)]="input.value">-->
+
+ <!--<h5 *ngIf="input.type === 'vf_location'" style="padding-left:10px;">id: {{input.name}}</h5>-->
+ <!--<span *ngIf="input.type === 'vf_location'"> vf_location: </span>-->
+ <!--<nz-select *ngIf="input.type === 'vf_location'" style="width: 165px;"-->
+ <!--[(ngModel)]="input.value"-->
+ <!--nzAllowClear>-->
+ <!--<nz-option *ngFor="let vim of vimInfos" [nzValue]="vim"-->
+ <!--[nzLabel]="vim.name"></nz-option>-->
+ <!--</nz-select>-->
+ <!--&lt;!&ndash; <nz-select *ngIf="input.type === 'sdn_controller'" style="width: 165px;" [(ngModel)]="input.value" nzAllowClear >-->
+ <!--<nz-option *ngFor="let control of sdnControllers" [nzValue]="control" [nzLabel]="control.name"></nz-option>-->
+ <!--</nz-select> &ndash;&gt;-->
+ <!--</li>-->
+ <!--</ul>-->
+ <!--</div>-->
+ <!--</div>-->
+ </div>
+
+ <!--<div *ngIf="detailParams.serviceDomain=='Network Service'" class="baseparms clearfix">-->
+ <!--<div class="vnf-box">-->
+ <!--<h3>Base</h3>-->
+ <!--<ul class="clearfix">-->
+ <!--<li><span>Name:</span> <input nz-input [(ngModel)]="ns_service.nsName"></li>-->
+ <!--<li><span>Description:</span> <input nz-input [(ngModel)]="ns_service.description"></li>-->
+ <!--</ul>-->
+ <!--</div>-->
+ <!--<div class="vnf-box">-->
+ <!--<h3>Template Parameters</h3>-->
+ <!--<h4>template Inputs</h4>-->
+ <!--<ul>-->
+ <!--<li *ngFor="let parameter of nsTemplateParameters.inputs2; let i = index;">-->
+ <!--<span *ngIf="parameter.type !== 'vf_location' && parameter.type !== 'sdn_controller'">{{parameter.name}}:</span>-->
+ <!--<input *ngIf="parameter.type !== 'vf_location' && parameter.type !== 'sdn_controller'" nz-input-->
+ <!--[(ngModel)]="parameter.value">-->
+
+ <!--<h5 *ngIf="parameter.type === 'vf_location'" style="padding-left:10px;">id:-->
+ <!--{{parameter.name}}</h5>-->
+ <!--<span *ngIf="parameter.type === 'vf_location'"> vf_location: </span>-->
+ <!--<nz-select *ngIf="parameter.type === 'vf_location'" style="width: 165px;"-->
+ <!--[(ngModel)]="parameter.value" nzAllowClear>-->
+ <!--<nz-option *ngFor="let vim of vimInfos" [nzValue]="vim" [nzLabel]="vim.name"></nz-option>-->
+ <!--</nz-select>-->
+ <!--&lt;!&ndash; <nz-select *ngIf="parameter.type === 'sdn_controller'" style="width: 165px;" [(ngModel)]="parameter.value" nzAllowClear >-->
+ <!--<nz-option *ngFor="let control of sdnControllers" [nzValue]="control" [nzLabel]="control.name"></nz-option>-->
+ <!--</nz-select> &ndash;&gt;-->
+ <!--</li>-->
+ <!--</ul>-->
+
+ <!--<h4>vnfs Inputs</h4>-->
+
+ <!--<ul>-->
+ <!--<li *ngFor="let vnf of nsTemplateParameters.vnfs;">-->
+ <!--<h5 style="padding-left:10px;">id: {{vnf.vnf_id}}</h5>-->
+ <!--<span> vf_location: </span>-->
+ <!--<nz-select style="width: 165px;" [(ngModel)]="vnf.value" nzAllowClear>-->
+ <!--<nz-option *ngFor="let vim of vimInfos" [nzValue]="vim" [nzLabel]="vim.name"></nz-option>-->
+ <!--</nz-select>-->
+ <!--</li>-->
+ <!--</ul>-->
+ <!--</div>-->
+ <!--</div>-->
+ </div>
+
+ <!-- chart -->
+ <div class="chart fr">
+ <div id="createChart">
+ <svg width="100%" height="100%">
+
+ <!--<image xlink:href="./assets/images/create-e2e.png"-->
+ <!--x="40%" y="16%" />-->
+
+ </svg>
+
+ </div>
+ </div>
+
+</div>
diff --git a/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.less b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.less
new file mode 100644
index 00000000..63b6c030
--- /dev/null
+++ b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.less
@@ -0,0 +1,140 @@
+/*
+ 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.
+*/
+.title {
+ font: 700 18px/18px "思源黑体";
+ color: #4c5e70;
+ margin-bottom: 18px;
+}
+hr {
+ border: none;
+ height: 2px;
+ background-color: #dce1e7;
+ margin-bottom: 10px;
+}
+.creation-model{
+ position: relative;
+}
+.model {
+ background-color: #F7F8FC;
+ height: 100%;
+ overflow-y: auto;
+ position: relative;
+ .top-title{ /*2019.01.22 add*/
+ width: 100%;
+ padding: 20px;
+ position: relative;
+ display: inline-block;
+ }
+ .back {
+ position: absolute;
+ top: 10px;
+ right: 20px;
+ display: inline-block;
+ width: 35px;
+ height: 35px;
+ background:#ffffff!important;
+ border-radius:4px;
+ color: #D7D7D7;
+ }
+ .back:hover{
+ background:#ffffff;
+ color: #3F9CFF;
+ border:1px solid #3F9CFF;
+ }
+ .top-title h3.title {
+ height: 35px;
+ width: 80%;
+ font-size:16px;
+ font-family:ArialMT;
+ color:#3C4F8C;
+ line-height:35px;
+ display: inline-block;
+ /*top:10px;*/
+
+ }
+ .detaildata{
+ position: relative;
+ width: 58%;
+ height: 100%;
+ overflow-y: auto;
+ border-radius: 5px;
+ padding: 20px;
+ background: #fff;
+ margin-left: 30px;
+ box-shadow:0px 10px 15px 2px rgba(222,222,222,0.5);
+ .baseparms {
+ h3 {
+ color: #06A7E2;
+ width: 96%;
+ height: 40px;
+ line-height: 35px;
+ font-size: 18px;
+ font-weight: 500;
+ margin: 10px auto;
+ border-bottom: 2px solid;
+ border-image: -webkit-linear-gradient(#07A9E1,#30D9C4) 100 100;
+ border-image: -moz-linear-gradient(#07A9E1,#30D9C4) 100 100;
+ border-image: linear-gradient(#07A9E1,#30D9C4) 100 100;
+ border-radius:2px;
+ }
+ h4 {
+ font: 700 16px "Arial";
+ margin-left: 25px;
+ }
+ ul{
+ margin-left: 30px;
+ }
+ ul li {
+ // display: inline-block;
+ margin: 10px 0;
+ width: 40%;
+ float: left;
+ text-align: left;
+ color:rgba(60,79,140,1);
+ font-size: 14px;
+ span {
+ display: inline-block;
+ width: 30%;
+ font: 700 14px "Arial";
+ vertical-align: middle;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ text-align: left;
+ color:rgba(60,79,140,0.5);
+ }
+ input,nz-select{
+ width: 170px;
+ }
+ }
+ }
+ }
+ .chart {
+ width: 35%;
+ padding: 10px;
+ height: 95%;
+ box-shadow: 0px 10px 35px 10px rgba(222, 222, 222, 0.5);
+ margin-right: 40px;
+ //background: url("../../../assets/images/ccvpn-createbanner2.png") no-repeat -45px -10px;
+ //background-size: 110% 110%;
+ background:linear-gradient(180deg,rgba(183, 230, 247, 1) 0%,rgba(214, 240, 254, 1) 100%);
+ //background-color: rgba(188, 231, 248, 1);
+ border-radius: 4px;
+ #createChart{
+ height: 100%;
+ width: 100%;
+ }
+ }
+}
diff --git a/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.spec.ts b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.spec.ts
new file mode 100644
index 00000000..ad24a477
--- /dev/null
+++ b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { E2eDetailComponent } from './e2e-detail.component';
+
+describe('E2eDetailComponent', () => {
+ let component: E2eDetailComponent;
+ let fixture: ComponentFixture<E2eDetailComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ E2eDetailComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(E2eDetailComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.ts b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.ts
new file mode 100644
index 00000000..a592e169
--- /dev/null
+++ b/usecaseui-portal/src/app/components/e2e-detail/e2e-detail.component.ts
@@ -0,0 +1,209 @@
+/*
+ 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.
+*/
+
+import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
+import {MyhttpService} from '../../myhttp.service';
+import * as d3 from 'd3';
+
+@Component({
+ selector: 'app-e2e-detail',
+ templateUrl: './e2e-detail.component.html',
+ styleUrls: ['./e2e-detail.component.less']
+})
+export class E2eDetailComponent implements OnInit {
+
+ constructor(private myhttp: MyhttpService) {
+ }
+
+ ngOnInit() {
+ // this.getDetails();
+ this.dataInit();
+ this.drawImage("E2E Service");
+ }
+
+ @Input() detailParams;
+ @Input() namesTranslate;
+ @Output() closeDetail = new EventEmitter();
+ templateParameters: any;
+ serviceInstanceName: any;
+ serviceType: any;
+
+ dataInit() {
+ console.log(this.detailParams);
+ this.serviceInstanceName = this.detailParams['service-instance-name'];
+ }
+
+ goback() {
+ this.closeDetail.emit();
+ }
+
+
+ roote2e = {
+ "name": "e2e",
+ "type": "e2e",
+ "children":
+ [
+ {
+ "name": "ns",
+ "type": "ns",
+ "children":
+ [
+ {
+ "name": "vnf",
+ "type": "vnf",
+ },
+ {
+ "name": "vnf",
+ "type": "vnf",
+ }
+ ]
+ },
+ {
+ "name": "ns",
+ "type": "ns",
+ "children":
+ [
+ {
+ "name": "vnf",
+ "type": "vnf",
+ },
+ {
+ "name": "vnf",
+ "type": "vnf",
+ }
+ ]
+ }]
+ }
+
+ rootns = {
+ "name": "ns",
+ "type": "ns",
+ "children":
+ [
+ {
+ "name": "vnf",
+ "type": "vnf",
+ },
+ {
+ "name": "vnf",
+ "type": "vnf",
+ }
+ ]
+ }
+
+ imgmap = {
+ '1': './assets/images/create-e2e.png',
+ '2': './assets/images/create-ns.png',
+ '3': './assets/images/create-vnf.png',
+ };
+
+ drawImage(type) {
+ if (type == "E2E Service") {
+ this.render(this.roote2e, this.imgmap)
+ } else if (type == "Network Service") {
+ this.render(this.rootns, this.imgmap)
+ }
+
+
+ }
+
+ render(data, imgmap) {
+ var width = document.getElementById("createChart").clientWidth,
+ height = document.getElementById("createChart").clientHeight;
+ var cluster = d3.layout.tree()
+ .size([width, height]);
+ var diagonal = d3.svg.diagonal()
+ .projection(function (d) {
+ return [d.x-18, d.y+40];
+ });
+ console.log(diagonal)
+ var svg = d3.select("svg");
+
+ //marker
+ var marker =
+ svg.append("marker")
+ .attr("id", "resolved")
+ .attr("markerUnits", "strokeWidth")
+ .attr("markerUnits", "userSpaceOnUse")
+ .attr("viewBox", "0 -5 10 10")
+ .attr("refX", 22)
+ .attr("refY", 0)
+ .attr("markerWidth", 20)
+ .attr("markerHeight", 20)
+ .attr("orient", "auto")
+ .attr("stroke-width", 1)
+ .append("circle")
+ .attr("cx", 5)
+ .attr("cy", 0)
+ .attr("r", 2)
+ .attr("stroke-width", 1)
+ .style("stroke", "#2F8BF7")
+ .attr('fill', 'white');
+ var i = 0;
+ var nodes = cluster.nodes(data).reverse();
+ nodes.forEach(function (d) {
+ d.y = d.depth * 200+100;
+
+ });
+
+ var links = cluster.links(nodes);
+
+ var linkEnter = svg.selectAll("path.link")
+ .data(links);
+
+ linkEnter.enter().append("path")
+ .attr("class", "link")
+ .attr("d", diagonal)
+ .style("stroke", "#2F8BF7")
+ .style('stroke-width', '1px')
+ .attr("marker-end", "url(#resolved)")
+ .style("fill", "none")
+ // .style("fill-opacity", 1)
+ .attr("id", function (d, i) {
+ return "mypath" + i;
+ });
+
+ var node = svg.selectAll(".node")
+ .data(nodes)
+ .enter()
+ .append("g")
+ .attr("class", "node")
+ .attr("transform", function (d) {
+ return "translate(" + (d.x + -50) + "," + (d.y) + ")";
+ });
+
+ node.append('image')
+ .attr('xlink:href', function (d) {
+ if(d.type=="e2e"){
+ return imgmap[1];
+ }else if(d.type=="ns"){
+ return imgmap[2];
+ }else if(d.type=="vnf"){
+ return imgmap[3];
+ }
+
+ })
+ .style('width', '12%')
+ .style("cursor","pointer")
+ .attr("x", 0)
+ .attr("y", 0)
+ .attr("rx", 3);
+
+
+ }
+
+
+}