fix: custom command arguments not parsed correctly node and proxy tab

This commit is contained in:
Cyrix126 2024-10-09 04:47:08 +02:00
parent 80db6bbacc
commit 9241b573a0
2 changed files with 14 additions and 6 deletions

View file

@ -56,9 +56,13 @@ impl Helper {
}
pub fn build_node_args(state: &crate::disk::state::Node) -> Vec<String> {
let mut args = Vec::with_capacity(500);
if !state.arguments.is_empty() {
args.push(state.arguments.clone());
return args;
if !state.arguments.is_empty() && !state.simple {
// This parses the input
// todo: set the state if user change port and token
for arg in state.arguments.split_whitespace() {
let arg = if arg == "localhost" { "127.0.0.1" } else { arg };
args.push(arg.to_string());
}
}
// [Simple]

View file

@ -114,8 +114,12 @@ impl Helper {
let port;
// custom args from user input
if !state.arguments.is_empty() && !state.simple {
args.push(state.arguments.clone());
return args;
// This parses the input
// todo: set the state if user change port and token
for arg in state.arguments.split_whitespace() {
let arg = if arg == "localhost" { "127.0.0.1" } else { arg };
args.push(arg.to_string());
}
}
// [Simple]
if state.simple {
@ -529,7 +533,7 @@ impl PubXmrigProxyApi {
*gui_api = Self {
output,
node,
..std::mem::take(pub_api)
..pub_api.clone()
};
if !buf.is_empty() {
gui_api.output.push_str(&buf);