mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-11-22 08:56:58 -06:00
clean up client ui
This commit is contained in:
parent
38ec19d9da
commit
f1377e6eba
@ -111,7 +111,8 @@ attach - attach the server to the Veilid network
|
||||
detach - detach the server from the Veilid network
|
||||
debug - send a debugging command to the Veilid server
|
||||
change_log_level - change the log level for a tracing layer
|
||||
"#,
|
||||
"#
|
||||
.to_owned(),
|
||||
);
|
||||
let ui = self.ui();
|
||||
ui.send_callback(callback);
|
||||
@ -202,7 +203,7 @@ change_log_level - change the log level for a tracing layer
|
||||
let log_level = match convert_loglevel(&rest.unwrap_or_default()) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
error!("failed to change log level: {}", e);
|
||||
ui.add_node_event(format!("Failed to change log level: {}", e));
|
||||
ui.send_callback(callback);
|
||||
return;
|
||||
}
|
||||
@ -210,12 +211,14 @@ change_log_level - change the log level for a tracing layer
|
||||
|
||||
match capi.server_change_log_level(layer, log_level).await {
|
||||
Ok(()) => {
|
||||
info!("Log level changed");
|
||||
ui.send_callback(callback);
|
||||
ui.display_string_dialog("Success", "Log level changed", callback);
|
||||
}
|
||||
Err(e) => {
|
||||
error!("Server command 'change_log_level' failed: {}", e);
|
||||
ui.send_callback(callback);
|
||||
ui.display_string_dialog(
|
||||
"Server command 'change_log_level' failed",
|
||||
e.to_string(),
|
||||
callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -326,8 +329,9 @@ change_log_level - change the log level for a tracing layer
|
||||
}
|
||||
|
||||
pub fn update_log(&mut self, log: veilid_core::VeilidStateLog) {
|
||||
let message = format!("{}: {}", log.log_level, log.message);
|
||||
self.inner().ui.add_node_event(&message);
|
||||
self.inner()
|
||||
.ui
|
||||
.add_node_event(format!("{}: {}", log.log_level, log.message));
|
||||
}
|
||||
|
||||
pub fn update_shutdown(&mut self) {
|
||||
|
@ -790,7 +790,7 @@ impl UI {
|
||||
inner.ui_state.connection_state.set(state);
|
||||
let _ = inner.cb_sink.send(Box::new(UI::update_cb));
|
||||
}
|
||||
pub fn add_node_event(&self, event: &str) {
|
||||
pub fn add_node_event(&self, event: String) {
|
||||
let inner = self.inner.borrow();
|
||||
let color = *inner.log_colors.get(&Level::Info).unwrap();
|
||||
for line in event.lines() {
|
||||
|
Loading…
Reference in New Issue
Block a user