i0110 commited on
Commit
bd90d1b
·
verified ·
1 Parent(s): 46613c3

Update public/index.html

Browse files
Files changed (1) hide show
  1. public/index.html +57 -20
public/index.html CHANGED
@@ -2,7 +2,7 @@
2
  <html lang="zh">
3
  <head>
4
  <meta charset="UTF-8">
5
- <title>HuggingFace 实例监控面板</title>
6
  <style>
7
  * {
8
  margin: 0;
@@ -369,54 +369,90 @@
369
  0% { transform: rotate(0deg); }
370
  100% { transform: rotate(360deg); }
371
  }
372
- /* 过滤与排序控件样式 */
373
- .filter-sort-container {
 
 
 
 
 
374
  display: flex;
375
- gap: 15px;
376
- margin-bottom: 20px;
377
  flex-wrap: wrap;
 
 
 
378
  }
379
  .filter-sort-group {
380
  display: flex;
381
  align-items: center;
382
- gap: 5px;
383
  font-size: 14px;
384
  color: var(--text-color);
 
385
  }
386
  .filter-sort-group label {
387
  white-space: nowrap;
 
 
388
  }
389
  .filter-sort-group select {
 
390
  background: var(--metric-background);
391
  border: 1px solid var(--metric-border);
392
  color: var(--text-color);
393
- padding: 8px;
394
- border-radius: 5px;
395
  cursor: pointer;
396
- min-width: 120px;
 
 
 
 
 
 
 
 
 
 
397
  }
398
  .filter-sort-group select:hover {
399
- background: var(--metric-hover);
 
 
 
 
 
400
  }
401
  .refresh-button {
402
  background: var(--action-button-bg);
403
  border: none;
404
  color: var(--text-color);
405
- padding: 6px 12px;
406
- border-radius: 4px;
407
  cursor: pointer;
408
- font-size: 13px;
409
- transition: background 0.2s ease;
410
  display: flex;
411
  align-items: center;
412
- gap: 5px;
 
413
  }
414
  .refresh-button:hover {
415
  background: var(--action-button-hover);
 
416
  }
417
  .refresh-icon {
418
  width: 16px;
419
  height: 16px;
 
 
 
 
 
 
 
 
 
420
  }
421
  </style>
422
  </head>
@@ -457,12 +493,12 @@
457
  <div>总下载: <span id="totalDownload">0 B/s</span></div>
458
  </div>
459
  </div>
460
- <!-- 过滤与排序控件 -->
461
- <div class="filter-sort-container">
462
  <div class="filter-sort-group">
463
  <label for="statusFilter">过滤状态:</label>
464
  <select id="statusFilter" onchange="applyFiltersAndSort()">
465
- <option value="all">全部</option>
466
  <option value="running">运行中</option>
467
  <option value="sleeping">休眠中</option>
468
  <option value="stopped">已停止</option>
@@ -471,7 +507,7 @@
471
  <div class="filter-sort-group">
472
  <label for="userFilter">过滤用户:</label>
473
  <select id="userFilter" onchange="applyFiltersAndSort()">
474
- <option value="all">全部</option>
475
  </select>
476
  </div>
477
  <div class="filter-sort-group">
@@ -518,6 +554,7 @@
518
  </div>
519
 
520
  <script>
 
521
  // 主题切换功能
522
  function setTheme(theme) {
523
  if (theme === 'system') {
@@ -765,7 +802,7 @@
765
  document.getElementById('totalUsers').textContent = usernamesList.length;
766
  // 更新用户过滤下拉菜单
767
  const userFilter = document.getElementById('userFilter');
768
- userFilter.innerHTML = '<option value="all">全部</option>';
769
  usernamesList.forEach(username => {
770
  const option = document.createElement('option');
771
  option.value = username;
 
2
  <html lang="zh">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <title>HF Space Manager</title>
6
  <style>
7
  * {
8
  margin: 0;
 
369
  0% { transform: rotate(0deg); }
370
  100% { transform: rotate(360deg); }
371
  }
372
+ /* 优化后的过滤与排序控件样式 */
373
+ .filter-sort-panel {
374
+ background: var(--card-background);
375
+ border: 1px solid var(--card-border);
376
+ border-radius: 10px;
377
+ padding: 15px;
378
+ margin-bottom: 25px;
379
  display: flex;
 
 
380
  flex-wrap: wrap;
381
+ gap: 20px;
382
+ align-items: center;
383
+ transition: background 0.3s ease, border 0.3s ease;
384
  }
385
  .filter-sort-group {
386
  display: flex;
387
  align-items: center;
388
+ gap: 10px;
389
  font-size: 14px;
390
  color: var(--text-color);
391
+ min-width: 220px; /* 确保控件有足够的宽度 */
392
  }
393
  .filter-sort-group label {
394
  white-space: nowrap;
395
+ color: var(--secondary-text);
396
+ font-weight: 500;
397
  }
398
  .filter-sort-group select {
399
+ flex: 1;
400
  background: var(--metric-background);
401
  border: 1px solid var(--metric-border);
402
  color: var(--text-color);
403
+ padding: 8px 12px;
404
+ border-radius: 6px;
405
  cursor: pointer;
406
+ font-size: 14px;
407
+ transition: background 0.2s ease, border 0.2s ease;
408
+ outline: none;
409
+ appearance: none; /* 移除默认的下拉箭头 */
410
+ background-image: url("data:image/svg+xml;utf8,<svg fill='%23fff' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
411
+ background-repeat: no-repeat;
412
+ background-position: right 10px center;
413
+ padding-right: 36px; /* 为箭头留出空间 */
414
+ }
415
+ [data-theme="light"] .filter-sort-group select {
416
+ background-image: url("data:image/svg+xml;utf8,<svg fill='%23333' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
417
  }
418
  .filter-sort-group select:hover {
419
+ background-color: var(--metric-hover);
420
+ border-color: rgba(255, 255, 255, 0.15); /* 微调 hover 时的边框 */
421
+ }
422
+ .filter-sort-group select:focus {
423
+ border-color: #4CAF50;
424
+ box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
425
  }
426
  .refresh-button {
427
  background: var(--action-button-bg);
428
  border: none;
429
  color: var(--text-color);
430
+ padding: 8px 16px;
431
+ border-radius: 6px;
432
  cursor: pointer;
433
+ font-size: 14px;
434
+ transition: background 0.2s ease, transform 0.2s ease;
435
  display: flex;
436
  align-items: center;
437
+ gap: 8px;
438
+ height: 40px;
439
  }
440
  .refresh-button:hover {
441
  background: var(--action-button-hover);
442
+ transform: translateY(-1px);
443
  }
444
  .refresh-icon {
445
  width: 16px;
446
  height: 16px;
447
+ fill: currentColor;
448
+ }
449
+ @media (max-width: 768px) {
450
+ .filter-sort-group {
451
+ min-width: 100%; /* 小屏时控件占满一行 */
452
+ }
453
+ .filter-sort-panel {
454
+ gap: 15px; /* 小屏时减少间距 */
455
+ }
456
  }
457
  </style>
458
  </head>
 
493
  <div>总下载: <span id="totalDownload">0 B/s</span></div>
494
  </div>
495
  </div>
496
+ <!-- 优化后的过滤与排序面板 -->
497
+ <div class="filter-sort-panel">
498
  <div class="filter-sort-group">
499
  <label for="statusFilter">过滤状态:</label>
500
  <select id="statusFilter" onchange="applyFiltersAndSort()">
501
+ <option value="all">全部状态</option>
502
  <option value="running">运行中</option>
503
  <option value="sleeping">休眠中</option>
504
  <option value="stopped">已停止</option>
 
507
  <div class="filter-sort-group">
508
  <label for="userFilter">过滤用户:</label>
509
  <select id="userFilter" onchange="applyFiltersAndSort()">
510
+ <option value="all">全部用户</option>
511
  </select>
512
  </div>
513
  <div class="filter-sort-group">
 
554
  </div>
555
 
556
  <script>
557
+ // 脚本部分保持不变,继续使用之前的逻辑
558
  // 主题切换功能
559
  function setTheme(theme) {
560
  if (theme === 'system') {
 
802
  document.getElementById('totalUsers').textContent = usernamesList.length;
803
  // 更新用户过滤下拉菜单
804
  const userFilter = document.getElementById('userFilter');
805
+ userFilter.innerHTML = '<option value="all">全部用户</option>';
806
  usernamesList.forEach(username => {
807
  const option = document.createElement('option');
808
  option.value = username;