some improvement

This commit is contained in:
2025-05-03 01:22:03 +02:00
parent 42332ac329
commit 26d4613dd1
9 changed files with 80 additions and 28 deletions

View File

@@ -7,6 +7,7 @@
>
<template v-slot:prepend>
<v-btn @click.stop="downloadClicked" :disabled="!is_download_finished" icon="mdi-download" color="green" variant="text"/>
<v-btn v-if="file.is_video" @click.stop="fluxClicked" :disabled="!is_download_finished" icon="mdi-vlc" color="orange" variant="text"></v-btn>
<v-dialog v-if="file.is_stream_video" v-model="video_modal" width="75%" height="100%">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" icon="mdi-play" variant="text"/>
@@ -52,7 +53,17 @@ export default {
a.setAttribute("download", "download");
a.click();
}
},
fluxClicked(){
const full_url = new URL(this.file.flux_url, window.location.href).href
navigator.clipboard.writeText(full_url)
.then(() => {
// Optionnel: Vous pouvez ajouter une notification pour indiquer à l'utilisateur que l'URL a été copiée
console.log('URL copiée dans le presse-papier');
})
.catch(err => {
console.error('Erreur lors de la copie dans le presse-papier:', err);
});
}
}
}

View File

@@ -8,19 +8,32 @@
<!-- indeterminate-->
<!-- :color="torrent.transmission_data.progress < 100 ? 'green':'red'"-->
<!-- />-->
<v-icon
v-if="torrent.transmission_data.rateDownload && torrent.transmission_data.rateUpload"
:color="torrent.transmission_data.rateDownload ? 'green':'red'"
:icon="torrent.transmission_data.rateDownload ? 'mdi-arrow-down-bold':'mdi-arrow-up-bold'"
/>
<strong style="padding-left: 5px">
<!-- Si téléchargement en cours-->
<v-chip variant="text" color="white" v-if="progressData.mode === 'download'">
<v-icon
v-if="torrent.transmission_data.rateDownload"
color="green"
icon="mdi-arrow-down-bold"
/>
{{progressData.value}}%
<strong
v-if="torrent.transmission_data.rateDownload || torrent.transmission_data.rateUpload"
>
({{torrent.transmission_data.rateDownload ? fs_speed_format(torrent.transmission_data.rateDownload):fs_speed_format(torrent.transmission_data.rateUpload)}}/s)
<strong style="padding-left: 5px" v-if="torrent.transmission_data.rateDownload">
({{fs_speed_format(torrent.transmission_data.rateDownload)}}/s)
</strong>
</strong>
</v-chip>
<!-- Si téléchargement terminé-->
<v-chip variant="text" color="red" v-else>
<v-icon
v-if="torrent.transmission_data.rateUpload"
color="red"
icon="mdi-arrow-up-bold"
/>
{{fs_format(torrent.transmission_data.uploadedEver)}}
<strong style="padding-left: 5px" v-if="torrent.transmission_data.rateUpload">
({{fs_speed_format(torrent.transmission_data.rateUpload)}}/s)
</strong>
</v-chip>
</v-progress-linear>
<v-row no-gutters>
<!-- ligne du haut -->
@@ -115,9 +128,10 @@ export default {
},
computed: {
progressData(){
let color = "red", value = 0, eta;
let color = "red", value = 0, mode, eta;
if(this.torrent.transmission_data.progress < 100){
color = "blue";
mode = "download";
value = this.torrent.transmission_data.progress;
if(this.torrent.transmission_data.eta !== -1){
eta = toHHMMSS(this.torrent.transmission_data.eta);
@@ -126,10 +140,11 @@ export default {
}
}else{
color = "green";
mode = "upload";
value = Number((this.torrent.transmission_data.uploadRatio / 5) * 100).toFixed(2)
if(value > 100) value = 100;
}
return {color, value, eta};
return {color, value, mode, eta};
}
}
}