feat:仪表盘不活跃时不刷新 && 网盘整理联动刮削

This commit is contained in:
jxxghp
2024-06-24 09:13:22 +08:00
parent 8efeb77102
commit 6fad85e957
8 changed files with 71 additions and 7 deletions

View File

@@ -4,6 +4,15 @@ import { useTheme } from 'vuetify'
import { hexToRgb } from '@layouts/utils'
import api from '@/api'
// 输入参数
const props = defineProps({
// 是否允许刷新数据
allowRefresh: {
type: Boolean,
default: true,
},
})
const vuetifyTheme = useTheme()
const currentTheme = controlledComputed(
@@ -94,6 +103,7 @@ const chartOptions = controlledComputed(
// 调用API接口获取最新CPU使用率
async function getCpuUsage() {
if (!props.allowRefresh) return
try {
// 请求数据
current.value = (await api.get('dashboard/cpu')) ?? 0