mirror of
https://github.com/house-of-vanity/khm.git
synced 2025-08-21 14:27:14 +00:00
Fix watcher
This commit is contained in:
@@ -402,7 +402,7 @@ impl eframe::App for KhmSettingsWindow {
|
|||||||
impl KhmSettingsWindow {
|
impl KhmSettingsWindow {
|
||||||
fn render_connection_tab(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
|
fn render_connection_tab(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
|
||||||
let available_height = ui.available_height();
|
let available_height = ui.available_height();
|
||||||
let button_area_height = 40.0; // Reserve space for buttons and status
|
let button_area_height = 120.0; // Reserve space for buttons and status
|
||||||
let content_height = available_height - button_area_height;
|
let content_height = available_height - button_area_height;
|
||||||
|
|
||||||
// Main content area (scrollable)
|
// Main content area (scrollable)
|
||||||
@@ -426,22 +426,6 @@ impl KhmSettingsWindow {
|
|||||||
if self.is_testing_connection {
|
if self.is_testing_connection {
|
||||||
ui.spinner();
|
ui.spinner();
|
||||||
ui.label(egui::RichText::new("Testing...").italics());
|
ui.label(egui::RichText::new("Testing...").italics());
|
||||||
} else {
|
|
||||||
match &self.connection_status {
|
|
||||||
ConnectionStatus::Unknown => {
|
|
||||||
ui.label(egui::RichText::new("Not tested").color(egui::Color32::GRAY));
|
|
||||||
}
|
|
||||||
ConnectionStatus::Connected { keys_count, flow } => {
|
|
||||||
ui.label(egui::RichText::new("✅").color(egui::Color32::GREEN));
|
|
||||||
ui.label(egui::RichText::new(format!("{} keys in '{}'", keys_count, flow))
|
|
||||||
.color(egui::Color32::LIGHT_GREEN));
|
|
||||||
}
|
|
||||||
ConnectionStatus::Error(err) => {
|
|
||||||
ui.label(egui::RichText::new("❌").color(egui::Color32::RED))
|
|
||||||
.on_hover_text(format!("Error: {}", err));
|
|
||||||
ui.label(egui::RichText::new("Failed").color(egui::Color32::RED));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -583,6 +567,10 @@ impl KhmSettingsWindow {
|
|||||||
[ui.available_width(), button_area_height].into(),
|
[ui.available_width(), button_area_height].into(),
|
||||||
egui::Layout::bottom_up(egui::Align::Min),
|
egui::Layout::bottom_up(egui::Align::Min),
|
||||||
|ui| {
|
|ui| {
|
||||||
|
// Status information block
|
||||||
|
ui.group(|ui| {
|
||||||
|
ui.set_min_width(ui.available_width());
|
||||||
|
ui.vertical(|ui| {
|
||||||
// Show sync status
|
// Show sync status
|
||||||
match &self.sync_status {
|
match &self.sync_status {
|
||||||
SyncStatus::Success { keys_count } => {
|
SyncStatus::Success { keys_count } => {
|
||||||
@@ -596,6 +584,25 @@ impl KhmSettingsWindow {
|
|||||||
SyncStatus::Unknown => {}
|
SyncStatus::Unknown => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show connection status
|
||||||
|
if !self.is_testing_connection {
|
||||||
|
match &self.connection_status {
|
||||||
|
ConnectionStatus::Connected { keys_count, flow } => {
|
||||||
|
ui.label(egui::RichText::new(format!("✅ Connected to '{}': {} keys available", flow, keys_count))
|
||||||
|
.color(egui::Color32::LIGHT_GREEN));
|
||||||
|
}
|
||||||
|
ConnectionStatus::Error(err) => {
|
||||||
|
ui.label(egui::RichText::new(format!("❌ Connection failed: {}", err))
|
||||||
|
.color(egui::Color32::RED));
|
||||||
|
}
|
||||||
|
ConnectionStatus::Unknown => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.add_space(8.0);
|
||||||
|
|
||||||
// Show validation hints
|
// Show validation hints
|
||||||
let save_enabled = !self.settings.host.is_empty() && !self.settings.flow.is_empty();
|
let save_enabled = !self.settings.host.is_empty() && !self.settings.flow.is_empty();
|
||||||
if !save_enabled {
|
if !save_enabled {
|
||||||
|
Reference in New Issue
Block a user