diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 1f154de..344c8aa 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -28,7 +28,7 @@ jobs: - name: Make dist directory run: | mkdir dist - rsync -R index.html meshmon.js meshmon.css protobufs/meshtastic/*.proto dist/ + rsync --relative --recursive index.html meshmon.js meshmon.css assets/ protobufs/meshtastic/*.proto dist/ - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact diff --git a/.gitmodules b/.gitmodules index 8614dd2..e6f376a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,3 @@ [submodule "protobufs"] path = protobufs url = https://github.com/meshtastic/protobufs.git - branch = v2.3.5 diff --git a/assets/github-mark-white.svg b/assets/github-mark-white.svg new file mode 100644 index 0000000..d5e6491 --- /dev/null +++ b/assets/github-mark-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/github-mark.svg b/assets/github-mark.svg new file mode 100644 index 0000000..37fa923 --- /dev/null +++ b/assets/github-mark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/meshtastic.svg b/assets/meshtastic.svg new file mode 100644 index 0000000..e6863f6 --- /dev/null +++ b/assets/meshtastic.svg @@ -0,0 +1,16 @@ + + + +Created with Fabric.js 4.6.0 + + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index eca4b38..dd3dff2 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,8 @@ Meshtastic MQTT Monitor - + - @@ -16,7 +15,7 @@ - +
@@ -33,11 +32,11 @@
- + - + @@ -56,7 +55,8 @@ - + + diff --git a/meshmon.css b/meshmon.css index 6a3ccc7..2e8b8aa 100644 --- a/meshmon.css +++ b/meshmon.css @@ -1,12 +1,17 @@ :root { + --font-family-main: Arial, sans-serif; + --font-family-verbatim: Monaco, monospace; + color-scheme: light; --font-color: #424242; --bg-color: white; --td-border: 1px solid #cbcbcb; - --packet-header-outbound-bg-color: #96f988; + --packet-header-outbound-bg-color: #a6dba2; --packet-header-bg-color: #dddddd; --filter-ok-bg-color: #8caeff; --filter-error-bg-color: #d5899c; + --logo-light-mode: block; + --logo-dark-mode: none; } [data-theme="dark"] { @@ -18,33 +23,35 @@ --packet-header-bg-color: #333333; --filter-ok-bg-color: #005596; --filter-error-bg-color: #4b2f36; + --logo-light-mode: none; + --logo-dark-mode: block; } body { - font-family: Verdana, sans-serif; + font-family: var(--font-family-main); + font-size: 14px; background-color: var(--bg-color); color: var(--font-color); } +.verbatim { + font-family: var(--font-family-verbatim); + font-size: 12px; +} +.table-main { + border-collapse: collapse; + border: none; +} .table-main td { white-space: nowrap; padding-left: 8px; padding-right: 8px; + border: var(--td-border); } .table-main thead { position: sticky; top: 0; } -.table-main thead, tbody { - font-family: monospace; -} -.table-main { - border-collapse: collapse; - border: none; -} -.table-main td { - border: var(--td-border); -} .table-main tr:first-child td { border-top: none; } @@ -71,12 +78,11 @@ body { .packet-header-row-outbound { background: var(--packet-header-outbound-bg-color); } -.decoded td { +.packet-decoded { text-align: left; - font-size: 80%; } #filter-expr-input { - width: 99%; + width: 100%; } .status-disconnected { background-color: #ea7a6c; @@ -93,37 +99,39 @@ body { #fit-row { visibility: collapse; - font-family: monospace; } .right { text-align: right; - margin-right: 1em; } .left { text-align: left; - margin-left: 1em; } -#connect-cell { - padding: 0; +.table-head, .table-foot { + width: 100%; } -.table-foot { +.table-head td, .table-foot td { padding: 0; width: 100%; + border: 0; } -.table-foot label, button, input, span { - font-family: Verdana, sans-serif; + +/* Source code link logo */ + +.logo { + height: 22px; } -.table-foot td { - padding: 0; - border: 0; +.logo-light { + display: var(--logo-light-mode); } -.table-foot a { - color: var(--font-color); +.logo-dark { + display: var(--logo-dark-mode); } +/* Theme switcher */ + .theme-switch-wrapper { - width: 6px; - align-items: right; + width: 40px; + padding-left: 10px; } .theme-switch { @@ -175,3 +183,9 @@ input:checked+.theme-slider:before { .theme-slider.round:before { border-radius: 50%; } + +/* For Safari */ +input, button { + font-family: var(--font-family-main); + font-size: 14px; +} diff --git a/meshmon.js b/meshmon.js index 01d364a..ef8edce 100644 --- a/meshmon.js +++ b/meshmon.js @@ -273,9 +273,9 @@ function render(se) { var headerRow = tbody.insertRow(); if (se.packet.rxRssi == 0) { - headerRow.className = 'packet-header-row-outbound'; + headerRow.className = 'packet-header-row-outbound verbatim'; } else { - headerRow.className = 'packet-header-row'; + headerRow.className = 'packet-header-row verbatim'; } fields.forEach((field) => { @@ -306,12 +306,12 @@ function render(se) { } var row = tbody.insertRow(); - row.className = 'decoded'; var cell = row.insertCell(); + cell.className = 'packet-decoded verbatim'; cell.colSpan = fields.length; var decoded = document.createElement('pre'); - cell.appendChild(decoded); decoded.textContent = decodedText; + cell.appendChild(decoded); } function mqttOnMessage(topic, message) {