diff --git a/data/migrations/001_add_first_heard.sql b/data/migrations/001_add_first_heard.sql deleted file mode 100644 index 1e67757..0000000 --- a/data/migrations/001_add_first_heard.sql +++ /dev/null @@ -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; - diff --git a/web/public/index.html b/web/public/index.html index 3608b6c..472ba3d 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -254,9 +254,10 @@ `${n.short_name || ''} ${n.node_id || ''}`, 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('
')); marker.addTo(markersLayer);