import ui
This commit is contained in:
112
src/App.vue
112
src/App.vue
@@ -54,7 +54,7 @@
|
||||
|
||||
<!-- 卡片展示区 -->
|
||||
<div v-if="report.hardware" class="dashboard fade-in">
|
||||
<!-- 1. 硬件概览 -->
|
||||
<!-- 1. 硬件概览 (强制独占一行) -->
|
||||
<div class="card summary slide-up">
|
||||
<div class="card-header">
|
||||
<h3>🖥️ 硬件概览与资源占用</h3>
|
||||
@@ -85,7 +85,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 2. 驱动状态 (修复了标签样式) -->
|
||||
<!-- 2. 驱动状态 -->
|
||||
<div v-if="report.drivers" class="card slide-up" :class="{ danger: report.drivers.length > 0, success: report.drivers.length === 0 }">
|
||||
<div class="card-header">
|
||||
<h3>🔌 驱动状态</h3>
|
||||
@@ -302,8 +302,18 @@ function triggerToast(title, message, type = 'success') { toast.title = title; t
|
||||
onUnmounted(() => { for (const fn of unlistenFns) fn(); if (toastTimer) clearTimeout(toastTimer); });
|
||||
</script>
|
||||
|
||||
<!-- [修复 2] 全局滚动条样式优化 -->
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f4f6f9;
|
||||
/* 改为 hidden,因为使用了内部 flex 滚动区域 (.main-content) */
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
/* ... 布局样式保持不变 ... */
|
||||
.app-layout { display: flex; height: 100vh; width: 100vw; overflow: hidden; background-color: #f4f6f9; }
|
||||
.sidebar { width: 240px; background: #2c3e50; color: white; display: flex; flex-direction: column; padding: 20px 0; box-shadow: 2px 0 10px rgba(0,0,0,0.1); z-index: 10; }
|
||||
.brand { padding: 0 20px 30px; display: flex; align-items: center; gap: 12px; }
|
||||
@@ -323,90 +333,19 @@ onUnmounted(() => { for (const fn of unlistenFns) fn(); if (toastTimer) clearTim
|
||||
|
||||
.dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; }
|
||||
.card { background: white; border-radius: 10px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border: 1px solid #eaecf0; border-top: 3px solid #2ecc71; }
|
||||
/* 修复: 头部 flex 对齐 */
|
||||
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #f0f2f5; }
|
||||
/* 修复: 使用 h3 匹配样式 */
|
||||
.card-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
|
||||
|
||||
/* item-header 增加 gap */
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 4px;
|
||||
gap: 12px;
|
||||
}
|
||||
.item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 12px; }
|
||||
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: #636e72; gap: 10px; }
|
||||
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
|
||||
.item-header strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
|
||||
.status-text, .code-tag, .badge { flex-shrink: 0; white-space: nowrap; }
|
||||
.event-id { font-weight: bold; color: #2c3e50; background: #e2e8f0; padding: 1px 5px; border-radius: 3px; font-size: 0.75rem; flex-shrink: 0; }
|
||||
.event-source { font-size: 0.75rem; color: #7f8c8d; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 5px; text-align: left; }
|
||||
.event-time { font-size: 0.75rem; color: #95a5a6; flex-shrink: 0; white-space: nowrap; }
|
||||
.badge { font-size: 0.75rem; padding: 3px 10px; border-radius: 12px; color: white; font-weight: 600; letter-spacing: 0.5px; white-space: nowrap; flex-shrink: 0; }
|
||||
|
||||
/* 进度条标签 增加 gap */
|
||||
.progress-label {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 0.85rem;
|
||||
color: #636e72;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.text-ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.item-header strong {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.status-text, .code-tag, .badge {
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.event-id {
|
||||
font-weight: bold;
|
||||
color: #2c3e50;
|
||||
background: #e2e8f0;
|
||||
padding: 1px 5px;
|
||||
border-radius: 3px;
|
||||
font-size: 0.75rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.event-source {
|
||||
font-size: 0.75rem;
|
||||
color: #7f8c8d;
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin: 0 5px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.event-time {
|
||||
font-size: 0.75rem;
|
||||
color: #95a5a6;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Badge 样式增强 */
|
||||
.badge {
|
||||
font-size: 0.75rem;
|
||||
padding: 3px 10px;
|
||||
border-radius: 12px;
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* ... 剩余样式 ... */
|
||||
.grid-container-summary { display: grid; grid-template-columns: 1fr 1.5fr; gap: 25px; }
|
||||
@media (max-width: 900px) { .grid-container-summary { grid-template-columns: 1fr; } }
|
||||
.basic-info, .usage-bars { display: flex; flex-direction: column; gap: 12px; }
|
||||
@@ -433,6 +372,13 @@ onUnmounted(() => { for (const fn of unlistenFns) fn(); if (toastTimer) clearTim
|
||||
.progress-bar { width: 100%; height: 8px; background: #f1f3f5; border-radius: 4px; overflow: hidden; }
|
||||
.content-box { padding: 5px 0; } .main-text { font-weight: 500; color: #2c3e50; margin-bottom: 8px; }
|
||||
.card.danger { border-top-color: #ff4757; }
|
||||
|
||||
/* [修复 1] 硬件概览独占一行 (Explicit Override) */
|
||||
.card.summary {
|
||||
border-top-color: #3498db;
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.primary-btn { background: #2ecc71; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
|
||||
.primary-btn:hover:not(:disabled) { background: #27ae60; } .primary-btn:disabled { background: #bdc3c7; cursor: not-allowed; }
|
||||
.secondary-btn { background: white; border: 1px solid #dcdfe6; color: #606266; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
|
||||
|
||||
Reference in New Issue
Block a user