Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Volkor Barbarian Warrior
yams
Commits
0e62abfa
Verified
Commit
0e62abfa
authored
4 weeks ago
by
Volkor Barbarian Warrior
Browse files
Options
Downloads
Patches
Plain Diff
add some better logging to db
parent
52f4acdb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gui/widgets/node_list.rs
+11
-1
11 additions, 1 deletion
src/gui/widgets/node_list.rs
with
11 additions
and
1 deletion
src/gui/widgets/node_list.rs
+
11
−
1
View file @
0e62abfa
use
chrono
::
DateTime
;
use
chrono_humanize
::
HumanTime
;
use
egui_extras
::{
Column
,
TableBuilder
};
use
figment
::
providers
::
Data
;
use
log
::{
error
,
info
};
use
longitude
::{
DistanceUnit
,
Location
};
use
meshtastic
::
protobufs
::{
channel
::
Role
,
HardwareModel
,
Position
};
...
...
@@ -45,7 +47,15 @@ pub(crate) fn calc_distance_to_node(away: Position) -> Option<f64> {
/// UI Elements for the Node List
pub
fn
nodelist_ui
(
ui
:
&
mut
egui
::
Ui
)
{
// Get nodes from DB
let
mut
nodes
=
Database
::
read_node_list
()
.expect
(
"Failed to read nodes"
);
let
mut
nodes
=
Database
::
read_node_list
()
.unwrap_or_else
(|
e
|
{
error!
(
"Failed to read nodes: {}"
,
e
);
// Return a default value or handle the error as needed
Vec
::
new
()
// Example default value, replace with appropriate handling
});
info!
(
"Loaded {} nodes from DB"
,
nodes
.len
());
// let mut nodes = Database::read_node_list().expect("Failed to read nodes");
// Sort nodes by `last_heard` in descending order
nodes
.sort_by
(|
a
,
b
|
b
.last_heard
.cmp
(
&
a
.last_heard
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment