thingsboard-memoizeit

changed fields names

3/12/2018 3:36:52 PM

Details

diff --git a/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js b/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js
index 967c561..e1d2519 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js
+++ b/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js
@@ -128,8 +128,8 @@ export default function ExtensionFormOpcDirective($compile, $templateCache, $tra
                         let addedFile = event.target.result;
 
                         if (addedFile && addedFile.length > 0) {
-                            model[options.fileName] = $file.name;
-                            model[options.location] = addedFile.replace(/^data.*base64,/, "");
+                            model[options.location] = $file.name;
+                            model[options.fileContent] = addedFile.replace(/^data.*base64,/, "");
 
                         }
                     }
@@ -142,8 +142,8 @@ export default function ExtensionFormOpcDirective($compile, $templateCache, $tra
         scope.clearFile = function(model, options) {
             scope.theForm.$setDirty();
 
-            model[options.fileName] = null;
             model[options.location] = null;
+            model[options.fileContent] = null;
 
         };
 
diff --git a/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html b/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html
index 99464cc..5a7c00b 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html
+++ b/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html
@@ -212,8 +212,8 @@
                                                     </md-input-container>
 
                                                     <section class="dropdown-section">
-                                                        <div class="tb-container" ng-class="{'ng-invalid':!server.keystore.location}">
-                                                            <span ng-init='fieldsToFill = {"fileName":"fileName", "location":"location"}'></span>
+                                                        <div class="tb-container" ng-class="{'ng-invalid':!server.keystore.fileContent}">
+                                                            <span ng-init='fieldsToFill = {"location":"location", "fileContent":"fileContent"}'></span>
                                                             <label class="tb-label" translate>extension.opc-keystore-location</label>
                                                             <div flow-init="{singleFile:true}" flow-file-added='fileAdded($file, server.keystore, fieldsToFill)' class="tb-file-select-container">
                                                                 <div class="tb-file-clear-container">
@@ -231,14 +231,14 @@
                                                                            class="file-input"
                                                                            flow-btn id="dropFileKeystore_{{serverIndex}}"
                                                                            name="keystoreFile"
-                                                                           ng-model="server.keystore.location"
+                                                                           ng-model="server.keystore.fileContent"
                                                                     >
                                                                 </div>
                                                             </div>
                                                         </div>
                                                         <div class="dropdown-messages">
-                                                            <div ng-if="!server.keystore[fieldsToFill.fileName]" class="tb-error-message" translate>extension.no-file</div>
-                                                            <div ng-if="server.keystore[fieldsToFill.fileName]">{{server.keystore[fieldsToFill.fileName]}}</div>
+                                                            <div ng-if="!server.keystore[fieldsToFill.location]" class="tb-error-message" translate>extension.no-file</div>
+                                                            <div ng-if="server.keystore[fieldsToFill.location]">{{server.keystore[fieldsToFill.location]}}</div>
                                                         </div>
                                                     </section>