From 1383e790c3ea0497c050049f43a32bc7ccf878b7 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Fri, 9 Jan 2026 17:20:59 +0000 Subject: [PATCH] feat: connectivity view: move quota up and combine with IMAP state. (#7653) like described in https://github.com/chatmail/core/pull/7630#discussion_r2641514867 ## classical account (with legacy option mvbox) ||| |---|---| | image| image| ## multi transport ||| |---|---| |image |image| --- src/scheduler.rs | 15 ++-- src/scheduler/connectivity.rs | 149 ++++++++++++++++++---------------- 2 files changed, 83 insertions(+), 81 deletions(-) diff --git a/src/scheduler.rs b/src/scheduler.rs index b0a97f53e..b10aaf0ca 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -324,8 +324,8 @@ impl Drop for IoPausedGuard { #[derive(Debug)] struct SchedBox { - /// Hostname of used chatmail/email relay - host: String, + /// Address at the used chatmail/email relay + addr: String, meaning: FolderMeaning, conn_state: ImapConnectionState, @@ -831,14 +831,9 @@ impl Scheduler { let ctx = ctx.clone(); task::spawn(inbox_loop(ctx, inbox_start_send, inbox_handlers)) }; - let host = configured_login_param - .addr - .split("@") - .last() - .context("address has no host")? - .to_owned(); + let addr = configured_login_param.addr.clone(); let inbox = SchedBox { - host: host.clone(), + addr: addr.clone(), meaning: FolderMeaning::Inbox, conn_state, handle, @@ -854,7 +849,7 @@ impl Scheduler { let meaning = FolderMeaning::Mvbox; let handle = task::spawn(simple_imap_loop(ctx, start_send, handlers, meaning)); oboxes.push(SchedBox { - host, + addr, meaning, conn_state, handle, diff --git a/src/scheduler/connectivity.rs b/src/scheduler/connectivity.rs index c131242ff..414d0ed2c 100644 --- a/src/scheduler/connectivity.rs +++ b/src/scheduler/connectivity.rs @@ -343,9 +343,18 @@ impl Context { .green { background-color: #34c759; } + .grey { + background-color: #808080; + } .yellow { background-color: #fdc625; } + .transport { + margin-bottom: 1em; + } + .quota-list { + padding-left: 0; + } "# @@ -375,7 +384,7 @@ impl Context { .boxes() .map(|b| { ( - b.host.clone(), + b.addr.clone(), b.meaning, b.conn_state.state.connectivity.clone(), ) @@ -396,73 +405,15 @@ impl Context { // ============================================================================================= // Add e.g. // Incoming messages - // - "Inbox": Connected + // - [X] nine.testrun.org: Connected + // 1.34 GiB of 2 GiB used + // [======67%===== ] // ============================================================================================= let watched_folders = get_watched_folder_configs(self).await?; let incoming_messages = stock_str::incoming_messages(self).await; ret += &format!("

{incoming_messages}

"; - - // ============================================================================================= - // Add e.g. - // Outgoing messages - // Your last message was sent successfully - // ============================================================================================= - - let outgoing_messages = stock_str::outgoing_messages(self).await; - ret += &format!("

{outgoing_messages}

"; - - // ============================================================================================= - // Add e.g. - // Storage on testrun.org - // 1.34 GiB of 2 GiB used - // [======67%===== ] - // ============================================================================================= - - ret += "

Message Buffers

"; let transports = self .sql .query_map_vec("SELECT id, addr FROM transports", (), |row| { @@ -472,31 +423,71 @@ impl Context { }) .await?; let quota = self.quota.read().await; - ret += ""; + // ============================================================================================= + // Add e.g. + // Outgoing messages + // Your last message was sent successfully + // ============================================================================================= + + let outgoing_messages = stock_str::outgoing_messages(self).await; + ret += &format!("

{outgoing_messages}

"; + // ============================================================================================= ret += "\n";