index.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>VirtManager</title>
  7. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  8. </head>
  9. <body>
  10. <div class="container mt-5">
  11. <h1 class="mb-4">VirtManager</h1>
  12. <div class="row">
  13. <div class="col-md-8">
  14. <h2>Virtual Machines</h2>
  15. <button class="btn btn-primary mb-3" onclick="loadVMs()">Refresh</button>
  16. <table class="table table-striped" id="vmTable">
  17. <thead>
  18. <tr>
  19. <th>ID</th>
  20. <th>Name</th>
  21. <th>State</th>
  22. <th>Actions</th>
  23. </tr>
  24. </thead>
  25. <tbody id="vmTableBody">
  26. </tbody>
  27. </table>
  28. </div>
  29. <div class="col-md-4">
  30. <h2>Create VM</h2>
  31. <form id="createVMForm">
  32. <div class="mb-3">
  33. <label for="name" class="form-label">Name</label>
  34. <input type="text" class="form-control" id="name" required>
  35. </div>
  36. <div class="mb-3">
  37. <label for="memory" class="form-label">Memory (MiB)</label>
  38. <input type="number" class="form-control" id="memory" required>
  39. </div>
  40. <div class="mb-3">
  41. <label for="disk_size" class="form-label">Disk Size (GB)</label>
  42. <input type="number" class="form-control" id="disk_size" required>
  43. </div>
  44. <div class="mb-3">
  45. <label for="cpus" class="form-label">CPUs</label>
  46. <input type="number" class="form-control" id="cpus" value="1" min="1" required>
  47. </div>
  48. <div class="mb-3">
  49. <label for="iso" class="form-label">ISO File</label>
  50. <select class="form-control" id="iso" required>
  51. <option value="">Select ISO</option>
  52. </select>
  53. </div>
  54. <button type="submit" class="btn btn-success">Create VM</button>
  55. </form>
  56. <h2 class="mt-4">Set Boot Order</h2>
  57. <form id="setBootOrderForm">
  58. <div class="mb-3">
  59. <label for="bootVM" class="form-label">VM Name</label>
  60. <select class="form-control" id="bootVM" required>
  61. <option value="">Select VM</option>
  62. </select>
  63. </div>
  64. <div class="mb-3">
  65. <label for="bootOrder" class="form-label">Boot Order (comma separated, e.g. hd,cdrom)</label>
  66. <input type="text" class="form-control" id="bootOrder" placeholder="hd,cdrom" required>
  67. </div>
  68. <button type="submit" class="btn btn-warning">Set Boot Order</button>
  69. </form>
  70. <h2 class="mt-4">Upload ISO</h2>
  71. <form id="uploadIsoForm" enctype="multipart/form-data">
  72. <div class="mb-3">
  73. <label for="isoFile" class="form-label">Select ISO File</label>
  74. <input type="file" class="form-control" id="isoFile" accept=".iso" required>
  75. </div>
  76. <div class="mb-3" id="progressContainer" style="display: none;">
  77. <label for="uploadProgress" class="form-label">Progress</label>
  78. <div class="progress">
  79. <div class="progress-bar" id="uploadProgress" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
  80. </div>
  81. </div>
  82. <button type="submit" class="btn btn-secondary" id="uploadBtn">Upload ISO</button>
  83. </form>
  84. <h2 class="mt-4">Manage ISOs</h2>
  85. <button class="btn btn-info mb-3" onclick="loadISOs()">Refresh ISOs</button>
  86. <table class="table table-striped" id="isoTable">
  87. <thead>
  88. <tr>
  89. <th>Name</th>
  90. <th>Actions</th>
  91. </tr>
  92. </thead>
  93. <tbody id="isoTableBody">
  94. </tbody>
  95. </table>
  96. </div>
  97. </div>
  98. </div>
  99. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  100. <script src="/static/app.js"></script>
  101. </body>
  102. </html>