index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. <button class="btn btn-primary mb-3" onclick="loadVMsCard()">New Refresh</button>
  17. <table class="table table-striped" id="vmTable">
  18. <thead>
  19. <tr>
  20. <th>ID</th>
  21. <th>Name</th>
  22. <th>State</th>
  23. <th>Actions</th>
  24. </tr>
  25. </thead>
  26. <tbody id="vmTableBody">
  27. </tbody>
  28. </table>
  29. <div class="card" style="width: 18rem;" id="vmCard">
  30. </div>
  31. </div>
  32. <div class="col-md-4">
  33. <h2>Create VM</h2>
  34. <form id="createVMForm">
  35. <div class="mb-3">
  36. <label for="name" class="form-label">Name</label>
  37. <input type="text" class="form-control" id="name" required>
  38. </div>
  39. <div class="mb-3">
  40. <label for="memory" class="form-label">Memory (MiB)</label>
  41. <input type="number" class="form-control" id="memory" required>
  42. </div>
  43. <div class="mb-3">
  44. <label for="disk_size" class="form-label">Disk Size (GB)</label>
  45. <input type="number" class="form-control" id="disk_size" required>
  46. </div>
  47. <div class="mb-3">
  48. <label for="iso" class="form-label">ISO File</label>
  49. <select class="form-control" id="iso" required>
  50. <option value="">Select ISO</option>
  51. </select>
  52. </div>
  53. <button type="submit" class="btn btn-success">Create VM</button>
  54. </form>
  55. <h2 class="mt-4">Set Boot Order</h2>
  56. <form id="setBootOrderForm">
  57. <div class="mb-3">
  58. <label for="bootVM" class="form-label">VM Name</label>
  59. <select class="form-control" id="bootVM" required>
  60. <option value="">Select VM</option>
  61. </select>
  62. </div>
  63. <div class="mb-3">
  64. <label for="bootOrder" class="form-label">Boot Order (comma separated, e.g. hd,cdrom)</label>
  65. <input type="text" class="form-control" id="bootOrder" placeholder="hd,cdrom" required>
  66. </div>
  67. <button type="submit" class="btn btn-warning">Set Boot Order</button>
  68. </form>
  69. <h2 class="mt-4">Upload ISO</h2>
  70. <form id="uploadIsoForm" enctype="multipart/form-data">
  71. <div class="mb-3">
  72. <label for="isoFile" class="form-label">Select ISO File</label>
  73. <input type="file" class="form-control" id="isoFile" accept=".iso" required>
  74. </div>
  75. <button type="submit" class="btn btn-secondary">Upload ISO</button>
  76. </form>
  77. <h2 class="mt-4">Manage ISOs</h2>
  78. <button class="btn btn-info mb-3" onclick="loadISOs()">Refresh ISOs</button>
  79. <table class="table table-striped" id="isoTable">
  80. <thead>
  81. <tr>
  82. <th>Name</th>
  83. <th>Actions</th>
  84. </tr>
  85. </thead>
  86. <tbody id="isoTableBody">
  87. </tbody>
  88. </table>
  89. </div>
  90. </div>
  91. </div>
  92. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  93. <script src="/static/app.js"></script>
  94. </body>
  95. </html>