aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties3
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties3
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js32
-rw-r--r--openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html28
-rw-r--r--openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/images/loading.gifbin0 -> 781 bytes
-rw-r--r--openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js42
-rw-r--r--openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/jquery.isloading.min.js39
7 files changed, 129 insertions, 18 deletions
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties
index 5e9b97bf..7c2d1303 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties
@@ -89,6 +89,9 @@ nfv-package-iui-message-select-vim-error = Can not select more than one VIM to b
nfv-package-iui-onboard-dialog-vimname = VIM Name
nfv-package-iui-product-env = Product Environment
nfv-package-iui-test-env = Test Environment
+nfv-package-iui-http-delete-error = Delete package from HTTP server failed!
+nfv-package-iui-template-delete-error = Delete template data failed!
+nfv-package-iui-package-delete-error = Delete package data failed!
nfv-package-iui-drop-zone-title=Drag & drop files here …
nfv-package-iui-drop-zone-selectBtn=Browse
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties
index efb19162..1d3e6cfe 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties
@@ -90,6 +90,9 @@ nfv-package-iui-message-select-vim-error = 最多只能选择一个VIM做为测
nfv-package-iui-onboard-dialog-vimname = VIM名称
nfv-package-iui-product-env = 生产环境
nfv-package-iui-test-env = 测试环境
+nfv-package-iui-http-delete-error = 从HTTP服务器上删除包失败!
+nfv-package-iui-template-delete-error = 删除模板数据失败!
+nfv-package-iui-package-delete-error = 删除包数据失败!
nfv-package-iui-drop-zone-title=拖拽文件到这里 …
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js b/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js
index 80067abc..db21456f 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js
@@ -71,8 +71,18 @@ pmUtil.updateDeletedPackageStatus = function(message) {
if(messageobj.status == "true" || messageobj.status == "deletionPending") {
commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-success"), "success");
refreshByCond();
- } else {
+ } else if (messageobj.status == "Delete package from HTTP server failed!") {
pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-http-delete-error"), "failed");
+ } else if (messageobj.status == "Delete template data failed!") {
+ pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-template-delete-error"), "failed");
+ } else if (messageobj.status == "Delete package data failed!") {
+ pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-package-delete-error"), "failed");
+ } else if (messageobj.status == "false") {
+ pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-error"), "failed");
}
}
@@ -168,15 +178,11 @@ pmUtil.delPackage = function (url) {
url : url,
contentType : "application/json",
success : function(resp) {
- //commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-success"), "success");
- //setTimeout( function(){
- // refreshByCond();
- //}, 1 * 1000 );
+
},
error : function(resp) {
if(resp.status == 202 || resp.responseText == "success") {
- //commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-success"), "success");
- //refreshByCond();
+
} else {
commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-error"), "failed");
refreshByCond();
@@ -185,6 +191,18 @@ pmUtil.delPackage = function (url) {
});
}
+pmUtil.isRowDeletingStatus = function(csarId) {
+ var table = $("#" + vm.$tableId).dataTable();
+ var tableData = table.fnGetData();
+ for (var i=0; i<tableData.length; i++) {
+ if(tableData[i]["csarId"] == csarId &&
+ tableData[i]["status"].indexOf($.i18n.prop("nfv-package-iui-status-deleting")) > -1) {
+ return true;
+ }
+ }
+ return false;
+}
+
pmUtil.nameRender = function(obj) {
return '<a href="#" onclick="vm.packageDetail.$showDetails('
+ '\'block\',\'' + obj.aData.csarId + '\', \'' + obj.aData.name + '\')">' + obj.aData.name + '</a>';
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 d20c55b1..a474be8a 100644
--- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html
+++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/gsolcmmain.html
@@ -30,11 +30,13 @@
<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="js/jquery.isloading.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.12.1.min.js"></script>
<link href="css/jquery-ui-1.12.1.min.css" rel="stylesheet" />
<script type="text/javascript" src="js/bootstrap-table-filter-control.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
+ new lcmHandler();
$('.modal-dialog').draggable();
$("#detailCont").show();
@@ -74,7 +76,7 @@
document.getElementById('inputcontent').setAttribute('data', 'InputData.html?json='+ JSON.stringify(row));
document.getElementById('inputcontentDlg').setAttribute('data', 'InputData.html?json='+ JSON.stringify(row));
});
- new lcmHandler();
+
});
function operateFormatter(value, row, index) {
@@ -213,6 +215,30 @@
.clearfix {
display: none;
}
+ .isloading-wrapper.isloading-right{
+ margin-left:10px;
+ }
+ .isloading-overlay{
+ position:relative;
+ text-align:center;
+ }
+ .isloading-overlay .isloading-wrapper{
+ background: url("images/loading.gif") 90% 50% no-repeat #FFFFFF;
+ padding:15px 30px;
+ -webkit-border-radius:7px;
+ -webkit-background-clip:padding-box;
+ -moz-border-radius:7px;
+ -moz-background-clip:padding;
+ border-radius:7px;
+ background-clip:padding-box;
+ display:inline-block;
+ margin:0 auto;
+ top:10%;
+ z-index:9000;
+ }
+ .icon-refresh{
+ background: url("images/loading.gif") 50% 50% no-repeat;
+ }
</style>
</head>
<body id="open_base_site_cotentBody" class="cotentBody ng-scope">
diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/images/loading.gif b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/images/loading.gif
new file mode 100644
index 00000000..5e28c953
--- /dev/null
+++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/images/loading.gif
Binary files differ
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 eb667968..09157cc4 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
@@ -32,6 +32,7 @@ lcmHandler.prototype = {
alert('Location must be selected in Template Parameters');
return;
}
+ $.isLoading({ text: "Creating service..." });
var serviceInstance = {
serviceTemplateId: $("#svcTempl").val(),
serviceName: $('#svcName').val(),
@@ -50,6 +51,7 @@ lcmHandler.prototype = {
).then(
function(serviceInstance) {
updateTable(serviceInstance);
+ $.isLoading('hide');
$('#vmAppDialog').removeClass('in').css('display', 'none');
}
);
@@ -150,7 +152,11 @@ function fetchGsoTemplateInputParameters(templateId) {
fetchSdnController()
).then(
function (templateParameterResponse, nestingTempatesParas, vimInfoResponse, sdnControllersResponse) {
- var inputParas = concat(templateParameterResponse[0].inputs, nestingTempatesParas);
+ var inputs = templateParameterResponse[0].inputs.map(function(input) {
+ input.showName = input.name;
+ return input;
+ });
+ var inputParas = concat(inputs, nestingTempatesParas);
var vims = translateToVimInfo(vimInfoResponse[0]);
var sdnControllers = translateToSdnControllers(sdnControllersResponse[0]);
templateParameters = translateToTemplateParameters(inputParas, vims, sdnControllers);
@@ -193,6 +199,7 @@ function fetchGsoNestingTemplateParameters(templateId) {
return;
}
var inputs = serviceTemplate.inputs.map(function(input) {
+ input.showName = input.name;
input.name = nodeTemplate.type + '.' + input.name;
return input;
});
@@ -205,13 +212,15 @@ function fetchGsoNestingTemplateParameters(templateId) {
name: nodeTemplate.type + '.location',
type: 'location',
description: nodeTemplate.name + ' Location',
- required: 'true'
+ required: 'true',
+ showName: nodeTemplate.name + ' Location'
});
inputs.push({
name: nodeTemplate.type + '.sdncontroller',
type: 'sdncontroller',
description: nodeTemplate.name + ' SDN Controller',
- required: 'true'
+ required: 'true',
+ showName: nodeTemplate.name + ' SDN Controller'
});
}
nodeAggregatation.notify(inputs);
@@ -274,7 +283,8 @@ function translateToTemplateParameters(inputs, vims, controllers) {
defaultValue: inputs[i].defaultValue,
required: inputs[i].required,
id: 'parameters_' + i,
- value: inputs[i].defaultValue || ''
+ value: inputs[i].defaultValue || '',
+ showName: inputs[i].showName
};
}
return {changed: false, parameters: inputParameters, vimInfos: vims, sdnControllers: controllers};
@@ -291,17 +301,23 @@ function fetchNfvoTemplateInputParameters(templateId) {
var vims = translateToVimInfo(vimInfoResponse[0]);
var sdnControllers = translateToSdnControllers(sdnControllerResponse[0]);
var inputParas = templateParameterResponse[0].inputs;
+ inputParas = inputParas.map(function(input) {
+ input.showName = input.name;
+ return input;
+ });
inputParas.push({
name: 'location',
type: 'location',
description: 'Location',
- required: 'true'
+ required: 'true',
+ showName: 'Location'
});
inputParas.push({
name: 'sdncontroller',
type: 'sdncontroller',
description: 'SDN Controller',
- required: 'true'
+ required: 'true',
+ showName: 'SDN Controller'
});
templateParameters = translateToTemplateParameters(inputParas, vims, sdnControllers);
defer.resolve(templateParameters);
@@ -316,7 +332,11 @@ function fetchSdnoTemplateInputParameters(templateId) {
fetchTemplateParameterDefinitions(templateId)
).then(
function (templateParameterResponse) {
- templateParameters = translateToTemplateParameters(templateParameterResponse.inputs, [], []);
+ var inputs = templateParameterResponse.inputs.map(function(input) {
+ input.showName = input.name;
+ return input;
+ })
+ templateParameters = translateToTemplateParameters(inputs, [], []);
defer.resolve(templateParameters);
}
);
@@ -385,7 +405,7 @@ function transformToComponents(templateParas) {
function generateComboxComponent(inputPara, items) {
var component = '<div class="form-group" style="margin-left:25px;margin-bottom:15px;">' +
'<label class="col-sm-3 control-label">' +
- '<span>'+ inputPara.description +'</span>' +
+ '<span>'+ inputPara.showName +'</span>' +
'<span class="required">*</span>' +
'</label>' +
'<div class="col-sm-7">' +
@@ -409,11 +429,11 @@ 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.description + '</span>' + generateRequiredLabel(inputPara) +
+ '<span>' + inputPara.showName + '</span>' + generateRequiredLabel(inputPara) +
'</label>' +
'<div class="col-sm-7">' +
'<input type="text" id="' + inputPara.id + '" name="parameter description" class="form-control" placeholder="' +
- inputPara.description + '" value="' + inputPara.value + '" />' +
+ inputPara.showName + '" value="' + inputPara.value + '" />' +
'</div></div>';
return component;
}
@@ -540,10 +560,12 @@ function formatDate(date) {
function deleteNe(rowId, row) {
var deleteHandle = function(result) {
if(result) {
+ $.isLoading({ text: "Deleting service..." });
var instanceId = row.serviceId;
var serviceType = row.serviceType;
var gatewayService = '/openoapi/servicegateway/v1/services/' + instanceId + '/terminate';
var remove = function () {
+ $.isLoading( "hide" );
$('#sai').bootstrapTable('remove', {field: 'serviceId', values: [instanceId]});
};
if(serviceType === 'GSO') {
diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/jquery.isloading.min.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/jquery.isloading.min.js
new file mode 100644
index 00000000..87573765
--- /dev/null
+++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/jquery.isloading.min.js
@@ -0,0 +1,39 @@
+/**
+* Loading plugin for jQuery
+* version: v1.0.6
+*
+* Small helper to give the user a visual feedback that something is happening
+* when fetching/posting data
+*
+* USAGE:
+* - global overlay: $.isLoading();
+* - use javascript: $( selector ).isLoading();
+* - On non-form elements: $("div").isLoading({ text: "Loading", position:'inside'});
+* - remove the loading element: $( selector ).isLoading( "hide" );
+*
+* @author Laurent Blanes <laurent.blanes@gmail.com>
+* ---
+* Copyright 2013, Laurent Blanes ( https://github.com/hekigan/is-loading )
+*
+* The MIT License (MIT)
+*
+* Copyright (c) 2013 Laurent Blanes
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/!function(e,t){function i(t,i){this.element=t,this.options=e.extend({},n,i),this._defaults=n,this._name=o,this._loader=null,this.init()}function s(){e[o]||(e.isLoading=function(t){e("body").isLoading(t)})}var o="isLoading",n={position:"right",text:"","class":"glyphicon glyphicon-refresh",transparency:.5,tpl:'<span class="isloading-wrapper %wrapper%">%text%<i class="%class% glyphicon-spin"></i></span>',disableSource:!0,disableOthers:[]};i.prototype={init:function(){e(this.element).is("body")&&(this.options.position="overlay"),this.show()},show:function(){var i=this,s=i.options.tpl.replace("%wrapper%"," isloading-show isloading-"+i.options.position);switch(s=s.replace("%class%",i.options["class"]),s=s.replace("%text%",""!==i.options.text?i.options.text+" ":""),i._loader=e(s),e(i.element).is("input, textarea")&&!0===i.options.disableSource?e(i.element).attr("disabled","disabled"):!0===i.options.disableSource&&e(i.element).addClass("disabled"),i.options.position){case"inside":e(i.element).html(i._loader);break;case"overlay":var o=null;if(e(i.element).is("body"))o=e('<div class="isloading-overlay" style="position:fixed; left:0; top:0; z-index: 10000; background: rgba(0,0,0,'+i.options.transparency+"); width: 100%; height: "+e(t).height()+'px;" />'),e("body").prepend(o),e(t).on("resize",function(){o.height(e(t).height()+"px"),i._loader.css({top:e(t).height()/2-i._loader.outerHeight()/2+"px"})});else{var n=e(i.element).css("position"),a={},l=e(i.element).outerHeight()+"px",r="100%";a="relative"===n||"absolute"===n?{top:0,left:0}:e(i.element).position(),o=e('<div class="isloading-overlay" style="position:absolute; top: '+a.top+"px; left: "+a.left+"px; z-index: 10000; background: rgba(0,0,0,"+i.options.transparency+"); width: "+r+"; height: "+l+';" />'),e(i.element).prepend(o),e(t).on("resize",function(){o.height(e(i.element).outerHeight()+"px"),i._loader.css({top:o.outerHeight()/2-i._loader.outerHeight()/2+"px"})})}o.html(i._loader),i._loader.css({top:o.outerHeight()/2-i._loader.outerHeight()/2+"px"});break;default:e(i.element).after(i._loader)}i.disableOthers()},hide:function(){"overlay"===this.options.position?e(this.element).find(".isloading-overlay").first().remove():(e(this._loader).remove(),e(this.element).text(e(this.element).attr("data-isloading-label"))),e(this.element).removeAttr("disabled").removeClass("disabled"),this.enableOthers()},disableOthers:function(){e.each(this.options.disableOthers,function(t,i){var s=e(i);s.is("button, input, textarea")?s.attr("disabled","disabled"):s.addClass("disabled")})},enableOthers:function(){e.each(this.options.disableOthers,function(t,i){var s=e(i);s.is("button, input, textarea")?s.removeAttr("disabled"):s.removeClass("disabled")})}},e.fn[o]=function(t){return this.each(function(){if(t&&"hide"!==t||!e.data(this,"plugin_"+o))e.data(this,"plugin_"+o,new i(this,t));else{var s=e.data(this,"plugin_"+o);"hide"===t?s.hide():s.show()}})},s()}(jQuery,window,document);