feat: client-server mode

This commit is contained in:
electria 2026-08-16 12:15:46 -07:00
commit a689366324
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs
7 changed files with 119 additions and 28 deletions

View file

@ -1,6 +1,6 @@
use std::time::Duration;
use iced::{Color, Element, Length, Renderer, Task, Theme, application, theme, widget};
use iced::{Color, Element, Error, Length, Renderer, Task, Theme, application, theme, widget};
use crate::{app::graph::Graph, sysinfo_snapshot::SysinfoSnapshot};
@ -23,10 +23,7 @@ struct State {
impl State {
fn new() -> (Self, Task<Message>) {
(
Self::default(),
Task::run(info_stream::create(), Message::Info),
)
(Self::default(), info_stream::create())
}
fn update(&mut self, message: Message) -> Task<Message> {
match message {
@ -95,7 +92,7 @@ impl State {
}
}
pub fn run() -> Result<(), impl std::error::Error> {
pub fn run() -> Result<(), Error> {
application(State::new, State::update, State::view)
.title(State::title)
.theme(theme::Theme::custom(