dashboard cards

This commit is contained in:
jxxghp
2024-01-05 15:59:03 +08:00
parent c5f564372b
commit 1d0d7f9975
4 changed files with 136 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
<script setup lang="ts">
import api from '@/api'
import type { MediaServerPlayItem } from '@/api/types'
// 最近入库列表
const latestList = ref<MediaServerPlayItem[]>([])
// 调用API查询
async function loadLatest() {
try {
latestList.value = await api.get('mediaserver/latest')
}
catch (e) {
console.log(e)
}
}
onMounted(() => {
loadLatest()
})
</script>
<template>
<VCard>
<VCardItem>
<VCardTitle>最近添加</VCardTitle>
</VCardItem>
<VCardText class="pt-4" />
</VCard>
</template>
<style lang="scss" scoped>
.card-list {
--v-card-list-gap: 1rem;
}
</style>

View File

@@ -0,0 +1,37 @@
<script setup lang="ts">
import api from '@/api'
import type { MediaServerPlayItem } from '@/api/types'
// 媒体库列表
const libraryList = ref<MediaServerPlayItem[]>([])
// 调用API查询
async function loadLibrary() {
try {
libraryList.value = await api.get('mediaserver/library')
}
catch (e) {
console.log(e)
}
}
onMounted(() => {
loadLibrary()
})
</script>
<template>
<VCard>
<VCardItem>
<VCardTitle>我的媒体库</VCardTitle>
</VCardItem>
<VCardText class="pt-4" />
</VCard>
</template>
<style lang="scss" scoped>
.card-list {
--v-card-list-gap: 1rem;
}
</style>

View File

@@ -0,0 +1,37 @@
<script setup lang="ts">
import api from '@/api'
import type { MediaServerPlayItem } from '@/api/types'
// 继续播放列表
const playingList = ref<MediaServerPlayItem[]>([])
// 调用API查询
async function loadPlayingList() {
try {
playingList.value = await api.get('mediaserver/playing')
}
catch (e) {
console.log(e)
}
}
onMounted(() => {
loadPlayingList()
})
</script>
<template>
<VCard>
<VCardItem>
<VCardTitle>继续观看</VCardTitle>
</VCardItem>
<VCardText class="pt-4" />
</VCard>
</template>
<style lang="scss" scoped>
.card-list {
--v-card-list-gap: 1rem;
}
</style>