⚡ 优化连接逻辑.
This commit is contained in:
@@ -188,9 +188,7 @@
|
|||||||
:wrap="true">
|
:wrap="true">
|
||||||
<template v-for="groupId in record.groupIdList"
|
<template v-for="groupId in record.groupIdList"
|
||||||
:key="groupId">
|
:key="groupId">
|
||||||
<a-tag color="green">
|
<a-tag>{{ hostGroupList.find(s => s.key === groupId)?.title || groupId }}</a-tag>
|
||||||
{{ hostGroupList.find(s => s.key === groupId)?.title || groupId }}
|
|
||||||
</a-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -244,11 +242,11 @@
|
|||||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SSH' } })">
|
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SSH' } })">
|
||||||
<span class="more-doption normal">SSH</span>
|
<span class="more-doption normal">SSH</span>
|
||||||
</a-doption>
|
</a-doption>
|
||||||
<!-- SFTP -->
|
<!-- RDP -->
|
||||||
<a-doption v-if="record.types.includes(HostType.SSH.value)"
|
<a-doption v-if="record.types.includes(HostType.RDP.value)"
|
||||||
v-permission="['asset:terminal:access']"
|
v-permission="['asset:terminal:access']"
|
||||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SFTP' } })">
|
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'RDP' } })">
|
||||||
<span class="more-doption normal">SFTP</span>
|
<span class="more-doption normal">RDP</span>
|
||||||
</a-doption>
|
</a-doption>
|
||||||
</template>
|
</template>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
|
|||||||
@@ -233,9 +233,7 @@
|
|||||||
:wrap="true">
|
:wrap="true">
|
||||||
<template v-for="groupId in record.groupIdList"
|
<template v-for="groupId in record.groupIdList"
|
||||||
:key="groupId">
|
:key="groupId">
|
||||||
<a-tag color="green">
|
<a-tag>{{ hostGroupList.find(s => s.key === groupId)?.title || groupId }}</a-tag>
|
||||||
{{ hostGroupList.find(s => s.key === groupId)?.title || groupId }}
|
|
||||||
</a-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -255,6 +253,41 @@
|
|||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
<template #handle="{ record }">
|
<template #handle="{ record }">
|
||||||
<div class="table-handle-wrapper row-handle-wrapper">
|
<div class="table-handle-wrapper row-handle-wrapper">
|
||||||
|
<!-- 单协议连接 -->
|
||||||
|
<a-button v-if="record.types?.length === 1"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
v-permission="['asset:terminal:access']"
|
||||||
|
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: record.types[0] } })">
|
||||||
|
连接
|
||||||
|
</a-button>
|
||||||
|
<!-- 多协议连接 -->
|
||||||
|
<a-popover v-else-if="(record.types?.length || 0) > 1"
|
||||||
|
v-permission="['asset:terminal:access']"
|
||||||
|
:title="undefined"
|
||||||
|
:content-style="{ padding: '8px' }">
|
||||||
|
<a-button type="text" size="mini">
|
||||||
|
连接
|
||||||
|
</a-button>
|
||||||
|
<template #content>
|
||||||
|
<a-space>
|
||||||
|
<!-- SSH -->
|
||||||
|
<a-button v-if="record.types.includes(HostType.SSH.value)"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: record.types[0] } })">
|
||||||
|
SSH
|
||||||
|
</a-button>
|
||||||
|
<!-- RDP -->
|
||||||
|
<a-button v-if="record.types.includes(HostType.RDP.value)"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'RDP' } })">
|
||||||
|
RDP
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</a-popover>
|
||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
<a-button type="text"
|
<a-button type="text"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -293,18 +326,6 @@
|
|||||||
@click="emits('openCopy', record)">
|
@click="emits('openCopy', record)">
|
||||||
<span class="more-doption normal">复制</span>
|
<span class="more-doption normal">复制</span>
|
||||||
</a-doption>
|
</a-doption>
|
||||||
<!-- SSH -->
|
|
||||||
<a-doption v-if="record.types.includes(HostType.SSH.value)"
|
|
||||||
v-permission="['asset:terminal:access']"
|
|
||||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SSH' } })">
|
|
||||||
<span class="more-doption normal">SSH</span>
|
|
||||||
</a-doption>
|
|
||||||
<!-- SFTP -->
|
|
||||||
<a-doption v-if="record.types.includes(HostType.SSH.value)"
|
|
||||||
v-permission="['asset:terminal:access']"
|
|
||||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SFTP' } })">
|
|
||||||
<span class="more-doption normal">SFTP</span>
|
|
||||||
</a-doption>
|
|
||||||
</template>
|
</template>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ export const HostType = {
|
|||||||
value: 'SSH',
|
value: 'SSH',
|
||||||
port: 22,
|
port: 22,
|
||||||
},
|
},
|
||||||
|
RDP: {
|
||||||
|
value: 'RDP',
|
||||||
|
port: 3389,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 系统类型
|
// 系统类型
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const columns = [
|
|||||||
}, {
|
}, {
|
||||||
title: '操作',
|
title: '操作',
|
||||||
slotName: 'handle',
|
slotName: 'handle',
|
||||||
width: 162,
|
width: 198,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
default: true,
|
default: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user