diff --git a/src/dashboard/templates.py b/src/dashboard/templates.py index 5da2c16..3925be0 100644 --- a/src/dashboard/templates.py +++ b/src/dashboard/templates.py @@ -310,6 +310,80 @@ DASHBOARD_HTML = """ color: #856404; border: 1px solid #ffeaa7; } + + /* Table Layout Fixes for Protocol Mappings */ + .protocol-mappings-table-container { + overflow-x: auto; + margin-top: 20px; + } + + #protocol-mappings-table { + table-layout: fixed; + width: 100%; + min-width: 800px; + } + + #protocol-mappings-table th, + #protocol-mappings-table td { + padding: 8px 10px; + border: 1px solid #ddd; + text-align: left; + word-wrap: break-word; + overflow-wrap: break-word; + } + + #protocol-mappings-table th:nth-child(1) { width: 10%; min-width: 80px; } /* ID */ + #protocol-mappings-table th:nth-child(2) { width: 8%; min-width: 80px; } /* Protocol */ + #protocol-mappings-table th:nth-child(3) { width: 15%; min-width: 120px; } /* Station */ + #protocol-mappings-table th:nth-child(4) { width: 15%; min-width: 120px; } /* Equipment */ + #protocol-mappings-table th:nth-child(5) { width: 15%; min-width: 120px; } /* Data Type */ + #protocol-mappings-table th:nth-child(6) { width: 12%; min-width: 100px; } /* Protocol Address */ + #protocol-mappings-table th:nth-child(7) { width: 15%; min-width: 120px; } /* Database Source */ + #protocol-mappings-table th:nth-child(8) { width: 10%; min-width: 100px; } /* Actions */ + + /* Protocol Signals Table */ + .protocol-signals-table-container { + overflow-x: auto; + margin-top: 20px; + } + + #protocol-signals-table { + table-layout: fixed; + width: 100%; + min-width: 700px; + } + + #protocol-signals-table th, + #protocol-signals-table td { + padding: 8px 10px; + border: 1px solid #ddd; + text-align: left; + word-wrap: break-word; + overflow-wrap: break-word; + } + + #protocol-signals-table th:nth-child(1) { width: 20%; min-width: 120px; } /* Signal Name */ + #protocol-signals-table th:nth-child(2) { width: 12%; min-width: 100px; } /* Protocol Type */ + #protocol-signals-table th:nth-child(3) { width: 20%; min-width: 150px; } /* Tags */ + #protocol-signals-table th:nth-child(4) { width: 15%; min-width: 100px; } /* Protocol Address */ + #protocol-signals-table th:nth-child(5) { width: 18%; min-width: 120px; } /* Database Source */ + #protocol-signals-table th:nth-child(6) { width: 8%; min-width: 80px; } /* Status */ + #protocol-signals-table th:nth-child(7) { width: 7%; min-width: 100px; } /* Actions */ + + /* Mobile responsiveness */ + @media (max-width: 768px) { + .protocol-mappings-table-container, + .protocol-signals-table-container { + font-size: 14px; + } + + #protocol-mappings-table th, + #protocol-mappings-table td, + #protocol-signals-table th, + #protocol-signals-table td { + padding: 6px 8px; + } + }
@@ -638,18 +712,18 @@ DASHBOARD_HTML = """ -| ID | -Protocol | -Station (Name & ID) | -Equipment (Name & ID) | -Data Type (Name & ID) | -Protocol Address | -Database Source | -Actions | +ID | +Protocol | +Station (Name & ID) | +Equipment (Name & ID) | +Data Type (Name & ID) | +Protocol Address | +Database Source | +Actions |
|---|
| Signal Name | -Protocol Type | -Tags | -Protocol Address | -Database Source | -Status | -Actions | +Signal Name | +Protocol Type | +Tags | +Protocol Address | +Database Source | +Status | +Actions |
|---|