4c1d67b513
Squashed commit of the following: commit53d1f382c5Author: Sun <95302870@qq.com> Date: Tue Jan 9 11:54:33 2024 +0800 系统状态标题加上阴影,beta版本最终优化 commitfc56328765Author: Sun <95302870@qq.com> Date: Mon Jan 8 22:37:24 2024 +0800 磁盘监控增加表单验证 commit3905717d42Author: Sun <95302870@qq.com> Date: Mon Jan 8 22:36:10 2024 +0800 删除无用文件 commit89b6b63310Author: Sun <95302870@qq.com> Date: Mon Jan 8 21:10:10 2024 +0800 修改翻译文件为json格式(为了方便引用插件)优化过期登录弹窗多个的问题 commit2efb31571eAuthor: Sun <95302870@qq.com> Date: Mon Jan 8 13:56:57 2024 +0800 增加vscode工作区文件 commitbc79b661dbAuthor: Sun <95302870@qq.com> Date: Mon Jan 8 13:56:45 2024 +0800 暂时解决依赖循环的问题 commita24520f808Author: Sun <95302870@qq.com> Date: Sun Jan 7 20:07:52 2024 +0800 修改设置里面壁纸提示词错误的问题修改首页默认标题 commit394c6ce20cAuthor: 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 完成基础设置页面的语言国际化适配 commitffc378a38fAuthor: Sun <95302870@qq.com> Date: Sat Jan 6 17:35:13 2024 +0800 增加完善基本配置中的系统状态开关 commitc91eaf3e94Merge:7ebe358a60f72cAuthor: Sun <95302870@qq.com> Date: Sat Jan 6 12:57:05 2024 +0800 Merge branch 'feature/monitor2' into dev commit7ebe35856eMerge:d3e3cf5779712aAuthor: Sun <95302870@qq.com> Date: Sat Jan 6 12:56:15 2024 +0800 Merge branch 'feature/footer' into dev commita60f72c277Author: Sun <95302870@qq.com> Date: Sat Jan 6 12:55:04 2024 +0800 优化了首页 commit899c945fffAuthor: Sun <95302870@qq.com> Date: Sat Jan 6 12:54:19 2024 +0800 完成系统监控 commitcdf16277ffAuthor: Sun <95302870@qq.com> Date: Sat Jan 6 12:41:38 2024 +0800 增加删除功能 commit128af005ebAuthor: Sun <95302870@qq.com> Date: Sat Jan 6 11:56:32 2024 +0800 完成排序保存功能 commit3f4b3c67f2Author: Sun <95302870@qq.com> Date: Sat Jan 6 11:46:59 2024 +0800 初步完成了增改查包括磁盘状态 commita85d90985dAuthor: Sun <95302870@qq.com> Date: Fri Jan 5 22:19:47 2024 +0800 增加磁盘信息卡片的适配 commitc955afd861Author: Sun <95302870@qq.com> Date: Fri Jan 5 21:36:38 2024 +0800 增加获取磁盘挂载点接口 commit21e8e8f1b8Author: Sun <95302870@qq.com> Date: Fri Jan 5 21:14:57 2024 +0800 基础完成了增改查cpu和内存状态 commitbdbcd50aa1Author: Sun <95302870@qq.com> Date: Fri Jan 5 14:25:09 2024 +0800 优化公共入口组件 commit9735e67a7dAuthor: Sun <95302870@qq.com> Date: Fri Jan 5 14:01:46 2024 +0800 适配三个组件 commit3a82949afcAuthor: Sun <95302870@qq.com> Date: Fri Jan 5 13:58:58 2024 +0800 优化组件 commit0d0421c8ebAuthor: Sun <95302870@qq.com> Date: Fri Jan 5 13:27:29 2024 +0800 初步完成了编辑器 commit1474f796fcAuthor: Sun <95302870@qq.com> Date: Thu Jan 4 16:22:33 2024 +0800 完成大图标小图标切换 commitbaf64a9272Author: Sun <95302870@qq.com> Date: Thu Jan 4 12:08:39 2024 +0800 增加获取各项监控的单独api commitd3e3cf5d58Author: Sun <95302870@qq.com> Date: Wed Jan 3 20:46:58 2024 +0800 尝试将所有监控放在顶部 commit8dfec7e4b7Author: Sun <95302870@qq.com> Date: Wed Jan 3 20:02:03 2024 +0800 完整横条显示并对容量尺寸单位优化自动识别 commitfe967a9314Author: Sun <95302870@qq.com> Date: Wed Jan 3 18:55:39 2024 +0800 适配显示了cpu、硬盘、内存信息 commit11ea134be3Author: Sun <95302870@qq.com> Date: Tue Jan 2 23:14:04 2024 +0800 完成系统监控的基础api接口 commitc447884d77Author: Sun <95302870@qq.com> Date: Tue Jan 2 22:11:34 2024 +0800 完成基本的系统监控类库 commit779712a5daAuthor: Sun <95302870@qq.com> Date: Tue Jan 2 17:14:16 2024 +0800 增加自定义footer
119 lines
4.4 KiB
Vue
119 lines
4.4 KiB
Vue
<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>
|