feat(gui): Review logs before sending feedback (#301)

* add review buttons that open the attached logs before submitting feedback
* add redact switches to redact transaction id's from attached logs
This commit is contained in:
Raphael 2025-04-23 15:09:19 +02:00 committed by GitHub
parent 3fa31ba139
commit e8084d65ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 255 additions and 85 deletions

View file

@ -3,7 +3,7 @@ use crate::bitcoin::{wallet, CancelTimelock, ExpiredTimelocks, PunishTimelock, T
use crate::cli::api::tauri_bindings::{TauriEmitter, TauriSwapProgressEvent};
use crate::cli::api::Context;
use crate::cli::{list_sellers as list_sellers_impl, EventLoop, Seller, SellerStatus};
use crate::common::get_logs;
use crate::common::{get_logs, redact};
use crate::libp2p_ext::MultiAddrExt;
use crate::monero::wallet_rpc::MoneroDaemon;
use crate::network::quote::{BidQuote, ZeroQuoteReceived};
@ -420,6 +420,29 @@ impl Request for GetLogsArgs {
}
}
/// Best effort redaction of logs, e.g. wallet addresses, swap-ids
#[typeshare]
#[derive(Serialize, Deserialize, Debug)]
pub struct RedactArgs {
pub text: String,
}
#[typeshare]
#[derive(Serialize, Debug)]
pub struct RedactResponse {
pub text: String,
}
impl Request for RedactArgs {
type Response = RedactResponse;
async fn request(self, _: Arc<Context>) -> Result<Self::Response> {
Ok(RedactResponse {
text: redact(&self.text),
})
}
}
#[typeshare]
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct GetMoneroAddressesArgs;