diff options
-rw-r--r-- | openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html | 1 | ||||
-rw-r--r-- | openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js | 24 |
2 files changed, 20 insertions, 5 deletions
diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html index a2828b7d..121c7ddb 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html @@ -30,6 +30,7 @@ <script type="text/javascript" src="js/bootstrap-table.min.js"></script>
<script type="text/javascript" src="js/gsolcm.js"></script>
<script type="text/javascript" src="../common/thirdparty/bootbox/bootbox.min.js"></script>
+ <script type="text/javascript" src="../common/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
<script type="text/javascript" src="js/jquery.bootstrap-growl.min.js"></script>
<script type="text/javascript" src="js/jquery.isloading.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.12.1.min.js"></script>
diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js index 907f4821..7173f644 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js @@ -21,6 +21,12 @@ var templateParameters = { var lcmHandler = function () { this._addOwnEvents(); + jQuery.i18n.properties({ + language:'en-US', + name:'lcm-template-parameters-i18n', + path:'i18n/', + mode:'map' + }); }; lcmHandler.prototype = { @@ -454,15 +460,23 @@ function transformToOptions(items) { function generateComponent(inputPara) { var component = '<div class="mT15 form-group" style="margin-left:25px;">' + '<label class="col-sm-3 control-label">' + - '<span>' + inputPara.showName + '</span>' + generateRequiredLabel(inputPara) + + '<span>' + showName(inputPara) + '</span>' + generateRequiredLabel(inputPara) + '</label>' + '<div class="col-sm-7">' + '<input type="text" id="' + inputPara.id + '" name="parameter description" class="form-control" placeholder="' + - inputPara.showName + '" value="' + inputPara.value + '" />' + + showName(inputPara) + '" value="' + inputPara.value + '" />' + '</div></div>'; return component; } +function showName(inputPara) { + var name = $.i18n.prop(inputPara.name) + if(name.length === 0 || name.slice(0, 1) === '[') { + name = inputPara.showName; + } + return name; +} + function generateRequiredLabel(parameter) { var requiredLabel = ''; if (parameter.required === 'true') { @@ -602,7 +616,7 @@ function createServiceInstance(gatewayService, lcmUri, serviceInstance) { status: responseDesc.status, statusDescription: responseDesc.statusDescription, errorCode: responseDesc.errorCode - }}}); + }}); } } ); @@ -729,7 +743,7 @@ function deleteNonGsoServiceInstance(gatewayService, lcmUri, instanceId, remove, } } ).fail(function() { - failFun({status: "fail", statusDescription: "delete service failed.", errorCode: "500"}}); + failFun({status: "fail", statusDescription: "delete service failed.", errorCode: "500"}); }); } else { failFun(responseDesc); @@ -738,7 +752,7 @@ function deleteNonGsoServiceInstance(gatewayService, lcmUri, instanceId, remove, ); } ).fail(function() { - failFun({status: "fail", statusDescription: "delete service failed.", errorCode: "500"}}); + failFun({status: "fail", statusDescription: "delete service failed.", errorCode: "500"}); }); } |