index.html 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. .btn-custom { background-color: #0B61A4; color: white; transition: all 0.2s; }
  10. .btn-custom:hover { background-color: #084b82; color: white; transform: translateY(-1px); }
  11. </style>
  12. </head>
  13. <body class="bg-light">
  14. <nav class="navbar navbar-dark shadow-sm py-2" style="background-color: #0B61A4;">
  15. <div class="container d-flex align-items-center">
  16. <div class="d-flex align-items-center">
  17. <img src="patch-manager/static/logo.png" alt="ArduPilot Logo" height="35" class="d-inline-block align-text-top me-3">
  18. <span class="navbar-brand mb-0 h4 fw-bold">Overlay Manager</span>
  19. </div>
  20. <div class="ms-auto">
  21. <a href="javascript:void(0);" onclick="window.location.href = window.location.protocol + '//' + window.location.hostname;" class="btn btn-outline-light btn-sm">
  22. <i class="bi bi-arrow-left me-1"></i>Back to Main App
  23. </a>
  24. </div>
  25. </div>
  26. </nav>
  27. <div class="container mt-4">
  28. <div class="row mb-4 g-4">
  29. <div class="col-md-7">
  30. <div class="card shadow border-0 rounded-3 h-100">
  31. <div class="card-body p-4">
  32. <h5 class="card-title fw-bold text-secondary mb-3"><i class="bi bi-cloud-arrow-up-fill me-2 text-primary"></i>Upload to Folder</h5>
  33. <form action="/patch-manager/upload" method="post" enctype="multipart/form-data" class="d-flex flex-column gap-3">
  34. <input class="form-control border-primary" type="file" name="file" required>
  35. <div class="input-group">
  36. <span class="input-group-text bg-light border-primary text-secondary"><i class="bi bi-folder2-open"></i></span>
  37. <select class="form-select border-primary" name="target_path">
  38. {% for d in dirs %}
  39. <option value="{{ d }}">{% if d == "" %}/ (Root Directory){% else %}{{ d }}{% endif %}</option>
  40. {% endfor %}
  41. </select>
  42. </div>
  43. <button type="submit" class="btn btn-custom fw-bold mt-auto">Upload File</button>
  44. </form>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="col-md-5">
  49. <div class="card shadow border-0 rounded-3 h-100">
  50. <div class="card-body p-4">
  51. <h5 class="card-title fw-bold text-secondary mb-3"><i class="bi bi-folder-plus me-2 text-success"></i>Create New Folder</h5>
  52. <form action="/patch-manager/create_folder" method="post" class="d-flex flex-column gap-3">
  53. <input type="text" class="form-control border-primary" name="folder_path" placeholder="Path (e.g., libraries/AP_HAL)" required>
  54. <button type="submit" class="btn btn-success fw-bold mt-auto">Create Folder</button>
  55. </form>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="card shadow border-0 rounded-3">
  61. <div class="card-body p-0">
  62. <table class="table table-hover align-middle mb-0">
  63. <thead class="table-light"><tr><th class="ps-4 py-3">Source Path</th><th class="text-end pe-4 py-3">Actions</th></tr></thead>
  64. <tbody>
  65. {% for file in files %}
  66. <tr>
  67. <td class="ps-4 font-monospace">{{ file }}</td>
  68. <td class="text-end pe-4">
  69. <a href="/patch-manager/edit?filepath={{ file }}" class="btn btn-sm btn-outline-primary me-2"><i class="bi bi-pencil"></i> Edit</a>
  70. <form action="/patch-manager/delete" method="post" class="d-inline" onsubmit="return confirm('Delete this file?');">
  71. <input type="hidden" name="filepath" value="{{ file }}">
  72. <button type="submit" class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i> Delete</button>
  73. </form>
  74. </td>
  75. </tr>
  76. {% endfor %}
  77. </tbody>
  78. </table>
  79. </div>
  80. </div>
  81. </div>
  82. </body>
  83. </html>