forked from github/dataease
Merge pull request #11150 from dataease/pr@dev-v2@fixDS
fix: SSH 设置显示问题
This commit is contained in:
commit
62346a258f
@ -159,21 +159,22 @@ const authMethodList = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const validateSshHost = (_: any, value: any, callback: any) => {
|
const validateSshHost = (_: any, value: any, callback: any) => {
|
||||||
if ((value === null || value === '') && form.value.configuration.useSSH) {
|
console.log(value)
|
||||||
|
if ((value === undefined || value === null || value === '') && form.value.configuration.useSSH) {
|
||||||
callback(new Error('SSH主机不能为空'))
|
callback(new Error('SSH主机不能为空'))
|
||||||
}
|
}
|
||||||
return callback()
|
return callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateSshPort = (_: any, value: any, callback: any) => {
|
const validateSshPort = (_: any, value: any, callback: any) => {
|
||||||
if ((value === null || value === '') && form.value.configuration.useSSH) {
|
if ((value === undefined || value === null || value === '') && form.value.configuration.useSSH) {
|
||||||
callback(new Error('SSH端口不能为空'))
|
callback(new Error('SSH端口不能为空'))
|
||||||
}
|
}
|
||||||
return callback()
|
return callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateSshUserName = (_: any, value: any, callback: any) => {
|
const validateSshUserName = (_: any, value: any, callback: any) => {
|
||||||
if ((value === null || value === '') && form.value.configuration.useSSH) {
|
if ((value === undefined || value === null || value === '') && form.value.configuration.useSSH) {
|
||||||
callback(new Error('SSH用户名不能为空'))
|
callback(new Error('SSH用户名不能为空'))
|
||||||
}
|
}
|
||||||
return callback()
|
return callback()
|
||||||
@ -181,7 +182,7 @@ const validateSshUserName = (_: any, value: any, callback: any) => {
|
|||||||
|
|
||||||
const validateSshPassword = (_: any, value: any, callback: any) => {
|
const validateSshPassword = (_: any, value: any, callback: any) => {
|
||||||
if (
|
if (
|
||||||
(value === null || value === '') &&
|
(value === undefined || value === null || value === '') &&
|
||||||
form.value.configuration.useSSH &&
|
form.value.configuration.useSSH &&
|
||||||
form.value.configuration.sshType === 'password'
|
form.value.configuration.sshType === 'password'
|
||||||
) {
|
) {
|
||||||
|
@ -1299,17 +1299,51 @@ const getMenuList = (val: boolean) => {
|
|||||||
}}</BaseInfoItem>
|
}}</BaseInfoItem>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span
|
<el-row :gutter="24">
|
||||||
v-if="!['es', 'api'].includes(nodeInfo.type.toLowerCase())"
|
<span
|
||||||
class="de-expand"
|
v-if="
|
||||||
@click="showPriority = !showPriority"
|
!['es', 'api'].includes(nodeInfo.type.toLowerCase()) &&
|
||||||
>{{ t('datasource.priority') }}
|
nodeInfo.configuration.urlType !== 'jdbcUrl'
|
||||||
<el-icon>
|
"
|
||||||
<Icon
|
class="de-expand"
|
||||||
:name="showPriority ? 'icon_down_outlined' : 'icon_down_outlined-1'"
|
@click="showSSH = !showSSH"
|
||||||
></Icon>
|
>SSH 设置
|
||||||
</el-icon>
|
<el-icon>
|
||||||
</span>
|
<Icon :name="showSSH ? 'icon_down_outlined' : 'icon_down_outlined-1'"></Icon>
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
</el-row>
|
||||||
|
<template v-if="showSSH">
|
||||||
|
<el-row :gutter="24" v-if="nodeInfo.configuration.useSSH">
|
||||||
|
<el-col :span="12">
|
||||||
|
<BaseInfoItem label="主机">{{ nodeInfo.configuration.sshHost }}</BaseInfoItem>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<BaseInfoItem label="端口">{{ nodeInfo.configuration.sshPort }}</BaseInfoItem>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="24" v-if="nodeInfo.configuration.useSSH">
|
||||||
|
<el-col :span="12">
|
||||||
|
<BaseInfoItem label="用户名">{{
|
||||||
|
nodeInfo.configuration.sshUserName
|
||||||
|
}}</BaseInfoItem>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<span
|
||||||
|
v-if="!['es', 'api'].includes(nodeInfo.type.toLowerCase())"
|
||||||
|
class="de-expand"
|
||||||
|
@click="showPriority = !showPriority"
|
||||||
|
>{{ t('datasource.priority') }}
|
||||||
|
<el-icon>
|
||||||
|
<Icon
|
||||||
|
:name="showPriority ? 'icon_down_outlined' : 'icon_down_outlined-1'"
|
||||||
|
></Icon>
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<template v-if="showPriority">
|
<template v-if="showPriority">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -1339,35 +1373,6 @@ const getMenuList = (val: boolean) => {
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
<span
|
|
||||||
v-if="
|
|
||||||
!['es', 'api'].includes(nodeInfo.type.toLowerCase()) &&
|
|
||||||
nodeInfo.configuration.urlType !== 'jdbcUrl'
|
|
||||||
"
|
|
||||||
class="de-expand"
|
|
||||||
@click="showSSH = !showSSH"
|
|
||||||
>SSH 设置
|
|
||||||
<el-icon>
|
|
||||||
<Icon :name="showSSH ? 'icon_down_outlined' : 'icon_down_outlined-1'"></Icon>
|
|
||||||
</el-icon>
|
|
||||||
</span>
|
|
||||||
<template v-if="showSSH">
|
|
||||||
<el-row :gutter="24" v-if="nodeInfo.configuration.useSSH">
|
|
||||||
<el-col :span="12">
|
|
||||||
<BaseInfoItem label="主机">{{ nodeInfo.configuration.sshHost }}</BaseInfoItem>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<BaseInfoItem label="端口">{{ nodeInfo.configuration.sshPort }}</BaseInfoItem>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="24" v-if="nodeInfo.configuration.useSSH">
|
|
||||||
<el-col :span="12">
|
|
||||||
<BaseInfoItem label="用户名">{{
|
|
||||||
nodeInfo.configuration.sshUserName
|
|
||||||
}}</BaseInfoItem>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</BaseInfoContent>
|
</BaseInfoContent>
|
||||||
|
Loading…
Reference in New Issue
Block a user