From dcab2530ec8ed7a7f7ac6b53c19180194ee7972a Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Mon, 10 Mar 2025 00:53:04 +0300 Subject: [PATCH] Improve history status display and added button to play the video incase thumbnail is hidden. --- ui/components/History.vue | 93 ++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 36 deletions(-) diff --git a/ui/components/History.vue b/ui/components/History.vue index 4bd0fe81..a37e03f5 100644 --- a/ui/components/History.vue +++ b/ui/components/History.vue @@ -86,6 +86,10 @@
+ + + @@ -118,11 +122,6 @@
-
- - Live stream is scheduled to start at {{ moment(item.live_in).format() }} - -
{{ item.error }}
@@ -130,23 +129,16 @@ {{ item.msg }}
- - - - - - Live Ended - {{ ucFirst(item.status) }} - + + + {{ setStatus(item) }} - - - - - - Live - +
+
+ + {{ moment(item.live_in).fromNow() }}
@@ -155,13 +147,6 @@ {{ moment(item.datetime).fromNow() }}
-
- - {{ moment(item.live_in).fromNow() }} - -
{{ formatBytes(item.file_size) }}
@@ -400,25 +385,61 @@ const clearIncomplete = () => { } const setIcon = item => { - if (item.status === 'finished' && item.is_live) { - return 'fa-solid fa-globe' + if ('finished' === item.status) { + return item.is_live ? 'fa-solid fa-globe' : 'fa-solid fa-circle-check' } - if (item.status === 'finished') { - return 'fa-solid fa-circle-check' - } - - if (item.status === 'error') { + if ('error' === item.status) { return 'fa-solid fa-circle-xmark' } - if (item.status === 'cancelled') { + if ('cancelled' === item.status) { return 'fa-solid fa-eject' } + if ('not_live' === item.status) { + return 'fa-solid fa-hourglass-half fa-spin' + } + return 'fa-solid fa-circle' } +const setIconColor = item => { + if (item.status === 'finished') { + return 'has-text-success' + } + + if ('not_live' === item.status) { + return 'has-text-info' + } + + if ('cancelled' === item.status) { + return 'has-text-warning' + } + + return 'has-text-danger' +} + +const setStatus = item => { + if ('finished' === item.status) { + return item.is_live ? 'Live Ended' : 'Completed' + } + + if ('error' === item.status) { + return 'Error' + } + + if ('cancelled' === item.status) { + return 'User Cancelled' + } + + if ('not_live' === item.status) { + return 'Live Stream' + } + + return item.status +} + const requeueIncomplete = () => { if (false === confirm('Are you sure you want to re-queue all incomplete downloads?')) { return false