diff --git a/src/utils/host.js b/src/utils/host.js index f76231e..1a7f478 100644 --- a/src/utils/host.js +++ b/src/utils/host.js @@ -212,8 +212,13 @@ export function getPlatformLogoIconClassName(platform) { /** * 获取系统发行版本 */ -export function getSystemOSLabel(platform) { - switch (platform) { +export function getSystemOSLabel(platform, short = false) { + const platformStr = (platform || '').toLowerCase(); + // 匹配一些超长系统发行版本 + if (short && platformStr.includes('windows')) { + return 'Windows'; + } + switch (platformStr) { case 'windows': return 'Windows'; case 'linux': diff --git a/src/views/components/server-list/row/server-list-item.vue b/src/views/components/server-list/row/server-list-item.vue index 4c8e85c..3f198ac 100644 --- a/src/views/components/server-list/row/server-list-item.vue +++ b/src/views/components/server-list/row/server-list-item.vue @@ -92,7 +92,7 @@ const { cpuAndMemAndDisk } = handleServerInfo({ props, }); -const platformSystemLabel = computed(() => hostUtils.getSystemOSLabel(props.info?.Host?.Platform)); +const platformSystemLabel = computed(() => hostUtils.getSystemOSLabel(props.info?.Host?.Platform, true)); function openDetail() { router.push({