windows: the app's Logs page; on Linux, units end with the service
- Logs: every unit's as they come (the last 500 first, 5000 kept), one unit's on its own, following or held; terminal colours stripped; a virtual list, so thousands of lines cost nothing. The follow starts when the page is first opened and reconnects by itself. - Linux (development, tests): the service's children get SIGKILL when it dies (PR_SET_PDEATHSIG), as the Job Object does on Windows; a killed service no longer leaves sing-box running (the e2e test leaked one per run). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a839d48e02
commit
23c1687118
5 files changed
+176
-1
No files matched your search
@@ -2,6 +2,7 @@
|
||||
//! notification.
|
||||
|
||||
mod dpi;
|
||||
mod logs;
|
||||
mod outbounds;
|
||||
mod overview;
|
||||
mod telegram;
|
||||
@@ -60,6 +61,8 @@ pub struct AppView {
|
||||
dpi: Entity<dpi::DpiPage>,
|
||||
telegram: Entity<telegram::TelegramPage>,
|
||||
outbounds: Entity<outbounds::OutboundsPage>,
|
||||
/// Made when first shown: following the logs starts then.
|
||||
logs: Option<Entity<logs::LogsPage>>,
|
||||
_subscriptions: Vec<Subscription>,
|
||||
}
|
||||
|
||||
@@ -78,7 +81,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, _subscriptions: subscriptions }
|
||||
Self { model, page: Page::Overview, dpi, telegram, outbounds, logs: None, _subscriptions: subscriptions }
|
||||
}
|
||||
|
||||
fn sidebar(&self, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
@@ -99,6 +102,10 @@ impl Render for AppView {
|
||||
Page::Dpi => self.dpi.clone().into_any_element(),
|
||||
Page::Telegram => self.telegram.clone().into_any_element(),
|
||||
Page::Outbounds => self.outbounds.clone().into_any_element(),
|
||||
Page::Logs => {
|
||||
let model = self.model.clone();
|
||||
self.logs.get_or_insert_with(|| cx.new(|cx| logs::LogsPage::new(model, 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()
|
||||
|
||||
Reference in new issue
Block a user