提交 8e80a6d7 编写于 作者: 偏锋书生's avatar 偏锋书生

doris

上级 34bd7dff
package net.wicp.tams.app.duckula.controller.bean.constant;
import org.apache.commons.lang3.StringUtils;
import net.wicp.tams.common.constant.dic.intf.IEnumCombobox;
public enum DorisRole implements IEnumCombobox {
BE("数据"), FE("前端");
private final String desc;
private DorisRole(String desc) {
this.desc = desc;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getDesc_en() {
return this.desc;
}
@Override
public String getDesc_zh() {
return this.desc;
}
@Override
public String getName() {
return this.name();
}
public static DorisRole find(String name) {
if (StringUtils.isEmpty(name)) {
return null;
}
for (DorisRole ele : DorisRole.values()) {
if (name.equalsIgnoreCase(ele.name())) {
return ele;
}
}
return null;
}
}
package net.wicp.tams.app.duckula.controller.bean.models;
import java.util.Date;
import net.wicp.tams.app.duckula.controller.bean.constant.DorisRole;
import net.wicp.tams.common.annotation.TamsBean;
import net.wicp.tams.common.annotation.TamsCol;
import net.wicp.tams.common.constant.dic.YesOrNo;
/**
*
* This class was generated by MyBatis Generator. This class corresponds to the
* database table devops_doris
*/
@TamsBean(title = "doris运维配置")
public class DevopsDoris {
/**
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.id
*
* @mbg.generated
*/
private Long id;
/**
* Database Column Remarks: 客户名
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.name
*
* @mbg.generated
*/
@TamsCol(value = "租户名", save = 1, query = 1, showWidth = 100)
private String name;
/**
* Database Column Remarks: ip1地址
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.ip
*
* @mbg.generated
*/
@TamsCol(value = "IP地址", save = 1, query = 1, showWidth = 150)
private String ip;
/**
* Database Column Remarks: 集群
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.cluster
*
* @mbg.generated
*/
@TamsCol(value = "集群", save = 1, query = 0, showWidth = 150)
private String cluster;
/**
* Database Column Remarks: 服务器的角色
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.roles
*
* @mbg.generated
*/
@TamsCol(value = "角色", save = 1, query = -1, showWidth = 150, multiple = true, enumClass = DorisRole.class)
private String roles;
/**
* Database Column Remarks: 存储磁盘
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.fs
*
* @mbg.generated
*/
// ,comboxurl = "/devops/dorisconfig:listFs"不好实现
@TamsCol(value = "存储磁盘", save = 1, query = -1, showWidth = 150)
private String fs;
/**
* Database Column Remarks: root密码
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.root_pwd
*
* @mbg.generated
*/
@TamsCol(value = "root密码", save = 1, query = -1)
private String rootPwd;
/**
* Database Column Remarks: 是否初始化,yes:已初始化 no:未初始化 创建duckula用户,创建环境变量创建目录
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.is_init
*
* @mbg.generated
*/
@TamsCol(value = "初始化", save = 1, query = 0, enumClass = YesOrNo.class, showWidth = 100)
private String isInit;
/**
* Database Column Remarks: 创建时间
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.create_time
*
* @mbg.generated
*/
private Date createTime;
/**
* Database Column Remarks: 创建时间
*
* This field was generated by MyBatis Generator. This field corresponds to the
* database column devops_doris.update_time
*
* @mbg.generated
*/
private Date updateTime;
/**
* This method was generated by MyBatis Generator. This method corresponds to
* the database table devops_doris
*
* @mbg.generated
*/
public DevopsDoris(Long id, String name, String ip, String cluster, String roles, String fs, String rootPwd,
String isInit, Date createTime, Date updateTime) {
this.id = id;
this.name = name;
this.ip = ip;
this.cluster = cluster;
this.roles = roles;
this.fs = fs;
this.rootPwd = rootPwd;
this.isInit = isInit;
this.createTime = createTime;
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator. This method corresponds to
* the database table devops_doris
*
* @mbg.generated
*/
public DevopsDoris() {
super();
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.id
*
* @return the value of devops_doris.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.id
*
* @param id the value for devops_doris.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.name
*
* @return the value of devops_doris.name
*
* @mbg.generated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.name
*
* @param name the value for devops_doris.name
*
* @mbg.generated
*/
public void setName(String name) {
this.name = name;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.ip
*
* @return the value of devops_doris.ip
*
* @mbg.generated
*/
public String getIp() {
return ip;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.ip
*
* @param ip the value for devops_doris.ip
*
* @mbg.generated
*/
public void setIp(String ip) {
this.ip = ip;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.cluster
*
* @return the value of devops_doris.cluster
*
* @mbg.generated
*/
public String getCluster() {
return cluster;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.cluster
*
* @param cluster the value for devops_doris.cluster
*
* @mbg.generated
*/
public void setCluster(String cluster) {
this.cluster = cluster;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.roles
*
* @return the value of devops_doris.roles
*
* @mbg.generated
*/
public String getRoles() {
return roles;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.roles
*
* @param roles the value for devops_doris.roles
*
* @mbg.generated
*/
public void setRoles(String roles) {
this.roles = roles;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.fs
*
* @return the value of devops_doris.fs
*
* @mbg.generated
*/
public String getFs() {
return fs;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.fs
*
* @param fs the value for devops_doris.fs
*
* @mbg.generated
*/
public void setFs(String fs) {
this.fs = fs;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.root_pwd
*
* @return the value of devops_doris.root_pwd
*
* @mbg.generated
*/
public String getRootPwd() {
return rootPwd;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.root_pwd
*
* @param rootPwd the value for devops_doris.root_pwd
*
* @mbg.generated
*/
public void setRootPwd(String rootPwd) {
this.rootPwd = rootPwd;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.is_init
*
* @return the value of devops_doris.is_init
*
* @mbg.generated
*/
public String getIsInit() {
return isInit;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.is_init
*
* @param isInit the value for devops_doris.is_init
*
* @mbg.generated
*/
public void setIsInit(String isInit) {
this.isInit = isInit;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.create_time
*
* @return the value of devops_doris.create_time
*
* @mbg.generated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.create_time
*
* @param createTime the value for devops_doris.create_time
*
* @mbg.generated
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator. This method returns the value
* of the database column devops_doris.update_time
*
* @return the value of devops_doris.update_time
*
* @mbg.generated
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of
* the database column devops_doris.update_time
*
* @param updateTime the value for devops_doris.update_time
*
* @mbg.generated
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
......@@ -31,11 +31,17 @@ public class DevopsFlink {
*/
@TamsCol(value = "IP地址", save = 1, query = 1, showWidth = 150)
private String ip;
/**
* Database Column Remarks: root密码 This field was generated by MyBatis Generator. This field corresponds to the database column devops_flink.root_pwd
* @mbg.generated
*/
@TamsCol(value = "root密码", save = 1, query = -1)
private String rootPwd;
/**
* Database Column Remarks: 是否初始化,yes:已初始化 no:未初始化 创建duckula用户,创建环境变量创建目录 This field was generated by MyBatis Generator. This field corresponds to the database column devops_flink.is_init
* @mbg.generated
*/
@TamsCol(value = "初始化", save = 1, query = 0, enumClass = YesOrNo.class)
@TamsCol(value = "初始化", save = 1, query = 0, enumClass = YesOrNo.class, showWidth = 100)
private String isInit;
/**
* Database Column Remarks: 创建时间 This field was generated by MyBatis Generator. This field corresponds to the database column devops_flink.create_time
......@@ -52,10 +58,12 @@ public class DevopsFlink {
* This method was generated by MyBatis Generator. This method corresponds to the database table devops_flink
* @mbg.generated
*/
public DevopsFlink(Long id, String name, String ip, String isInit, Date createTime, Date updateTime) {
public DevopsFlink(Long id, String name, String ip, String rootPwd, String isInit, Date createTime,
Date updateTime) {
this.id = id;
this.name = name;
this.ip = ip;
this.rootPwd = rootPwd;
this.isInit = isInit;
this.createTime = createTime;
this.updateTime = updateTime;
......@@ -123,6 +131,24 @@ public class DevopsFlink {
this.ip = ip;
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_flink.root_pwd
* @return the value of devops_flink.root_pwd
* @mbg.generated
*/
public String getRootPwd() {
return rootPwd;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of the database column devops_flink.root_pwd
* @param rootPwd the value for devops_flink.root_pwd
* @mbg.generated
*/
public void setRootPwd(String rootPwd) {
this.rootPwd = rootPwd;
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_flink.is_init
* @return the value of devops_flink.is_init
......
......@@ -363,6 +363,76 @@ public class DevopsFlinkExample {
return (Criteria) this;
}
public Criteria andRootPwdIsNull() {
addCriterion("root_pwd is null");
return (Criteria) this;
}
public Criteria andRootPwdIsNotNull() {
addCriterion("root_pwd is not null");
return (Criteria) this;
}
public Criteria andRootPwdEqualTo(String value) {
addCriterion("root_pwd =", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdNotEqualTo(String value) {
addCriterion("root_pwd <>", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdGreaterThan(String value) {
addCriterion("root_pwd >", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdGreaterThanOrEqualTo(String value) {
addCriterion("root_pwd >=", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdLessThan(String value) {
addCriterion("root_pwd <", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdLessThanOrEqualTo(String value) {
addCriterion("root_pwd <=", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdLike(String value) {
addCriterion("root_pwd like", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdNotLike(String value) {
addCriterion("root_pwd not like", value, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdIn(List<String> values) {
addCriterion("root_pwd in", values, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdNotIn(List<String> values) {
addCriterion("root_pwd not in", values, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdBetween(String value1, String value2) {
addCriterion("root_pwd between", value1, value2, "rootPwd");
return (Criteria) this;
}
public Criteria andRootPwdNotBetween(String value1, String value2) {
addCriterion("root_pwd not between", value1, value2, "rootPwd");
return (Criteria) this;
}
public Criteria andIsInitIsNull() {
addCriterion("is_init is null");
return (Criteria) this;
......
package net.wicp.tams.app.duckula.controller.dao;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wicp.tams.app.duckula.controller.bean.models.DevopsDoris;
import net.wicp.tams.app.duckula.controller.bean.models.DevopsDorisExample;
public interface DevopsDorisMapper extends BaseMapper<DevopsDoris> {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
long countByExample(DevopsDorisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
int deleteByExample(DevopsDorisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
@Delete({
"delete from devops_doris",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
@Insert({
"insert into devops_doris (id, name, ",
"ip, cluster, roles, ",
"fs, root_pwd, is_init, ",
"create_time, update_time)",
"values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
"#{ip,jdbcType=VARCHAR}, #{cluster,jdbcType=VARCHAR}, #{roles,jdbcType=VARCHAR}, ",
"#{fs,jdbcType=VARCHAR}, #{rootPwd,jdbcType=VARCHAR}, #{isInit,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})"
})
int insert(DevopsDoris record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
int insertSelective(DevopsDoris record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
List<DevopsDoris> selectByExample(DevopsDorisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
@Select({
"select",
"id, name, ip, cluster, roles, fs, root_pwd, is_init, create_time, update_time",
"from devops_doris",
"where id = #{id,jdbcType=BIGINT}"
})
@ResultMap("net.wicp.tams.app.duckula.controller.dao.DevopsDorisMapper.BaseResultMap")
DevopsDoris selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DevopsDoris record, @Param("example") DevopsDorisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
int updateByExample(@Param("record") DevopsDoris record, @Param("example") DevopsDorisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DevopsDoris record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table devops_doris
*
* @mbg.generated
*/
@Update({
"update devops_doris",
"set name = #{name,jdbcType=VARCHAR},",
"ip = #{ip,jdbcType=VARCHAR},",
"cluster = #{cluster,jdbcType=VARCHAR},",
"roles = #{roles,jdbcType=VARCHAR},",
"fs = #{fs,jdbcType=VARCHAR},",
"root_pwd = #{rootPwd,jdbcType=VARCHAR},",
"is_init = #{isInit,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(DevopsDoris record);
}
\ No newline at end of file
......@@ -39,10 +39,10 @@ public interface DevopsFlinkMapper extends BaseMapper<DevopsFlink>{
* This method was generated by MyBatis Generator. This method corresponds to the database table devops_flink
* @mbg.generated
*/
@Insert({ "insert into devops_flink (id, name, ", "ip, is_init, create_time, ", "update_time)",
@Insert({ "insert into devops_flink (id, name, ", "ip, root_pwd, is_init, ", "create_time, update_time)",
"values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
"#{ip,jdbcType=VARCHAR}, #{isInit,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP})" })
"#{ip,jdbcType=VARCHAR}, #{rootPwd,jdbcType=VARCHAR}, #{isInit,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})" })
int insert(DevopsFlink record);
/**
......@@ -61,7 +61,7 @@ public interface DevopsFlinkMapper extends BaseMapper<DevopsFlink>{
* This method was generated by MyBatis Generator. This method corresponds to the database table devops_flink
* @mbg.generated
*/
@Select({ "select", "id, name, ip, is_init, create_time, update_time", "from devops_flink",
@Select({ "select", "id, name, ip, root_pwd, is_init, create_time, update_time", "from devops_flink",
"where id = #{id,jdbcType=BIGINT}" })
@ResultMap("net.wicp.tams.app.duckula.controller.dao.DevopsFlinkMapper.BaseResultMap")
DevopsFlink selectByPrimaryKey(Long id);
......@@ -89,7 +89,8 @@ public interface DevopsFlinkMapper extends BaseMapper<DevopsFlink>{
* @mbg.generated
*/
@Update({ "update devops_flink", "set name = #{name,jdbcType=VARCHAR},", "ip = #{ip,jdbcType=VARCHAR},",
"is_init = #{isInit,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP}", "where id = #{id,jdbcType=BIGINT}" })
"root_pwd = #{rootPwd,jdbcType=VARCHAR},", "is_init = #{isInit,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP}",
"where id = #{id,jdbcType=BIGINT}" })
int updateByPrimaryKey(DevopsFlink record);
}
\ No newline at end of file
......@@ -11,19 +11,14 @@ import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import net.wicp.tams.app.duckula.controller.config.constant.CommandType;
import net.wicp.tams.app.duckula.controller.config.constant.DeployType;
import net.wicp.tams.app.duckula.controller.service.DeployService;
import net.wicp.tams.app.duckula.controller.service.K8sService;
import net.wicp.tams.app.duckula.controller.service.deploy.IDeploy;
import net.wicp.tams.common.spring.autoconfig.SpringAssit;
@ServerEndpoint(value = "/websocket")
......
package net.wicp.tams.duckula.ops.pages.devops;
import java.util.List;
import java.util.Set;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.util.TextStreamResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lombok.extern.slf4j.Slf4j;
import net.wicp.tams.app.duckula.controller.bean.models.DevopsDoris;
import net.wicp.tams.app.duckula.controller.config.constant.DevOpsType;
import net.wicp.tams.app.duckula.controller.dao.DevopsDorisMapper;
import net.wicp.tams.common.Result;
import net.wicp.tams.common.apiext.CollectionUtil;
import net.wicp.tams.common.apiext.StringUtil;
import net.wicp.tams.common.apiext.json.JSONUtil;
import net.wicp.tams.common.constant.PathType;
import net.wicp.tams.common.exception.ExceptAll;
import net.wicp.tams.common.exception.ProjectExceptionRuntime;
import net.wicp.tams.common.os.SSHAssit;
import net.wicp.tams.common.os.bean.DiskBean;
import net.wicp.tams.common.os.pool.SSHConnection;
import net.wicp.tams.component.tools.TapestryAssist;
import net.wicp.tams.duckula.ops.pages.ParentPageBean;
@Slf4j
public class DorisConfig extends ParentPageBean<DevopsDoris> {
@Inject
private DevopsDorisMapper devopsDorisMapper;
@Override
public void doSave(DevopsDoris t, boolean isInsert) {
// 1、登陆
SSHConnection conn = SSHAssit.getConn(t.getIp(), "root", t.getRootPwd());
try {
List<DiskBean> list = conn.fdiskData();
Set<String> paths = CollectionUtil.getColSetFromObj(list, "path");
if (!paths.contains(t.getFs())) {
throw new ProjectExceptionRuntime(ExceptAll.param_error,
"存储磁盘不正确,只能填写:" + CollectionUtil.arrayJoin(paths.toArray(new String[paths.size()]), ","));
}
} finally {
SSHAssit.close(conn);
}
if (isInsert) {
devopsDorisMapper.insert(t);
} else {
devopsDorisMapper.updateByPrimaryKeySelective(t);
}
}
@Override
public void doDel(String id) {
this.devopsDorisMapper.deleteById(id);
}
@Override
public BaseMapper<DevopsDoris> getBaseMapper() {
return this.devopsDorisMapper;
}
@Override
public void packageQuery(DevopsDoris t, QueryWrapper<DevopsDoris> queryWrapper) {
if (StringUtil.isNotNull(t.getName())) {
queryWrapper.eq("name", t.getName());
}
if (StringUtil.isNotNull(t.getIsInit())) {
queryWrapper.eq("is_init", t.getIsInit());
}
}
/***
* <r:combobox id="groupIsEdit" name="isEdit" textField="name1" valueField=
* "name" url="/sys/OptionItemManager:list/YesOrNo" panelHeight="50" value=
* "literal:yes"/> 得到centos的磁盘。
*
* @return
*/
// public TextStreamResponse onListFs() {
// final DevopsDoris devopsDoris = TapestryAssist.getBeanFromPage(DevopsDoris.class, requestGlobals);
//
// }
/***
* 测试用后端调用
*
* @return
*/
public TextStreamResponse onCheckHost() {
final DevopsDoris DevopsDoris = TapestryAssist.getBeanFromPage(DevopsDoris.class, requestGlobals);
// 1、OSS下载
String localPath = PathType.getPath(DevOpsType.flink.getCheckurl());
// 1、登陆
SSHConnection conn = SSHAssit.getConn(DevopsDoris.getIp(), "root", DevopsDoris.getRootPwd());
try {
String fileName = localPath.substring(localPath.lastIndexOf("/") + 1);
conn.scp(localPath, fileName, "~", "0744");
// 执行
Result result = conn.executeCommand(String.format("sh ~/%s", fileName));
log.info(result.getMessage());
return TapestryAssist.getTextStreamResponse(Result.getError("检查结果:" + result.getMessage()));
} finally {
SSHAssit.close(conn);
}
}
}
......@@ -11,6 +11,7 @@ import net.wicp.tams.app.duckula.controller.bean.models.DevopsFlink;
import net.wicp.tams.app.duckula.controller.config.constant.DevOpsType;
import net.wicp.tams.app.duckula.controller.dao.DevopsFlinkMapper;
import net.wicp.tams.common.Result;
import net.wicp.tams.common.apiext.StringUtil;
import net.wicp.tams.common.constant.PathType;
import net.wicp.tams.common.os.SSHAssit;
import net.wicp.tams.common.os.pool.SSHConnection;
......@@ -44,7 +45,12 @@ public class FlinkConfig extends ParentPageBean<DevopsFlink> {
@Override
public void packageQuery(DevopsFlink t, QueryWrapper<DevopsFlink> queryWrapper) {
// TODO Auto-generated method stub
if (StringUtil.isNotNull(t.getName())) {
queryWrapper.eq("name", t.getName());
}
if (StringUtil.isNotNull(t.getIsInit())) {
queryWrapper.eq("is_init", t.getIsInit());
}
}
/***
......@@ -54,12 +60,10 @@ public class FlinkConfig extends ParentPageBean<DevopsFlink> {
*/
public TextStreamResponse onCheckHost() {
final DevopsFlink devopsFlink = TapestryAssist.getBeanFromPage(DevopsFlink.class, requestGlobals);
// 1、OSS下载
String localPath = PathType.getPath(DevOpsType.flink.getCheckurl());
// 1、登陆
SSHConnection conn = SSHAssit.getConn(devopsFlink.getIp(), "root", "mfkwcwiqpl");
SSHConnection conn = SSHAssit.getConn(devopsFlink.getIp(), "root", devopsFlink.getRootPwd());
String fileName = localPath.substring(localPath.lastIndexOf("/") + 1);
conn.scp(localPath, fileName, "~", "0744");
// 执行
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wicp.tams.app.duckula.controller.dao.DevopsDorisMapper">
<resultMap id="BaseResultMap" type="net.wicp.tams.app.duckula.controller.bean.models.DevopsDoris">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="ip" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="cluster" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="roles" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="fs" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="root_pwd" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_init" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="create_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="update_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, name, ip, cluster, roles, fs, root_pwd, is_init, create_time, update_time
</sql>
<select id="selectByExample" parameterType="net.wicp.tams.app.duckula.controller.bean.models.DevopsDorisExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from devops_doris
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="net.wicp.tams.app.duckula.controller.bean.models.DevopsDorisExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from devops_doris
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insertSelective" parameterType="net.wicp.tams.app.duckula.controller.bean.models.DevopsDoris">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into devops_doris
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="ip != null">
ip,
</if>
<if test="cluster != null">
cluster,
</if>
<if test="roles != null">
roles,
</if>
<if test="fs != null">
fs,
</if>
<if test="rootPwd != null">
root_pwd,
</if>
<if test="isInit != null">
is_init,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="cluster != null">
#{cluster,jdbcType=VARCHAR},
</if>
<if test="roles != null">
#{roles,jdbcType=VARCHAR},
</if>
<if test="fs != null">
#{fs,jdbcType=VARCHAR},
</if>
<if test="rootPwd != null">
#{rootPwd,jdbcType=VARCHAR},
</if>
<if test="isInit != null">
#{isInit,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.wicp.tams.app.duckula.controller.bean.models.DevopsDorisExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from devops_doris
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update devops_doris
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.ip != null">
ip = #{record.ip,jdbcType=VARCHAR},
</if>
<if test="record.cluster != null">
cluster = #{record.cluster,jdbcType=VARCHAR},
</if>
<if test="record.roles != null">
roles = #{record.roles,jdbcType=VARCHAR},
</if>
<if test="record.fs != null">
fs = #{record.fs,jdbcType=VARCHAR},
</if>
<if test="record.rootPwd != null">
root_pwd = #{record.rootPwd,jdbcType=VARCHAR},
</if>
<if test="record.isInit != null">
is_init = #{record.isInit,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update devops_doris
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
ip = #{record.ip,jdbcType=VARCHAR},
cluster = #{record.cluster,jdbcType=VARCHAR},
roles = #{record.roles,jdbcType=VARCHAR},
fs = #{record.fs,jdbcType=VARCHAR},
root_pwd = #{record.rootPwd,jdbcType=VARCHAR},
is_init = #{record.isInit,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="net.wicp.tams.app.duckula.controller.bean.models.DevopsDoris">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update devops_doris
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="ip != null">
ip = #{ip,jdbcType=VARCHAR},
</if>
<if test="cluster != null">
cluster = #{cluster,jdbcType=VARCHAR},
</if>
<if test="roles != null">
roles = #{roles,jdbcType=VARCHAR},
</if>
<if test="fs != null">
fs = #{fs,jdbcType=VARCHAR},
</if>
<if test="rootPwd != null">
root_pwd = #{rootPwd,jdbcType=VARCHAR},
</if>
<if test="isInit != null">
is_init = #{isInit,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -10,6 +10,7 @@
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="ip" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="root_pwd" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_init" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="create_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="update_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
......@@ -86,7 +87,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, name, ip, is_init, create_time, update_time
id, name, ip, root_pwd, is_init, create_time, update_time
</sql>
<select id="selectByExample" parameterType="net.wicp.tams.app.duckula.controller.bean.models.DevopsFlinkExample" resultMap="BaseResultMap">
<!--
......@@ -132,6 +133,9 @@
<if test="ip != null">
ip,
</if>
<if test="rootPwd != null">
root_pwd,
</if>
<if test="isInit != null">
is_init,
</if>
......@@ -152,6 +156,9 @@
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="rootPwd != null">
#{rootPwd,jdbcType=VARCHAR},
</if>
<if test="isInit != null">
#{isInit,jdbcType=VARCHAR},
</if>
......@@ -189,6 +196,9 @@
<if test="record.ip != null">
ip = #{record.ip,jdbcType=VARCHAR},
</if>
<if test="record.rootPwd != null">
root_pwd = #{record.rootPwd,jdbcType=VARCHAR},
</if>
<if test="record.isInit != null">
is_init = #{record.isInit,jdbcType=VARCHAR},
</if>
......@@ -212,6 +222,7 @@
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
ip = #{record.ip,jdbcType=VARCHAR},
root_pwd = #{record.rootPwd,jdbcType=VARCHAR},
is_init = #{record.isInit,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
......@@ -232,6 +243,9 @@
<if test="ip != null">
ip = #{ip,jdbcType=VARCHAR},
</if>
<if test="rootPwd != null">
root_pwd = #{rootPwd,jdbcType=VARCHAR},
</if>
<if test="isInit != null">
is_init = #{isInit,jdbcType=VARCHAR},
</if>
......
<html t:type="rjzjh/layoutQuery" queryButs="[{'id':'checkBut','iconCls':'icon-attach','text':'检查服务器','url':'checkHost','confirm':'你确定要检查此服务器吗?'}]"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
xmlns:r="tapestry-library:rjzjh"
xmlns:s="tapestry-library:tams"
xmlns:p="tapestry:parameter">
<r:dialog id="demoDialog" title="请选择位点" width="640" height="420" closable="true" toolbar="[{'id':'savePosBut','text':'保存','plain':false}]">
ddddddddddddddddddddddddddddddddd
</r:dialog>
<script>
function viewLogButDo(row){
alert(row.id);
}
function initAdd(){
alert("do add")
}
function initUpdate(row){
alert("do update:"+row.id)
}
function saveCheck(){
alert("新增或修改前的检查,跟据业务需求写前端较验:");
//var deployComValue= $.rjzjh.getcombogrid('deployId_save','deploy');
//var middlewareIdSel= $('#middlewareId_save').combobox('getValue');
//var rules= $('#ruleEdit').val();
return false;
}
</script>
</html>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册