MCPcopy Index your code
hub / github.com/coder/coder / downloadLogs

Function downloadLogs

site/src/modules/resources/DownloadSelectedAgentLogsButton.tsx:39–51  ·  view source on GitHub ↗
(logsText: string, filenameSuffix: string)

Source from the content-addressed store, hash-verified

37}) => {
38 const [isDownloading, setIsDownloading] = useState(false);
39 const downloadLogs = async (logsText: string, filenameSuffix: string) => {
40 try {
41 setIsDownloading(true);
42 const file = new Blob([logsText], { type: "text/plain" });
43 await download(file, `${agentName}-${filenameSuffix}.txt`);
44 } catch (error) {
45 toast.error(`Failed to download "${agentName}" logs.`, {
46 description: getErrorDetail(error),
47 });
48 } finally {
49 setIsDownloading(false);
50 }
51 };
52
53 const hasAllLogs = allLogsText.length > 0;
54

Callers 1

Calls 1

getErrorDetailFunction · 0.90

Tested by

no test coverage detected