APPC CDT to Support Multiple Templates for VNFCs
[appc/cdt.git] / src / app / vnfs / build-artifacts / parameter-definitions / parameter.component.html
1 <!--
2 ============LICENSE_START==========================================
3 ===================================================================
4 Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
5 ===================================================================
6 Copyright (C) 2018 IBM.
7 ===================================================================
8 Unless otherwise specified, all software contained herein is licensed
9 under the Apache License, Version 2.0 (the License);
10 you may not use this software except in compliance with the License.
11 You may obtain a copy of the License at
12
13     http://www.apache.org/licenses/LICENSE-2.0
14
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20
21 ============LICENSE_END============================================
22 -->
23
24 <simple-notifications [options]="options"></simple-notifications>
25 <ngx-spinner bdColor="rgba(51,51,51,0.8)"
26   size="large"
27   color="orange"
28   loadingText="Uploading PD file..."
29   type="ball-scale-multiple"></ngx-spinner>
30 <ng-progress [positionUsing]="'marginLeft'" [minimum]="0.15" [maximum]="1" [speed]="200" [showSpinner]="false" [direction]="'leftToRightIncreased'" [color]="'#6ab344'" [trickleSpeed]="250" [thick]="true" [ease]="'linear'"></ng-progress>
31 <div class="card" style="    margin-bottom: 23px;">
32     <img class="card-img-top" data-src="holder.js/100%x180/" alt="">
33     <div class="card-block" style="border-top: 5px solid #6ab344;border-top-right-radius: 7px;border-top-left-radius: 7px;">
34         <div class="row" style="padding: 15px 25px">
35             <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12">
36                 <label>Action</label>
37                 <input class="form-control" type="text" disabled value="{{action}}" />
38             </div>
39             <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12">
40                 <label>Vnf Type</label><input class="form-control" type="text" disabled value="{{vnfType}}" />
41             </div>
42             <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12" *ngIf="vnfcType">
43                 <label>Vnfc Type</label><input class="form-control" type="text" disabled value="{{vnfcType}}" />
44             </div>
45             <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12" *ngIf="!vnfcType">
46
47             </div>
48             <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12">
49                 <label>Protocol</label><input class="form-control" type="text" disabled value="{{protocol}}" />
50             </div>
51             <div *ngIf="(action === 'ConfigScaleOut')" class="col-lg-3 col-sm-6 col-md-3 col-xs-12">
52                 <label>Template Identifier</label><input class="form-control" type="text" disabled value="{{template_id}}" />
53             </div>
54         </div>
55     </div>
56 </div>
57 <div class="row create-wrapper">
58     <div class="col-md-12">
59         <div class="row" style="padding: 5px 5px">
60             <div class="col-12 mb-3">
61                 <div class="input-group">
62                     <input id="inputFile1" class="file" hidden #myInput1 type='file' (change)="fileChange(myInput1, 'pdfile')">
63                     <input [(ngModel)]="myPdFileName" type="text" class="input-lg" disabled placeholder="Upload parameters from PC" style="width:85%;">
64                     <button [disabled]="(undefined == mappingEditorService.latestAction)" (click)="browsePdFile($event)" class="browse mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary input-lg" type="button"> UPLOAD PD FILE
65                     </button>
66                 </div>
67             </div>
68             <div class="col-12">
69                 <div class="input-group">
70                     <input id="inputFile2" class="file" hidden #myInput2 type='file' (change)="fileChange(myInput2, 'keyfile')">
71                     <input [(ngModel)]="myKeyFileName" type="text" class="input-lg" disabled placeholder="Upload key file from PC. You can upload a key file only if you have some parameters." style="width:85%;">
72                     <button [disabled]="(!(undefined !== displayParamObjects && displayParamObjects.length>0))" (click)="browseKeyFile($event)" class="browse mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary input-lg" type="button">UPLOAD KEY FILE
73                     </button>
74                 </div>
75             </div>
76         </div>
77     </div>
78     <br>
79     <hr>
80     <!--h4>testing{{initialData}}</h4-->
81     <div *ngIf="((undefined !== displayParamObjects && displayParamObjects.length>0)   ) " class="col-md-12 ">
82         <form *ngIf="undefined !== displayParamObjects" class="form-inline" novalidate #paramForm="ngForm" (ngSubmit)="saveChanges('download', paramForm.valid)">
83
84             <div style="height: 210px; overflow: auto;">
85                 <table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
86                     <thead>
87                         <tr>
88                             <th class="mdl-data-table__cell--non-numeric">NAME</th>
89                             <th class="mdl-data-table__cell--non-numeric">DESCRIPTION</th>
90                             <th class="mdl-data-table__cell--non-numeric">TYPE</th>
91                             <th class="mdl-data-table__cell--non-numeric">REQUIRED</th>
92                             <th class="mdl-data-table__cell--non-numeric">DEFAULT</th>
93                             <th class="mdl-data-table__cell--non-numeric">SOURCE</th>
94                             <th class="mdl-data-table__cell--non-numeric">RULETYPE</th>
95                             <th class="mdl-data-table__cell--non-numeric">FILTER BY FIELD</th>
96                             <th class="mdl-data-table__cell--non-numeric">FILTER BY VALUE</th>
97                             <th class="mdl-data-table__cell--non-numeric">RESPKEY NAME</th>
98                             <th class="mdl-data-table__cell--non-numeric">RESPKEY VALUE</th>
99                             <th class="mdl-data-table__cell--non-numeric">RESPKEY NAME</th>
100                             <th class="mdl-data-table__cell--non-numeric">RESPKEY VALUE</th>
101                             <th class="mdl-data-table__cell--non-numeric">RESPKEY NAME</th>
102                             <th class="mdl-data-table__cell--non-numeric">RESPKEY VALUE</th>
103                             <th class="mdl-data-table__cell--non-numeric">REQKEY NAME</th>
104                             <th class="mdl-data-table__cell--non-numeric">REQKEY VALUE</th>
105                             <th class="mdl-data-table__cell--non-numeric">REQKEY NAME</th>
106                             <th class="mdl-data-table__cell--non-numeric">REQKEY VALUE</th>
107                             <th class="mdl-data-table__cell--non-numeric">REQKEY NAME</th>
108                             <th class="mdl-data-table__cell--non-numeric">REQKEY VALUE</th>
109                         </tr>
110                     </thead>
111                     <tbody>
112                         <tr *ngFor="let obj of displayParamObjects; let i = index">
113                             <td class="mdl-data-table__cell--non-numeric">
114                                 <input required id="id1" [(ngModel)]="obj.name" #objName="ngModel" name="objName{{i}}" style="width:300px">
115                                 <span class="error-message" [hidden]="objName.valid || (objName.pristine && !paramForm.submitted)">Required Field</span>
116                             </td>
117                             <td class="mdl-data-table__cell--non-numeric"><input [(ngModel)]="obj.description" #objDesc="ngModel" name="objDesc{{i}}">
118                             </td>
119                             <td class="mdl-data-table__cell--non-numeric">
120                                 <select id="id3" [(ngModel)]="obj.type" name="{{'objType'+i}}">
121                                 <option *ngFor="let typ of typeValues"
122                                         [value]="typ"
123                                         [selected]="obj.type === typ"
124                                 >
125                                     {{typ}}
126                                 </option>
127                             </select>
128                             </td>
129                             <td class="mdl-data-table__cell--non-numeric">
130                                 <select [(ngModel)]="obj.required" #objRequired="ngModel" name="{{'objRequired'+i}}">
131                                 <option *ngFor="let req of requiredValues"
132                                         [value]="req"
133                                         [selected]="req === obj.required"
134                                 >
135                                     {{req}}
136                                 </option>
137                             </select>
138                             </td>
139                             <td class="mdl-data-table__cell--non-numeric"><input id="id1" [(ngModel)]="obj.default" #objDefault="ngModel" name="objDefault{{i}}"></td>
140                             <td class="mdl-data-table__cell--non-numeric">
141                                 <select class="form-control" required id="id3" [(ngModel)]="obj.source" #objSource="ngModel" (ngModelChange)="sourceChanged($event,obj)" name="{{'objSource'+i}}">
142                                 <option *ngFor="let src of sourceValues"
143                                         [value]="src"
144                                         [selected]="src === obj.source"
145                                         >
146                                     {{src}}
147                                 </option>
148
149                             </select>
150                                 <span class="error-message" [hidden]="objSource.valid || (objSource.pristine && !paramForm.submitted)">Required Field</span>
151                             </td>
152
153                             <td class="mdl-data-table__cell--non-numeric">
154                                 <select (ngModelChange)="ruleTypeChanged($event,obj)" class="form-control" id="id4" [(ngModel)]="obj['rule-type']" #objRuleType="ngModel" name="objRuleType{{i}}" list="ruleTypes">
155                                 <option *ngFor="let rTyp of obj.ruleTypeValues;" [value]="rTyp"
156                                         [selected]="rTyp === obj.rule-type">
157                                     {{rTyp}}
158                                 </option>
159                             </select>
160                             </td>
161
162                             <td>
163                                 <select *ngIf="obj.showFilterFields" (ngModelChange)="filetrByFieldChanged($event,obj)" class="form-control" id="id4" [(ngModel)]="obj['response-keys'][3]['key-value']" #objfilterByField="ngModel" name="filterByField{{i}}" list="ruleTypes">
164                                 <option *ngFor="let fTyp of filterByFieldvalues;" [value]="fTyp"
165                                         [selected]="fTyp === obj['response-keys'][3]['key-value']">
166                                     {{fTyp}}
167                                 </option>
168                             </select>
169                             </td>
170                             <td>
171                                 <input *ngIf="obj.showFilterFields" [disabled]="!(obj.enableFilterByValue)" type="text" [value]="obj['response-keys'][4]['key-value']" class="form-control" id="id4" [(ngModel)]="obj['response-keys'][4]['key-value']" #objfilterByValue="ngModel" name="objfilterByValue{{i}}"
172                                     list="ruleTypes">
173                             </td>
174
175                             <td class="mdl-data-table__cell--non-numeric">{{obj['response-keys'][0]['key-name']}}
176
177                             </td>
178                             <td class="mdl-data-table__cell--non-numeric">{{obj['response-keys'][0]['key-value']}}
179
180                             </td>
181                             <td class="mdl-data-table__cell--non-numeric">{{obj['response-keys'][1]['key-name']}}
182
183                             </td>
184                             <td class="mdl-data-table__cell--non-numeric">{{obj['response-keys'][1]['key-value']}}
185
186                             </td>
187                             <td class="mdl-data-table__cell--non-numeric">{{obj['response-keys'][2]['key-name']}}
188
189                             </td>
190                             <td class="mdl-data-table__cell--non-numeric">{{obj['response-keys'][2]['key-value']}}
191
192                             </td>
193
194                             <td class="mdl-data-table__cell--non-numeric">{{obj['request-keys'][0]['key-name']}}
195
196                             </td>
197                             <td class="mdl-data-table__cell--non-numeric">{{obj['request-keys'][0]['key-value']}}
198
199                             </td>
200                             <td class="mdl-data-table__cell--non-numeric">{{obj['request-keys'][1]['key-name']}}
201
202                             </td>
203                             <td class="mdl-data-table__cell--non-numeric">{{obj['request-keys'][1]['key-value']}}
204
205                             </td>
206                             <td class="mdl-data-table__cell--non-numeric">{{obj['request-keys'][2]['key-name']}}
207
208                             </td>
209                             <td class="mdl-data-table__cell--non-numeric">{{obj['request-keys'][2]['key-value']}}
210
211                             </td>
212                         </tr>
213                     </tbody>
214                 </table>
215                 `
216             </div>
217
218         </form>
219     </div>
220 </div>