📝 修改密钥.

This commit is contained in:
lijiahang
2024-05-17 12:26:01 +08:00
parent c85ab97cc5
commit a9dd8f2f36
75 changed files with 163 additions and 163 deletions

View File

@@ -23,15 +23,15 @@
{{ getDictValue(identityTypeKey, record.type) }}
</a-tag>
</template>
<!-- 钥名称 -->
<!-- 钥名称 -->
<template #keyId="{ record }">
<!-- -->
<!-- -->
<template v-if="record.keyId && record.type === 'KEY'">
<a-tag color="arcoblue" v-if="record.keyId">
{{ hostKeys.find(s => s.id === record.keyId)?.name }}
</a-tag>
</template>
<!-- -->
<!-- -->
<template v-else>
<span>-</span>
</template>
@@ -137,9 +137,9 @@
}
});
// 初始化钥数据
// 初始化钥数据
onMounted(async () => {
// 加载主机
// 加载主机
hostKeys.value = await cacheStore.loadHostKeys();
});

View File

@@ -5,7 +5,7 @@
@grant="doGrant"
@select-all="selectAll"
@reverse="reverseSelect">
<!-- 主机钥表格 -->
<!-- 主机钥表格 -->
<a-table row-key="id"
class="host-key-main-table"
:columns="hostKeyColumns"

View File

@@ -11,9 +11,9 @@ export const GrantKey = {
HOST_GROUP_ROLE: 1,
// 主机分组-用户
HOST_GROUP_USER: 2,
// 主机钥-角色
// 主机钥-角色
HOST_KEY_ROLE: 3,
// 主机钥-用户
// 主机钥-用户
HOST_KEY_USER: 4,
// 主机身份-角色
HOST_IDENTITY_ROLE: 5,
@@ -46,14 +46,14 @@ export const GrantTabs = [
}, {
key: GrantKey.HOST_KEY_ROLE,
permission: ['asset:host-key:grant'],
title: '主机钥授权 - 角色',
title: '主机钥授权 - 角色',
icon: 'icon-lock',
type: GrantType.ROLE,
component: HostKeyGrant
}, {
key: GrantKey.HOST_KEY_USER,
permission: ['asset:host-key:grant'],
title: '主机钥授权 - 用户',
title: '主机钥授权 - 用户',
icon: 'icon-lock',
type: GrantType.USER,
component: HostKeyGrant

View File

@@ -1,7 +1,7 @@
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
import { dateFormat } from '@/utils';
// 主机钥列
// 主机钥列
export const hostKeyColumns = [
{
title: 'id',
@@ -64,7 +64,7 @@ export const hostIdentityColumns = [
ellipsis: true,
tooltip: true
}, {
title: '主机钥',
title: '主机钥',
dataIndex: 'keyId',
slotName: 'keyId',
}, {

View File

@@ -64,8 +64,8 @@
<a-form-item field="username" label="用户名">
<a-input v-model="formModel.username" placeholder="请输入用户名" allow-clear />
</a-form-item>
<!-- -->
<a-form-item field="keyId" label="钥">
<!-- -->
<a-form-item field="keyId" label="钥">
<host-key-selector v-model="formModel.keyId" allow-clear />
</a-form-item>
</a-form>
@@ -86,9 +86,9 @@
{{ record.username }}
</span>
</template>
<!-- 钥名称 -->
<!-- 钥名称 -->
<template #keyId="{ record }">
<!-- -->
<!-- -->
<template v-if="record.keyId && record.type === IdentityType.KEY">
<!-- 可查看详情 -->
<a-tooltip v-if="hasAnyPermission(['asset:host-key:detail', 'asset:host-key:update'])"
@@ -104,7 +104,7 @@
{{ record.keyName }}
</a-tag>
</template>
<!-- -->
<!-- -->
<template v-else>
<span>-</span>
</template>

View File

@@ -49,10 +49,10 @@
checked-text="使用新密码"
unchecked-text="使用原密码" />
</a-form-item>
<!-- 主机 -->
<!-- 主机 -->
<a-form-item v-if="formModel.type === IdentityType.KEY"
field="keyId"
label="主机钥">
label="主机钥">
<host-key-selector v-model="formModel.keyId" />
</a-form-item>
</a-form>

View File

@@ -28,8 +28,8 @@
<a-form-item field="username" label="用户名">
<a-input v-model="formModel.username" placeholder="请输入用户名" allow-clear />
</a-form-item>
<!-- 主机 -->
<a-form-item field="keyId" label="主机钥">
<!-- 主机 -->
<a-form-item field="keyId" label="主机钥">
<host-key-selector v-model="formModel.keyId" allow-clear />
</a-form-item>
</query-header>
@@ -99,9 +99,9 @@
{{ record.username }}
</span>
</template>
<!-- 钥名称 -->
<!-- 钥名称 -->
<template #keyId="{ record }">
<!-- 有钥 -->
<!-- 有钥 -->
<template v-if="record.keyId && record.type === IdentityType.KEY">
<!-- 可查看详情 -->
<a-tooltip v-if="hasAnyPermission(['asset:host-key:detail', 'asset:host-key:update'])"
@@ -117,7 +117,7 @@
{{ record.keyName }}
</a-tag>
</template>
<!-- 无钥 -->
<!-- 无钥 -->
<template v-else>
<span>-</span>
</template>

View File

@@ -16,7 +16,7 @@
<host-identity-form-modal ref="modal"
@added="modalAddCallback"
@updated="modalUpdateCallback" />
<!-- 主机钥抽屉 -->
<!-- 主机钥抽屉 -->
<host-key-form-drawer ref="keyDrawer" />
</div>
</template>

View File

@@ -19,7 +19,7 @@ const fieldConfig = {
slotName: 'username',
ellipsis: true,
}, {
label: '主机钥',
label: '主机钥',
dataIndex: 'keyId',
slotName: 'keyId',
height: '24px',

View File

@@ -15,7 +15,7 @@ export const type = [{
export const keyId = [{
required: true,
message: '请选择钥'
message: '请选择钥'
}] as FieldRule[];
export const username = [{

View File

@@ -25,7 +25,7 @@ const columns = [
dataIndex: 'username',
slotName: 'username',
}, {
title: '主机钥',
title: '主机钥',
dataIndex: 'keyId',
slotName: 'keyId',
}, {

View File

@@ -10,7 +10,7 @@
@cancel="handleClose">
<a-spin class="full modal-form-small" :loading="loading">
<a-alert class="keygen-alert">
请使用 ssh-keygen -m PEM -t rsa 生成
请使用 ssh-keygen -m PEM -t rsa 生成
</a-alert>
<a-form :model="formModel"
ref="formRef"
@@ -119,7 +119,7 @@
// 打开新增
const openAdd = () => {
title.value = '添加主机钥';
title.value = '添加主机钥';
isAddHandle.value = true;
isViewHandler.value = false;
renderForm({ ...defaultForm() });
@@ -128,7 +128,7 @@
// 打开修改
const openUpdate = async (record: any) => {
title.value = '修改主机钥';
title.value = '修改主机钥';
isAddHandle.value = false;
isViewHandler.value = false;
await render(record.id);
@@ -136,7 +136,7 @@
// 打开查看
const openView = async (record: any) => {
title.value = '主机钥';
title.value = '主机钥';
isAddHandle.value = false;
isViewHandler.value = true;
await render(record.id);

View File

@@ -26,7 +26,7 @@
<div class="table-left-bar-handle">
<!-- 标题 -->
<div class="table-title">
钥列表
钥列表
</div>
</div>
<!-- 右侧操作 -->

View File

@@ -69,10 +69,10 @@
checked-text="使用新密码"
unchecked-text="使用原密码" />
</a-form-item>
<!-- 主机钥 -->
<!-- 主机钥 -->
<a-form-item v-if="SshAuthType.KEY === formModel.authType"
field="keyId"
label="主机"
label="主机"
:hide-asterisk="true">
<host-key-selector v-model="formModel.keyId" />
</a-form-item>

View File

@@ -19,7 +19,7 @@ export interface HostSshConfig {
export const SshAuthType = {
// 密码验证
PASSWORD: 'PASSWORD',
// 钥验证
// 钥验证
KEY: 'KEY',
// 身份验证
IDENTITY: 'IDENTITY'

View File

@@ -22,7 +22,7 @@ export const authType = [{
export const keyId = [{
required: true,
message: '请选择主机钥'
message: '请选择主机钥'
}] as FieldRule[];
export const identityId = [{