Update public/index.html
Browse files- public/index.html +40 -10
public/index.html
CHANGED
|
@@ -138,7 +138,7 @@
|
|
| 138 |
padding: 16px;
|
| 139 |
border: 1px solid var(--metric-border);
|
| 140 |
transition: background 0.2s ease, box-shadow 0.2s ease;
|
| 141 |
-
min-height:
|
| 142 |
display: flex;
|
| 143 |
flex-direction: column;
|
| 144 |
box-shadow: 0 0 5px rgba(0, 212, 255, 0.2);
|
|
@@ -146,7 +146,7 @@
|
|
| 146 |
overflow: hidden;
|
| 147 |
}
|
| 148 |
.server-card.not-logged-in {
|
| 149 |
-
min-height:
|
| 150 |
}
|
| 151 |
.server-card:hover {
|
| 152 |
background: var(--metric-hover);
|
|
@@ -165,18 +165,19 @@
|
|
| 165 |
.server-header {
|
| 166 |
display: flex;
|
| 167 |
justify-content: space-between;
|
| 168 |
-
align-items:
|
| 169 |
margin-bottom: 12px;
|
| 170 |
font-size: 14px;
|
| 171 |
}
|
| 172 |
.server-name {
|
| 173 |
display: flex;
|
| 174 |
-
|
| 175 |
-
|
|
|
|
| 176 |
flex: 1;
|
| 177 |
min-width: 0;
|
| 178 |
}
|
| 179 |
-
.server-name div {
|
| 180 |
overflow: hidden;
|
| 181 |
text-overflow: ellipsis;
|
| 182 |
white-space: nowrap;
|
|
@@ -185,6 +186,14 @@
|
|
| 185 |
color: var(--accent-color);
|
| 186 |
text-shadow: 0 0 3px rgba(0, 212, 255, 0.5);
|
| 187 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
.server-flag {
|
| 189 |
width: 20px;
|
| 190 |
height: 20px;
|
|
@@ -194,7 +203,7 @@
|
|
| 194 |
}
|
| 195 |
.metric-grid {
|
| 196 |
display: grid;
|
| 197 |
-
grid-template-columns: repeat(
|
| 198 |
gap: 10px;
|
| 199 |
margin-top: 12px;
|
| 200 |
}
|
|
@@ -319,7 +328,7 @@
|
|
| 319 |
font-size: 20px;
|
| 320 |
}
|
| 321 |
.metric-grid {
|
| 322 |
-
grid-template-columns: repeat(3, 1fr); /* 与系统概览同步,
|
| 323 |
gap: 8px;
|
| 324 |
}
|
| 325 |
.metric-item {
|
|
@@ -344,7 +353,7 @@
|
|
| 344 |
grid-template-columns: 1fr !important;
|
| 345 |
}
|
| 346 |
.metric-grid {
|
| 347 |
-
grid-template-columns: repeat(2, 1fr); /* 与系统概览同步,变为2列 */
|
| 348 |
gap: 8px;
|
| 349 |
}
|
| 350 |
.metric-item {
|
|
@@ -365,6 +374,9 @@
|
|
| 365 |
padding: 16px;
|
| 366 |
margin-bottom: 20px;
|
| 367 |
}
|
|
|
|
|
|
|
|
|
|
| 368 |
}
|
| 369 |
@media (max-width: 400px) {
|
| 370 |
#summary {
|
|
@@ -1287,6 +1299,19 @@
|
|
| 1287 |
chartDataBuffer.set(instanceId, { data: [], count: 0 });
|
| 1288 |
}
|
| 1289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1290 |
function renderInstanceCard(instance, container) {
|
| 1291 |
const instanceId = instance.repo_id;
|
| 1292 |
instanceMap.set(instanceId, instance);
|
|
@@ -1314,7 +1339,8 @@
|
|
| 1314 |
<div class="server-name">
|
| 1315 |
<div class="status-dot status-sleep"></div>
|
| 1316 |
${iconSvg}
|
| 1317 |
-
<div>${instance.name}
|
|
|
|
| 1318 |
</div>
|
| 1319 |
<div>
|
| 1320 |
<button class="chart-toggle-button" onclick="toggleChart('${instanceId}')">查看图表</button>
|
|
@@ -1341,6 +1367,10 @@
|
|
| 1341 |
<div class="metric-label">下载</div>
|
| 1342 |
<div class="metric-value download">N/A</div>
|
| 1343 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1344 |
</div>
|
| 1345 |
<div class="action-buttons" style="display: ${isLoggedIn ? 'flex' : 'none'};">
|
| 1346 |
<button class="action-button view-button" onclick="viewInstance('${instance.url}')">查看</button>
|
|
|
|
| 138 |
padding: 16px;
|
| 139 |
border: 1px solid var(--metric-border);
|
| 140 |
transition: background 0.2s ease, box-shadow 0.2s ease;
|
| 141 |
+
min-height: 180px; /* 增加高度以容纳新字段 */
|
| 142 |
display: flex;
|
| 143 |
flex-direction: column;
|
| 144 |
box-shadow: 0 0 5px rgba(0, 212, 255, 0.2);
|
|
|
|
| 146 |
overflow: hidden;
|
| 147 |
}
|
| 148 |
.server-card.not-logged-in {
|
| 149 |
+
min-height: 150px; /* 未登录时高度略小 */
|
| 150 |
}
|
| 151 |
.server-card:hover {
|
| 152 |
background: var(--metric-hover);
|
|
|
|
| 165 |
.server-header {
|
| 166 |
display: flex;
|
| 167 |
justify-content: space-between;
|
| 168 |
+
align-items: flex-start; /* 调整为顶部对齐以容纳描述 */
|
| 169 |
margin-bottom: 12px;
|
| 170 |
font-size: 14px;
|
| 171 |
}
|
| 172 |
.server-name {
|
| 173 |
display: flex;
|
| 174 |
+
flex-direction: column; /* 改为列布局以显示描述 */
|
| 175 |
+
align-items: flex-start;
|
| 176 |
+
gap: 4px;
|
| 177 |
flex: 1;
|
| 178 |
min-width: 0;
|
| 179 |
}
|
| 180 |
+
.server-name div.name {
|
| 181 |
overflow: hidden;
|
| 182 |
text-overflow: ellipsis;
|
| 183 |
white-space: nowrap;
|
|
|
|
| 186 |
color: var(--accent-color);
|
| 187 |
text-shadow: 0 0 3px rgba(0, 212, 255, 0.5);
|
| 188 |
}
|
| 189 |
+
.server-name div.description {
|
| 190 |
+
font-size: 12px;
|
| 191 |
+
color: var(--secondary-text);
|
| 192 |
+
overflow: hidden;
|
| 193 |
+
text-overflow: ellipsis;
|
| 194 |
+
white-space: nowrap;
|
| 195 |
+
max-width: 100%;
|
| 196 |
+
}
|
| 197 |
.server-flag {
|
| 198 |
width: 20px;
|
| 199 |
height: 20px;
|
|
|
|
| 203 |
}
|
| 204 |
.metric-grid {
|
| 205 |
display: grid;
|
| 206 |
+
grid-template-columns: repeat(3, 1fr); /* 默认3列x2行以容纳6个指标 */
|
| 207 |
gap: 10px;
|
| 208 |
margin-top: 12px;
|
| 209 |
}
|
|
|
|
| 328 |
font-size: 20px;
|
| 329 |
}
|
| 330 |
.metric-grid {
|
| 331 |
+
grid-template-columns: repeat(3, 1fr); /* 与系统概览同步,保持3列x2行 */
|
| 332 |
gap: 8px;
|
| 333 |
}
|
| 334 |
.metric-item {
|
|
|
|
| 353 |
grid-template-columns: 1fr !important;
|
| 354 |
}
|
| 355 |
.metric-grid {
|
| 356 |
+
grid-template-columns: repeat(2, 1fr); /* 与系统概览同步,变为2列x3行 */
|
| 357 |
gap: 8px;
|
| 358 |
}
|
| 359 |
.metric-item {
|
|
|
|
| 374 |
padding: 16px;
|
| 375 |
margin-bottom: 20px;
|
| 376 |
}
|
| 377 |
+
.server-name div.description {
|
| 378 |
+
font-size: 11px; /* 窄屏下描述字体缩小 */
|
| 379 |
+
}
|
| 380 |
}
|
| 381 |
@media (max-width: 400px) {
|
| 382 |
#summary {
|
|
|
|
| 1299 |
chartDataBuffer.set(instanceId, { data: [], count: 0 });
|
| 1300 |
}
|
| 1301 |
|
| 1302 |
+
// 格式化日期时间函数
|
| 1303 |
+
function formatDateTime(timestamp) {
|
| 1304 |
+
if (!timestamp) return 'N/A';
|
| 1305 |
+
const date = new Date(timestamp);
|
| 1306 |
+
if (isNaN(date.getTime())) return 'N/A';
|
| 1307 |
+
const year = date.getFullYear();
|
| 1308 |
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
| 1309 |
+
const day = String(date.getDate()).padStart(2, '0');
|
| 1310 |
+
const hours = String(date.getHours()).padStart(2, '0');
|
| 1311 |
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
| 1312 |
+
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
| 1313 |
+
}
|
| 1314 |
+
|
| 1315 |
function renderInstanceCard(instance, container) {
|
| 1316 |
const instanceId = instance.repo_id;
|
| 1317 |
instanceMap.set(instanceId, instance);
|
|
|
|
| 1339 |
<div class="server-name">
|
| 1340 |
<div class="status-dot status-sleep"></div>
|
| 1341 |
${iconSvg}
|
| 1342 |
+
<div class="name">${instance.name}</div>
|
| 1343 |
+
<div class="description">${instance.short_description || '暂无描述'}</div>
|
| 1344 |
</div>
|
| 1345 |
<div>
|
| 1346 |
<button class="chart-toggle-button" onclick="toggleChart('${instanceId}')">查看图表</button>
|
|
|
|
| 1367 |
<div class="metric-label">下载</div>
|
| 1368 |
<div class="metric-value download">N/A</div>
|
| 1369 |
</div>
|
| 1370 |
+
<div class="metric-item">
|
| 1371 |
+
<div class="metric-label">最后修改</div>
|
| 1372 |
+
<div class="metric-value last-modified">${formatDateTime(instance.lastModified)}</div>
|
| 1373 |
+
</div>
|
| 1374 |
</div>
|
| 1375 |
<div class="action-buttons" style="display: ${isLoggedIn ? 'flex' : 'none'};">
|
| 1376 |
<button class="action-button view-button" onclick="viewInstance('${instance.url}')">查看</button>
|