[Update] 优化创建RemoteApp前端逻辑

pull/2945/head
BaiJiangJie 2019-07-15 14:57:57 +08:00
parent 9219786f2d
commit 92aeecbc3e
1 changed files with 11 additions and 8 deletions

View File

@ -107,17 +107,20 @@ function hiddenFields(){
}); });
$('.' + app_type + '-fields').removeClass('hidden'); $('.' + app_type + '-fields').removeClass('hidden');
} }
function constructParams(obj) { function constructParams(data) {
var type = ['chrome', 'mysql_workbench', 'vmware_client', 'custom']; var typeList = ['chrome', 'mysql_workbench', 'vmware_client', 'custom'];
var params = {}; var params = {};
type.forEach(function (attr) { for (var type in typeList){
if (obj.type === attr){ if (data.type === type){
for (var k in obj){ for (var k in data){
if (k.startsWith(obj.type)){params[k] = obj[k]} if (k.startsWith(data.type)){
params[k] = data[k]
}
} }
break
} }
}); }
return params return params;
} }
$(document).ready(function () { $(document).ready(function () {
$('.select2').select2({ $('.select2').select2({