-
Notifications
You must be signed in to change notification settings - Fork 1
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
SQL Logs #207
SQL Logs #207
Conversation
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
This PR is being deployed to Railway 🚅 web: ◻️ REMOVED |
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
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.
Experimenting with my own Card
component on the txn page just to have more control over how it looks. Still don't love using cards like this everywhere, but it's just a go-to for the time being.
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.
You, @dtbuchholz, and I all independently opened PRs to fix/change the ShadCN Card. Maybe we combine them into a single component and start using that everywhere on the site?
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.
This is the react server component page that renders to view a single transaction.
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.
Made this address display component a little more flexible so we can use it to display txn hashes as well.
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.
Added the ability to disable the buttons in the Paginator
component. You'd want to disable them while data is loading, for example.
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.
Client component that renders SQL logs for a table.
<Tabs defaultValue="data" className="py-4"> | ||
<TabsList> | ||
<TabsTrigger value="data">Table Data</TabsTrigger> | ||
<TabsTrigger value="logs">SQL Logs</TabsTrigger> | ||
</TabsList> | ||
<TabsContent value="data"> | ||
<DataTable columns={columns} data={data.results} /> | ||
</TabsContent> | ||
<TabsContent value="logs"> | ||
<SQLLogs chain={chainId} tableId={tokenId} /> | ||
</TabsContent> | ||
</Tabs> |
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.
Added tabbed navigation to switch between viewing table data and SQL logs. Planning on adding a tab to view the table schema as well.
packages/web/components/ui/tabs.tsx
Outdated
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.
Shadcn tabs component. This is not code I wrote, just installed it from his tool.
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.
Added new functions for querying for SQL logs.
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
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.
Looks really good!! I'm gonna use this regularly when I'm debugging etc...
The only potential blocker here is that the log list is using transaction hash the key, which isn't unique if someone batched statements into the same transaction.
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
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.
Ok
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.
@joewagner here is a new component that wraps the shadcn card with what I'm calling MetricCard
. The shadcn card is quite flexible and general use. I made the MetricCard
more opinionated about the way it displays information which lends itself more to the display of "metrics" tiles. This is how we've mostly been using the card throughout Studio. It also handles the overflow issue by using hyphens: auto
and a tooltip.
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.
I use this component on the sql log page in this PR, and we can apply it elsewhere in the site in an upcoming PR.
Adds a tabbed UI to the table page where you can switch between viewing table data and SQL logs for the table. When viewing logs, you can click any log entry and view a dedicated page for that txn hash.