Refactor TelegramManager and improve frontend article display

- Simplified inline keyboard button creation in TelegramManager for better readability.
- Adjusted the structure of the keyboard arrays to ensure proper formatting.
- Enhanced Articles.vue by cleaning up the layout and ensuring consistent spacing and alignment.
- Improved the handling of article display properties for better user experience.
This commit is contained in:
Omar Sánchez Pizarro
2026-01-19 21:10:44 +01:00
parent c3ef3daf5e
commit 96db30ff00
3 changed files with 72 additions and 59 deletions

View File

@@ -2,21 +2,21 @@
<div>
<div class="mb-6">
<div class="flex justify-between items-center mb-4">
<h1 class="text-3xl font-bold text-gray-900">Artículos Notificados</h1>
<div class="flex items-center space-x-4">
<select
v-model="selectedPlatform"
@change="loadArticles"
class="input"
style="width: auto;"
>
<option value="">Todas las plataformas</option>
<option value="wallapop">Wallapop</option>
<option value="vinted">Vinted</option>
</select>
<button @click="loadArticles" class="btn btn-primary">
Actualizar
</button>
<h1 class="text-3xl font-bold text-gray-900">Artículos Notificados</h1>
<div class="flex items-center space-x-4">
<select
v-model="selectedPlatform"
@change="loadArticles"
class="input"
style="width: auto;"
>
<option value="">Todas las plataformas</option>
<option value="wallapop">Wallapop</option>
<option value="vinted">Vinted</option>
</select>
<button @click="loadArticles" class="btn btn-primary">
Actualizar
</button>
</div>
</div>
@@ -83,21 +83,21 @@
<div class="flex-1 min-w-0">
<div class="flex items-start justify-between mb-2">
<div class="flex-1 min-w-0">
<div class="flex items-center space-x-2 mb-2">
<span
<div class="flex items-center space-x-2 mb-2">
<span
class="px-2 py-1 text-xs font-semibold rounded flex-shrink-0"
:class="
article.platform === 'wallapop'
? 'bg-blue-100 text-blue-800'
: 'bg-green-100 text-green-800'
"
>
:class="
article.platform === 'wallapop'
? 'bg-blue-100 text-blue-800'
: 'bg-green-100 text-green-800'
"
>
{{ article.platform?.toUpperCase() || 'N/A' }}
</span>
</span>
<span class="text-sm text-gray-500 whitespace-nowrap">
{{ formatDate(article.notifiedAt) }}
</span>
</div>
{{ formatDate(article.notifiedAt) }}
</span>
</div>
<h3 class="text-lg font-semibold text-gray-900 mb-1 truncate" :title="article.title">
{{ article.title || 'Sin título' }}
@@ -211,7 +211,7 @@ async function loadArticles(reset = true, silent = false) {
}
if (!silent) {
loading.value = true;
loading.value = true;
}
try {
@@ -235,7 +235,7 @@ async function loadArticles(reset = true, silent = false) {
console.error('Error cargando artículos:', error);
} finally {
if (!silent) {
loading.value = false;
loading.value = false;
}
}
}