Add Suno pagination (#169)

Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
GermeyandAceDataCloud authored and GitHub committed 2025-02-07 23:52:05 +08:00
1 parent ddb8cc2ea1
commit 5d91f2699a
44 files changed
+1148 -942

No files matched your search

+11 -5
View File
@@ -1,5 +1,5 @@
<template>
<div class="panel recent">
<div ref="panel" class="panel recent" @scroll="onHandleScroll">
<div v-if="tasks?.items === undefined" class="tasks">
<div v-for="_ in 3" :key="_" class="task placeholder">
<div class="left">
@@ -23,7 +23,6 @@
<div v-else-if="tasks?.items?.length && tasks?.items?.length > 0" class="tasks">
<task-preview v-for="(task, taskId) in tasks?.items" :key="taskId" :model-value="task" class="preview" />
</div>
{{ tasks?.items }}
<p v-if="tasks?.items?.length === 0" class="description">
{{ $t('suno.message.noTasks') }}
</p>
@@ -49,6 +48,7 @@ export default defineComponent({
ElSkeletonItem,
Player
},
emits: ['reach-top'],
data() {
return {
job: 0
@@ -59,9 +59,17 @@ export default defineComponent({
// reverse the order of the tasks.items
return {
...this.$store.state.suno?.tasks,
items: this.$store.state.suno?.tasks?.items?.slice().reverse()
items: this.$store.state.suno?.tasks?.items?.slice()
};
}
},
methods: {
onHandleScroll() {
const el = this.$refs.panel as HTMLElement;
if (el.scrollTop === 0) {
this.$emit('reach-top');
}
}
}
});
</script>
@@ -71,8 +79,6 @@ export default defineComponent({
display: flex;
flex-direction: column;
align-items: center;
// justify-content: center;
// height: 100%;
&.recent {
width: 100%;
height: 100%;
-1
View File
@@ -167,7 +167,6 @@ export default defineComponent({
result.push(audio);
});
}
console.log('audios', result);
return result;
},
application() {