modify ui
This commit is contained in:
14
index.html
14
index.html
@@ -243,7 +243,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="type-label" :style="{ color: getTypeColor(item.type) }">
|
<span class="type-label"> <!-- :style="{ color: getTypeColor(item.type) }"> -->
|
||||||
{{ translateStatic(item.type) }}
|
{{ translateStatic(item.type) }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div v-if="loading" style="padding: 5rem; text-align: center; color: var(--text-muted);">{{ ui[lang].syncing }}</div>
|
<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>
|
||||||
|
|
||||||
<div class="pagination" v-if="totalPages > 1">
|
<div class="pagination" v-if="totalPages > 1">
|
||||||
@@ -290,9 +290,9 @@ createApp({
|
|||||||
const defaultIcon = 'https://pictures.volan.top/security-list/1/0.png';
|
const defaultIcon = 'https://pictures.volan.top/security-list/1/0.png';
|
||||||
|
|
||||||
const ui = {
|
const ui = {
|
||||||
cn: { subtitle: '软件安全列表Plus', searchPlaceholder: '搜索...', colName: '描述', colType: '类型', colPlat: '平台', colSafety: '安全性', colDate: '最近更新', colAction: '操作', linkBtn: '访问官网', syncing: '同步云端数据中...', prev: '上一页', next: '下一页', page: '页码' },
|
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' },
|
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' }
|
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 = {
|
const staticMap = {
|
||||||
@@ -354,7 +354,7 @@ createApp({
|
|||||||
const translateStatic = (val) => (staticMap[val] && staticMap[val][lang.value]) || val;
|
const translateStatic = (val) => (staticMap[val] && staticMap[val][lang.value]) || val;
|
||||||
const splitPlatform = (str) => str ? str.split(/[,,]/).map(s => s.trim()) : [];
|
const splitPlatform = (str) => str ? str.split(/[,,]/).map(s => s.trim()) : [];
|
||||||
const getSafetyColor = (val) => val === '安全' ? '#10b981' : (val === '不安全' ? '#ef4444' : '#f59e0b');
|
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 formatDate = (dateStr) => dateStr ? new Date(dateStr).toISOString().split('T')[0].replace(/-/g, '/') : '--';
|
||||||
|
|
||||||
const toggleDark = () => {
|
const toggleDark = () => {
|
||||||
@@ -364,7 +364,7 @@ createApp({
|
|||||||
|
|
||||||
onMounted(fetchData);
|
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');
|
}).mount('#app');
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user