mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 11:55:05 +03:00
added more styling for DataGrid and LogSelection
This commit is contained in:
1 parent
1d56ecbf4a
commit
17eb129255
2 files changed
+13
-16
No files matched your search
@@ -22,7 +22,7 @@ const LogSelection = ({ log, onClose }: Props) => (
|
||||
}
|
||||
>
|
||||
<div className="p-4 h-full flex-col">
|
||||
<Typography.Text code className="block" small>{log.event_message} </Typography.Text>
|
||||
<Typography.Text code className="block w-full overflow-x-auto" small>{log.event_message} </Typography.Text>
|
||||
<Input.TextArea label="Metadata" className="font-mono mt-4" size="tiny" rows={25} disabled value={JSON.stringify(log.metadata, null, 2)} />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -57,22 +57,19 @@ const LogTable = ({ data }: Props) => {
|
||||
if (!data) return null
|
||||
|
||||
return (<section className="flex flex-row gap-x-4">
|
||||
<div className="flex-grow w-2/3">
|
||||
<DataGrid
|
||||
onSelectedCellChange={({ idx, rowIdx }) => setFocusedLog(data[rowIdx])}
|
||||
noRowsFallback={<Typography.Text className="text-center">No data returned from query</Typography.Text>}
|
||||
columns={columns as any}
|
||||
rowClass={r => `${r.id === focusedLog?.id ? "bg-green-800" : "cursor-pointer"}`}
|
||||
rows={data}
|
||||
rowKeyGetter={r => r.id}
|
||||
onRowClick={r => {
|
||||
const log = logMap[r.id]
|
||||
setFocusedLog(logMap[r.id])
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<DataGrid
|
||||
style={{ height: "unset", minHeight: "75vh" }}
|
||||
className="flex-grow flex-1"
|
||||
onSelectedCellChange={({ idx, rowIdx }) => setFocusedLog(data[rowIdx])}
|
||||
noRowsFallback={<Typography.Text className="text-center">No data returned from query</Typography.Text>}
|
||||
columns={columns as any}
|
||||
rowClass={r => `${r.id === focusedLog?.id ? "bg-green-800" : "cursor-pointer"}`}
|
||||
rows={data}
|
||||
rowKeyGetter={r => r.id}
|
||||
onRowClick={r => setFocusedLog(logMap[r.id])}
|
||||
/>
|
||||
{focusedLog && (
|
||||
<div className="sticky top-0 w-1/3">
|
||||
<div className="w-2/5">
|
||||
<LogSelection onClose={() => setFocusedLog(null)} log={focusedLog} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user