匹配一些超长系统发行版本,比如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) {
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':

View File

@ -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({