💄 连接日志表格样式更新.

This commit is contained in:
lijiahangmax
2024-03-03 23:28:17 +08:00
parent b424dd02db
commit 0f9c3db9cc
4 changed files with 31 additions and 36 deletions

View File

@@ -1,6 +1,6 @@
<template> <template>
<a-layout-footer class="footer"> <a-layout-footer class="footer">
<a-space direction="vertical" size="medium"> <a-space direction="vertical" size="small">
<a-space size="large"> <a-space size="large">
<!-- <a-link target="_blank" href="https://github.com/lijiahangmax/orion-ops-pro">官网</a-link> --> <!-- <a-link target="_blank" href="https://github.com/lijiahangmax/orion-ops-pro">官网</a-link> -->
<!-- <a-link target="_blank" href="https://github.com/lijiahangmax/orion-ops-pro">教程</a-link> --> <!-- <a-link target="_blank" href="https://github.com/lijiahangmax/orion-ops-pro">教程</a-link> -->

View File

@@ -5,7 +5,7 @@
label-align="left" label-align="left"
:itemOptions="{ 6: { span: 2 } }" :itemOptions="{ 6: { span: 2 } }"
@submit="fetchTableData" @submit="fetchTableData"
@reset="resetTableData" @reset="fetchTableData"
@keyup.enter="() => fetchTableData()"> @keyup.enter="() => fetchTableData()">
<!-- 连接用户 --> <!-- 连接用户 -->
<a-form-item field="userId" label="连接用户" label-col-flex="50px"> <a-form-item field="userId" label="连接用户" label-col-flex="50px">
@@ -58,7 +58,7 @@
<div class="table-left-bar-handle"> <div class="table-left-bar-handle">
<!-- 标题 --> <!-- 标题 -->
<div class="table-title"> <div class="table-title">
主机连接日志 - 用户 主机连接日志
</div> </div>
</div> </div>
<!-- 右侧操作 --> <!-- 右侧操作 -->
@@ -78,18 +78,20 @@
:bordered="false"> :bordered="false">
<!-- 连接用户 --> <!-- 连接用户 -->
<template #username="{ record }"> <template #username="{ record }">
{{ record.userId }} - {{ record.username }} {{ record.username }}
</template> </template>
<!-- 连接主机 --> <!-- 连接主机 -->
<template #hostName="{ record }"> <template #hostName="{ record }">
{{ record.hostId }} - {{ record.hostName }} <span class="host-name" :title="record.hostName">
</template> {{ record.hostName }}
<!-- 主机地址 --> </span>
<template #hostAddress="{ record }"> <br>
<span class="copy-left" title="复制" @click="copy(record.hostAddress)"> <span class="copy-left" title="复制" @click="copy(record.hostAddress)">
<icon-copy /> <icon-copy />
</span> </span>
<span>{{ record.hostAddress }}</span> <span class="host-address">
{{ record.hostAddress }}
</span>
</template> </template>
<!-- 状态 --> <!-- 状态 -->
<template #status="{ record }"> <template #status="{ record }">
@@ -134,7 +136,7 @@
userId: undefined, userId: undefined,
hostId: undefined, hostId: undefined,
hostAddress: undefined, hostAddress: undefined,
type: HostConnectType.SSH, type: undefined,
token: undefined, token: undefined,
status: undefined, status: undefined,
startTimeRange: undefined, startTimeRange: undefined,
@@ -155,12 +157,6 @@
} }
}; };
// 重置
const resetTableData = (page = 1, limit = pagination.pageSize, form = formModel) => {
formModel.type = HostConnectType.SSH;
doFetchTableData({ page, limit, ...form });
};
// 切换页码 // 切换页码
const fetchTableData = (page = 1, limit = pagination.pageSize, form = formModel) => { const fetchTableData = (page = 1, limit = pagination.pageSize, form = formModel) => {
doFetchTableData({ page, limit, ...form }); doFetchTableData({ page, limit, ...form });
@@ -173,5 +169,13 @@
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.host-name {
color: var(--color-text-2);
}
.host-address {
margin-top: 4px;
display: inline-block;
color: var(--color-text-3);
}
</style> </style>

View File

@@ -13,6 +13,7 @@ const columns = [
title: '连接用户', title: '连接用户',
dataIndex: 'username', dataIndex: 'username',
slotName: 'username', slotName: 'username',
width: 180,
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
tooltip: true, tooltip: true,
@@ -22,45 +23,35 @@ const columns = [
slotName: 'hostName', slotName: 'hostName',
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
tooltip: true,
}, {
title: '主机地址',
dataIndex: 'hostAddress',
slotName: 'hostAddress',
align: 'left',
ellipsis: true,
tooltip: true,
}, { }, {
title: '类型', title: '类型',
dataIndex: 'type', dataIndex: 'type',
slotName: 'type', slotName: 'type',
width: 68, width: 74,
align: 'left', align: 'left',
}, { }, {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
slotName: 'status', slotName: 'status',
align: 'left', align: 'left',
width: 90, width: 96,
}, {
title: 'token',
dataIndex: 'token',
slotName: 'token',
align: 'left',
width: 120,
ellipsis: true,
tooltip: true,
}, { }, {
title: '连接时间', title: '连接时间',
dataIndex: 'connectTime', dataIndex: 'connectTime',
slotName: 'connectTime', slotName: 'connectTime',
align: 'left', align: 'left',
width: 310, width: 318,
render: ({ record }) => { render: ({ record }) => {
return (record.startTime && dateFormat(new Date(record.startTime))) return (record.startTime && dateFormat(new Date(record.startTime)))
+ ' - ' + ' - '
+ (record.endTime && dateFormat(new Date(record.endTime)) || '现在'); + (record.endTime && dateFormat(new Date(record.endTime)) || '现在');
}, },
}, {
title: '操作',
slotName: 'handle',
width: 180,
align: 'center',
fixed: 'right',
}, },
] as TableColumnData[]; ] as TableColumnData[];

View File

@@ -49,7 +49,7 @@ const columns = [
}, { }, {
title: '操作', title: '操作',
slotName: 'handle', slotName: 'handle',
width: 162, width: 168,
fixed: 'right', fixed: 'right',
} }
] as TableColumnData[]; ] as TableColumnData[];