mirror of
https://git.alemi.dev/dashboard.git
synced 2024-11-14 19:59:18 +01:00
fix: cheap way to edit panel order
This commit is contained in:
parent
1100b5f5fe
commit
e7af410edf
1 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
use eframe::{Frame, egui::{collapsing_header::CollapsingState, Context, Ui, Layout, ScrollArea, global_dark_light_mode_switch, TextEdit, Checkbox, Slider, ComboBox}, emath::Align};
|
use eframe::{Frame, egui::{collapsing_header::CollapsingState, Context, Ui, Layout, ScrollArea, global_dark_light_mode_switch, TextEdit, Checkbox, Slider, ComboBox, DragValue}, emath::Align};
|
||||||
use sea_orm::{Set, Unchanged, ActiveValue::NotSet};
|
use sea_orm::{Set, Unchanged, ActiveValue::NotSet};
|
||||||
use tokio::sync::watch;
|
use tokio::sync::watch;
|
||||||
|
|
||||||
|
@ -204,6 +204,10 @@ pub fn popup_edit_ui(
|
||||||
TextEdit::singleline(&mut panel.name)
|
TextEdit::singleline(&mut panel.name)
|
||||||
.hint_text("name")
|
.hint_text("name")
|
||||||
.show(ui);
|
.show(ui);
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
ui.label("position");
|
||||||
|
ui.add(DragValue::new(&mut panel.position).clamp_range(0..=1000));
|
||||||
|
});
|
||||||
for (i, metric) in metrics.iter().enumerate() {
|
for (i, metric) in metrics.iter().enumerate() {
|
||||||
if i >= opts.len() { // TODO safe but jank: always starts with all off
|
if i >= opts.len() { // TODO safe but jank: always starts with all off
|
||||||
opts.push(false);
|
opts.push(false);
|
||||||
|
@ -219,6 +223,10 @@ pub fn popup_edit_ui(
|
||||||
.hint_text("name")
|
.hint_text("name")
|
||||||
.show(ui);
|
.show(ui);
|
||||||
});
|
});
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
ui.label("position");
|
||||||
|
ui.add(DragValue::new(&mut source.position).clamp_range(0..=1000));
|
||||||
|
});
|
||||||
TextEdit::singleline(&mut source.url)
|
TextEdit::singleline(&mut source.url)
|
||||||
.hint_text("url")
|
.hint_text("url")
|
||||||
.show(ui);
|
.show(ui);
|
||||||
|
@ -234,6 +242,10 @@ pub fn popup_edit_ui(
|
||||||
.hint_text("name")
|
.hint_text("name")
|
||||||
.show(ui);
|
.show(ui);
|
||||||
});
|
});
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
ui.label("position");
|
||||||
|
ui.add(DragValue::new(&mut metric.position).clamp_range(0..=1000));
|
||||||
|
});
|
||||||
ComboBox::from_id_source(format!("source-selector-{}", metric.id))
|
ComboBox::from_id_source(format!("source-selector-{}", metric.id))
|
||||||
.selected_text(format!("source: {:02}", metric.source_id))
|
.selected_text(format!("source: {:02}", metric.source_id))
|
||||||
.show_ui(ui, |ui| {
|
.show_ui(ui, |ui| {
|
||||||
|
|
Loading…
Reference in a new issue