mirror of
https://git.alemi.dev/dashboard.git
synced 2024-11-21 15:04:51 +01:00
fix: db name shows correctly instead of mirroring db uri
This commit is contained in:
parent
54c61130f6
commit
c1af8a1262
2 changed files with 4 additions and 1 deletions
|
@ -23,6 +23,7 @@ pub struct App {
|
|||
view: AppStateView,
|
||||
db_uri: String,
|
||||
db_uri_tx: mpsc::Sender<String>,
|
||||
last_db_uri: String,
|
||||
interval: i64,
|
||||
last_redraw: i64,
|
||||
|
||||
|
@ -59,6 +60,7 @@ impl App {
|
|||
}
|
||||
Self {
|
||||
db_uri_tx, interval, panels, width_tx, view, logger_view,
|
||||
last_db_uri: "[disconnected]".into(),
|
||||
db_uri: initial_uri.unwrap_or("".into()),
|
||||
buffer_source: entities::sources::Model::default(),
|
||||
buffer_metric: entities::metrics::Model::default(),
|
||||
|
@ -116,7 +118,7 @@ impl eframe::App for App {
|
|||
});
|
||||
|
||||
TopBottomPanel::bottom("footer").show(ctx, |ui| {
|
||||
footer(ctx, ui, self.logger_view.clone(), self.db_uri.clone(), self.view.points.borrow().len());
|
||||
footer(ctx, ui, self.logger_view.clone(), self.last_db_uri.clone(), self.view.points.borrow().len());
|
||||
});
|
||||
|
||||
for m in self.editing.iter_mut() {
|
||||
|
|
|
@ -314,6 +314,7 @@ pub fn header(app: &mut App, ui: &mut Ui, frame: &mut Frame) {
|
|||
.show(ui);
|
||||
if ui.button("connect").clicked() {
|
||||
app.update_db_uri();
|
||||
app.last_db_uri = app.db_uri.split("/").last().unwrap_or("").to_string();
|
||||
}
|
||||
ui.separator();
|
||||
let last_edit = app.edit; // replace panels when going into edit mode
|
||||
|
|
Loading…
Reference in a new issue