feat(logs): sticky table thead

This commit is contained in:
kunish 2023-09-05 00:20:19 +08:00
parent c9f696597e
commit 5affd5b91e
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
2 changed files with 7 additions and 7 deletions

View File

@ -237,7 +237,7 @@ export default () => {
}) })
return ( return (
<div class="flex h-full flex-col gap-4 overflow-y-auto"> <div class="flex h-full flex-col gap-4 overflow-y-auto p-1">
<div class="flex w-full items-center gap-2"> <div class="flex w-full items-center gap-2">
<input <input
class="input input-primary flex-1" class="input input-primary flex-1"

View File

@ -67,16 +67,16 @@ export default () => {
}) })
return ( return (
<div class="flex flex-col gap-4"> <div class="flex h-full flex-col gap-4 overflow-y-auto p-1">
<input <input
class="input input-primary" class="input input-primary flex-shrink-0"
placeholder={t('search')} placeholder={t('search')}
onInput={(e) => setSearch(e.target.value)} onInput={(e) => setSearch(e.target.value)}
/> />
<div class="overflow-x-auto whitespace-nowrap rounded-md"> <div class="overflow-x-auto whitespace-nowrap rounded-md bg-base-300">
<table class="table table-zebra-zebra table-xs rounded-none bg-base-200"> <table class="table table-xs relative rounded-none">
<thead> <thead class="sticky top-0 z-10">
<For each={table.getHeaderGroups()}> <For each={table.getHeaderGroups()}>
{(headerGroup) => ( {(headerGroup) => (
<tr> <tr>
@ -102,7 +102,7 @@ export default () => {
<tbody> <tbody>
<For each={table.getRowModel().rows}> <For each={table.getRowModel().rows}>
{(row) => ( {(row) => (
<tr> <tr class="hover">
<For each={row.getVisibleCells()}> <For each={row.getVisibleCells()}>
{(cell) => ( {(cell) => (
<td> <td>