mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-12 07:10:43 +08:00
🪄 单独处理darwin系统、windows系统的LOGO
This commit is contained in:
parent
8e6489ba5c
commit
6558f2ffe9
@ -192,6 +192,23 @@ export function calcTransfer(bytes) {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function getPlatformLogoIconClassName(platform) {
|
||||
const platformStr = (platform || '').toLowerCase();
|
||||
if (platformStr.includes('windows') || platformStr.includes('microsoft')) {
|
||||
return 'ri-microsoft-fill';
|
||||
}
|
||||
switch (platformStr) {
|
||||
case 'darwin':
|
||||
case 'macos':
|
||||
return 'fl-apple';
|
||||
default:
|
||||
}
|
||||
if (platform) {
|
||||
return `fl-${platform}`;
|
||||
}
|
||||
return 'ri-server-line';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统发行版本
|
||||
*/
|
||||
|
||||
@ -21,12 +21,9 @@
|
||||
class="cpu-mem-group"
|
||||
>
|
||||
<span
|
||||
v-if="info?.Host?.Platform"
|
||||
class="system-os-icon"
|
||||
>
|
||||
<span
|
||||
:class="'fl-' + info?.Host?.Platform"
|
||||
/>
|
||||
<span :class="platformLogoIconClassName" />
|
||||
</span>
|
||||
<span class="core-mem">{{ cpuAndMemAndDisk }}</span>
|
||||
</span>
|
||||
@ -91,6 +88,7 @@ const { cpuAndMemAndDisk } = handleServerInfo({
|
||||
|
||||
const slogan = computed(() => props.info?.PublicNote?.customData?.slogan);
|
||||
const cpuInfo = computed(() => hostUtils.getCPUInfo(props.info?.Host?.CPU?.[0]));
|
||||
const platformLogoIconClassName = computed(() => hostUtils.getPlatformLogoIconClassName(props.info?.Host?.Platform));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -18,10 +18,7 @@
|
||||
<span
|
||||
class="server-flag"
|
||||
>
|
||||
<span
|
||||
class="fi"
|
||||
:class="'fi-' + (info?.Host?.CountryCode || 'un')"
|
||||
/>
|
||||
<span :class="platformLogoIconClassName" />
|
||||
</span>
|
||||
<span class="server-name">
|
||||
{{ info.Name }}
|
||||
@ -66,9 +63,13 @@
|
||||
* 单节点
|
||||
*/
|
||||
|
||||
import {
|
||||
computed,
|
||||
} from 'vue';
|
||||
import {
|
||||
useRouter,
|
||||
} from 'vue-router';
|
||||
import * as hostUtils from '@/utils/host';
|
||||
|
||||
import handleServerInfo from '@/views/composable/server-info';
|
||||
import ServerRealTime from '@/views/components/server/server-real-time.vue';
|
||||
@ -91,6 +92,8 @@ const { cpuAndMemAndDisk } = handleServerInfo({
|
||||
props,
|
||||
});
|
||||
|
||||
const platformLogoIconClassName = computed(() => hostUtils.getPlatformLogoIconClassName(props.info?.Host?.Platform));
|
||||
|
||||
function openDetail() {
|
||||
router.push({
|
||||
name: 'ServerDetail',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user