-
+
Cloudflare 资源配额
+ {#if missingEnvVars}
+
+ 提示:如需正常获取 D1 和 R2 数据,请确保在环境变量中配置 CF_ACCOUNT_ID,
+ CF_D1_ID
+ 和 CF_R2_BUCKET。
+
+ {/if}
+
{/if}
@@ -241,14 +313,17 @@
.analytics-panel {
display: flex;
flex-direction: column;
- gap: 24px;
+ gap: 30px;
}
.section-title {
- font-size: 1.2rem;
- font-weight: 600;
+ font-size: 1.25rem;
+ font-weight: 700;
color: var(--text-color);
- margin-bottom: -10px;
+ margin-bottom: -15px;
+ display: flex;
+ align-items: center;
+ gap: 8px;
}
.info-alert {
@@ -268,61 +343,22 @@
font-family: monospace;
}
- .stats-row {
+ .dashboard-grid {
display: grid;
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
- gap: 20px;
- }
-
- .stat-card {
+ grid-template-columns: 3fr 1fr;
+ gap: 0;
border: 2px solid var(--text-color, #000);
- padding: 20px;
background: transparent;
- display: flex;
- flex-direction: column;
- gap: 8px;
}
- .stat-title {
- font-size: 0.9rem;
- font-weight: 600;
- color: var(--text-muted, rgba(0, 0, 0, 0.6));
- text-transform: uppercase;
- letter-spacing: 0.5px;
- }
-
- .stat-value {
- font-size: 2rem;
- font-weight: 800;
- font-family: monospace;
- }
-
- .progress-bar {
- width: 100%;
- height: 6px;
- background: rgba(0, 0, 0, 0.1);
- margin-top: 8px;
- border-radius: 3px;
- overflow: hidden;
- }
-
- .progress-fill {
- height: 100%;
- background: #4caf50;
- transition: width 1s ease-out;
+ @media (max-width: 768px) {
+ .dashboard-grid {
+ grid-template-columns: 1fr;
+ }
}
.chart-container {
- border: 2px solid var(--text-color, #000);
padding: 20px;
- background: transparent;
- }
-
- .chart-container h3 {
- margin: 0 0 20px 0;
- font-size: 1.1rem;
- border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
- padding-bottom: 10px;
}
.canvas-wrapper {
@@ -331,6 +367,133 @@
width: 100%;
}
+ .core-metrics {
+ display: flex;
+ flex-direction: column;
+ border-left: 2px solid var(--text-color, #000);
+ }
+
+ @media (max-width: 768px) {
+ .core-metrics {
+ border-left: none;
+ border-top: 2px solid var(--text-color, #000);
+ flex-direction: row;
+ flex-wrap: wrap;
+ }
+ }
+
+ .metric-item {
+ padding: 20px;
+ border-bottom: 2px solid var(--text-color, #000);
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ flex: 1;
+ min-width: 140px;
+ }
+
+ .metric-item:last-child {
+ border-bottom: none;
+ }
+
+ .metric-title {
+ font-size: 0.85rem;
+ font-weight: 600;
+ color: var(--text-muted, rgba(0, 0, 0, 0.6));
+ }
+
+ .metric-value {
+ font-size: 1.8rem;
+ font-weight: 800;
+ font-family: monospace;
+ }
+
+ .quota-container {
+ border: 2px solid var(--text-color, #000);
+ background: transparent;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .quota-item {
+ padding: 24px;
+ border-bottom: 2px solid var(--text-color, #000);
+ }
+ .quota-item:last-child {
+ border-bottom: none;
+ }
+
+ .quota-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-end;
+ margin-bottom: 12px;
+ }
+
+ .quota-title {
+ font-weight: 600;
+ font-size: 1rem;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ }
+
+ .badge {
+ font-size: 0.75rem;
+ font-weight: 400;
+ background: rgba(0, 0, 0, 0.05);
+ border: 1px solid var(--text-color, #000);
+ padding: 2px 8px;
+ border-radius: 12px;
+ color: var(--text-muted, rgba(0, 0, 0, 0.6));
+ }
+
+ .quota-numbers {
+ font-size: 1.1rem;
+ font-weight: 700;
+ font-family: monospace;
+ }
+
+ .quota-max {
+ color: var(--text-muted, rgba(0, 0, 0, 0.5));
+ font-weight: 500;
+ font-size: 0.9rem;
+ }
+
+ .quota-bar-bg {
+ width: 100%;
+ height: 10px;
+ background: rgba(0, 0, 0, 0.1);
+ border: 1px solid var(--text-color, #000);
+ border-radius: 6px;
+ overflow: hidden;
+ }
+
+ .quota-bar-fill {
+ height: 100%;
+ transition: width 1s ease-out;
+ }
+
+ .quota-bar-fill.safe {
+ background: #4caf50;
+ }
+
+ .quota-bar-fill.warning {
+ background: #ff9800;
+ }
+
+ .quota-bar-fill.danger {
+ background: #e53935;
+ }
+
+ .quota-footer {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 8px;
+ font-size: 0.85rem;
+ color: var(--text-muted, rgba(0, 0, 0, 0.6));
+ }
+
.loading-state,
.error-state,
.empty-state {