[Feature-4428][dao、UI] It is recommended to add an owner in the data source center and the Resource Center to make it easier to manage (#4442)

* add owner to datasource list and resource list

* add owner to datasource list and resource list

Co-authored-by: bobqiu <xiaoqiu369@gmail.com>
This commit is contained in:
qiubo 2021-01-14 17:10:14 +08:00 committed by GitHub
parent 2a98aee1bd
commit d0ac87a638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 11 deletions

View File

@ -40,11 +40,14 @@
<select id="selectPaging" resultType="org.apache.dolphinscheduler.dao.entity.DataSource">
select
<include refid="baseSql"/>
from t_ds_datasource
d.id, d.name, d.note, d.type, d.user_id, connection_params, d.create_time, d.update_time
,
u.user_name as user_name
from t_ds_datasource d
join t_ds_user u on d.user_id = u.id
where 1 =1
<if test="userId != 0">
and id in
and d.id in
(select datasource_id
from t_ds_relation_datasource_user
where user_id=#{userId}

View File

@ -60,17 +60,20 @@
</select>
<select id="queryResourcePaging" resultType="org.apache.dolphinscheduler.dao.entity.Resource">
select
<include refid="baseSql"/>
from t_ds_resources
where type=#{type} and pid=#{id}
d.id, d.alias, d.file_name, d.description, d.user_id, d.type, d.size, d.create_time, d.update_time,
d.pid, d.full_name, d.is_directory,
u.user_name as user_name
from t_ds_resources d
join t_ds_user u on d.user_id = u.id
where d.type=#{type} and d.pid=#{id}
<if test="userId != 0">
and id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId}
and d.id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId}
union select id as resources_id from t_ds_resources where user_id=#{userId})
</if>
<if test="searchVal != null and searchVal != ''">
and alias like concat('%', #{searchVal}, '%')
and d.alias like concat('%', #{searchVal}, '%')
</if>
order by update_time desc
order by d.update_time desc
</select>
<select id="queryAuthorizedResourceList" resultType="org.apache.dolphinscheduler.dao.entity.Resource">
select

View File

@ -20,6 +20,7 @@
<el-table :data="list" size="mini" style="width: 100%">
<el-table-column type="index" :label="$t('#')" width="50"></el-table-column>
<el-table-column prop="name" :label="$t('Datasource Name')"></el-table-column>
<el-table-column prop="userName" :label="$t('Datasource userName')"></el-table-column>
<el-table-column prop="type" :label="$t('Datasource Type')"></el-table-column>
<el-table-column :label="$t('Datasource Parameter')">
<template slot-scope="scope">

View File

@ -29,6 +29,7 @@
</el-popover>
</template>
</el-table-column>
<el-table-column prop="userName" :label="$t('Resource userName')"></el-table-column>
<el-table-column :label="$t('Whether directory')" width="100">
<template slot-scope="scope">
{{scope.row.directory? $t('Yes') : $t('No')}}

View File

@ -665,5 +665,7 @@ export default {
'Max Memory': 'Max Memory',
'Min Memory': 'Min Memory',
'The workflow canvas is abnormal and cannot be saved, please recreate': 'The workflow canvas is abnormal and cannot be saved, please recreate',
Info: 'Info'
Info: 'Info',
'Datasource userName': 'owner',
'Resource userName': 'owner'
}

View File

@ -664,5 +664,7 @@ export default {
'Max Memory': '最大内存',
'Min Memory': '最小内存',
'The workflow canvas is abnormal and cannot be saved, please recreate': '该工作流画布异常无法保存请重新创建',
Info: '提示'
Info: '提示',
'Datasource userName': '所属用户',
'Resource userName': '所属用户'
}