提交 92f1382e 编写于 作者: 偏锋书生's avatar 偏锋书生

处理按钮可用性

上级 2d1b8272
......@@ -176,9 +176,14 @@ public class DorisConfig extends ParentPageBean<DevopsDoris> {
String.format("sh %s", IOUtil.mergeFolderAndFilePath("~/", DevOpsType.doris.getRelaPathCheck())));
log.info(result.getMessage());
if (result.isSuc()) {
devopsDoris.setIsInit(YesOrNo.yes.name());
devopsDorisMapper.updateByPrimaryKeySelective(devopsDoris);
return TapestryAssist.getTextStreamResponse(Result.getSuc());
// 检查完成,符合条件,可以开始安装部署Doris
// 检查完成,当前环境不符合条件,无法安装Doirs需联络客户或者运维解决上述问
if (result.getMessage().contains("检查完成,符合条件,可以开始安装部署Doris")) {
devopsDoris.setIsInit(YesOrNo.yes.name());
devopsDorisMapper.updateByPrimaryKeySelective(devopsDoris);
}
return TapestryAssist.getTextStreamResponse(Result.getError(result.getMessage()));
} else {
return TapestryAssist.getTextStreamResponse(Result.getError(result.getMessage()));
}
......
......@@ -107,7 +107,7 @@ public class FlinkConfig extends ParentPageBean<DevopsFlink> {
return TapestryAssist.getTextStreamResponse(Result.getError("不能安装,需要有且仅有一台主机为prod-bigdata-flink03的服务器"));
}
// 1、OSS下载
String localPath = PathType.getPath(DevOpsType.flink.getInstallDownFile());
String localPath = PathType.getPath(DevOpsType.flink.getInstallDownFile(),true);
DevopsFlink flink03 = select.get(0);
SSHConnection conn = SSHAssit.getConn(flink03.getIp(), flink03.getRootUser(), flink03.getRootPwd());
......@@ -183,7 +183,7 @@ public class FlinkConfig extends ParentPageBean<DevopsFlink> {
freeparam.append(String.format(" %s %s %s", flink.getRootUser(), flink.getHostname(), flink.getRootPwd()));
}
// 1、OSS下载
String localPath = PathType.getPath(DevOpsType.flink.getCheckDownFile());
String localPath = PathType.getPath(DevOpsType.flink.getCheckDownFile(),true);
// 1、登陆
SSHConnection conn = SSHAssit.getConn(devopsFlink.getIp(), devopsFlink.getRootUser(), devopsFlink.getRootPwd());
// String fileName = localPath.substring(localPath.lastIndexOf("/") + 1);
......@@ -222,6 +222,7 @@ public class FlinkConfig extends ParentPageBean<DevopsFlink> {
Conf.overProp("common.os.ssh.timeout", "30000");
SSHConnection freeconn = SSHAssit.getConn(devopsFlink2.getIp(), 22,
devopsFlink2.getRootUser(), devopsFlink2.getRootPwd(), 5 * 6000);
freeconn.executeCommand("rm -rf ~/flink/*log ");
try {
// free,由于需要ssh到别的服务器,拿到到返回的日志,采用先做,重定向到~/flink/freelog,再查日志文件的方式完成
Result freeRs = freeconn.executeCommand(String.format("sh %s %s &>~/flink/freelog",
......
<html t:type="rjzjh/layoutQuery" queryButs="[{'id':'checkBut','iconCls':'icon-attach','text':'初始化服务器','url':'checkHost','confirm':'你确定要初始化此服务器吗?'},{'id':'installBut','iconCls':'icon-attach','text':'安装','url':'installHost','confirm':'你确定要安装flink吗?'}]"
<html t:type="rjzjh/layoutQuery" selectHandle="selectGrid" queryButs="[{'id':'checkBut','iconCls':'icon-attach','text':'初始化服务器','url':'checkHost','confirm':'你确定要初始化此服务器吗?'},{'id':'installBut','iconCls':'icon-attach','text':'安装','url':'installHost','confirm':'你确定要安装flink吗?'}]"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
xmlns:r="tapestry-library:rjzjh"
xmlns:s="tapestry-library:tams"
......@@ -20,6 +20,20 @@
alert("do update:"+row.id)
}
function selectGrid(row){
if(row){//有选择行,刚进页面时为undefined
_bindButEvent('checkBut');
if(and(row.isInit=='yes',row.hostname=='prod-bigdata-flink03')){
_bindButEvent('installBut');
}else{
_unbindButEvent('installBut');
}
}else{
_unbindButEvent('checkBut');
_unbindButEvent('installBut');
}
}
function saveCheck(){
alert("新增或修改前的检查,跟据业务需求写前端较验:");
//var deployComValue= $.rjzjh.getcombogrid('deployId_save','deploy');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册