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

@ -25,6 +25,8 @@ import {
GetDataDirArgs,
ResolveApprovalArgs,
ResolveApprovalResponse,
RedactArgs,
RedactResponse,
} from "models/tauriModel";
import {
rpcSetBalance,
@ -40,6 +42,8 @@ import { getNetwork, isTestnet } from "store/config";
import { Blockchain, Network } from "store/features/settingsSlice";
import { setStatus } from "store/features/nodesSlice";
import { discoveredMakersByRendezvous } from "store/features/makersSlice";
import { CliLog } from "models/cliModel";
import { logsToRawString, parseLogsFromString } from "utils/parseUtils";
export const PRESET_RENDEZVOUS_POINTS = [
"/dns4/discover.unstoppableswap.net/tcp/8888/p2p/12D3KooWA6cnqJpVnreBVnoro8midDL9Lpzmg8oJPoAGi7YYaamE",
@ -164,6 +168,18 @@ export async function getLogsOfSwap(
});
}
/// Call the rust backend to redact logs.
export async function redactLogs(
logs: (string | CliLog)[]
): Promise<(string | CliLog)[]> {
const response = await invoke<RedactArgs, RedactResponse>("redact", {
text: logsToRawString(logs)
})
console.log(response.text.split("\n").length)
return parseLogsFromString(response.text);
}
export async function listSellersAtRendezvousPoint(
rendezvousPointAddress: string,
): Promise<ListSellersResponse> {