Reworked statistics
This commit is contained in:
+87
-1
@@ -711,6 +711,12 @@ pub enum Popup {
|
||||
},
|
||||
/// Wrapped read-only text (this peer's connection ticket).
|
||||
FedText { title: String, text: String },
|
||||
/// Wrapped text that can be copied to the system clipboard.
|
||||
FedCopyText {
|
||||
title: String,
|
||||
text: String,
|
||||
help: String,
|
||||
},
|
||||
/// Incoming trusted-device pairing request.
|
||||
DevicePairing {
|
||||
request_id: String,
|
||||
@@ -725,7 +731,68 @@ pub enum Popup {
|
||||
/// Connected playback devices and their current role/status.
|
||||
ConnectedDevices { cursor: usize },
|
||||
/// Full federation, transport and device status details.
|
||||
FederationStatusDetails { scroll: usize },
|
||||
FederationStatusDetails {
|
||||
focus: StatusDetailFocus,
|
||||
status_cursor: usize,
|
||||
devices_scroll: usize,
|
||||
logs_scroll: usize,
|
||||
},
|
||||
/// Full text opened from the full federation status dashboard.
|
||||
FederationStatusText {
|
||||
parent: FederationStatusPopupState,
|
||||
title: String,
|
||||
text: String,
|
||||
scroll: usize,
|
||||
},
|
||||
/// Full connection log opened from the full federation status dashboard.
|
||||
FederationStatusLog {
|
||||
parent: FederationStatusPopupState,
|
||||
scroll: usize,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct FederationStatusPopupState {
|
||||
pub focus: StatusDetailFocus,
|
||||
pub status_cursor: usize,
|
||||
pub devices_scroll: usize,
|
||||
pub logs_scroll: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum StatusDetailFocus {
|
||||
Status,
|
||||
Devices,
|
||||
Logs,
|
||||
}
|
||||
|
||||
impl From<FederationStatusPopupState> for Popup {
|
||||
fn from(value: FederationStatusPopupState) -> Self {
|
||||
Popup::FederationStatusDetails {
|
||||
focus: value.focus,
|
||||
status_cursor: value.status_cursor,
|
||||
devices_scroll: value.devices_scroll,
|
||||
logs_scroll: value.logs_scroll,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StatusDetailFocus {
|
||||
pub fn next(self) -> Self {
|
||||
match self {
|
||||
StatusDetailFocus::Status => StatusDetailFocus::Devices,
|
||||
StatusDetailFocus::Devices => StatusDetailFocus::Logs,
|
||||
StatusDetailFocus::Logs => StatusDetailFocus::Status,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn previous(self) -> Self {
|
||||
match self {
|
||||
StatusDetailFocus::Status => StatusDetailFocus::Logs,
|
||||
StatusDetailFocus::Devices => StatusDetailFocus::Status,
|
||||
StatusDetailFocus::Logs => StatusDetailFocus::Devices,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -745,6 +812,23 @@ impl FedInputField {
|
||||
FedInputField::ConnectInvite => "Connect device (paste frid://i invite)",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn help(self) -> &'static str {
|
||||
match self {
|
||||
FedInputField::NetworkId => {
|
||||
"A unique network id. It must match exactly on every client that should see and connect to the same peers."
|
||||
}
|
||||
FedInputField::ConnectTicket => {
|
||||
"Paste a connection ticket generated by another client to connect to that peer directly."
|
||||
}
|
||||
FedInputField::DeviceName => {
|
||||
"A friendly nickname for this device, used only to make connected-device management easier."
|
||||
}
|
||||
FedInputField::ConnectInvite => {
|
||||
"Paste a frid:// invite generated by another client to add this device to its sync group."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Rows of the federation block inside Settings, in display order.
|
||||
@@ -944,6 +1028,8 @@ pub struct FederationTab {
|
||||
pub settings: crate::federation::FedSettings,
|
||||
pub status: Option<crate::federation::FedStatus>,
|
||||
pub devices: Option<crate::devices::DeviceSyncStatus>,
|
||||
pub publishing: bool,
|
||||
pub device_syncing: bool,
|
||||
}
|
||||
|
||||
/// Playlists eligible as add-targets (the virtual Likes playlist is managed
|
||||
|
||||
Reference in New Issue
Block a user