[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');
}
function constructParams(obj) {
var type = ['chrome', 'mysql_workbench', 'vmware_client', 'custom'];
function constructParams(data) {
var typeList = ['chrome', 'mysql_workbench', 'vmware_client', 'custom'];
var params = {};
type.forEach(function (attr) {
if (obj.type === attr){
for (var k in obj){
if (k.startsWith(obj.type)){params[k] = obj[k]}
for (var type in typeList){
if (data.type === type){
for (var k in data){
if (k.startsWith(data.type)){
params[k] = data[k]
}
}
break
}
});
return params
}
return params;
}
$(document).ready(function () {
$('.select2').select2({