index.html 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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="iso" class="form-label">ISO File</label>
  46. <select class="form-control" id="iso" required>
  47. <option value="">Select ISO</option>
  48. </select>
  49. </div>
  50. <button type="submit" class="btn btn-success">Create VM</button>
  51. </form>
  52. <h2 class="mt-4">Set Boot Order</h2>
  53. <form id="setBootOrderForm">
  54. <div class="mb-3">
  55. <label for="bootVM" class="form-label">VM Name</label>
  56. <select class="form-control" id="bootVM" required>
  57. <option value="">Select VM</option>
  58. </select>
  59. </div>
  60. <div class="mb-3">
  61. <label for="bootOrder" class="form-label">Boot Order (comma separated, e.g. hd,cdrom)</label>
  62. <input type="text" class="form-control" id="bootOrder" placeholder="hd,cdrom" required>
  63. </div>
  64. <button type="submit" class="btn btn-warning">Set Boot Order</button>
  65. </form>
  66. <h2 class="mt-4">Upload ISO</h2>
  67. <form id="uploadIsoForm" enctype="multipart/form-data">
  68. <div class="mb-3">
  69. <label for="isoFile" class="form-label">Select ISO File</label>
  70. <input type="file" class="form-control" id="isoFile" accept=".iso" required>
  71. </div>
  72. <button type="submit" class="btn btn-secondary">Upload ISO</button>
  73. </form>
  74. <h2 class="mt-4">Manage ISOs</h2>
  75. <button class="btn btn-info mb-3" onclick="loadISOs()">Refresh ISOs</button>
  76. <table class="table table-striped" id="isoTable">
  77. <thead>
  78. <tr>
  79. <th>Name</th>
  80. <th>Actions</th>
  81. </tr>
  82. </thead>
  83. <tbody id="isoTableBody">
  84. </tbody>
  85. </table>
  86. </div>
  87. </div>
  88. </div>
  89. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  90. <script src="/static/app.js"></script>
  91. </body>
  92. </html>