Enhance backend functionality and frontend UI

- Updated main.py to include authentication for brand, model, and OTA routers.
- Added new OTA schemas in schemas.py for version management.
- Enhanced model retrieval with sorting options in models.py.
- Improved model update functionality to support multipart/form-data uploads.
- Updated frontend layout and styles for a more modern look, including new font integration.
- Implemented login route and authentication checks in router/index.js.
- Added sorting capabilities in model table and improved file handling in model view.
- Updated requirements.txt to include PyJWT for token management.
This commit is contained in:
yangy
2026-05-14 17:54:36 +08:00
parent b1d088a755
commit 661b85ce62
23 changed files with 2104 additions and 119 deletions
+320
View File
@@ -0,0 +1,320 @@
html,
body {
min-height: 100%;
background: #0a0e14;
}
/**
* 全站主题(与登录页一致):深色宇宙底、浅色内容卡片、青紫渐变主按钮
* 仅作用于 .lux-shell 内,避免影响登录页
*/
:root {
--lux-font:
'Inter', 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei',
sans-serif;
--lux-page-bg: #0a0e14;
--lux-text-strong: #0f172a;
--lux-text-muted: #64748b;
--lux-cyan: #38bdf8;
--lux-indigo: #6366f1;
--lux-violet: #7c3aed;
--lux-card-grad: linear-gradient(165deg, #fafbfc 0%, #f0f3f8 100%);
--lux-glass-sidebar: rgba(15, 23, 42, 0.52);
--lux-glass-header: rgba(250, 251, 252, 0.9);
}
.lux-shell {
font-family: var(--lux-font);
position: relative;
min-height: 100vh;
height: 100vh;
overflow: hidden;
color: var(--lux-text-strong);
background: radial-gradient(ellipse 120% 90% at 50% -15%, #1a2840 0%, #0d1117 48%, #0a0e14 100%);
}
.lux-shell-bg {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 0;
overflow: hidden;
}
.lux-orb {
position: absolute;
border-radius: 50%;
filter: blur(80px);
opacity: 0.34;
}
.lux-orb-1 {
width: min(52vw, 400px);
height: min(52vw, 400px);
background: #22d3ee;
top: -12%;
left: -8%;
}
.lux-orb-2 {
width: min(48vw, 360px);
height: min(48vw, 360px);
background: #a78bfa;
top: 40%;
right: -12%;
opacity: 0.28;
}
.lux-orb-3 {
width: min(42vw, 320px);
height: min(42vw, 320px);
background: #38bdf8;
bottom: -8%;
left: 20%;
opacity: 0.22;
}
.lux-shell-body {
position: relative;
z-index: 1;
height: 100%;
background: transparent !important;
}
.lux-shell-body > .el-container {
height: 100%;
}
/* —— 侧栏玻璃 —— */
.lux-shell .sidebar-glass {
position: relative;
width: 220px !important;
overflow-x: hidden;
background: var(--lux-glass-sidebar) !important;
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
border-right: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}
.lux-shell .sidebar-logo {
height: 60px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 12px;
background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lux-shell .sidebar-logo h2 {
margin: 0;
font-size: 16px;
font-weight: 700;
letter-spacing: 0.02em;
text-align: center;
line-height: 1.35;
color: #f1f5f9;
text-shadow: 0 0 24px rgba(56, 189, 248, 0.25);
}
.lux-shell .lux-menu.el-menu {
border-right: none !important;
background: transparent !important;
padding: 8px 6px 16px;
}
.lux-shell .lux-menu .el-sub-menu__title {
border-radius: 10px;
margin: 2px 0;
color: #cbd5e1 !important;
}
.lux-shell .lux-menu .el-sub-menu__title:hover {
background: rgba(255, 255, 255, 0.06) !important;
}
.lux-shell .lux-menu .el-menu-item {
border-radius: 10px;
margin: 3px 4px;
color: #cbd5e1 !important;
}
.lux-shell .lux-menu .el-menu-item:hover {
background: rgba(255, 255, 255, 0.07) !important;
color: #e2e8f0 !important;
}
.lux-shell .lux-menu .el-menu-item.is-active {
color: #e0f2fe !important;
background: linear-gradient(
90deg,
rgba(56, 189, 248, 0.22),
rgba(99, 102, 241, 0.14)
) !important;
box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25) inset;
}
.lux-shell .lux-menu .el-icon {
color: inherit;
}
/* —— 顶栏 —— */
.lux-shell .lux-header {
height: 56px !important;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 22px !important;
margin: 12px 16px 0 8px;
border-radius: 14px;
background: var(--lux-glass-header);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
border: 1px solid rgba(148, 163, 184, 0.2);
box-shadow:
0 4px 6px -1px rgba(15, 23, 42, 0.06),
0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}
.lux-shell .lux-header-title {
font-size: 17px;
font-weight: 700;
letter-spacing: -0.01em;
color: #0f172a;
}
/* —— 主内容区 —— */
.lux-shell .lux-main {
background: transparent !important;
padding: 16px 16px 24px 12px !important;
overflow: auto;
}
.lux-shell .card-header .title {
font-size: 18px;
font-weight: 700;
letter-spacing: -0.02em;
color: #0f172a;
}
.lux-shell .brand-not-in-db-tip {
color: #b45309;
}
/* —— 卡片 / 表格 —— */
.lux-shell .el-card {
border-radius: 16px !important;
background: var(--lux-card-grad) !important;
border: 1px solid rgba(148, 163, 184, 0.22) !important;
box-shadow:
0 4px 6px -1px rgba(15, 23, 42, 0.06),
0 14px 32px -10px rgba(15, 23, 42, 0.14),
0 0 0 1px rgba(255, 255, 255, 0.65) inset !important;
}
.lux-shell .el-card__header {
border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
font-weight: 600;
color: var(--lux-text-strong);
}
.lux-shell .el-table {
--el-table-border-color: rgba(148, 163, 184, 0.22);
--el-table-header-bg-color: #eef2f7;
--el-table-row-hover-bg-color: rgba(56, 189, 248, 0.06);
color: var(--lux-text-strong);
border-radius: 12px;
overflow: hidden;
}
.lux-shell .el-table th.el-table__cell {
font-weight: 600;
color: #334155;
}
.lux-shell .el-pagination {
--el-pagination-font-size: 13px;
--el-pagination-button-color: #475569;
--el-pagination-hover-color: var(--lux-cyan);
}
.lux-shell .el-pagination .el-pager li.is-active {
color: #fff !important;
background: linear-gradient(135deg, var(--lux-cyan), var(--lux-indigo)) !important;
border-radius: 8px;
}
/* 主按钮渐变 */
.lux-shell .el-button--primary {
--el-button-bg-color: transparent;
--el-button-border-color: transparent;
background: linear-gradient(
92deg,
#38bdf8 0%,
#4f8ff7 38%,
#6366f1 72%,
#7c3aed 100%
) !important;
border: none !important;
box-shadow: 0 8px 20px rgba(56, 189, 248, 0.28);
}
.lux-shell .el-button--primary:hover,
.lux-shell .el-button--primary:focus {
filter: brightness(1.06);
box-shadow: 0 10px 26px rgba(56, 189, 248, 0.35);
}
.lux-shell .el-button--primary.is-plain {
background: rgba(56, 189, 248, 0.12) !important;
color: #0369a1 !important;
border: 1px solid rgba(56, 189, 248, 0.45) !important;
box-shadow: none;
}
.lux-shell .el-button--primary.is-plain:hover {
filter: none;
background: rgba(56, 189, 248, 0.2) !important;
}
.lux-shell .el-button--warning {
box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.lux-shell .el-button--danger {
box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}
/* 输入框(搜索栏等) */
.lux-shell .el-input__wrapper {
border-radius: 10px;
box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25) inset;
}
.lux-shell .el-input__wrapper.is-focus {
box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45) inset, 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.lux-shell .el-select .el-select__wrapper {
border-radius: 10px;
}
/* 标签 */
.lux-shell .el-tag {
border-radius: 8px;
}
/* 对话框(Teleport 到 body,不用 .lux-shell 前缀) */
.el-overlay .el-dialog {
border-radius: 18px;
overflow: hidden;
box-shadow:
0 25px 50px -12px rgba(0, 0, 0, 0.35),
0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}
.el-overlay .el-dialog__header {
border-bottom: 1px solid rgba(148, 163, 184, 0.18);
font-weight: 700;
}