-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wallet Logs #994
Merged
Merged
Wallet Logs #994
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
b650ffc
nwc wallet logs
ekzyis 336ac95
persist logs in IndexedDB
ekzyis e0be8a0
Potential fix for empty error message
ekzyis 1a89dcc
load logs limited to 5m ago from IDB
ekzyis 1663db1
load logs from past via query param
ekzyis db767a0
Add 5m, 1h, 6h links for earlier logs
ekzyis b0f4961
Show end of log
ekzyis f8db214
Clamp to logStart
ekzyis 62c39db
Add log.module.css
ekzyis e44d32c
Remove TODO about persistence
ekzyis 3f1f489
Use table for logs
ekzyis 69dc7b3
Rename .header to .logNav
ekzyis 68ea329
Simply load all logs and remove navigation
ekzyis 166a793
Add follow checkbox
ekzyis ebb42e0
Create WalletLogs component
ekzyis 2ef39a4
Embed wallet logs
ekzyis dae5970
Remove test error
ekzyis 39f8756
Fix level padding
ekzyis bdd6ac0
Add LNbits logs
ekzyis 3ce22a6
Add logs for attaching LND and lnAddr
ekzyis c247d2f
Use err.message || err.toString?.() consistently
ekzyis a6b9985
Autowithdrawal logs
ekzyis 49d2ff0
Use details from LND error
ekzyis 14ba1db
Don't log test invoice individually
ekzyis 823cd9e
Also refetch logs on error
ekzyis dbbf9b4
Remove obsolete and annoying toasts
ekzyis b5786e8
Replace scrollIntoView with scroll
ekzyis 326b2a9
Use constant embedded max-height
ekzyis eefbfe4
Fix missing width: 100% for embedded logs
ekzyis a20642f
Show full payment hash and preimage in logs
ekzyis 72ca741
Also parse details from LND errors on autowithdrawal failures
ekzyis ce67132
Remove TODO
ekzyis ba97b5c
Fix accidental removal of wss:// check
ekzyis 5cf2899
Fix alignment of start marker and show empty if empty
ekzyis 2b632cb
Fix sendPayment loop
ekzyis 2b4e634
Split context in two
ekzyis File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,15 @@ | ||
import { timeSince } from '@/lib/time' | ||
import styles from './log-message.module.css' | ||
|
||
export default function LogMessage ({ wallet, level, message, ts }) { | ||
level = level.toLowerCase() | ||
const levelClassName = ['ok', 'success'].includes(level) ? 'text-success' : level === 'error' ? 'text-danger' : level === 'info' ? 'text-info' : '' | ||
return ( | ||
<tr className={styles.line}> | ||
<td className={styles.timestamp}>{timeSince(new Date(ts))}</td> | ||
<td className={styles.wallet}>[{wallet}]</td> | ||
<td className={`${styles.level} ${levelClassName}`}>{level}</td> | ||
<td>{message}</td> | ||
</tr> | ||
) | ||
} |
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,23 @@ | ||
.line { | ||
font-family: monospace; | ||
color: var(--theme-grey) !important; /* .text-muted */ | ||
} | ||
|
||
.timestamp { | ||
vertical-align: top; | ||
text-align: end; | ||
text-wrap: nowrap; | ||
justify-self: first baseline; | ||
} | ||
|
||
.wallet { | ||
vertical-align: top; | ||
font-weight: bold; | ||
} | ||
|
||
.level { | ||
font-weight: bold; | ||
vertical-align: top; | ||
text-transform: uppercase; | ||
padding-right: 0.5em; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are wasting a lot of bandwidth per wallet save here since we always fetch all logs instead of passing the last id the frontend already knows.
But this is as simple as it can be and maybe it's as unnecessary as trying to optimize log performance by not loading all logs from IDB at once but have pagination but that made the code a lot more complicated (see cb1f1a6).