fix(monitor): 缩短过长操作系统名称显示

在在线用户和登录日志的表格列以及登录详情弹窗中,当操作系统字段包含“ or ”(如“Windows 10 or Windows Server 2016”)时,仅显示第一部分以优化表格显示宽度。完整的原始信息在详情中仍可查看。
This commit is contained in:
dap
2026-01-23 14:23:28 +08:00
parent 1539932556
commit 682dc9a5d6
3 changed files with 33 additions and 3 deletions

View File

@@ -70,10 +70,20 @@ export const columns: VxeGridProps['columns'] = [
field: 'os',
slots: {
default: ({ row }) => {
/**
* Windows 10 or Windows Server 2016 太长了 分割一下 详情依旧能看到详细的
*/
let value = row.os;
if (value) {
const split = value.split(' or ');
if (split.length === 2) {
value = split[0];
}
}
return (
<div class="flex items-center justify-center gap-[6px]">
{renderOsIcon(row.os, 'shrink-0')}
{row.os}
{value}
</div>
);
},

View File

@@ -31,6 +31,16 @@ const items = computed<DescriptionsProps['items']>(() => {
return [];
}
const data = loginInfo.value;
/**
* Windows 10 or Windows Server 2016 太长了 分割一下 详情依旧能看到详细的
*/
let os = data.os;
if (os) {
const split = os.split(' or ');
if (split.length === 2) {
os = split[0]!;
}
}
return [
{
label: '登录状态',
@@ -66,7 +76,7 @@ const items = computed<DescriptionsProps['items']>(() => {
content: (
<div class="flex items-center justify-center gap-[6px]">
{renderOsIcon(data.os, 'shrink-0')}
{data.os}
{os}
</div>
),
},

View File

@@ -58,10 +58,20 @@ export const columns: VxeGridProps['columns'] = [
field: 'os',
slots: {
default: ({ row }) => {
/**
* Windows 10 or Windows Server 2016 太长了 分割一下 详情依旧能看到详细的
*/
let value = row.os;
if (value) {
const split = value.split(' or ');
if (split.length === 2) {
value = split[0];
}
}
return (
<div class="flex items-center justify-center gap-[6px]">
{renderOsIcon(row.os, 'shrink-0')}
{row.os}
{value}
</div>
);
},