refactor: fix tabby-ui formatting

support-auth-token
Meng Zhang 2023-12-06 22:35:31 +08:00
parent d4bef71441
commit 7de4073779
3 changed files with 19 additions and 7 deletions

View File

@ -17,14 +17,21 @@ export default function RunnerCard({
cpuCount, cpuCount,
cpuInfo cpuInfo
}: RunnerCardProps) { }: RunnerCardProps) {
const textClass = cn("ml-2", "whitespace-nowrap", "overflow-hidden", "overflow-ellipsis") const textClass = cn(
const cpuMessage = `${cpuInfo} (${cpuCount} cores)`; 'ml-2',
'whitespace-nowrap',
'overflow-hidden',
'overflow-ellipsis'
)
const cpuMessage = `${cpuInfo} (${cpuCount} cores)`
return ( return (
<Card className="rounded-xl p-2 shadow-md lg:w-[260px]"> <Card className="rounded-xl p-2 shadow-md lg:w-[260px]">
<CardHeader className="p-0 px-4 pb-2 pt-4"> <CardHeader className="p-0 px-4 pb-2 pt-4">
<CardTitle className="text-md flex items-center font-normal"> <CardTitle className="text-md flex items-center font-normal">
<ModelIcon type={kind} /> <ModelIcon type={kind} />
<p title={name} className={textClass}>{name}</p> <p title={name} className={textClass}>
{name}
</p>
</CardTitle> </CardTitle>
</CardHeader> </CardHeader>
<CardContent className="flex flex-col gap-2 p-0 px-4 pb-4 pt-2"> <CardContent className="flex flex-col gap-2 p-0 px-4 pb-4 pt-2">
@ -47,7 +54,9 @@ export default function RunnerCard({
<path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3" /> <path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3" />
<path d="M12 12V8" /> <path d="M12 12V8" />
</svg> </svg>
<p title={addr} className={textClass}>{addr}</p> <p title={addr} className={textClass}>
{addr}
</p>
</Info> </Info>
<Info> <Info>
<svg <svg
@ -103,7 +112,9 @@ export default function RunnerCard({
<path d="M2 15h20" /> <path d="M2 15h20" />
<path d="M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z" /> <path d="M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z" />
</svg> </svg>
<p title={x} className={textClass}>{x}</p> <p title={x} className={textClass}>
{x}
</p>
</Info> </Info>
))} ))}
</CardContent> </CardContent>

View File

@ -109,7 +109,8 @@ function MainPanel() {
{!!registrationTokenRes?.registrationToken && ( {!!registrationTokenRes?.registrationToken && (
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
Registeration token: <span className="text-sm rounded-lg text-red-600"> Registeration token:{' '}
<span className="text-sm rounded-lg text-red-600">
{registrationTokenRes.registrationToken} {registrationTokenRes.registrationToken}
</span> </span>
<CopyButton value={registrationTokenRes.registrationToken} /> <CopyButton value={registrationTokenRes.registrationToken} />

View File

@ -3,7 +3,7 @@ import { create } from 'zustand'
import { persist } from 'zustand/middleware' import { persist } from 'zustand/middleware'
import { nanoid } from '@/lib/utils' import { nanoid } from '@/lib/utils'
const excludeFromState = ['_hasHydrated', 'setHasHydrated', "activeChatId"] const excludeFromState = ['_hasHydrated', 'setHasHydrated', 'activeChatId']
export interface ChatState { export interface ChatState {
chats: Chat[] | undefined chats: Chat[] | undefined