Skip to content

Commit

Permalink
fix ApexCharts
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Jan 19, 2025
1 parent 615ce34 commit d523790
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 57 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@
"workbox-window": "^7.3.0"
},
"packageManager": "[email protected]"
}
}
102 changes: 53 additions & 49 deletions src/components/dialog/SubscribeFilesDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,59 +132,63 @@ onBeforeMount(() => {
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
<VWindowItem value="download">
<transition name="fade-slide" appear>
<VDataTable
items-per-page="50"
:headers="downloadHeaders"
:items="downloadInfos"
:items-length="totalCount"
density="compact"
item-value="title"
return-object
fixed-header
hover
items-per-page-text="每页条数"
page-text="{0}-{1} 共 {2} 条"
loading-text="加载中..."
>
<template #item.episode_number="{ item }">
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
</template>
<template #item.torrent_title="{ item }">
<div class="text-xs" v-for="file in item.download">
【{{ file.site_name }}】{{ file.torrent_title }}
</div>
</template>
<template #item.file_path="{ item }">
<div class="text-xs" v-for="file in item.download">{{ file.file_path }}</div>
</template>
<template #no-data> 没有数据 </template>
</VDataTable>
<div>
<VDataTable
items-per-page="50"
:headers="downloadHeaders"
:items="downloadInfos"
:items-length="totalCount"
density="compact"
item-value="title"
return-object
fixed-header
hover
items-per-page-text="每页条数"
page-text="{0}-{1} 共 {2} 条"
loading-text="加载中..."
>
<template #item.episode_number="{ item }">
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
</template>
<template #item.torrent_title="{ item }">
<div class="text-xs" v-for="file in item.download">
【{{ file.site_name }}】{{ file.torrent_title }}
</div>
</template>
<template #item.file_path="{ item }">
<div class="text-xs" v-for="file in item.download">{{ file.file_path }}</div>
</template>
<template #no-data> 没有数据 </template>
</VDataTable>
</div>
</transition>
</VWindowItem>
<VWindowItem value="library">
<transition name="fade-slide" appear>
<VDataTable
items-per-page="50"
:headers="libraryHeaders"
:items="libraryInfos"
:items-length="totalCount"
density="compact"
item-value="title"
return-object
fixed-header
hover
items-per-page-text="每页条数"
page-text="{0}-{1} 共 {2} 条"
loading-text="加载中..."
>
<template #item.episode_number="{ item }">
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
</template>
<template #item.file_path="{ item }">
<div class="text-xs" v-for="file in item.library">{{ file.file_path }}</div>
</template>
<template #no-data> 没有数据 </template>
</VDataTable>
<div>
<VDataTable
items-per-page="50"
:headers="libraryHeaders"
:items="libraryInfos"
:items-length="totalCount"
density="compact"
item-value="title"
return-object
fixed-header
hover
items-per-page-text="每页条数"
page-text="{0}-{1} 共 {2} 条"
loading-text="加载中..."
>
<template #item.episode_number="{ item }">
<div class="text-high-emphasis pt-1">{{ item.episode_number }}. {{ item.title }}</div>
</template>
<template #item.file_path="{ item }">
<div class="text-xs" v-for="file in item.library">{{ file.file_path }}</div>
</template>
<template #no-data> 没有数据 </template>
</VDataTable>
</div>
</transition>
</VWindowItem>
</VWindow>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/downloading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ onMounted(async () => {
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
<VWindowItem v-for="item in downloaders" :value="item.name">
<transition name="fade-slide" appear>
<DownloadingListView :name="item.name" />
<div>
<DownloadingListView :name="item.name" />
</div>
</transition>
</VWindowItem>
</VWindow>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function jumpTab(tab: string) {
<!-- 规则 -->
<VWindowItem value="rule">
<transition name="fade-slide" appear>
<AccountSettingRule />
<div>
<AccountSettingRule />
</div>
</transition>
</VWindowItem>

Expand Down
12 changes: 9 additions & 3 deletions src/pages/subscribe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ function jumpTab(tab: string) {
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
<VWindowItem value="mysub">
<transition name="fade-slide" appear>
<SubscribeListView :type="subType" :subid="subId" />
<div>
<SubscribeListView :type="subType" :subid="subId" />
</div>
</transition>
</VWindowItem>
<VWindowItem value="popular">
<transition name="fade-slide" appear>
<SubscribePopularView :type="subType" />
<div>
<SubscribePopularView :type="subType" />
</div>
</transition>
</VWindowItem>
<VWindowItem value="share">
<transition name="fade-slide" appear>
<SubscribeShareView />
<div>
<SubscribeShareView />
</div>
</transition>
</VWindowItem>
</VWindow>
Expand Down
8 changes: 7 additions & 1 deletion src/views/dashboard/AnalyticsCpu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const variableTheme = controlledComputed(
() => vuetifyTheme.current.value.variables,
)
const chartKey = ref(0)
// 定时器
let refreshTimer: NodeJS.Timeout | null = null
Expand Down Expand Up @@ -129,6 +131,10 @@ onUnmounted(() => {
refreshTimer = null
}
})
onActivated(() => {
chartKey.value += 1
})
</script>

<template>
Expand All @@ -142,7 +148,7 @@ onUnmounted(() => {
<VCardTitle>CPU</VCardTitle>
</VCardItem>
<VCardText>
<VApexChart type="line" :options="chartOptions" :series="series" :height="150" />
<VApexChart :key="chartKey" type="line" :options="chartOptions" :series="series" :height="150" />
<p class="text-center font-weight-medium mb-0">当前:{{ current }}%</p>
</VCardText>
</VCard>
Expand Down
8 changes: 7 additions & 1 deletion src/views/dashboard/AnalyticsMemory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const variableTheme = controlledComputed(
() => vuetifyTheme.current.value.variables,
)
const chartKey = ref(0)
// 定时器
let refreshTimer: NodeJS.Timeout | null = null
Expand Down Expand Up @@ -135,6 +137,10 @@ onUnmounted(() => {
refreshTimer = null
}
})
onActivated(() => {
chartKey.value += 1
})
</script>

<template>
Expand All @@ -148,7 +154,7 @@ onUnmounted(() => {
<VCardTitle>内存</VCardTitle>
</VCardItem>
<VCardText>
<VApexChart type="area" :options="chartOptions" :series="series" :height="150" />
<VApexChart :key="chartKey" type="area" :options="chartOptions" :series="series" :height="150" />
<p class="text-center font-weight-medium mb-0">当前:{{ formatBytes(usedMemory) }}</p>
</VCardText>
</VCard>
Expand Down

0 comments on commit d523790

Please sign in to comment.