ui: reset node config from ui on error

This commit is contained in:
ardocrat 2024-09-20 10:58:52 +03:00
parent 0ead11ec6c
commit 71e80f6df7

View file

@ -24,7 +24,7 @@ use crate::gui::views::{Content, TitlePanel, View};
use crate::gui::views::network::{ConnectionsContent, NetworkMetrics, NetworkMining, NetworkNode, NetworkSettings}; use crate::gui::views::network::{ConnectionsContent, NetworkMetrics, NetworkMining, NetworkNode, NetworkSettings};
use crate::gui::views::network::types::{NetworkTab, NetworkTabType}; use crate::gui::views::network::types::{NetworkTab, NetworkTabType};
use crate::gui::views::types::{TitleContentType, TitleType}; use crate::gui::views::types::{TitleContentType, TitleType};
use crate::node::{Node, NodeError}; use crate::node::{Node, NodeConfig, NodeError};
use crate::wallet::ExternalConnection; use crate::wallet::ExternalConnection;
/// Network content. /// Network content.
@ -312,6 +312,14 @@ impl NetworkContent {
.size(16.0) .size(16.0)
.color(Colors::red()) .color(Colors::red())
); );
ui.add_space(8.0);
let btn_txt = format!("{} {}",
ARROWS_COUNTER_CLOCKWISE,
t!("network_settings.reset"));
View::action_button(ui, btn_txt, || {
NodeConfig::reset_to_default();
Node::start();
});
ui.add_space(2.0); ui.add_space(2.0);
}); });
} }