modify ui

This commit is contained in:
Julian Freeman
2025-12-22 08:27:58 -04:00
parent 582993b813
commit a443dc48b2

View File

@@ -243,7 +243,7 @@
</div>
</td>
<td>
<span class="type-label" :style="{ color: getTypeColor(item.type) }">
<span class="type-label"> <!-- :style="{ color: getTypeColor(item.type) }"> -->
{{ translateStatic(item.type) }}
</span>
</td>
@@ -265,7 +265,7 @@
</tbody>
</table>
<div v-if="loading" style="padding: 5rem; text-align: center; color: var(--text-muted);">{{ ui[lang].syncing }}</div>
<div v-else-if="filteredItems.length === 0" style="padding: 5rem; text-align: center; color: var(--text-muted);">No results.</div>
<div v-else-if="filteredItems.length === 0" style="padding: 5rem; text-align: center; color: var(--text-muted);">{{ ui[lang].noResults }}</div>
</div>
<div class="pagination" v-if="totalPages > 1">
@@ -290,9 +290,9 @@ createApp({
const defaultIcon = 'https://pictures.volan.top/security-list/1/0.png';
const ui = {
cn: { subtitle: '软件安全列表Plus', searchPlaceholder: '搜索...', colName: '描述', colType: '类型', colPlat: '平台', colSafety: '安全性', colDate: '最近更新', colAction: '操作', linkBtn: '访问官网', syncing: '同步云端数据中...', prev: '上一页', next: '下一页', page: '页码' },
en: { subtitle: 'Software Security List', searchPlaceholder: 'Search...', colName: 'Description', colType: 'Type', colPlat: 'Platform', colSafety: 'Security', colDate: 'Updated', colAction: 'Action', linkBtn: 'VISIT', syncing: 'Syncing...', prev: 'Prev', next: 'Next', page: 'Page' },
es: { subtitle: 'Lista de seguridad del software', searchPlaceholder: 'Buscar...', colName: 'Descripción', colType: 'Tipo', colPlat: 'Plataforma', colSafety: 'Seguridad', colDate: 'Fecha', colAction: 'Acción', linkBtn: 'VISITAR', syncing: 'Sincronizando...', prev: 'Anterior', next: 'Siguiente', page: 'Página' }
cn: { subtitle: '软件安全列表Plus', searchPlaceholder: '搜索...', colName: '描述', colType: '类型', colPlat: '平台', colSafety: '安全性', colDate: '最近更新', colAction: '操作', linkBtn: '访问', syncing: '同步云端数据中...', prev: '上一页', next: '下一页', page: '页码', noResults: '没有结果' },
en: { subtitle: 'Software Security List', searchPlaceholder: 'Search...', colName: 'Description', colType: 'Type', colPlat: 'Platform', colSafety: 'Security', colDate: 'Updated', colAction: 'Action', linkBtn: 'VISIT', syncing: 'Syncing...', prev: 'Prev', next: 'Next', page: 'Page', noResults: 'No results' },
es: { subtitle: 'Lista de seguridad del software', searchPlaceholder: 'Buscar...', colName: 'Descripción', colType: 'Tipo', colPlat: 'Plataforma', colSafety: 'Seguridad', colDate: 'Fecha', colAction: 'Acción', linkBtn: 'VISITAR', syncing: 'Sincronizando...', prev: 'Anterior', next: 'Siguiente', page: 'Página', noResults: 'Sin resultados' }
};
const staticMap = {
@@ -354,7 +354,7 @@ createApp({
const translateStatic = (val) => (staticMap[val] && staticMap[val][lang.value]) || val;
const splitPlatform = (str) => str ? str.split(/[,]/).map(s => s.trim()) : [];
const getSafetyColor = (val) => val === '安全' ? '#10b981' : (val === '不安全' ? '#ef4444' : '#f59e0b');
const getTypeColor = (type) => type === '网站' ? '#06b6d4' : (type === '软件' ? '#6366f1' : '#f59e0b');
// const getTypeColor = (type) => type === '网站' ? '#06b6d4' : (type === '软件' ? '#6366f1' : '#f59e0b');
const formatDate = (dateStr) => dateStr ? new Date(dateStr).toISOString().split('T')[0].replace(/-/g, '/') : '--';
const toggleDark = () => {
@@ -364,7 +364,7 @@ createApp({
onMounted(fetchData);
return { lang, searchTerm, loading, isDark, filteredItems, paginatedItems, totalPages, currentPage, ui, defaultIcon, toggleDark, translateStatic, getSafetyColor, getTypeColor, formatDate, splitPlatform };
return { lang, searchTerm, loading, isDark, filteredItems, paginatedItems, totalPages, currentPage, ui, defaultIcon, toggleDark, translateStatic, getSafetyColor, formatDate, splitPlatform };
}
}).mount('#app');
</script>