Merge "Send logs to logstash"
[vid.git] / vid-app-common / src / main / webapp / app / vid / scripts / modals / new-change-management / new-change-management.html
index 4473ee3..611b8e5 100644 (file)
@@ -1,10 +1,30 @@
+<!--
+  ============LICENSE_START=======================================================
+  VID
+  ================================================================================
+  Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.
+  ============LICENSE_END=========================================================
+  -->
+
 <link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
 <div class="modal-header">
     <h3 class="modal-title" id="modal-title">New VNF Change</h3>
     <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
 </div>
 <form class="form-create" name="newChangeManagement" ng-submit="vm.openModal();vm.close();" novalidate>
-    <div class="modal-body">
+    <div class="modal-body step1" ng-show="vm.wizardStep === 1" >
         <div class="form-group">
             <label class="control-label">Subscriber</label>
             <select class="form-control" ng-model="vm.changeManagement.subscriberId" ng-change="vm.loadServiceTypes()" name="subscriber" id="subscriber" data-tests-id="subscriberName" required>
@@ -45,9 +65,9 @@
                             <option ng-repeat="version in vnfName.availableVersions">{{version.modelInfo.modelVersion}}</option>
                         </select>
                     </td>
-                    <td class="col-md-1 vnf-versions-name">
+                    <td class="col-md-1 vnf-versions-file">
                         <input ng-model="vnfName.filePath" onchange="angular.element(this).scope().selectFileForVNFName(this)" type="file" id="{{vnfName['invariant-id']}}" class="vnf-files-select" />
-                        <span class="vnf-versions-name">Select File<span class="caret"></span></span></td>
+                        <span class="vnf-versions-file">Select File<span class="caret"></span></span></td>
                 </tr>
                 </tbody>
             </table>
                 <option value="" disabled>Select workflow</option>
             </select>
         </div>
-        <div class="form-group" ng-if="vm.isConfigUpdate()">
-            <label class="control-label">Attach configuration file</label>
+
+        <div class="form-group" ng-if="vm.changeManagement.workflow" ng-repeat="item in vm.getInternalWorkFlowParameters(vm.changeManagement.workflow, 'FILE')">
+            <label class="control-label">{{item.name}}</label>
             <div class="file-wrapper">
-                <input id="config-update-input" class="file-input" type="file" ngf-select ng-model="vm.configUpdateFile" ngf-validate-async-fn="vm.uploadConfigFile($file)" name="configUpdateFile"
-                       accept=".csv" ngf-pattern=".csv" required> </input>
-                <label id="config-update-label" class="file-input-label">{{vm.configUpdateFile&&vm.configUpdateFile.name||"Select File"}} </label>
-                <label for="config-update-input"><span class="icon-browse"></span></label>
+                <input id="internal-workflow-parameter-file-{{item.id}}" class="file-input" type="file" ngf-select ng-model="item.value" ngf-validate-async-fn="vm.uploadConfigFile($file)" name="configUpdateFile" accept="{{item.acceptableFileType}}" ngf-pattern="{{item.acceptableFileType}}" ng-required="{{item.required}}"/>
+                <label id="internal-workflow-parameter-file-{{item.id}}-label" class="file-input-label">{{item.value&&item.value.name||"Select File"}} </label>
+                <label for="internal-workflow-parameter-file-{{item.id}}"><span class="icon-browse"></span></label>
             </div>
-            <label id="errorLabel" class="icon-alert error" ng-if="newChangeManagement.configUpdateFile.$error.pattern">{{vm.configUpdatePatternError}}</label>
-            <label id="errorContentLabel" class="icon-alert error" ng-if="newChangeManagement.configUpdateFile.$error.validateAsyncFn">{{vm.configUpdateContentError}}</label>
+            <label id="errorLabel" class="icon-alert error" ng-if="item.value.$error.pattern">{{item.msgOnPatternError}}</label>
+            <label id="errorContentLabel" class="icon-alert error" ng-if="item.value.$error.validateAsyncFn">{{item.msgOnContentError}}</label>
         </div>
-        <div ng-if="vm.shouldShowVnfInPlaceFields()">
-            <div class="form-group">
-                <label class="control-label">operations-timeout</label>
-                <input class="form-control" ng-model="vm.changeManagement.operationTimeout" name="operationTimeout" type="text" id="operations-timeout" pattern="[0-9]+" required>
-            </div>
-            <div class="form-group">
-                <label class="control-label">existing-software-version</label>
-                <input class="form-control" ng-model="vm.changeManagement.existingSoftwareVersion" name="existingSoftwareVersion" type="text" id="existing-software-version" pattern="{{vm.softwareVersionRegex}}" required>
-            </div>
-            <div class="form-group">
-                <label class="control-label">new-software-version</label>
-                <input class="form-control" ng-model="vm.changeManagement.newSoftwareVersion" name="newSoftwareVersion" type="text" id="new-software-version" pattern="{{vm.softwareVersionRegex}}" required>
+
+        <div class="form-group" ng-if="vm.changeManagement.workflow" ng-repeat="item in vm.getInternalWorkFlowParameters(vm.changeManagement.workflow, 'text')">
+            <label for="internal-workflow-parameter-text-{{item.id}}" class="control-label">{{item.name}}</label>
+            <input ng-model="item.value" type="text" id="internal-workflow-parameter-text-{{item.id}}" pattern="{{item.pattern}}" ng-required="{{item.required}}">
+        </div>
+
+        <div class="form-group" ng-if="vm.changeManagement.workflow" ng-repeat="item in vm.getRemoteWorkFlowParameters(vm.changeManagement.workflow)">
+          <label for="so-workflow-parameter-{{item.id}}" class="control-label">{{item.name}}</label>
+          <input  ng-model="item.value" type="text" id="so-workflow-parameter-{{item.id}}" pattern="{{item.pattern}}" maxlength="{{item.maxLength}}" ng-required="{{item.required}}" soFieldName="{{item.soFieldName}}">
+        </div>
+    </div>
+
+    <div class="modal-body step2 scale-out-modules" ng-if="vm.wizardStep === 2">
+
+        <div class="table-header table-row">
+            <div></div>
+            <div>Service Instance Name</div>
+            <div>VNF Instance Name</div>
+            <div>Model V</div>
+            <div>Category</div>
+            <div>UUID</div>
+            <div>Invariant UUID</div>
+        </div>
+
+        <div class="table-row" ng-repeat-start="vnf in vm.changeManagement.vnfNames" ng-click="vnf.isOpen=!!!vnf.isOpen">
+            <div>{{vnf.isOpen ? '-' : '+'}}</div>
+            <div>{{vnf['service-instance-node'][0].properties['service-instance-name']}}</div>
+            <div>{{vnf.name}}</div>
+            <div>{{vnf['availableVersions'][0].modelInfo.modelVersion}}</div>
+            <div>{{vnf.category}}</div>
+            <div>{{vnf.modelVersionId}}</div>
+            <div>{{vnf['invariant-id']}}</div>
+        </div>
+        <div class="modules-table" ng-repeat-end="" ng-class="{'open' :vnf.isOpen}">
+            <div class="table-header table-row">
+                <div>VF Module</div>
+                <div>In Service</div>
+                <div>Scale</div>
+                <div>Module UID</div>
+                <div>File</div>
             </div>
 
+            <div class="table-row" ng-repeat="(custUUID, moduleArr) in vnf.groupModules">
+                <div>{{moduleArr[0].modelCustomizationName}}</div>
+                <div>{{moduleArr.length}}</div>
+                <div ng-if="!moduleArr[0].scalable">N/A</div>
+                <div ng-if="moduleArr[0].scalable">
+                    <input type="checkbox" ng-model="moduleArr[0].scale" />
+                </div>
+                <div>{{moduleArr[0].uuid}}</div>
+                <div ng-if="!moduleArr[0].scalable">N/A</div>
+                <div ng-if="moduleArr[0].scalable">
+                    <input type="file" accept="application/json" onchange="angular.element(this).scope().setPreload(this)" />
+                </div>
+            </div>
         </div>
+
     </div>
+
     <div class="modal-footer">
+        <div class="pull-left">
+            <button ng-if="vm.wizardStep === 2" ng-click="vm.prevStep();" type="button" id="back" name="back" class="btn btn-primary">Back</button>
+        </div>
         <div class="pull-right">
-            <button type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Schedule</button>
             <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
+            <button ng-if="!vm.isScaleOut() || (vm.isScaleOut() && vm.wizardStep === 2)" type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">{{vm.hasScheduler ? "Schedule" : "Confirm"}}</button>
+            <button ng-if="vm.isScaleOut() && vm.wizardStep === 1" ng-click="vm.nextStep();" type="button" id="next" name="next" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Next</button>
         </div>
     </div>
 </form>