Refactor processing logic and enhance error handling

- Cleaned up code in processing.py by removing inline semicolons and improving readability.
- Updated upsert_file_relation calls to ensure consistent handling of file relations.
- Enhanced query_file_relations in db_schema.py to support filtering by file existence.
- Improved API error handling in index.ts with user-friendly messages for 401 and 403 errors.
- Added online/offline status tracking in Layout.vue.
- Implemented debounced search functionality across multiple views to optimize performance.
- Introduced loading skeletons in Dashboard.vue for better user experience during data fetching.
- Enhanced file preview cleanup logic in Images.vue, Orders.vue, and Tables.vue to prevent memory leaks.
- Updated global styles to include new loading and notification animations.
This commit is contained in:
2026-05-12 18:37:23 +08:00
parent 81bafaf557
commit e441ac82a8
20 changed files with 455 additions and 76 deletions
+101 -2
View File
@@ -3,7 +3,15 @@
Clean · Minimal · Zinc palette
═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
/* Use system fonts with fallbacks — avoids blocking render on Google Fonts */
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400 700;
font-display: swap;
src: local('Inter'), local('InterVariable'),
url('https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
}
:root {
/* ── Backgrounds ── */
@@ -26,6 +34,19 @@
--danger-light: #fef2f2;
--info: #18181b;
/* ── Extended palette ── */
--indigo-500: #6366f1;
--indigo-400: #818cf8;
--indigo-100: rgba(99,102,241,0.1);
--emerald-500: #10b981;
--emerald-100: rgba(16,185,129,0.1);
--amber-400: #fbbf24;
--amber-500: #f59e0b;
--amber-600: #d97706;
--amber-100: rgba(245,158,11,0.1);
--red-500: #ef4444;
--red-100: rgba(239,68,68,0.1);
/* ── Text ── */
--text-primary: #18181b;
--text-secondary: #525252;
@@ -51,11 +72,14 @@
/* ── Typography ── */
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
--font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
/* ── Transitions ── */
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
--duration-fast: 0.15s;
--duration-normal: 0.2s;
--duration-slow: 0.3s;
}
* {
@@ -393,3 +417,78 @@ body {
.animate-in-delay-2 { animation-delay: 0.1s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.2s; }
/* ═══════════════════════════════════════════
Skeleton Loading
═══════════════════════════════════════════ */
.skeleton {
background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
background-size: 200% 100%;
animation: shimmer 1.5s ease-in-out infinite;
border-radius: var(--radius-sm);
}
.skeleton-text {
height: 14px;
margin-bottom: 8px;
width: 100%;
}
.skeleton-text.short {
width: 60%;
}
.skeleton-circle {
width: 40px;
height: 40px;
border-radius: 50%;
}
.skeleton-card {
height: 80px;
border-radius: var(--radius);
}
/* ═══════════════════════════════════════════
Loading Overlay
═══════════════════════════════════════════ */
.loading-overlay {
position: relative;
pointer-events: none;
opacity: 0.7;
}
.loading-overlay::after {
content: '';
position: absolute;
inset: 0;
background: rgba(255,255,255,0.5);
border-radius: inherit;
z-index: 1;
}
/* ═══════════════════════════════════════════
Toast / Notification Transitions
═══════════════════════════════════════════ */
@keyframes slideInRight {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}