Skip to content

Commit

Permalink
feat: small size table
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Aug 28, 2023
1 parent e4bfb3f commit 9b56558
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 43 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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} />
Expand All @@ -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>
Expand Down
79 changes: 41 additions & 38 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<IconHome />
</A>
</li>
<Nav href="/" tooltip="Overview">
<IconHome />
</Nav>

<li>
<A class="tooltip tooltip-bottom" href="/proxies" data-tip="Proxies">
<IconGlobe />
</A>
</li>
<Nav href="/proxies" tooltip="Proxies">
<IconGlobe />
</Nav>

<li>
<A class="tooltip tooltip-bottom" href="/rules" data-tip="Rules">
<IconRuler />
</A>
</li>
<Nav href="/rules" tooltip="Rules">
<IconRuler />
</Nav>

<li>
<A
class="tooltip tooltip-bottom"
href="/conns"
data-tip="Connections"
>
<IconNetwork />
</A>
</li>
<Nav href="/conns" tooltip="Connections">
<IconNetwork />
</Nav>

<li>
<A class="tooltip tooltip-bottom" href="/logs" data-tip="Logs">
<IconFileStack />
</A>
</li>
<Nav href="/logs" tooltip="Logs">
<IconFileStack />
</Nav>

<li>
<A class="tooltip tooltip-bottom" href="/config" data-tip="Config">
<IconSettings />
</A>
</li>
<Nav href="/config" tooltip="Config">
<IconSettings />
</Nav>

<li>
<button
class="tooltip tooltip-bottom"
class="tooltip tooltip-bottom rounded-full"
data-tip="Switch Endpoint"
onClick={() => {
setSelectedEndpoint('')
Expand All @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
Expand Down Expand Up @@ -202,7 +202,7 @@ export const Connections = () => {
<tbody>
<For each={table.getRowModel().rows}>
{(row) => (
<tr>
<tr class="hover">
<For each={row.getVisibleCells()}>
{(cell) => (
<td>
Expand Down

0 comments on commit 9b56558

Please sign in to comment.