feat: ajout de la fonctionnalité de téléchargement des volumes de manga, avec mise à jour de l'API et des composants pour gérer l'indicateur de chargement et le téléchargement des fichiers.
This commit is contained in:
parent
17f9feea7b
commit
d23c82631e
@@ -41,8 +41,15 @@
|
||||
}">
|
||||
<MagnifyingGlassIcon class="h-6 w-6" />
|
||||
</button>
|
||||
<button class="w-8 text-center" @click="handleDownload">
|
||||
<ArrowDownTrayIcon class="h-6 w-6 text-gray-500 hover:text-green-500" />
|
||||
<button
|
||||
class="w-8 text-center"
|
||||
@click="handleDownload"
|
||||
:class="{
|
||||
'text-yellow-500 cursor-wait': isDownloading,
|
||||
'text-gray-500 hover:text-green-500': !isDownloading
|
||||
}"
|
||||
:disabled="isDownloading">
|
||||
<ArrowDownTrayIcon class="h-6 w-6" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,6 +100,7 @@ import MangaChapterList from './MangaChapterList.vue';
|
||||
const store = useMangaStore();
|
||||
const isOpen = ref(props.isOpen);
|
||||
const isSearching = ref(false);
|
||||
const isDownloading = ref(false);
|
||||
|
||||
const toggleVolume = () => {
|
||||
isOpen.value = !isOpen.value;
|
||||
@@ -137,7 +145,17 @@ import MangaChapterList from './MangaChapterList.vue';
|
||||
};
|
||||
|
||||
const handleDownload = async () => {
|
||||
// TODO: Implémenter le téléchargement du volume
|
||||
console.log('Téléchargement du volume:', props.volume.number);
|
||||
try {
|
||||
console.log(`MangaVolume: Téléchargement du volume ${props.volume.number} (Manga ID: ${props.mangaId})`);
|
||||
// Montrer l'indicateur de chargement
|
||||
isDownloading.value = true;
|
||||
|
||||
await store.downloadVolume(props.mangaId, props.volume.number);
|
||||
} catch (error) {
|
||||
console.error('Erreur lors du téléchargement du volume:', error);
|
||||
} finally {
|
||||
// Arrêter l'indicateur de chargement
|
||||
isDownloading.value = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user