fix: broken download, added to queue alert, download list component; feat: monitor list
This commit is contained in:
@@ -1,21 +1,28 @@
|
||||
{# Learn how to use Turbo Streams: https://github.com/symfony/ux-turbo#broadcast-doctrine-entities-update #}
|
||||
{% block create %}
|
||||
<turbo-stream action="remove" target="active_downloads_no_downloads">
|
||||
</turbo-stream>
|
||||
|
||||
<turbo-stream action="append" target="active_downloads">
|
||||
<template>
|
||||
<tr id="ad_download_{{ entity.id }}">
|
||||
<tr id="ad_download_{{ entity.id }}">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 min-w-[45ch] max-w-[45ch] truncate">
|
||||
{{ entity.title }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-end text-gray-800 dark:text-gray-50">
|
||||
<span class="p-1.5 bg-purple-600 rounded-full">
|
||||
<span class="w-4 inline-block text-center text-gray-50">{{ entity.progress }}</span>
|
||||
</span>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-50">
|
||||
{% if entity.progress < 100 %}
|
||||
<span class="p-1.5 bg-purple-600 rounded-full">
|
||||
<span class="w-4 inline-block text-center text-gray-50">{{ entity.progress }}</span>
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="p-1.5 bg-green-600 rounded-full">
|
||||
<span class="inline-block text-center text-gray-50">Complete</span>
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</turbo-stream>
|
||||
|
||||
<twig:Alert title="Success" message="{{ entity.title }} has been added to the Download queue" alert_id="{{ entity.id }}" data-controller="alert" />
|
||||
{% endblock %}
|
||||
|
||||
{% block update %}
|
||||
@@ -33,6 +40,9 @@
|
||||
</template>
|
||||
</turbo-stream>
|
||||
{% else %}
|
||||
<turbo-stream action="remove" target="complete_downloads_no_downloads">
|
||||
</turbo-stream>
|
||||
|
||||
<turbo-stream action="remove" target="ad_download_{{ id }}">
|
||||
</turbo-stream>
|
||||
|
||||
@@ -42,16 +52,16 @@
|
||||
</template>
|
||||
</turbo-stream>
|
||||
|
||||
<turbo-stream action="prepend" target="recent_downloads">
|
||||
<turbo-stream action="prepend" target="complete_downloads">
|
||||
<template>
|
||||
<tr id="recent_download_{{ entity.id }}">
|
||||
<tr id="ad_download_{{ entity.id }}">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 min-w-[45ch] max-w-[45ch] truncate">
|
||||
{{ entity.title }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-end text-gray-800 dark:text-gray-50">
|
||||
<span class="p-1.5 bg-purple-600 rounded-full">
|
||||
<span class="w-4 inline-block text-center text-gray-50">{{ entity.progress }}</span>
|
||||
</span>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-50">
|
||||
<span class="p-1.5 bg-green-600 rounded-full">
|
||||
<span class="inline-block text-center text-gray-50">Complete</span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user