Download static/index.html from slimshadow/file-sharing-server: direct link, hf CLI and curl.
- Browser
- Download file 3.94 kB
-
https://huggingface.co/spaces/slimshadow/file-sharing-server/resolve/main/static/index.html
- Command line
-
hf download hf://spaces/slimshadow/file-sharing-server/static/index.html
-
curl -L -o index.html https://huggingface.co/spaces/slimshadow/file-sharing-server/resolve/main/static/index.html
3.94 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>System Metrics</title> | |
| <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@400;500&family=Roboto:wght@400;500&display=swap" rel="stylesheet"> | |
| <style> | |
| body { | |
| font-family: 'Roboto', sans-serif; | |
| background-color: #f5f5f5; | |
| color: #333; | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| h1 { | |
| text-align: center; | |
| font-family: 'Oswald', sans-serif; | |
| font-size: 2.5rem; | |
| margin: 20px 0; | |
| } | |
| .metrics { | |
| display: flex; | |
| justify-content: space-around; | |
| padding: 20px; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } | |
| .metric { | |
| background-color: #fff; | |
| border: 1px solid #ddd; | |
| border-radius: 10px; | |
| padding: 20px; | |
| box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | |
| width: 30%; | |
| box-sizing: border-box; | |
| } | |
| .metric h2 { | |
| font-family: 'Oswald', sans-serif; | |
| font-size: 1.5rem; | |
| border-bottom: 2px solid #eee; | |
| padding-bottom: 10px; | |
| margin-bottom: 15px; | |
| } | |
| .metric p { | |
| font-size: 1.1rem; | |
| margin: 5px 0; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>System Metrics</h1> | |
| <div class="metrics"> | |
| <div class="metric"> | |
| <h2>CPU Load</h2> | |
| <p id="cpu-load">Loading...</p> | |
| </div> | |
| <div class="metric"> | |
| <h2>Memory Usage</h2> | |
| <p id="memory-total">Total: Loading...</p> | |
| <p id="memory-used">Used: Loading...</p> | |
| <p id="memory-available">Available: Loading...</p> | |
| <p id="memory-percent">Usage: Loading...</p> | |
| </div> | |
| <div class="metric"> | |
| <h2>Disk Usage</h2> | |
| <p id="disk-total">Total: Loading...</p> | |
| <p id="disk-used">Used: Loading...</p> | |
| <p id="disk-free">Free: Loading...</p> | |
| <p id="disk-percent">Usage: Loading...</p> | |
| </div> | |
| </div> | |
| <script> | |
| async function fetchMetrics() { | |
| try { | |
| const response = await fetch('/system/metrics'); | |
| const metrics = await response.json(); | |
| document.getElementById('cpu-load').textContent = metrics.cpu_load + '%'; | |
| document.getElementById('memory-total').textContent = 'Total: ' + (metrics.memory.total / (1024 ** 3)).toFixed(2) + ' GB'; | |
| document.getElementById('memory-used').textContent = 'Used: ' + (metrics.memory.used / (1024 ** 3)).toFixed(2) + ' GB'; | |
| document.getElementById('memory-available').textContent = 'Available: ' + (metrics.memory.available / (1024 ** 3)).toFixed(2) + ' GB'; | |
| document.getElementById('memory-percent').textContent = 'Usage: ' + metrics.memory.percent + '%'; | |
| document.getElementById('disk-total').textContent = 'Total: ' + (metrics.disk_usage.total / (1024 ** 3)).toFixed(2) + ' GB'; | |
| document.getElementById('disk-used').textContent = 'Used: ' + (metrics.disk_usage.used / (1024 ** 3)).toFixed(2) + ' GB'; | |
| document.getElementById('disk-free').textContent = 'Free: ' + (metrics.disk_usage.free / (1024 ** 3)).toFixed(2) + ' GB'; | |
| document.getElementById('disk-percent').textContent = 'Usage: ' + metrics.disk_usage.percent + '%'; | |
| } catch (error) { | |
| console.error('Error fetching metrics:', error); | |
| } | |
| } | |
| fetchMetrics(); | |
| setInterval(fetchMetrics, 1000); // Refresh metrics every 1 seconds | |
| </script> | |
| </body> | |
| </html> | |