|
3 | 3 | <head> |
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | | - <title>ConnectLib Dashboard</title> |
| 6 | + <title>Dashboard</title> |
7 | 7 | <style> |
8 | 8 | * { |
9 | 9 | margin: 0; |
|
365 | 365 | <body> |
366 | 366 | <div class="content-wrapper"> |
367 | 367 | <nav class="navbar"> |
368 | | - <div class="navbar-title">ConnectLib Dashboard</div> |
| 368 | + <div class="navbar-title", id="navbar-title"></div> |
369 | 369 | </nav> |
370 | 370 |
|
371 | 371 | <div class="main-container"> |
|
381 | 381 | </div> |
382 | 382 | <div class="sidebar-content"> |
383 | 383 | <div class="sidebar-item active" onclick="showSection('status')"> |
384 | | - <svg class="sidebar-item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| 384 | + <svg class="sidebar-item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" |
| 385 | + stroke-width="2"> |
385 | 386 | <circle cx="12" cy="12" r="10"></circle> |
386 | 387 | <path d="M12 6v6l4 2"></path> |
387 | 388 | </svg> |
388 | 389 | <span class="sidebar-item-text">Status</span> |
389 | 390 | </div> |
390 | 391 | <div class="sidebar-item" onclick="showSection('routes')"> |
391 | | - <svg class="sidebar-item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| 392 | + <svg class="sidebar-item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" |
| 393 | + stroke-width="2"> |
392 | 394 | <circle cx="18" cy="5" r="3"></circle> |
393 | 395 | <circle cx="6" cy="12" r="3"></circle> |
394 | 396 | <circle cx="18" cy="19" r="3"></circle> |
|
398 | 400 | <span class="sidebar-item-text">Routes</span> |
399 | 401 | </div> |
400 | 402 | <div class="sidebar-item" onclick="showSection('requests')"> |
401 | | - <svg class="sidebar-item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| 403 | + <svg class="sidebar-item-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" |
| 404 | + stroke-width="2"> |
402 | 405 | <rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect> |
403 | 406 | <path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path> |
404 | 407 | </svg> |
@@ -450,7 +453,8 @@ <h2 class="section-title">Routes</h2> |
450 | 453 | <div class="section-header"> |
451 | 454 | <h2 class="section-title">Requests</h2> |
452 | 455 | <button class="refresh-btn" id="refresh-btn" onclick="refreshRequests()"> |
453 | | - <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| 456 | + <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" |
| 457 | + stroke-width="2"> |
454 | 458 | <polyline points="23 4 23 10 17 10"></polyline> |
455 | 459 | <polyline points="1 20 1 14 7 14"></polyline> |
456 | 460 | <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path> |
@@ -486,6 +490,23 @@ <h2 class="section-title">Requests</h2> |
486 | 490 |
|
487 | 491 | const API_BASE_URL = '/api'; |
488 | 492 |
|
| 493 | + async function loadConfig() { |
| 494 | + try { |
| 495 | + const response = await fetch(`${API_BASE_URL}/config`); |
| 496 | + const config = await response.json(); |
| 497 | + |
| 498 | + const navbarTitle = document.getElementById('navbar-title'); |
| 499 | + |
| 500 | + if (config && config.nameDashboard) { |
| 501 | + navbarTitle.textContent = config.nameDashboard; |
| 502 | + } else { |
| 503 | + navbarTitle.textContent = 'ConnectLib Dashboard'; |
| 504 | + } |
| 505 | + } catch (error) { |
| 506 | + console.error('Error loading config:', error); |
| 507 | + } |
| 508 | + } |
| 509 | + |
489 | 510 | async function loadStatus() { |
490 | 511 | try { |
491 | 512 | const response = await fetch(`${API_BASE_URL}/status`); |
@@ -594,6 +615,7 @@ <h2 class="section-title">Requests</h2> |
594 | 615 | loadStatus(); |
595 | 616 | loadRoutes(); |
596 | 617 | loadRequests(); |
| 618 | + loadConfig(); |
597 | 619 |
|
598 | 620 | setInterval(() => { |
599 | 621 | loadStatus(); |
|
0 commit comments