Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
814aee0e
提交
814aee0e
authored
9月 29, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 【数据源】新建数据源至空必要参数,部分必要参数未弹出提示
上级
2dcae3d1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
18 行删除
+17
-18
EsConfigDTO.java
...src/main/java/io/dataease/datasource/dto/EsConfigDTO.java
+2
-2
EsProvider.java
...main/java/io/dataease/datasource/provider/EsProvider.java
+6
-6
form.vue
frontend/src/views/system/datasource/form.vue
+9
-10
没有找到文件。
backend/src/main/java/io/dataease/datasource/dto/EsConfigDTO.java
浏览文件 @
814aee0e
...
...
@@ -8,8 +8,8 @@ import lombok.Setter;
@Setter
public
class
EsConfigDTO
{
private
String
url
;
private
String
u
sername
;
private
String
p
assword
;
private
String
esU
sername
;
private
String
esP
assword
;
private
String
version
;
private
String
uri
;
private
String
dataSourceType
=
"es"
;
...
...
backend/src/main/java/io/dataease/datasource/provider/EsProvider.java
浏览文件 @
814aee0e
...
...
@@ -50,8 +50,8 @@ public class EsProvider extends DatasourceProvider {
try
{
EsConfigDTO
esConfigDTO
=
new
Gson
().
fromJson
(
dsr
.
getDatasource
().
getConfiguration
(),
EsConfigDTO
.
class
);
HttpClientConfig
httpClientConfig
=
new
HttpClientConfig
();
if
(
StringUtils
.
isNotEmpty
(
esConfigDTO
.
getUsername
())){
String
auth
=
esConfigDTO
.
get
Username
()
+
":"
+
esConfigDTO
.
get
Password
();
if
(
StringUtils
.
isNotEmpty
(
esConfigDTO
.
get
Es
Username
())){
String
auth
=
esConfigDTO
.
get
EsUsername
()
+
":"
+
esConfigDTO
.
getEs
Password
();
byte
[]
encodedAuth
=
Base64
.
encodeBase64
(
auth
.
getBytes
(
StandardCharsets
.
UTF_8
));
httpClientConfig
.
addHeader
(
HttpHeaders
.
AUTHORIZATION
,
"Basic "
+
new
String
(
encodedAuth
));
}
...
...
@@ -252,8 +252,8 @@ public class EsProvider extends DatasourceProvider {
EsConfigDTO
esConfigDTO
=
new
Gson
().
fromJson
(
datasourceRequest
.
getDatasource
().
getConfiguration
(),
EsConfigDTO
.
class
);
uri
=
esConfigDTO
.
getUri
()+
uri
;
HttpClientConfig
httpClientConfig
=
new
HttpClientConfig
();
if
(
StringUtils
.
isNotEmpty
(
esConfigDTO
.
get
Username
())
&&
StringUtils
.
isNotEmpty
(
esConfigDTO
.
get
Password
())){
String
auth
=
esConfigDTO
.
get
Username
()
+
":"
+
esConfigDTO
.
get
Password
();
if
(
StringUtils
.
isNotEmpty
(
esConfigDTO
.
get
EsUsername
())
&&
StringUtils
.
isNotEmpty
(
esConfigDTO
.
getEs
Password
())){
String
auth
=
esConfigDTO
.
get
EsUsername
()
+
":"
+
esConfigDTO
.
getEs
Password
();
byte
[]
encodedAuth
=
Base64
.
encodeBase64
(
auth
.
getBytes
(
StandardCharsets
.
UTF_8
));
httpClientConfig
.
addHeader
(
HttpHeaders
.
AUTHORIZATION
,
"Basic "
+
new
String
(
encodedAuth
));
}
...
...
@@ -269,8 +269,8 @@ public class EsProvider extends DatasourceProvider {
private
String
exexGetQuery
(
DatasourceRequest
datasourceRequest
){
EsConfigDTO
esConfigDTO
=
new
Gson
().
fromJson
(
datasourceRequest
.
getDatasource
().
getConfiguration
(),
EsConfigDTO
.
class
);
HttpClientConfig
httpClientConfig
=
new
HttpClientConfig
();
if
(
StringUtils
.
isNotEmpty
(
esConfigDTO
.
get
Username
())
&&
StringUtils
.
isNotEmpty
(
esConfigDTO
.
get
Password
())){
String
auth
=
esConfigDTO
.
get
Username
()
+
":"
+
esConfigDTO
.
get
Password
();
if
(
StringUtils
.
isNotEmpty
(
esConfigDTO
.
get
EsUsername
())
&&
StringUtils
.
isNotEmpty
(
esConfigDTO
.
getEs
Password
())){
String
auth
=
esConfigDTO
.
get
EsUsername
()
+
":"
+
esConfigDTO
.
getEs
Password
();
byte
[]
encodedAuth
=
Base64
.
encodeBase64
(
auth
.
getBytes
(
StandardCharsets
.
UTF_8
));
httpClientConfig
.
addHeader
(
HttpHeaders
.
AUTHORIZATION
,
"Basic "
+
new
String
(
encodedAuth
));
}
...
...
frontend/src/views/system/datasource/form.vue
浏览文件 @
814aee0e
...
...
@@ -39,12 +39,19 @@
<el-radio
v-model=
"form.configuration.connectionType"
label=
"serviceName"
>
{{ $t('datasource.oracle_service_name') }}
</el-radio>
</el-form-item>
<el-form-item
:label=
"$t('datasource.user_name')"
>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.user_name')"
prop=
"configuration.username"
>
<el-input
v-model=
"form.configuration.username"
autocomplete=
"off"
/>
</el-form-item>
<el-form-item
:label=
"$t('datasource.password')"
>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.password')"
prop=
"configuration.password"
>
<el-input
v-model=
"form.configuration.password"
autocomplete=
"off"
show-password
/>
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='es'"
:label=
"$t('datasource.user_name')"
>
<el-input
v-model=
"form.configuration.esUsername"
autocomplete=
"off"
/>
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='es'"
:label=
"$t('datasource.password')"
>
<el-input
v-model=
"form.configuration.esPassword"
autocomplete=
"off"
show-password
/>
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.port')"
prop=
"configuration.port"
>
<el-input
v-model=
"form.configuration.port"
autocomplete=
"off"
/>
</el-form-item>
...
...
@@ -208,14 +215,6 @@ export default {
this
.
$refs
.
dsForm
.
resetFields
()
},
save
()
{
if
(
this
.
form
.
type
!==
'es'
&&
!
this
.
form
.
configuration
.
username
){
this
.
$message
.
error
(
this
.
$t
(
'datasource.please_input_user_name'
))
return
}
if
(
this
.
form
.
type
!==
'es'
&&
!
this
.
form
.
configuration
.
username
){
this
.
$message
.
error
(
this
.
$t
(
'datasource.please_input_password'
))
return
}
if
(
!
this
.
form
.
configuration
.
schema
&&
(
this
.
form
.
type
===
'oracle'
||
this
.
form
.
type
===
'sqlServer'
))
{
this
.
$message
.
error
(
this
.
$t
(
'datasource.please_choose_schema'
))
return
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论