fix: v0.6.8 - Bugfixes: Node-Sync, Modal, Badge, CSS
- bot.py: pub.subscribe vor TCPInterface verschoben; Nodes beim Start wurden nicht geladen da connection.established/node.updated Events verpasst wurden. Fallback-Sync nach Konstruktor ergaenzt. - HTML: tabler.min.js -> bootstrap.bundle.min.js; Tabler exportiert bootstrap nicht global, new bootstrap.Modal() schlug fehl. - dashboard.js: badge-pill -> rounded-pill (Bootstrap 4 -> 5) - style.css: --tblr-bg-body Typo -> --tblr-body-bg Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6499d90921
commit
0b68c0417d
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -1,5 +1,16 @@
|
|||
# Changelog
|
||||
|
||||
## [0.6.8] - 2026-02-18
|
||||
|
||||
### Fixed
|
||||
- **bot.py**: `pub.subscribe()` wurde nach `TCPInterface()` aufgerufen → `connection.established`
|
||||
und `node.updated`-Events beim Start wurden verpasst; Nodes nicht geladen, Status blieb
|
||||
"Getrennt". Subscriptions werden jetzt VOR dem Konstruktor registriert + Fallback danach.
|
||||
- **HTML**: `tabler.min.js` exportiert `bootstrap` nicht global → `new bootstrap.Modal()` schlug
|
||||
fehl, Seiten brachen ab. Zurück zu `bootstrap.bundle.min.js` (Tabler CSS bleibt).
|
||||
- **dashboard.js**: Bootstrap-4-Klasse `badge-pill` durch `rounded-pill` (Bootstrap 5) ersetzt.
|
||||
- **style.css**: CSS-Variablen-Typo `--tblr-bg-body` → `--tblr-body-bg`.
|
||||
|
||||
## [0.6.7] - 2026-02-17
|
||||
|
||||
### Changed
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
version: "0.6.7"
|
||||
version: "0.6.8"
|
||||
|
||||
bot:
|
||||
name: "MeshDD-Bot"
|
||||
command_prefix: "?"
|
||||
|
||||
meshtastic:
|
||||
host: "192.168.11.11"
|
||||
host: "192.168.11.4"
|
||||
port: 4403
|
||||
|
||||
web:
|
||||
host: "0.0.0.0"
|
||||
port: 8080
|
||||
port: 8081
|
||||
|
||||
database:
|
||||
path: "meshdd.db"
|
||||
|
|
|
|||
|
|
@ -27,11 +27,28 @@ class MeshBot:
|
|||
host = config.get("meshtastic.host", "localhost")
|
||||
port = config.get("meshtastic.port", 4403)
|
||||
logger.info("Connecting to Meshtastic at %s:%s", host, port)
|
||||
self.interface = TCPInterface(hostname=host, portNumber=port)
|
||||
# Subscribe BEFORE creating the interface: TCPInterface fires
|
||||
# connection.established and node.updated from a background thread
|
||||
# during its constructor, so late subscriptions miss those events.
|
||||
pub.subscribe(self._on_receive, "meshtastic.receive")
|
||||
pub.subscribe(self._on_connection, "meshtastic.connection.established")
|
||||
pub.subscribe(self._on_connection_lost, "meshtastic.connection.lost")
|
||||
pub.subscribe(self._on_node_updated, "meshtastic.node.updated")
|
||||
self.interface = TCPInterface(hostname=host, portNumber=port)
|
||||
# Fallback: if connection.established fired before our subscription
|
||||
# was registered, set the flag and sync initial nodes manually.
|
||||
if not self._connected:
|
||||
logger.warning("connection.established missed – applying fallback")
|
||||
self._connected = True
|
||||
if self.ws_manager:
|
||||
self.loop.call_soon_threadsafe(
|
||||
asyncio.ensure_future, self._broadcast_bot_status()
|
||||
)
|
||||
if self.interface.nodes:
|
||||
for node in self.interface.nodes.values():
|
||||
self.loop.call_soon_threadsafe(
|
||||
asyncio.ensure_future, self._handle_node_update(node)
|
||||
)
|
||||
logger.info("Connected to Meshtastic")
|
||||
|
||||
def disconnect(self):
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tabler/core@1.4.0/dist/js/tabler.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
<script src="/static/js/admin.js"></script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
margin-left: 210px;
|
||||
padding: .875rem;
|
||||
min-height: calc(100vh - 48px);
|
||||
background: var(--tblr-bg-body, var(--bs-body-bg));
|
||||
background: var(--tblr-body-bg, var(--bs-body-bg));
|
||||
}
|
||||
|
||||
/* ── Info Boxes ──────────────────────────────────────────────── */
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tabler/core@1.4.0/dist/js/tabler.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.4/dist/chart.umd.min.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ function addMessage(msg) {
|
|||
item.innerHTML = `
|
||||
<div class="d-flex justify-content-between align-items-center mb-1">
|
||||
<small class="fw-medium"><i class="bi ${icon} me-1 text-body-secondary"></i>${escapeHtml(from)}</small>
|
||||
<small class="text-body-secondary"><span class="badge badge-pill bg-secondary text-white me-1">${escapeHtml(chName)}</span>${time}</small>
|
||||
<small class="text-body-secondary"><span class="badge rounded-pill bg-secondary text-white me-1">${escapeHtml(chName)}</span>${time}</small>
|
||||
</div>
|
||||
<div class="${bubbleClass}">${escapeHtml(msg.payload || '')}</div>`;
|
||||
if (msgChannelFilter !== 'all' && String(chIdx) !== msgChannelFilter) {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
</div>
|
||||
</main>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tabler/core@1.4.0/dist/js/tabler.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/static/js/login.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tabler/core@1.4.0/dist/js/tabler.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
<script src="/static/js/scheduler.js"></script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@
|
|||
</div>
|
||||
</main>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tabler/core@1.4.0/dist/js/tabler.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
<script src="/static/js/settings.js"></script>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Reference in a new issue