mirror of
https://github.com/l5yth/potato-mesh.git
synced 2026-07-31 14:02:30 +02:00
update map info
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
-- Add first_heard column to nodes table and backfill with last_heard
|
||||
BEGIN TRANSACTION;
|
||||
|
||||
CREATE TABLE nodes_new (
|
||||
node_id TEXT PRIMARY KEY,
|
||||
num INTEGER,
|
||||
short_name TEXT,
|
||||
long_name TEXT,
|
||||
macaddr TEXT,
|
||||
hw_model TEXT,
|
||||
role TEXT,
|
||||
public_key TEXT,
|
||||
is_unmessagable BOOLEAN,
|
||||
is_favorite BOOLEAN,
|
||||
hops_away INTEGER,
|
||||
snr REAL,
|
||||
last_heard INTEGER,
|
||||
first_heard INTEGER NOT NULL,
|
||||
battery_level REAL,
|
||||
voltage REAL,
|
||||
channel_utilization REAL,
|
||||
air_util_tx REAL,
|
||||
uptime_seconds INTEGER,
|
||||
position_time INTEGER,
|
||||
location_source TEXT,
|
||||
latitude REAL,
|
||||
longitude REAL,
|
||||
altitude REAL
|
||||
);
|
||||
|
||||
INSERT INTO nodes_new(node_id,num,short_name,long_name,macaddr,hw_model,role,public_key,is_unmessagable,is_favorite,
|
||||
hops_away,snr,last_heard,first_heard,battery_level,voltage,channel_utilization,air_util_tx,uptime_seconds,
|
||||
position_time,location_source,latitude,longitude,altitude)
|
||||
SELECT node_id,num,short_name,long_name,macaddr,hw_model,role,public_key,is_unmessagable,is_favorite,
|
||||
hops_away,snr,last_heard,last_heard,battery_level,voltage,channel_utilization,air_util_tx,uptime_seconds,
|
||||
position_time,location_source,latitude,longitude,altitude
|
||||
FROM nodes;
|
||||
|
||||
DROP TABLE nodes;
|
||||
ALTER TABLE nodes_new RENAME TO nodes;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_nodes_last_heard ON nodes(last_heard);
|
||||
CREATE INDEX IF NOT EXISTS idx_nodes_hw_model ON nodes(hw_model);
|
||||
CREATE INDEX IF NOT EXISTS idx_nodes_latlon ON nodes(latitude, longitude);
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -254,9 +254,10 @@
|
||||
`<b>${n.short_name || ''}</b> <span class="mono">${n.node_id || ''}</span>`,
|
||||
n.hw_model ? `Model: ${n.hw_model}` : null,
|
||||
`Role: ${n.role || 'CLIENT'}`,
|
||||
(n.battery_level != null ? `Battery: ${n.battery_level}` : null),
|
||||
(n.battery_level != null ? `Battery: ${fmtAlt(n.battery_level, "%")}, ${fmtAlt(n.voltage, "V")}` : null),
|
||||
(n.last_heard ? `Last seen: ${timeAgo(n.last_heard)}` : null),
|
||||
(n.pos_time_iso ? `Last Position: ${timeAgo(n.position_time)}` : null)
|
||||
(n.pos_time_iso ? `Last Position: ${timeAgo(n.position_time)}` : null),
|
||||
(n.uptime_seconds ? `Uptime: ${timeHum(n.uptime_seconds)}` : null),
|
||||
].filter(Boolean);
|
||||
marker.bindPopup(lines.join('<br/>'));
|
||||
marker.addTo(markersLayer);
|
||||
|
||||
Reference in New Issue
Block a user