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