-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: capture logs in browser storage (#576)
* feat: add error reporting feat: add error reporting - notify user when claiming failed - i18n error messages - add errors table to indexed db - add ui into settings with download / copy errors exacter scss * smaller log i18n * log error responses * fixup! * fixup spacing * feat: capture all logs (#583) * refactor: cleanup logging code * test: add tests for logs capturing * chore: add missing strings * fix: prettier formatting --------- Co-authored-by: michael1011 <[email protected]> Co-authored-by: Kilian <[email protected]>
- Loading branch information
1 parent
cd9a76f
commit e8a9689
Showing
19 changed files
with
431 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { | ||
BiRegularCopy, | ||
BiRegularDownload, | ||
BiRegularTrash, | ||
} from "solid-icons/bi"; | ||
import { Show } from "solid-js/web"; | ||
|
||
import { useGlobalContext } from "../context/Global"; | ||
import { downloadJson } from "../utils/download"; | ||
import { clipboard, isIos } from "../utils/helper"; | ||
|
||
const Logs = () => { | ||
const { getLogs, clearLogs } = useGlobalContext(); | ||
|
||
const clear = async (evt: MouseEvent) => { | ||
evt.stopPropagation(); | ||
await clearLogs(); | ||
}; | ||
|
||
const copy = async (evt: MouseEvent) => { | ||
evt.stopPropagation(); | ||
const logs = await getLogs(); | ||
clipboard(JSON.stringify(logs)); | ||
}; | ||
|
||
const download = async (evt: MouseEvent) => { | ||
evt.stopPropagation(); | ||
downloadJson("boltz-logs", await getLogs()); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<span onClick={copy} class="btn-small"> | ||
<BiRegularCopy size={14} /> | ||
</span> | ||
| ||
<Show when={!isIos()}> | ||
<span | ||
onClick={download} | ||
class="btn-small" | ||
data-testid="logs-download"> | ||
<BiRegularDownload size={14} /> | ||
</span> | ||
| ||
</Show> | ||
<span onClick={clear} class="btn-small btn-danger"> | ||
<BiRegularTrash size={14} /> | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Logs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.