mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
highlight proxy lookup issues with the error class
This commit is contained in:
parent
0e71b44f45
commit
1cbcd72c71
1 changed files with 19 additions and 19 deletions
|
|
@ -139,27 +139,27 @@ impl Request {
|
||||||
s.update(Some(50)); // @TODO optional
|
s.update(Some(50)); // @TODO optional
|
||||||
}
|
}
|
||||||
// Indicate proxy connections @TODO cancel previous operation on update
|
// Indicate proxy connections @TODO cancel previous operation on update
|
||||||
{
|
match p.proxy.matches(&t) {
|
||||||
const C: &str = "accent";
|
Some(r) => r.lookup_async(&t, Cancellable::NONE, {
|
||||||
match p.proxy.matches(&t) {
|
let e = e.clone();
|
||||||
Some(r) => {
|
move |r| {
|
||||||
e.set_css_classes(&[C]);
|
e.set_tooltip_text(Some(&{
|
||||||
r.lookup_async(&t, Cancellable::NONE, {
|
match r {
|
||||||
let e = e.clone();
|
Ok(h) => {
|
||||||
move |r| {
|
e.set_css_classes(&["accent"]);
|
||||||
e.set_tooltip_text(Some(&{
|
format!("Proxy over {}", h.join(","))
|
||||||
match r {
|
}
|
||||||
Ok(h) => format!("Proxy over {}", h.join(",")),
|
Err(i) => {
|
||||||
Err(e) => e.to_string(),
|
e.set_css_classes(&["error"]);
|
||||||
}
|
i.to_string()
|
||||||
}))
|
}
|
||||||
}
|
}
|
||||||
});
|
}))
|
||||||
}
|
|
||||||
None => {
|
|
||||||
e.remove_css_class(C);
|
|
||||||
e.set_tooltip_text(None)
|
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
|
None => {
|
||||||
|
e.set_css_classes(&[]);
|
||||||
|
e.set_tooltip_text(None)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue