mirror of
https://git.alemi.dev/dashboard.git
synced 2024-11-24 08:24:52 +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,
|
view: AppStateView,
|
||||||
db_uri: String,
|
db_uri: String,
|
||||||
db_uri_tx: mpsc::Sender<String>,
|
db_uri_tx: mpsc::Sender<String>,
|
||||||
|
last_db_uri: String,
|
||||||
interval: i64,
|
interval: i64,
|
||||||
last_redraw: i64,
|
last_redraw: i64,
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ impl App {
|
||||||
}
|
}
|
||||||
Self {
|
Self {
|
||||||
db_uri_tx, interval, panels, width_tx, view, logger_view,
|
db_uri_tx, interval, panels, width_tx, view, logger_view,
|
||||||
|
last_db_uri: "[disconnected]".into(),
|
||||||
db_uri: initial_uri.unwrap_or("".into()),
|
db_uri: initial_uri.unwrap_or("".into()),
|
||||||
buffer_source: entities::sources::Model::default(),
|
buffer_source: entities::sources::Model::default(),
|
||||||
buffer_metric: entities::metrics::Model::default(),
|
buffer_metric: entities::metrics::Model::default(),
|
||||||
|
@ -116,7 +118,7 @@ impl eframe::App for App {
|
||||||
});
|
});
|
||||||
|
|
||||||
TopBottomPanel::bottom("footer").show(ctx, |ui| {
|
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() {
|
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);
|
.show(ui);
|
||||||
if ui.button("connect").clicked() {
|
if ui.button("connect").clicked() {
|
||||||
app.update_db_uri();
|
app.update_db_uri();
|
||||||
|
app.last_db_uri = app.db_uri.split("/").last().unwrap_or("").to_string();
|
||||||
}
|
}
|
||||||
ui.separator();
|
ui.separator();
|
||||||
let last_edit = app.edit; // replace panels when going into edit mode
|
let last_edit = app.edit; // replace panels when going into edit mode
|
||||||
|
|
Loading…
Reference in a new issue