From d44f57f237e77af24995ad28a553a571408f9bf1 Mon Sep 17 00:00:00 2001 From: Benoit DUMONT Date: Thu, 7 Nov 2024 21:22:11 +0100 Subject: [PATCH] fixed #2544. Save application list from environment modal. --- .../src/main/webapp/js/pages/Environment.js | 71 ++++++++++--------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/source/src/main/webapp/js/pages/Environment.js b/source/src/main/webapp/js/pages/Environment.js index 2a92d1634..351415070 100644 --- a/source/src/main/webapp/js/pages/Environment.js +++ b/source/src/main/webapp/js/pages/Environment.js @@ -647,6 +647,9 @@ function appendApplicationRow(app, selectSystem) { var variable2 = $("").addClass("form-control input-sm").val(app.var2); var variable3 = $("").addClass("form-control input-sm").val(app.var3); var variable4 = $("").addClass("form-control input-sm").val(app.var4); + var secret1Input = $("").addClass("form-control input-sm").val(app.secret1); + var secret2Input = $("").addClass("form-control input-sm").val(app.secret2); + var activeInput = $("").addClass("form-control input-sm").prop("checked", app.isActive); var mobileActivity = $("").addClass("form-control input-sm").val(app.mobileActivity); var mobilePackage = $("").addClass("form-control input-sm").val(app.mobilePackage); @@ -657,39 +660,35 @@ function appendApplicationRow(app, selectSystem) { var td1 = $("").append(deleteBtn); var td2 = $("").append(selectApplication.val(app.application)); -// var td2 = $("").append(application); - var ipName = $("
").append("").append(ipInput); + var ipName = $("
").append("").append(ipInput); var urlName = $("
").append("").append(urlInput); - var poolSizeName = $("
").append("").append(poolSizeInput); - var expandName = $("
").append(""); - var drow1 = $("
").append(ipName).append(urlName).append(poolSizeName).append(expandName); + var poolSizeName = $("
").append("").append(poolSizeInput); + var expandName = $("
").append(""); + var activeName = $("
").append("").append(activeInput); var loginName = $("
").append("").append(urlLoginInput); var domainName = $("
").append("").append(domainInput); - var drow2 = $("
").append(loginName).append(domainName); - var var1Name = $("
").append("").append(variable1); + var var1Name = $("
").append("").append(variable1); var var2Name = $("
").append("").append(variable2); - var var3Name = $("
").append("").append(variable3); - var var4Name = $("
").append("").append(variable4); - var drow3 = $("
").append(var1Name).append(var2Name).append(var3Name).append(var4Name); - - var mobileActivityName = $("
").append("").append(mobileActivity); - var mobilePackageName = $("
").append("").append(mobilePackage); - var drow4 = $("
").append(mobileActivityName).append(mobilePackageName); - - // var ipName = $("").append(ipInput).append(urlLoginInput); -// var urlName = $("").append(urlInput).append(domainInput); -// var vars1 = $("").append(variable1).append(variable2); -// var vars2 = $("").append(variable3).append(variable4); -// var poolSize = $("").append(poolSizeInput); -// var mobileData = $("").append(mobileActivity).append(mobilePackage); -// var drow2 = $("
").append(vars1).append(vars2); - - var panelExtra = $("
").append(drow2).append(drow3).append(drow4); - - var td3 = $("").append(drow1).append(panelExtra); + var var3Name = $("
").append("").append(variable3); + var var4Name = $("
").append("").append(variable4); + + var secret1Name = $("
").append("").append(secret1Input); + var secret2Name = $("
").append("").append(secret2Input); + var mobileActivityName = $("
").append("").append(mobileActivity); + var mobilePackageName = $("
").append("").append(mobilePackage); + + var drow1 = $("
").append(activeName).append(ipName).append(urlName).append(poolSizeName); + var drow2 = $("
").append(var1Name).append(var2Name).append(secret1Name).append(expandName); + var drow3 = $("
").append(loginName).append(domainName); + var drow4 = $("
").append(var3Name).append(var4Name).append(secret2Name); + var drow5 = $("
").append(mobileActivityName).append(mobilePackageName); + + var panelExtra = $("
").append(drow3).append(drow4).append(drow5); + + var td3 = $("").append(drow1).append(drow2).append(panelExtra); deleteBtn.click(function () { app.toDelete = (app.toDelete) ? false : true; @@ -702,6 +701,9 @@ function appendApplicationRow(app, selectSystem) { selectApplication.change(function () { app.application = $(this).val(); }); + activeInput.change(function () { + app.isActive = $(this).prop("checked"); + }); ipInput.change(function () { app.ip = $(this).val(); }); @@ -726,6 +728,12 @@ function appendApplicationRow(app, selectSystem) { variable4.change(function () { app.var4 = $(this).val(); }); + secret1Input.change(function () { + app.secret1 = $(this).val(); + }); + secret2Input.change(function () { + app.secret2 = $(this).val(); + }); poolSizeInput.change(function () { app.poolSize = $(this).val(); }); @@ -739,14 +747,6 @@ function appendApplicationRow(app, selectSystem) { row.append(td1); row.append(td2); row.append(td3); -// row.append(deleteBtnRow); -// row.append(application); -// row.append(ipName); -// row.append(urlName); -// row.append(vars1); -// row.append(vars2); -// row.append(poolSize); -// row.append(mobileData); app.application = selectApplication.prop("value"); // Value that has been requested by dtb parameter may not exist in combo vlaues so we take the real selected value. row.data("application", app); @@ -756,6 +756,7 @@ function appendApplicationRow(app, selectSystem) { function addNewApplicationRow(selectSystem) { var newApplication = { application: "", + isActive: true, ip: "", domain: "", url: "", @@ -764,6 +765,8 @@ function addNewApplicationRow(selectSystem) { var2: "", var3: "", var4: "", + secret1: "", + secret2: "", poolSize: "", mobileActivity: "", mobilePackage: "",