index.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>ArduPilot Overlay Manager</title>
  6. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  7. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
  8. <style>
  9. /* Ensures the body takes up at least the full height of the viewport */
  10. html, body {
  11. height: 100%;
  12. }
  13. body {
  14. display: flex;
  15. flex-direction: column;
  16. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  17. }
  18. .content-wrapper {
  19. flex: 1 0 auto; /* Pushes the footer down */
  20. }
  21. .navbar-brand { font-size: 25px; }
  22. .card { border-radius: 8px; }
  23. .table-light { background-color: #f8f9fa; }
  24. footer {
  25. flex-shrink: 0; /* Prevents footer from shrinking */
  26. }
  27. </style>
  28. </head>
  29. <body class="bg-light">
  30. <div class="content-wrapper">
  31. <nav class="navbar navbar-dark bg-dark shadow-sm py-2">
  32. <div class="container-fluid px-4">
  33. <div class="d-flex align-items-center">
  34. <a class="navbar-brand d-flex align-items-center" href="/">
  35. <img src="/static/images/ardupilot_logo.png" alt="ArduPilot" height="24" class="d-inline-block align-text-top me-2">
  36. <span class="text-white">Overlay Manager</span>
  37. </a>
  38. </div>
  39. <div class="ms-auto">
  40. <a href="javascript:void(0);" onclick="window.location.href = window.location.protocol + '//' + window.location.hostname;" class="btn btn-outline-light">
  41. <i class="bi bi-arrow-left me-2"></i>Back to Main App
  42. </a>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="container-fluid px-4 mt-4">
  47. <div class="row mb-4 g-4">
  48. <div class="col-md-7">
  49. <div class="card shadow-sm border-0 h-100">
  50. <div class="card-header bg-white py-3">
  51. <h5 class="card-title mb-0 fw-bold text-dark">
  52. <i class="bi bi-cloud-arrow-up-fill me-2 text-info"></i>Upload to Folder
  53. </h5>
  54. </div>
  55. <div class="card-body p-4">
  56. <form action="/patch-manager/upload" method="post" enctype="multipart/form-data" class="d-flex flex-column gap-3">
  57. <label class="form-label small fw-bold text-muted mb-0">Select File</label>
  58. <input class="form-control" type="file" name="file" required>
  59. <label class="form-label small fw-bold text-muted mb-0">Target Directory</label>
  60. <div class="input-group">
  61. <span class="input-group-text bg-light"><i class="bi bi-folder2-open"></i></span>
  62. <select class="form-select" name="target_path">
  63. {% for d in dirs %}
  64. <option value="{{ d }}">{% if d == "" %}/ (Root Directory){% else %}{{ d }}{% endif %}</option>
  65. {% endfor %}
  66. </select>
  67. </div>
  68. <button type="submit" class="btn btn-primary fw-bold mt-2">
  69. <i class="bi bi-upload me-2"></i>Upload File
  70. </button>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="col-md-5">
  76. <div class="card shadow-sm border-0 h-100">
  77. <div class="card-header bg-white py-3">
  78. <h5 class="card-title mb-0 fw-bold text-dark">
  79. <i class="bi bi-folder-plus me-2 text-success"></i>Create New Folder
  80. </h5>
  81. </div>
  82. <div class="card-body p-4">
  83. <form action="/patch-manager/create_folder" method="post" class="d-flex flex-column gap-3">
  84. <label class="form-label small fw-bold text-muted mb-0">Folder Path</label>
  85. <input type="text" class="form-control" name="folder_path" placeholder="e.g., libraries/AP_HAL" required>
  86. <button type="submit" class="btn btn-success fw-bold mt-2">
  87. <i class="bi bi-plus-lg me-2"></i>Create Folder
  88. </button>
  89. </form>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="card shadow-sm border-0 mb-5">
  95. <div class="card-header bg-white py-3">
  96. <h5 class="card-title mb-0 fw-bold text-dark">
  97. <i class="bi bi-files me-2 text-primary"></i>Managed Files
  98. </h5>
  99. </div>
  100. <div class="card-body p-0">
  101. <div class="table-responsive">
  102. <table class="table table-hover align-middle mb-0">
  103. <thead class="table-light">
  104. <tr>
  105. <th class="ps-4 py-3">Source Path</th>
  106. <th class="text-end pe-4 py-3">Actions</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. {% for file in files %}
  111. <tr>
  112. <td class="ps-4 font-monospace text-primary" style="font-size: 0.9rem;">{{ file }}</td>
  113. <td class="text-end pe-4">
  114. <a href="/patch-manager/edit?filepath={{ file }}" class="btn btn-sm btn-outline-primary me-2">
  115. <i class="bi bi-pencil me-1"></i> Edit
  116. </a>
  117. <form action="/patch-manager/delete" method="post" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this file?');">
  118. <input type="hidden" name="filepath" value="{{ file }}">
  119. <button type="submit" class="btn btn-sm btn-outline-danger">
  120. <i class="bi bi-trash me-1"></i> Delete
  121. </button>
  122. </form>
  123. </td>
  124. </tr>
  125. {% endfor %}
  126. </tbody>
  127. </table>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. <footer class="py-3 bg-dark text-white-50">
  134. <div class="container-fluid px-4 d-flex justify-content-between">
  135. <div>
  136. <span class="mx-2">Credits:
  137. <a href="https://github.com/ArduPilot/CustomBuild/graphs/contributors" style="text-decoration: underline; color: white;">See Contributors</a>
  138. </span>|
  139. <span class="mx-2">Source:
  140. <a href="https://git.equalmass.com/Equalmass/ArdupilotCustomFirmwareBuilder" style="text-decoration: underline; color: white;">Ardupilot/CustomBuild</a>
  141. </span>
  142. </div>
  143. <span>ArduPilot Overlay Manager</span>
  144. </div>
  145. </footer>
  146. </body>
  147. </html>