feat: relay status viewer (#143)

* add relay status

* .
This commit is contained in:
reya
2025-09-07 14:54:28 +07:00
committed by GitHub
parent e177facef4
commit 71140beb52
15 changed files with 163 additions and 63 deletions

View File

@@ -14,8 +14,6 @@ pub enum IconName {
ArrowLeft,
ArrowRight,
ArrowUp,
ArrowUpCircle,
Bell,
CaretUp,
CaretDown,
CaretDownFill,
@@ -28,7 +26,6 @@ pub enum IconName {
CloseCircleFill,
Copy,
Edit,
EditFill,
Ellipsis,
Eye,
EyeOff,
@@ -52,9 +49,8 @@ pub enum IconName {
Reply,
Report,
Refresh,
Forward,
Signal,
Search,
SearchFill,
Settings,
SortAscending,
SortDescending,
@@ -62,8 +58,8 @@ pub enum IconName {
ThumbsDown,
ThumbsUp,
Upload,
UsersThreeFill,
OpenUrl,
Warning,
WindowClose,
WindowMaximize,
WindowMinimize,
@@ -78,8 +74,6 @@ impl IconName {
Self::ArrowLeft => "icons/arrow-left.svg",
Self::ArrowRight => "icons/arrow-right.svg",
Self::ArrowUp => "icons/arrow-up.svg",
Self::ArrowUpCircle => "icons/arrow-up-circle.svg",
Self::Bell => "icons/bell.svg",
Self::CaretRight => "icons/caret-right.svg",
Self::CaretUp => "icons/caret-up.svg",
Self::CaretDown => "icons/caret-down.svg",
@@ -92,7 +86,6 @@ impl IconName {
Self::CloseCircleFill => "icons/close-circle-fill.svg",
Self::Copy => "icons/copy.svg",
Self::Edit => "icons/edit.svg",
Self::EditFill => "icons/edit-fill.svg",
Self::Ellipsis => "icons/ellipsis.svg",
Self::Eye => "icons/eye.svg",
Self::EmojiFill => "icons/emoji-fill.svg",
@@ -116,9 +109,8 @@ impl IconName {
Self::Reply => "icons/reply.svg",
Self::Report => "icons/report.svg",
Self::Refresh => "icons/refresh.svg",
Self::Forward => "icons/forward.svg",
Self::Signal => "icons/signal.svg",
Self::Search => "icons/search.svg",
Self::SearchFill => "icons/search-fill.svg",
Self::Settings => "icons/settings.svg",
Self::SortAscending => "icons/sort-ascending.svg",
Self::SortDescending => "icons/sort-descending.svg",
@@ -126,8 +118,8 @@ impl IconName {
Self::ThumbsDown => "icons/thumbs-down.svg",
Self::ThumbsUp => "icons/thumbs-up.svg",
Self::Upload => "icons/upload.svg",
Self::UsersThreeFill => "icons/users-three-fill.svg",
Self::OpenUrl => "icons/open-url.svg",
Self::Warning => "icons/warning.svg",
Self::WindowClose => "icons/window-close.svg",
Self::WindowMaximize => "icons/window-maximize.svg",
Self::WindowMinimize => "icons/window-minimize.svg",

View File

@@ -30,14 +30,10 @@ pub enum NotificationType {
impl NotificationType {
fn icon(&self, cx: &App) -> Icon {
match self {
Self::Info => Icon::new(IconName::Info).text_color(cx.theme().element_active),
Self::Warning => Icon::new(IconName::Report).text_color(cx.theme().warning_foreground),
Self::Success => {
Icon::new(IconName::CheckCircle).text_color(cx.theme().element_foreground)
}
Self::Error => {
Icon::new(IconName::CloseCircle).text_color(cx.theme().danger_foreground)
}
Self::Info => Icon::new(IconName::Info).text_color(cx.theme().element_foreground),
Self::Success => Icon::new(IconName::Info).text_color(cx.theme().secondary_foreground),
Self::Warning => Icon::new(IconName::Warning).text_color(cx.theme().warning_foreground),
Self::Error => Icon::new(IconName::Warning).text_color(cx.theme().danger_foreground),
}
}
}