Selaa lähdekoodia

changed style of the overlay manager

Nicole 1 kuukausi sitten
vanhempi
sitoutus
0cf935f37a
1 muutettua tiedostoa jossa 127 lisäystä ja 62 poistoa
  1. 127 62
      overlay_manager/templates/index.html

+ 127 - 62
overlay_manager/templates/index.html

@@ -6,83 +6,148 @@
     <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
     <style>
-        .btn-custom { background-color: #0B61A4; color: white; transition: all 0.2s; }
-        .btn-custom:hover { background-color: #084b82; color: white; transform: translateY(-1px); }
+        /* Ensures the body takes up at least the full height of the viewport */
+        html, body {
+            height: 100%;
+        }
+        body {
+            display: flex;
+            flex-direction: column;
+            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
+        }
+        .content-wrapper {
+            flex: 1 0 auto; /* Pushes the footer down */
+        }
+        .navbar-brand { font-size: 25px; }
+        .card { border-radius: 8px; }
+        .table-light { background-color: #f8f9fa; }
+        footer {
+            flex-shrink: 0; /* Prevents footer from shrinking */
+        }
     </style>
 </head>
 <body class="bg-light">
-    <nav class="navbar navbar-dark shadow-sm py-2" style="background-color: #0B61A4;">
-        <div class="container d-flex align-items-center">
-            <div class="d-flex align-items-center">
-                <img src="patch-manager/static/logo.png" alt="ArduPilot Logo" height="35" class="d-inline-block align-text-top me-3">
-                <span class="navbar-brand mb-0 h4 fw-bold">Overlay Manager</span>
-            </div>
-            <div class="ms-auto">
-                <a href="javascript:void(0);" onclick="window.location.href = window.location.protocol + '//' + window.location.hostname;" class="btn btn-outline-light btn-sm">
-                    <i class="bi bi-arrow-left me-1"></i>Back to Main App
-                </a>
+    <div class="content-wrapper">
+        <nav class="navbar navbar-dark bg-dark shadow-sm py-2">
+            <div class="container-fluid px-4">
+                <div class="d-flex align-items-center">
+                    <a class="navbar-brand d-flex align-items-center" href="/">
+                        <img src="/static/images/ardupilot_logo.png" alt="ArduPilot" height="24" class="d-inline-block align-text-top me-2">
+                        <span class="text-white">Overlay Manager</span>
+                    </a>
+                </div>
+                <div class="ms-auto">
+                    <a href="javascript:void(0);" onclick="window.location.href = window.location.protocol + '//' + window.location.hostname;" class="btn btn-outline-light">
+                        <i class="bi bi-arrow-left me-2"></i>Back to Main App
+                    </a>
+                </div>
             </div>
-        </div>
-    </nav>
-    <div class="container mt-4">
-        
-        <div class="row mb-4 g-4">
-            <div class="col-md-7">
-                <div class="card shadow border-0 rounded-3 h-100">
-                    <div class="card-body p-4">
-                        <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>
-                        <form action="/patch-manager/upload" method="post" enctype="multipart/form-data" class="d-flex flex-column gap-3">
-                            <input class="form-control border-primary" type="file" name="file" required>
-                            
-                            <div class="input-group">
-                                <span class="input-group-text bg-light border-primary text-secondary"><i class="bi bi-folder2-open"></i></span>
-                                <select class="form-select border-primary" name="target_path">
-                                    {% for d in dirs %}
-                                        <option value="{{ d }}">{% if d == "" %}/ (Root Directory){% else %}{{ d }}{% endif %}</option>
-                                    {% endfor %}
-                                </select>
-                            </div>
+        </nav>
+
+        <div class="container-fluid px-4 mt-4">
+            <div class="row mb-4 g-4">
+                <div class="col-md-7">
+                    <div class="card shadow-sm border-0 h-100">
+                        <div class="card-header bg-white py-3">
+                            <h5 class="card-title mb-0 fw-bold text-dark">
+                                <i class="bi bi-cloud-arrow-up-fill me-2 text-info"></i>Upload to Folder
+                            </h5>
+                        </div>
+                        <div class="card-body p-4">
+                            <form action="/patch-manager/upload" method="post" enctype="multipart/form-data" class="d-flex flex-column gap-3">
+                                <label class="form-label small fw-bold text-muted mb-0">Select File</label>
+                                <input class="form-control" type="file" name="file" required>
+                                
+                                <label class="form-label small fw-bold text-muted mb-0">Target Directory</label>
+                                <div class="input-group">
+                                    <span class="input-group-text bg-light"><i class="bi bi-folder2-open"></i></span>
+                                    <select class="form-select" name="target_path">
+                                        {% for d in dirs %}
+                                            <option value="{{ d }}">{% if d == "" %}/ (Root Directory){% else %}{{ d }}{% endif %}</option>
+                                        {% endfor %}
+                                    </select>
+                                </div>
 
-                            <button type="submit" class="btn btn-custom fw-bold mt-auto">Upload File</button>
-                        </form>
+                                <button type="submit" class="btn btn-primary fw-bold mt-2">
+                                    <i class="bi bi-upload me-2"></i>Upload File
+                                </button>
+                            </form>
+                        </div>
+                    </div>
+                </div>
+
+                <div class="col-md-5">
+                    <div class="card shadow-sm border-0 h-100">
+                        <div class="card-header bg-white py-3">
+                            <h5 class="card-title mb-0 fw-bold text-dark">
+                                <i class="bi bi-folder-plus me-2 text-success"></i>Create New Folder
+                            </h5>
+                        </div>
+                        <div class="card-body p-4">
+                            <form action="/patch-manager/create_folder" method="post" class="d-flex flex-column gap-3">
+                                <label class="form-label small fw-bold text-muted mb-0">Folder Path</label>
+                                <input type="text" class="form-control" name="folder_path" placeholder="e.g., libraries/AP_HAL" required>
+                                <button type="submit" class="btn btn-success fw-bold mt-2">
+                                    <i class="bi bi-plus-lg me-2"></i>Create Folder
+                                </button>
+                            </form>
+                        </div>
                     </div>
                 </div>
             </div>
 
-            <div class="col-md-5">
-                <div class="card shadow border-0 rounded-3 h-100">
-                    <div class="card-body p-4">
-                        <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>
-                        <form action="/patch-manager/create_folder" method="post" class="d-flex flex-column gap-3">
-                            <input type="text" class="form-control border-primary" name="folder_path" placeholder="Path (e.g., libraries/AP_HAL)" required>
-                            <button type="submit" class="btn btn-success fw-bold mt-auto">Create Folder</button>
-                        </form>
+            <div class="card shadow-sm border-0 mb-5">
+                <div class="card-header bg-white py-3">
+                    <h5 class="card-title mb-0 fw-bold text-dark">
+                        <i class="bi bi-files me-2 text-primary"></i>Managed Files
+                    </h5>
+                </div>
+                <div class="card-body p-0">
+                    <div class="table-responsive">
+                        <table class="table table-hover align-middle mb-0">
+                            <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>
+                            <tbody>
+                                {% for file in files %}
+                                <tr>
+                                    <td class="ps-4 font-monospace text-primary" style="font-size: 0.9rem;">{{ file }}</td>
+                                    <td class="text-end pe-4">
+                                        <a href="/patch-manager/edit?filepath={{ file }}" class="btn btn-sm btn-outline-primary me-2">
+                                            <i class="bi bi-pencil me-1"></i> Edit
+                                        </a>
+                                        <form action="/patch-manager/delete" method="post" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this file?');">
+                                            <input type="hidden" name="filepath" value="{{ file }}">
+                                            <button type="submit" class="btn btn-sm btn-outline-danger">
+                                                <i class="bi bi-trash me-1"></i> Delete
+                                            </button>
+                                        </form>
+                                    </td>
+                                </tr>
+                                {% endfor %}
+                            </tbody>
+                        </table>
                     </div>
                 </div>
             </div>
         </div>
+    </div>
 
-        <div class="card shadow border-0 rounded-3">
-            <div class="card-body p-0">
-                <table class="table table-hover align-middle mb-0">
-                    <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>
-                    <tbody>
-                        {% for file in files %}
-                        <tr>
-                            <td class="ps-4 font-monospace">{{ file }}</td>
-                            <td class="text-end pe-4">
-                                <a href="/patch-manager/edit?filepath={{ file }}" class="btn btn-sm btn-outline-primary me-2"><i class="bi bi-pencil"></i> Edit</a>
-                                <form action="/patch-manager/delete" method="post" class="d-inline" onsubmit="return confirm('Delete this file?');">
-                                    <input type="hidden" name="filepath" value="{{ file }}">
-                                    <button type="submit" class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i> Delete</button>
-                                </form>
-                            </td>
-                        </tr>
-                        {% endfor %}
-                    </tbody>
-                </table>
+    <footer class="py-3 bg-dark text-white-50">
+        <div class="container-fluid px-4 d-flex justify-content-between">
+            <div>
+                <span class="mx-2">Credits: 
+                    <a href="https://github.com/ArduPilot/CustomBuild/graphs/contributors" style="text-decoration: underline; color: white;">See Contributors</a>
+                </span>|
+                <span class="mx-2">Source:
+                    <a href="https://git.equalmass.com/Equalmass/ArdupilotCustomFirmwareBuilder" style="text-decoration: underline; color: white;">Ardupilot/CustomBuild</a>
+                </span>
             </div>
+            <span>ArduPilot Overlay Manager</span>
         </div>
-    </div>
+    </footer>
 </body>
 </html>