Files
daohangye/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/index.vue
T
Sun 4c1d67b513 更新 1.3.0-beta24-01-09
Squashed commit of the following:

commit 53d1f382c5
Author: Sun <95302870@qq.com>
Date:   Tue Jan 9 11:54:33 2024 +0800

    系统状态标题加上阴影,beta版本最终优化

commit fc56328765
Author: Sun <95302870@qq.com>
Date:   Mon Jan 8 22:37:24 2024 +0800

    磁盘监控增加表单验证

commit 3905717d42
Author: Sun <95302870@qq.com>
Date:   Mon Jan 8 22:36:10 2024 +0800

    删除无用文件

commit 89b6b63310
Author: Sun <95302870@qq.com>
Date:   Mon Jan 8 21:10:10 2024 +0800

    修改翻译文件为json格式(为了方便引用插件)优化过期登录弹窗多个的问题

commit 2efb31571e
Author: Sun <95302870@qq.com>
Date:   Mon Jan 8 13:56:57 2024 +0800

    增加vscode工作区文件

commit bc79b661db
Author: Sun <95302870@qq.com>
Date:   Mon Jan 8 13:56:45 2024 +0800

    暂时解决依赖循环的问题

commit a24520f808
Author: Sun <95302870@qq.com>
Date:   Sun Jan 7 20:07:52 2024 +0800

    修改设置里面壁纸提示词错误的问题修改首页默认标题

commit 394c6ce20c
Author: Sun <95302870@qq.com>
Date:   Sun Jan 7 14:53:53 2024 +0800

    适配多语言
    Squashed commit of the following:

    commit 632f86c0228c68391c01865c7576f3aa0408c102
    Author: Sun <95302870@qq.com>
    Date:   Sun Jan 7 14:47:55 2024 +0800

        退出的时候清除appstore

    commit b9d805e49a3c6b2ad38bc8d527cb12cc8709012e
    Author: Sun <95302870@qq.com>
    Date:   Sun Jan 7 13:55:20 2024 +0800

        系统状态监控适配国际化

    commit daece99723ec96d210241d2ca4e5a85dc5ae69bd
    Author: Sun <95302870@qq.com>
    Date:   Sun Jan 7 13:09:46 2024 +0800

        适配添加项目页面的国际化配置还有时钟的星期*

    commit 8ea2b2fe951f6266415c96a197cb8d00faef4058
    Author: Sun <95302870@qq.com>
    Date:   Sun Jan 7 12:01:55 2024 +0800

        完成适配所有apps国际化

    commit 21ef54e0d4afb10f560c8cb7aff666374afe0f87
    Author: Sun <95302870@qq.com>
    Date:   Sat Jan 6 21:36:07 2024 +0800

        增加读取默认浏览器语言

    commit 6f710bbebe63ab2800193f27c71e5c0034f11978
    Author: Sun <95302870@qq.com>
    Date:   Sat Jan 6 21:09:58 2024 +0800

        登录页面增加语言选择选项

    commit cb7c4a89a160ed3ef91ad566ec98e75325e7601f
    Author: Sun <95302870@qq.com>
    Date:   Sat Jan 6 20:37:16 2024 +0800

        首次尝试增加英文语言,并在我的信息设置

    commit fb996e17cd11611d30c0e12feee00ddf7b225e32
    Author: Sun <95302870@qq.com>
    Date:   Sat Jan 6 18:22:40 2024 +0800

        完成基础设置页面的语言国际化适配

commit ffc378a38f
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 17:35:13 2024 +0800

    增加完善基本配置中的系统状态开关

commit c91eaf3e94
Merge: 7ebe358 a60f72c
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 12:57:05 2024 +0800

    Merge branch 'feature/monitor2' into dev

commit 7ebe35856e
Merge: d3e3cf5 779712a
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 12:56:15 2024 +0800

    Merge branch 'feature/footer' into dev

commit a60f72c277
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 12:55:04 2024 +0800

    优化了首页

commit 899c945fff
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 12:54:19 2024 +0800

    完成系统监控

commit cdf16277ff
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 12:41:38 2024 +0800

    增加删除功能

commit 128af005eb
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 11:56:32 2024 +0800

    完成排序保存功能

commit 3f4b3c67f2
Author: Sun <95302870@qq.com>
Date:   Sat Jan 6 11:46:59 2024 +0800

    初步完成了增改查包括磁盘状态

commit a85d90985d
Author: Sun <95302870@qq.com>
Date:   Fri Jan 5 22:19:47 2024 +0800

    增加磁盘信息卡片的适配

commit c955afd861
Author: Sun <95302870@qq.com>
Date:   Fri Jan 5 21:36:38 2024 +0800

    增加获取磁盘挂载点接口

commit 21e8e8f1b8
Author: Sun <95302870@qq.com>
Date:   Fri Jan 5 21:14:57 2024 +0800

    基础完成了增改查cpu和内存状态

commit bdbcd50aa1
Author: Sun <95302870@qq.com>
Date:   Fri Jan 5 14:25:09 2024 +0800

    优化公共入口组件

commit 9735e67a7d
Author: Sun <95302870@qq.com>
Date:   Fri Jan 5 14:01:46 2024 +0800

    适配三个组件

commit 3a82949afc
Author: Sun <95302870@qq.com>
Date:   Fri Jan 5 13:58:58 2024 +0800

    优化组件

commit 0d0421c8eb
Author: Sun <95302870@qq.com>
Date:   Fri Jan 5 13:27:29 2024 +0800

    初步完成了编辑器

commit 1474f796fc
Author: Sun <95302870@qq.com>
Date:   Thu Jan 4 16:22:33 2024 +0800

    完成大图标小图标切换

commit baf64a9272
Author: Sun <95302870@qq.com>
Date:   Thu Jan 4 12:08:39 2024 +0800

    增加获取各项监控的单独api

commit d3e3cf5d58
Author: Sun <95302870@qq.com>
Date:   Wed Jan 3 20:46:58 2024 +0800

    尝试将所有监控放在顶部

commit 8dfec7e4b7
Author: Sun <95302870@qq.com>
Date:   Wed Jan 3 20:02:03 2024 +0800

    完整横条显示并对容量尺寸单位优化自动识别

commit fe967a9314
Author: Sun <95302870@qq.com>
Date:   Wed Jan 3 18:55:39 2024 +0800

    适配显示了cpu、硬盘、内存信息

commit 11ea134be3
Author: Sun <95302870@qq.com>
Date:   Tue Jan 2 23:14:04 2024 +0800

    完成系统监控的基础api接口

commit c447884d77
Author: Sun <95302870@qq.com>
Date:   Tue Jan 2 22:11:34 2024 +0800

    完成基本的系统监控类库

commit 779712a5da
Author: Sun <95302870@qq.com>
Date:   Tue Jan 2 17:14:16 2024 +0800

    增加自定义footer
2024-01-09 14:03:03 +08:00

119 lines
4.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { computed } from 'vue'
import { MonitorType } from '../typings'
import type { CardStyle } from '../typings'
import GenericMonitorCard from '../components/GenericMonitorCard/index.vue'
import CardCPU from './CPU.vue'
import Memory from './Memory.vue'
import Disk from './Disk.vue'
import { SvgIcon } from '@/components/common'
import { PanelPanelConfigStyleEnum } from '@/enums'
interface Prop {
extendParam?: any
iconTextColor?: string
iconTextIconHideTitle: boolean
cardTypeStyle: PanelPanelConfigStyleEnum
monitorType: string
cardStyle: CardStyle
}
const props = withDefaults(defineProps<Prop>(), {})
const iconText = computed(() => {
switch (props.monitorType) {
case MonitorType.cpu:
return 'CPU'
case MonitorType.disk:
return props.extendParam.path
case MonitorType.memory:
return 'RAM'
}
return ''
})
const refreshInterval = 5000
</script>
<template>
<div class="w-full">
<GenericMonitorCard
:icon-text-icon-hide-title="false"
:card-type-style="cardTypeStyle"
:icon-text="iconText"
:icon-text-color="iconTextColor"
:background-color="extendParam.backgroundColor"
class="hover:shadow-[0_0_20px_10px_rgba(0,0,0,0.2)]"
>
<template #icon>
<!-- 图标 -->
<div class="w-[60px] h-[70px]">
<div class="w-[60px] h-full flex items-center justify-center text-white">
<SvgIcon v-if="monitorType === MonitorType.cpu" icon="solar-cpu-bold" :style="{ color: extendParam.color }" style="width:35px;height:35px" />
<SvgIcon v-if="monitorType === MonitorType.memory" icon="material-symbols-memory-alt-rounded" :style="{ color: extendParam.color }" style="width:35px;height:35px" />
<SvgIcon v-if="monitorType === MonitorType.disk" icon="clarity-hard-disk-solid" :style="{ color: extendParam.color }" style="width:35px;height:35px" />
</div>
</div>
</template>
<template #info>
<!-- 如果为纯白色将自动根据背景的明暗计算字体的黑白色 -->
<div
class=" w-full text-white flex items-center"
>
<CardCPU
v-if="monitorType === MonitorType.cpu"
:card-type-style="PanelPanelConfigStyleEnum.info"
:progress-color="extendParam?.progressColor"
:progress-rail-color="extendParam?.progressRailColor"
:text-color="extendParam?.color"
:refresh-interval="refreshInterval"
/>
<Memory
v-else-if="monitorType === MonitorType.memory"
:card-type-style="PanelPanelConfigStyleEnum.info"
:progress-color="extendParam?.progressColor"
:progress-rail-color="extendParam?.progressRailColor"
:text-color="extendParam?.color"
:refresh-interval="refreshInterval"
/>
<Disk
v-else-if="monitorType === MonitorType.disk"
:card-type-style="PanelPanelConfigStyleEnum.info"
:progress-color="extendParam?.progressColor"
:progress-rail-color="extendParam?.progressRailColor"
:text-color="extendParam?.color"
:path="extendParam?.path"
:refresh-interval="refreshInterval"
/>
</div>
</template>
<template #small>
<CardCPU
v-if="monitorType === MonitorType.cpu"
:card-type-style="PanelPanelConfigStyleEnum.icon"
:progress-color="extendParam?.progressColor"
:progress-rail-color="extendParam?.progressRailColor"
:text-color="extendParam?.color"
:refresh-interval="refreshInterval"
/>
<Memory
v-else-if="monitorType === MonitorType.memory"
:card-type-style="PanelPanelConfigStyleEnum.icon"
:progress-color="extendParam?.progressColor"
:progress-rail-color="extendParam?.progressRailColor"
:text-color="extendParam?.color"
:refresh-interval="refreshInterval"
/>
<Disk
v-else-if="monitorType === MonitorType.disk"
:card-type-style="PanelPanelConfigStyleEnum.icon"
:progress-color="extendParam?.progressColor"
:progress-rail-color="extendParam?.progressRailColor"
:text-color="extendParam?.color"
:path="extendParam?.path"
:refresh-interval="refreshInterval"
/>
</template>
</GenericMonitorCard>
</div>
</template>