feat: small size table

This commit is contained in:
kunish 2023-08-29 00:03:32 +08:00
parent e4bfb3f2a8
commit 9b56558f84
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
3 changed files with 46 additions and 43 deletions

View File

@ -21,12 +21,12 @@ export const App = () => {
return (
<div
class="relative flex h-screen flex-col p-2 subpixel-antialiased"
class="relative flex h-screen flex-col subpixel-antialiased"
data-theme={curTheme()}
>
<Header />
<div class="flex-1 overflow-y-auto py-4">
<div class="flex-1 overflow-y-auto p-4">
<Routes>
<Show when={selectedEndpoint()}>
<Route path="/" component={Overview} />
@ -41,7 +41,7 @@ export const App = () => {
</Routes>
</div>
<footer class="footer footer-center rounded-box hidden bg-base-200 p-2 text-base-content sm:block">
<footer class="footer footer-center hidden rounded bg-base-200 p-2 text-base-content sm:block">
<a href="https://github.com/metacubex/metacubexd" target="_blank">
metacubexd
</a>

View File

@ -9,60 +9,60 @@ import {
IconRuler,
IconSettings,
} from '@tabler/icons-solidjs'
import { For, Show } from 'solid-js'
import { For, ParentComponent, Show } from 'solid-js'
import { themes } from '~/constants'
import { setCurTheme, setSelectedEndpoint } from '~/signals'
const Nav: ParentComponent<{ href: string; tooltip: string }> = ({
href,
tooltip,
children,
}) => (
<li>
<A
class="tooltiptooltip-bottom rounded-full"
href={href}
data-tip={tooltip}
>
{children}
</A>
</li>
)
export const Header = () => {
const location = useLocation()
const navigate = useNavigate()
return (
<ul class="menu rounded-box menu-horizontal sticky left-0 top-0 z-10 flex items-center justify-center gap-2 bg-base-200 p-2">
<ul class="menu menu-horizontal sticky left-0 top-0 z-10 flex items-center justify-center gap-2 rounded-full bg-base-200 p-2">
<Show when={location.pathname !== '/setup'}>
<li>
<A class="tooltip tooltip-bottom" href="/" data-tip="Home">
<Nav href="/" tooltip="Overview">
<IconHome />
</A>
</li>
</Nav>
<li>
<A class="tooltip tooltip-bottom" href="/proxies" data-tip="Proxies">
<Nav href="/proxies" tooltip="Proxies">
<IconGlobe />
</A>
</li>
</Nav>
<li>
<A class="tooltip tooltip-bottom" href="/rules" data-tip="Rules">
<Nav href="/rules" tooltip="Rules">
<IconRuler />
</A>
</li>
</Nav>
<li>
<A
class="tooltip tooltip-bottom"
href="/conns"
data-tip="Connections"
>
<Nav href="/conns" tooltip="Connections">
<IconNetwork />
</A>
</li>
</Nav>
<li>
<A class="tooltip tooltip-bottom" href="/logs" data-tip="Logs">
<Nav href="/logs" tooltip="Logs">
<IconFileStack />
</A>
</li>
</Nav>
<li>
<A class="tooltip tooltip-bottom" href="/config" data-tip="Config">
<Nav href="/config" tooltip="Config">
<IconSettings />
</A>
</li>
</Nav>
<li>
<button
class="tooltip tooltip-bottom"
class="tooltip tooltip-bottom rounded-full"
data-tip="Switch Endpoint"
onClick={() => {
setSelectedEndpoint('')
@ -79,7 +79,10 @@ export const Header = () => {
<input id="themes" type="checkbox" class="drawer-toggle" />
<div class="drawer-content flex items-center">
<label for="themes" class="btn btn-primary drawer-button btn-sm">
<label
for="themes"
class="btn btn-circle btn-primary drawer-button btn-sm"
>
<IconPalette />
</label>
</div>

View File

@ -164,7 +164,7 @@ export const Connections = () => {
/>
<div class="overflow-x-auto whitespace-nowrap">
<table class="table">
<table class="table table-xs">
<thead>
<For each={table.getHeaderGroups()}>
{(headerGroup) => (
@ -202,7 +202,7 @@ export const Connections = () => {
<tbody>
<For each={table.getRowModel().rows}>
{(row) => (
<tr>
<tr class="hover">
<For each={row.getVisibleCells()}>
{(cell) => (
<td>