匹配一些超长系统发行版本,比如Windows的server版本

This commit is contained in:
hi2hi 2024-12-30 14:29:25 +00:00
parent bdbd083d45
commit 786d6c0a87
2 changed files with 8 additions and 3 deletions

View File

@ -212,8 +212,13 @@ export function getPlatformLogoIconClassName(platform) {
/** /**
* 获取系统发行版本 * 获取系统发行版本
*/ */
export function getSystemOSLabel(platform) { export function getSystemOSLabel(platform, short = false) {
switch (platform) { const platformStr = (platform || '').toLowerCase();
// 匹配一些超长系统发行版本
if (short && platformStr.includes('windows')) {
return 'Windows';
}
switch (platformStr) {
case 'windows': case 'windows':
return 'Windows'; return 'Windows';
case 'linux': case 'linux':

View File

@ -92,7 +92,7 @@ const { cpuAndMemAndDisk } = handleServerInfo({
props, props,
}); });
const platformSystemLabel = computed(() => hostUtils.getSystemOSLabel(props.info?.Host?.Platform)); const platformSystemLabel = computed(() => hostUtils.getSystemOSLabel(props.info?.Host?.Platform, true));
function openDetail() { function openDetail() {
router.push({ router.push({