Spaces:
Runtime error
Runtime error
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Virtual SSD Manager</title> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| min-height: 100vh; | |
| padding: 20px; | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| background: white; | |
| border-radius: 12px; | |
| box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); | |
| overflow: hidden; | |
| } | |
| .header { | |
| background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%); | |
| color: white; | |
| padding: 30px; | |
| text-align: center; | |
| } | |
| .header h1 { | |
| font-size: 2.5rem; | |
| margin-bottom: 10px; | |
| } | |
| .header p { | |
| opacity: 0.9; | |
| font-size: 1.1rem; | |
| } | |
| .main-content { | |
| padding: 30px; | |
| } | |
| .section { | |
| margin-bottom: 40px; | |
| } | |
| .section h2 { | |
| color: #2c3e50; | |
| margin-bottom: 20px; | |
| font-size: 1.5rem; | |
| border-bottom: 2px solid #3498db; | |
| padding-bottom: 10px; | |
| } | |
| .upload-section { | |
| background: #f8f9fa; | |
| padding: 25px; | |
| border-radius: 8px; | |
| border: 2px dashed #3498db; | |
| text-align: center; | |
| margin-bottom: 30px; | |
| } | |
| .file-input-wrapper { | |
| position: relative; | |
| display: inline-block; | |
| margin-bottom: 15px; | |
| } | |
| .file-input { | |
| position: absolute; | |
| opacity: 0; | |
| width: 100%; | |
| height: 100%; | |
| cursor: pointer; | |
| } | |
| .file-input-label { | |
| display: inline-block; | |
| padding: 12px 24px; | |
| background: #3498db; | |
| color: white; | |
| border-radius: 6px; | |
| cursor: pointer; | |
| transition: background 0.3s; | |
| } | |
| .file-input-label:hover { | |
| background: #2980b9; | |
| } | |
| .filename-input { | |
| width: 300px; | |
| padding: 12px; | |
| border: 2px solid #ddd; | |
| border-radius: 6px; | |
| margin: 0 10px; | |
| font-size: 14px; | |
| } | |
| .btn { | |
| padding: 12px 24px; | |
| border: none; | |
| border-radius: 6px; | |
| cursor: pointer; | |
| font-size: 14px; | |
| font-weight: 500; | |
| transition: all 0.3s; | |
| text-decoration: none; | |
| display: inline-block; | |
| margin: 5px; | |
| } | |
| .btn-primary { | |
| background: #3498db; | |
| color: white; | |
| } | |
| .btn-primary:hover { | |
| background: #2980b9; | |
| } | |
| .btn-danger { | |
| background: #e74c3c; | |
| color: white; | |
| } | |
| .btn-danger:hover { | |
| background: #c0392b; | |
| } | |
| .btn-success { | |
| background: #27ae60; | |
| color: white; | |
| } | |
| .btn-success:hover { | |
| background: #229954; | |
| } | |
| .btn-warning { | |
| background: #f39c12; | |
| color: white; | |
| } | |
| .btn-warning:hover { | |
| background: #e67e22; | |
| } | |
| .files-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | |
| gap: 20px; | |
| margin-top: 20px; | |
| } | |
| .file-card { | |
| background: #f8f9fa; | |
| border: 1px solid #dee2e6; | |
| border-radius: 8px; | |
| padding: 20px; | |
| transition: transform 0.2s, box-shadow 0.2s; | |
| } | |
| .file-card:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | |
| } | |
| .file-name { | |
| font-weight: bold; | |
| color: #2c3e50; | |
| margin-bottom: 10px; | |
| word-break: break-all; | |
| } | |
| .file-info { | |
| color: #6c757d; | |
| font-size: 0.9rem; | |
| margin-bottom: 15px; | |
| } | |
| .capacity-info { | |
| background: #e8f4fd; | |
| padding: 20px; | |
| border-radius: 8px; | |
| border-left: 4px solid #3498db; | |
| margin-bottom: 20px; | |
| } | |
| .capacity-bar { | |
| width: 100%; | |
| height: 20px; | |
| background: #ecf0f1; | |
| border-radius: 10px; | |
| overflow: hidden; | |
| margin: 10px 0; | |
| } | |
| .capacity-fill { | |
| height: 100%; | |
| background: linear-gradient(90deg, #27ae60, #f39c12, #e74c3c); | |
| transition: width 0.3s; | |
| } | |
| .stats-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); | |
| gap: 20px; | |
| margin-top: 20px; | |
| } | |
| .stat-card { | |
| background: #f8f9fa; | |
| padding: 20px; | |
| border-radius: 8px; | |
| border-left: 4px solid #3498db; | |
| } | |
| .stat-title { | |
| font-weight: bold; | |
| color: #2c3e50; | |
| margin-bottom: 10px; | |
| } | |
| .stat-value { | |
| font-size: 1.2rem; | |
| color: #3498db; | |
| } | |
| .message { | |
| padding: 15px; | |
| border-radius: 6px; | |
| margin: 10px 0; | |
| font-weight: 500; | |
| } | |
| .message.success { | |
| background: #d4edda; | |
| color: #155724; | |
| border: 1px solid #c3e6cb; | |
| } | |
| .message.error { | |
| background: #f8d7da; | |
| color: #721c24; | |
| border: 1px solid #f5c6cb; | |
| } | |
| .loading { | |
| display: none; | |
| text-align: center; | |
| padding: 20px; | |
| } | |
| .spinner { | |
| border: 4px solid #f3f3f3; | |
| border-top: 4px solid #3498db; | |
| border-radius: 50%; | |
| width: 40px; | |
| height: 40px; | |
| animation: spin 1s linear infinite; | |
| margin: 0 auto 10px; | |
| } | |
| @keyframes spin { | |
| 0% { transform: rotate(0deg); } | |
| 100% { transform: rotate(360deg); } | |
| } | |
| .hidden { | |
| display: none; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <div class="header"> | |
| <h1>π§ Virtual SSD Manager</h1> | |
| <p>Manage files on your two-tier virtual solid state drive</p> | |
| </div> | |
| <div class="main-content"> | |
| <div id="messages"></div> | |
| <!-- Upload Section --> | |
| <div class="section"> | |
| <h2>π€ Upload File</h2> | |
| <div class="upload-section"> | |
| <div class="file-input-wrapper"> | |
| <input type="file" id="fileInput" class="file-input"> | |
| <label for="fileInput" class="file-input-label">Choose File</label> | |
| </div> | |
| <br> | |
| <input type="text" id="filenameInput" class="filename-input" placeholder="Enter filename (optional)"> | |
| <button onclick="uploadFile()" class="btn btn-primary">Upload to Virtual SSD</button> | |
| </div> | |
| </div> | |
| <!-- Capacity Section --> | |
| <div class="section"> | |
| <h2>πΎ Storage Capacity</h2> | |
| <div id="capacityInfo" class="capacity-info"> | |
| <div class="loading"> | |
| <div class="spinner"></div> | |
| Loading capacity information... | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Files Section --> | |
| <div class="section"> | |
| <h2>π Files on Virtual SSD</h2> | |
| <button onclick="refreshFiles()" class="btn btn-primary">π Refresh</button> | |
| <button onclick="formatSSD()" class="btn btn-danger">ποΈ Format SSD</button> | |
| <div id="filesContainer" class="files-grid"> | |
| <div class="loading"> | |
| <div class="spinner"></div> | |
| Loading files... | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Statistics Section --> | |
| <div class="section"> | |
| <h2>π System Statistics</h2> | |
| <button onclick="refreshStats()" class="btn btn-success">π Refresh Stats</button> | |
| <div id="statsContainer" class="stats-grid"> | |
| <div class="loading"> | |
| <div class="spinner"></div> | |
| Loading statistics... | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script src="script.js"></script> | |
| </body> | |
| </html> | |