提交 4c8e061e authored 作者: taojinlong's avatar taojinlong

feat: 定时检测数据源状态信息

上级 6b1abd07
...@@ -13,12 +13,14 @@ public class Datasource implements Serializable { ...@@ -13,12 +13,14 @@ public class Datasource implements Serializable {
private String type; private String type;
private String createBy;
private Long createTime; private Long createTime;
private Long updateTime; private Long updateTime;
private String createBy;
private String status;
private String configuration; private String configuration;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -384,76 +384,6 @@ public class DatasourceExample { ...@@ -384,76 +384,6 @@ public class DatasourceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
...@@ -573,6 +503,146 @@ public class DatasourceExample { ...@@ -573,6 +503,146 @@ public class DatasourceExample {
addCriterion("update_time not between", value1, value2, "updateTime"); addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="desc" jdbcType="VARCHAR" property="desc" /> <result column="desc" jdbcType="VARCHAR" property="desc" />
<result column="type" jdbcType="VARCHAR" property="type" /> <result column="type" jdbcType="VARCHAR" property="type" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="status" jdbcType="VARCHAR" property="status" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.Datasource"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.Datasource">
<result column="configuration" jdbcType="LONGVARCHAR" property="configuration" /> <result column="configuration" jdbcType="LONGVARCHAR" property="configuration" />
...@@ -72,7 +73,7 @@ ...@@ -72,7 +73,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, `desc`, `type`, create_by, create_time, update_time id, `name`, `desc`, `type`, create_time, update_time, create_by, `status`
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
configuration configuration
...@@ -127,11 +128,13 @@ ...@@ -127,11 +128,13 @@
</delete> </delete>
<insert id="insert" parameterType="io.dataease.base.domain.Datasource"> <insert id="insert" parameterType="io.dataease.base.domain.Datasource">
insert into datasource (id, `name`, `desc`, insert into datasource (id, `name`, `desc`,
`type`, create_by, create_time, `type`, create_time, update_time,
update_time, configuration) create_by, `status`, configuration
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{configuration,jdbcType=LONGVARCHAR}) #{createBy,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{configuration,jdbcType=LONGVARCHAR}
)
</insert> </insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.Datasource"> <insert id="insertSelective" parameterType="io.dataease.base.domain.Datasource">
insert into datasource insert into datasource
...@@ -148,15 +151,18 @@ ...@@ -148,15 +151,18 @@
<if test="type != null"> <if test="type != null">
`type`, `type`,
</if> </if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="createBy != null">
create_by,
</if>
<if test="status != null">
`status`,
</if>
<if test="configuration != null"> <if test="configuration != null">
configuration, configuration,
</if> </if>
...@@ -174,15 +180,18 @@ ...@@ -174,15 +180,18 @@
<if test="type != null"> <if test="type != null">
#{type,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
</if> </if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
</if> </if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="configuration != null"> <if test="configuration != null">
#{configuration,jdbcType=LONGVARCHAR}, #{configuration,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -209,15 +218,18 @@ ...@@ -209,15 +218,18 @@
<if test="record.type != null"> <if test="record.type != null">
`type` = #{record.type,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR},
</if> </if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
</if> </if>
<if test="record.updateTime != null"> <if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
</if> </if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.configuration != null"> <if test="record.configuration != null">
configuration = #{record.configuration,jdbcType=LONGVARCHAR}, configuration = #{record.configuration,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -232,9 +244,10 @@ ...@@ -232,9 +244,10 @@
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
`desc` = #{record.desc,jdbcType=VARCHAR}, `desc` = #{record.desc,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
configuration = #{record.configuration,jdbcType=LONGVARCHAR} configuration = #{record.configuration,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -246,9 +259,10 @@ ...@@ -246,9 +259,10 @@
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
`desc` = #{record.desc,jdbcType=VARCHAR}, `desc` = #{record.desc,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT} update_time = #{record.updateTime,jdbcType=BIGINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -265,15 +279,18 @@ ...@@ -265,15 +279,18 @@
<if test="type != null"> <if test="type != null">
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
</if> </if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
</if> </if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="configuration != null"> <if test="configuration != null">
configuration = #{configuration,jdbcType=LONGVARCHAR}, configuration = #{configuration,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -285,9 +302,10 @@ ...@@ -285,9 +302,10 @@
set `name` = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
`desc` = #{desc,jdbcType=VARCHAR}, `desc` = #{desc,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
create_by = #{createBy,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
configuration = #{configuration,jdbcType=LONGVARCHAR} configuration = #{configuration,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
...@@ -296,9 +314,10 @@ ...@@ -296,9 +314,10 @@
set `name` = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
`desc` = #{desc,jdbcType=VARCHAR}, `desc` = #{desc,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT} update_time = #{updateTime,jdbcType=BIGINT},
create_by = #{createBy,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</select> </select>
<select id="queryUnion" resultMap="BaseResultMapDTO"> <select id="queryUnion" resultMap="BaseResultMapDTO">
select id , name , `desc` ,`type` , configuration ,create_time ,update_time, select id , name , `desc` ,`type` , configuration ,create_time ,update_time, status,
get_auths(id,'link',#{userId}) as `privileges` get_auths(id,'link',#{userId}) as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'link') cids) t,datasource from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'link') cids) t,datasource
<where> <where>
......
...@@ -57,6 +57,7 @@ public class DatasourceService { ...@@ -57,6 +57,7 @@ public class DatasourceService {
datasource.setCreateBy(String.valueOf(AuthUtils.getUser().getUsername())); datasource.setCreateBy(String.valueOf(AuthUtils.getUser().getUsername()));
datasourceMapper.insertSelective(datasource); datasourceMapper.insertSelective(datasource);
handleConnectionPool(datasource, "add"); handleConnectionPool(datasource, "add");
checkAndUpdateDatasourceStatus(datasource);
return datasource; return datasource;
} }
...@@ -111,6 +112,7 @@ public class DatasourceService { ...@@ -111,6 +112,7 @@ public class DatasourceService {
datasource.setUpdateTime(System.currentTimeMillis()); datasource.setUpdateTime(System.currentTimeMillis());
datasourceMapper.updateByPrimaryKeySelective(datasource); datasourceMapper.updateByPrimaryKeySelective(datasource);
handleConnectionPool(datasource, "edit"); handleConnectionPool(datasource, "edit");
checkAndUpdateDatasourceStatus(datasource);
} }
public void validate(Datasource datasource) throws Exception { public void validate(Datasource datasource) throws Exception {
...@@ -200,4 +202,25 @@ public class DatasourceService { ...@@ -200,4 +202,25 @@ public class DatasourceService {
DEException.throwException(Translator.get("i18n_ds_name_exists")); DEException.throwException(Translator.get("i18n_ds_name_exists"));
} }
} }
public void updateDatasourceStatus(){
List<Datasource> datasources = datasourceMapper.selectByExampleWithBLOBs(new DatasourceExample());
datasources.forEach(datasource -> {
checkAndUpdateDatasourceStatus(datasource);
});
}
private void checkAndUpdateDatasourceStatus(Datasource datasource){
try {
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(datasource);
datasourceProvider.checkStatus(datasourceRequest);
datasource.setStatus("Success");
datasourceMapper.updateByPrimaryKeySelective(datasource);
} catch (Exception e) {
datasource.setStatus("Error");
datasourceMapper.updateByPrimaryKeySelective(datasource);
}
}
} }
...@@ -1542,7 +1542,6 @@ public class DataSetTableService { ...@@ -1542,7 +1542,6 @@ public class DataSetTableService {
@Resource @Resource
private UtilMapper utilMapper; private UtilMapper utilMapper;
@QuartzScheduled(cron = "0 0/3 * * * ?")
public void updateDatasetTableStatus() { public void updateDatasetTableStatus() {
List<QrtzSchedulerState> qrtzSchedulerStates = qrtzSchedulerStateMapper.selectByExample(null); List<QrtzSchedulerState> qrtzSchedulerStates = qrtzSchedulerStateMapper.selectByExample(null);
List<String> activeQrtzInstances = qrtzSchedulerStates.stream().filter(qrtzSchedulerState -> qrtzSchedulerState.getLastCheckinTime() + qrtzSchedulerState.getCheckinInterval() + 1000 > utilMapper.currentTimestamp()).map(QrtzSchedulerStateKey::getInstanceName).collect(Collectors.toList()); List<String> activeQrtzInstances = qrtzSchedulerStates.stream().filter(qrtzSchedulerState -> qrtzSchedulerState.getLastCheckinTime() + qrtzSchedulerState.getCheckinInterval() + 1000 > utilMapper.currentTimestamp()).map(QrtzSchedulerStateKey::getInstanceName).collect(Collectors.toList());
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<!--要生成的数据库表 --> <!--要生成的数据库表 -->
<table tableName="chart_view"/> <table tableName="datasource"/>
<!-- <table tableName="sys_dict_item"/>--> <!-- <table tableName="sys_dict_item"/>-->
<!-- <table tableName="dataset_table_field"/>--> <!-- <table tableName="dataset_table_field"/>-->
<!-- <table tableName="v_chart">--> <!-- <table tableName="v_chart">-->
......
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
class="ms-aside-container" class="ms-aside-container"
:style="{'margin-left': !asideHidden ? 0 : '-' + width}" :style="{'margin-left': !asideHidden ? 0 : '-' + width}"
> >
<!--<div v-if="enableAsideHidden" class="hiddenBottom" @click="asideHidden = !asideHidden">-->
<!--<i v-if="!asideHidden" class="el-icon-arrow-left"/>-->
<!--<i v-if="asideHidden" class="el-icon-arrow-right"/>-->
<!--</div>-->
<slot /> <slot />
<de-horizontal-drag-bar v-if="showDragBar" /> <de-horizontal-drag-bar v-if="showDragBar" />
</el-aside> </el-aside>
......
...@@ -1043,7 +1043,8 @@ export default { ...@@ -1043,7 +1043,8 @@ export default {
oracle_service_name: 'Service Name', oracle_service_name: 'Service Name',
get_schema: 'Get Schema', get_schema: 'Get Schema',
schema: 'Database Schema', schema: 'Database Schema',
please_choose_schema: 'Please select Schema' please_choose_schema: 'Please select Schema',
in_valid: 'Invalid datasource'
}, },
pblink: { pblink: {
key_pwd: 'Please enter the password to open the link', key_pwd: 'Please enter the password to open the link',
......
...@@ -1043,7 +1043,8 @@ export default { ...@@ -1043,7 +1043,8 @@ export default {
oracle_service_name: '服務名', oracle_service_name: '服務名',
get_schema: '獲取 Schema', get_schema: '獲取 Schema',
schema: '數據庫 Schema', schema: '數據庫 Schema',
please_choose_schema: '請選擇數據庫 Schema' please_choose_schema: '請選擇數據庫 Schema',
in_valid: '無效數據源'
}, },
pblink: { pblink: {
key_pwd: '請輸入密碼打開鏈接', key_pwd: '請輸入密碼打開鏈接',
......
...@@ -1045,7 +1045,8 @@ export default { ...@@ -1045,7 +1045,8 @@ export default {
get_schema: '获取 Schema', get_schema: '获取 Schema',
schema: '数据库 Schema', schema: '数据库 Schema',
please_choose_schema: '请选择数据库 Schema', please_choose_schema: '请选择数据库 Schema',
edit_datasource_msg: '修改数据源信息,可能会导致改数据源下的数据集不可用,确认修改?' edit_datasource_msg: '修改数据源信息,可能会导致改数据源下的数据集不可用,确认修改?',
in_valid: '无效数据源'
}, },
pblink: { pblink: {
key_pwd: '请输入密码打开链接', key_pwd: '请输入密码打开链接',
......
...@@ -37,13 +37,22 @@ ...@@ -37,13 +37,22 @@
> >
<span slot-scope="{ node, data }" class="custom-tree-node-list father"> <span slot-scope="{ node, data }" class="custom-tree-node-list father">
<span style="display: flex;flex: 1;width: 0;"> <span style="display: flex;flex: 1;width: 0;">
<span v-if="data.type !== 'folder'"> <span v-if="data.type !== 'folder' && data.status !== 'Error'">
<svg-icon icon-class="datasource" class="ds-icon-scene" /> <svg-icon icon-class="datasource" class="ds-icon-scene" />
</span> </span>
<span v-if="data.status === 'Error'">
<svg-icon icon-class="exclamationmark" class="ds-icon-scene" />
<el-tooltip v-if="data.status === 'Error'" style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" effect="dark" :content="$t('datasource.in_valid')" placement="right">
<el-button type="text" > {{ data.name }} </el-button>
</el-tooltip>
</span>
<span v-if="data.type === 'folder'"> <span v-if="data.type === 'folder'">
<i class="el-icon-folder" /> <i class="el-icon-folder" />
</span> </span>
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ data.name }}</span> <span v-if=" data.status !== 'Error'" style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
{{ data.name }}
</span>
</span> </span>
<span class="child"> <span class="child">
<span v-if="data.type ==='folder'" @click.stop> <span v-if="data.type ==='folder'" @click.stop>
...@@ -67,24 +76,6 @@ ...@@ -67,24 +76,6 @@
@click="_handleDelete(data)" @click="_handleDelete(data)"
/> />
</span> </span>
<!-- <el-dropdown trigger="click" size="small" @command="clickFileMore">
<span class="el-dropdown-link">
<el-button
icon="el-icon-more"
type="text"
size="small"
/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item icon="el-icon-edit" :command="beforeClickFile('edit',data,node)">
{{ $t('panel.edit') }}
</el-dropdown-item>
<el-dropdown-item icon="el-icon-delete" :command="beforeClickFile('delete',data,node)">
{{ $t('panel.delete') }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
</span> </span>
</span> </span>
</span> </span>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论