windows: the app's Settings page: the whole configuration

Upstream's option tree as JSON in a code editor (highlighted, folding),
loaded with its revision; Check asks the service to validate without
taking it; Save sends it against the revision loaded, so a change made
elsewhere meanwhile is refused, not overwritten, and the page says so.
The validator's notes and an apply failure are shown under the editor;
redacted secrets are explained (left as they are, they keep their
values). Every option the other pages do not show is editable here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-27 01:44:55 +03:00
1 parent 23c1687118
commit 69759cfbce
2 files changed
+198 -1

No files matched your search

+8 -1
View File
@@ -5,6 +5,7 @@ mod dpi;
mod logs;
mod outbounds;
mod overview;
mod settings;
mod telegram;
mod widgets;
@@ -63,6 +64,8 @@ pub struct AppView {
outbounds: Entity<outbounds::OutboundsPage>,
/// Made when first shown: following the logs starts then.
logs: Option<Entity<logs::LogsPage>>,
/// Made when first shown, as it loads the configuration into its editor then.
settings: Option<Entity<settings::SettingsPage>>,
_subscriptions: Vec<Subscription>,
}
@@ -81,7 +84,7 @@ impl AppView {
let dpi = cx.new(|cx| dpi::DpiPage::new(model.clone(), window, cx));
let telegram = cx.new(|cx| telegram::TelegramPage::new(model.clone(), window, cx));
let outbounds = cx.new(|cx| outbounds::OutboundsPage::new(model.clone(), window, cx));
Self { model, page: Page::Overview, dpi, telegram, outbounds, logs: None, _subscriptions: subscriptions }
Self { model, page: Page::Overview, dpi, telegram, outbounds, logs: None, settings: None, _subscriptions: subscriptions }
}
fn sidebar(&self, cx: &mut Context<Self>) -> impl IntoElement {
@@ -106,6 +109,10 @@ impl Render for AppView {
let model = self.model.clone();
self.logs.get_or_insert_with(|| cx.new(|cx| logs::LogsPage::new(model, cx))).clone().into_any_element()
}
Page::Settings => {
let model = self.model.clone();
self.settings.get_or_insert_with(|| cx.new(|cx| settings::SettingsPage::new(model, window, cx))).clone().into_any_element()
}
other => widgets::page(other.title(), cx).child(div().text_color(cx.theme().muted_foreground).child("Not here yet.")).into_any_element(),
};
div()