Authored by xwx

资源管理-【1759】-资源管理SSHPUBKEY协议私钥参数录入保存格式问题

@@ -448,10 +448,15 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'laydate', 'admi @@ -448,10 +448,15 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'laydate', 'admi
448 defaultValue=price; 448 defaultValue=price;
449 } 449 }
450 row = createSelect(e.protocolCode,param,index); 450 row = createSelect(e.protocolCode,param,index);
  451 + let td = '';
  452 + if (param.paramCode === 'privkey'){
  453 + td='<td style="width: 60%"><textarea'+chooseStyle+' data-paramName="' + param.paramName + '" data-paramCode="' + param.paramCode + '" data-protocol="' + e.protocolCode + '" data-allCode="' + e.protocolCode+param.paramCode + '" type="' + type + '" class="layui-textarea" name="paramValue">'+defaultValue+'</textarea></td>'
  454 + }else {
  455 + td='<td style="width: 60%"><input'+chooseStyle+' data-paramName="' + param.paramName + '" data-paramCode="' + param.paramCode + '" data-protocol="' + e.protocolCode + '" data-allCode="' + e.protocolCode+param.paramCode + '" type="' + type + '" class="layui-input" value="' + defaultValue + '" name="paramValue"></td>'
  456 + }
451 if (row == '') { 457 if (row == '') {
452 row = '<tr'+revealStyle+'>' + 458 row = '<tr'+revealStyle+'>' +
453 - '<td style="width: 40%"><span>' + param.paramName + fillStyle+'</span></td>' +  
454 - '<td style="width: 60%"><input'+chooseStyle+' data-paramName="' + param.paramName + '" data-paramCode="' + param.paramCode + '" data-protocol="' + e.protocolCode + '" data-allCode="' + e.protocolCode+param.paramCode + '" type="' + type + '" class="layui-input" value="' + defaultValue + '" name="paramValue"></td>' + 459 + '<td style="width: 40%"><span>' + param.paramName + fillStyle+'</span></td>' + td +
455 '</tr>' 460 '</tr>'
456 } 461 }
457 $dom.find("table tbody").append(row); 462 $dom.find("table tbody").append(row);
@@ -495,10 +500,15 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'laydate', 'admi @@ -495,10 +500,15 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'laydate', 'admi
495 param.paramValue=price; 500 param.paramValue=price;
496 } 501 }
497 row=createSelect(k,param,index); 502 row=createSelect(k,param,index);
  503 + let td = '';
  504 + if (param.paramCode === 'privkey'){
  505 + td='<td style="width: 60%"><textarea'+chooseStyle+' data-paramName="' + param.paramName + '" data-paramCode="' + param.paramCode + '" data-protocol="' +k + '" data-allCode="' + k+param.paramCode + '" type="' + type + '" class="layui-textarea" name="paramValue" >'+param.paramValue+'</textarea></td>'
  506 + }else {
  507 + td='<td style="width: 60%"><input '+chooseStyle+' data-paramName="'+param.paramName+'" data-paramCode="'+param.paramCode+'" data-protocol="'+k+'" value="'+param.paramValue+'" data-allCode="' + k+param.paramCode + '" type="'+type+'" class="layui-input" name="paramValue"></td>'
  508 + }
498 if (row == '') { 509 if (row == '') {
499 var row = '<tr '+revealStyle+'>' + 510 var row = '<tr '+revealStyle+'>' +
500 - '<td style="width: 40%"><span>'+param.paramName+fillStyle+'</span>'+typeHtml+'</td>' +  
501 - '<td style="width: 60%"><input '+chooseStyle+' data-paramName="'+param.paramName+'" data-paramCode="'+param.paramCode+'" data-protocol="'+k+'" value="'+param.paramValue+'" data-allCode="' + k+param.paramCode + '" type="'+type+'" class="layui-input" name="paramValue"></td>' + 511 + '<td style="width: 40%"><span>'+param.paramName+fillStyle+'</span>'+typeHtml+'</td>' + td +
502 '</tr>' 512 '</tr>'
503 } 513 }
504 $dom.find("table tbody").append(row); 514 $dom.find("table tbody").append(row);
@@ -1950,6 +1950,27 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -1950,6 +1950,27 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
1950 } 1950 }
1951 } 1951 }
1952 res.push(obj) 1952 res.push(obj)
  1953 + }else if ($(td).find('.xm-select-demo').length > 0 || $(td).find('textarea').length > 0){
  1954 + var $dom = $(td).find('.xm-select-demo').length>=1?$(td).find('.xm-select-demo'):$(td).find('textarea');
  1955 + var obj ={
  1956 + protocol: $dom.data("protocol"),
  1957 + paramCode:$dom.data("paramcode"),
  1958 + paramName:$dom.data("paramname"),
  1959 + paramValue:$dom.val()
  1960 + }
  1961 + //为xmSelect时
  1962 + if($(td).find('.xm-select-demo').length>=1){
  1963 + obj.paramValue=$(td).find('.label-content').attr('title')?$(td).find('.label-content').attr('title'):'';
  1964 + }
  1965 + //是否集群 保存是否0,是1
  1966 + if(obj.protocol=="REDIS_CLI" && obj.paramCode=="redis_isCluster"){
  1967 + if(obj.paramValue=="否"){
  1968 + obj.paramValue="0";
  1969 + }else{
  1970 + obj.paramValue="1";
  1971 + }
  1972 + }
  1973 + res.push(obj)
1953 } 1974 }
1954 }) 1975 })
1955 }) 1976 })