feat: client-server mode
This commit is contained in:
parent
171194e99f
commit
a689366324
7 changed files with 119 additions and 28 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue