-
Notifications
You must be signed in to change notification settings - Fork 997
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
309 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test tabby-agent | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/tabby-ui-test.yml' | ||
- 'package.json' | ||
- 'yarn.lock' | ||
- 'clients/tabby-ui/**' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/tabby-ui-test.yml' | ||
- 'package.json' | ||
- 'yarn.lock' | ||
- 'clients/tabby-ui/**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
cache: yarn | ||
cache-dependency-path: 'yarn.lock' | ||
- name: Install dependencies | ||
working-directory: ./clients/tabby-ui | ||
run: yarn install | ||
- name: Format | ||
working-directory: ./clients/tabby-ui | ||
run: yarn format:check | ||
- name: Lint | ||
working-directory: ./clients/tabby-ui | ||
run: yarn lint:check | ||
- name: Run tests | ||
working-directory: ./clients/tabby-ui | ||
run: yarn test | ||
- name: Test build | ||
working-directory: ./clients/tabby-ui | ||
run: yarn build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { Metadata } from 'next' | ||
|
||
export const metadata: Metadata = { | ||
title: 'API', | ||
title: 'API' | ||
} | ||
|
||
const serverUrl = process.env.NEXT_PUBLIC_TABBY_SERVER_URL || ''; | ||
const serverUrl = process.env.NEXT_PUBLIC_TABBY_SERVER_URL || '' | ||
|
||
export default function IndexPage() { | ||
return <iframe className='flex-grow' src={`${serverUrl}/swagger-ui`} /> | ||
return <iframe className="grow" src={`${serverUrl}/swagger-ui`} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,134 @@ | ||
"use client" | ||
'use client' | ||
|
||
import { buttonVariants } from "@/components/ui/button" | ||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; | ||
import { IconSlack } from "@/components/ui/icons" | ||
import { Separator } from "@/components/ui/separator"; | ||
import { useHealth } from "@/lib/hooks/use-health"; | ||
import { PropsWithChildren, useEffect, useState } from "react"; | ||
import { buttonVariants } from '@/components/ui/button' | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogFooter, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger | ||
} from '@/components/ui/dialog' | ||
import { IconSlack } from '@/components/ui/icons' | ||
import { Separator } from '@/components/ui/separator' | ||
import { useHealth } from '@/lib/hooks/use-health' | ||
import { PropsWithChildren, useEffect, useState } from 'react' | ||
|
||
const COMMUNITY_DIALOG_SHOWN_KEY = "community-dialog-shown"; | ||
const COMMUNITY_DIALOG_SHOWN_KEY = 'community-dialog-shown' | ||
|
||
export default function IndexPage() { | ||
const [open, setOpen] = useState(false); | ||
const [open, setOpen] = useState(false) | ||
useEffect(() => { | ||
if (!localStorage.getItem(COMMUNITY_DIALOG_SHOWN_KEY)) { | ||
setOpen(true); | ||
localStorage.setItem(COMMUNITY_DIALOG_SHOWN_KEY, "true"); | ||
setOpen(true) | ||
localStorage.setItem(COMMUNITY_DIALOG_SHOWN_KEY, 'true') | ||
} | ||
}, []); | ||
}, []) | ||
|
||
return <div className="grow flex justify-center items-center" > | ||
<MainPanel /> | ||
<Dialog open={open} onOpenChange={setOpen}> | ||
<DialogContent> | ||
<DialogHeader className="gap-3"> | ||
<DialogTitle>Join the Tabby community</DialogTitle> | ||
<DialogDescription> | ||
Connect with other contributors building Tabby. Share knowledge, get help, and contribute to the open-source project. | ||
</DialogDescription> | ||
</DialogHeader> | ||
<DialogFooter className="sm:justify-start"> | ||
<a target="_blank" href="https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA" className={buttonVariants()}><IconSlack className="-ml-2 h-8 w-8" />Join us on Slack</a> | ||
</DialogFooter> | ||
</DialogContent> | ||
</Dialog> | ||
</div> | ||
return ( | ||
<div className="flex grow items-center justify-center"> | ||
<MainPanel /> | ||
<Dialog open={open} onOpenChange={setOpen}> | ||
<DialogContent> | ||
<DialogHeader className="gap-3"> | ||
<DialogTitle>Join the Tabby community</DialogTitle> | ||
<DialogDescription> | ||
Connect with other contributors building Tabby. Share knowledge, | ||
get help, and contribute to the open-source project. | ||
</DialogDescription> | ||
</DialogHeader> | ||
<DialogFooter className="sm:justify-start"> | ||
<a | ||
target="_blank" | ||
href="https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA" | ||
className={buttonVariants()} | ||
> | ||
<IconSlack className="-ml-2 h-8 w-8" /> | ||
Join us on Slack | ||
</a> | ||
</DialogFooter> | ||
</DialogContent> | ||
</Dialog> | ||
</div> | ||
) | ||
} | ||
|
||
interface LinkProps { | ||
href: string | ||
} | ||
|
||
function Link({ href, children }: PropsWithChildren<LinkProps>) { | ||
return <a target="_blank" href={href} className="underline">{children}</a> | ||
return ( | ||
<a target="_blank" href={href} className="underline"> | ||
{children} | ||
</a> | ||
) | ||
} | ||
|
||
function toBadgeString(str: string) { | ||
return encodeURIComponent(str.replaceAll("-", "--")); | ||
return encodeURIComponent(str.replaceAll('-', '--')) | ||
} | ||
|
||
function MainPanel() { | ||
const { data: healthInfo } = useHealth(); | ||
const { data: healthInfo } = useHealth() | ||
|
||
if (!healthInfo) return | ||
|
||
return <div className="w-2/3 lg:w-1/3 flex flex-col gap-3"> | ||
<h1><span className="font-bold">Congratulations</span>, your tabby instance is running!</h1> | ||
<span className="flex flex-wrap gap-1"> | ||
<a target="_blank" href={`https://github.com/TabbyML/tabby/releases/tag/${healthInfo.version.git_describe}`}> | ||
<img src={`https://img.shields.io/badge/version-${toBadgeString(healthInfo.version.git_describe)}-green`} /> | ||
</a> | ||
<img src={`https://img.shields.io/badge/device-${healthInfo.device}-blue`} /> | ||
<img src={`https://img.shields.io/badge/model-${toBadgeString(healthInfo.model)}-red`} /> | ||
{healthInfo.chat_model && <img src={`https://img.shields.io/badge/chat%20model-${toBadgeString(healthInfo.chat_model)}-orange`} />} | ||
</span> | ||
return ( | ||
<div className="flex w-2/3 flex-col gap-3 lg:w-1/3"> | ||
<h1> | ||
<span className="font-bold">Congratulations</span>, your tabby instance | ||
is running! | ||
</h1> | ||
<span className="flex flex-wrap gap-1"> | ||
<a | ||
target="_blank" | ||
href={`https://github.com/TabbyML/tabby/releases/tag/${healthInfo.version.git_describe}`} | ||
> | ||
<img | ||
src={`https://img.shields.io/badge/version-${toBadgeString( | ||
healthInfo.version.git_describe | ||
)}-green`} | ||
/> | ||
</a> | ||
<img | ||
src={`https://img.shields.io/badge/device-${healthInfo.device}-blue`} | ||
/> | ||
<img | ||
src={`https://img.shields.io/badge/model-${toBadgeString( | ||
healthInfo.model | ||
)}-red`} | ||
/> | ||
{healthInfo.chat_model && ( | ||
<img | ||
src={`https://img.shields.io/badge/chat%20model-${toBadgeString( | ||
healthInfo.chat_model | ||
)}-orange`} | ||
/> | ||
)} | ||
</span> | ||
|
||
<Separator /> | ||
<Separator /> | ||
|
||
<span> | ||
You can find our documentation <Link href="https://tabby.tabbyml.com/docs/getting-started">here</Link>. | ||
<ul className="mt-2"> | ||
<li>💻 <Link href="https://tabby.tabbyml.com/docs/extensions/">IDE/Editor Extensions</Link></li> | ||
<li>⚙️ <Link href="https://tabby.tabbyml.com/docs/configuration">Configuration</Link></li> | ||
</ul> | ||
</span> | ||
</div> | ||
} | ||
<span> | ||
You can find our documentation{' '} | ||
<Link href="https://tabby.tabbyml.com/docs/getting-started">here</Link>. | ||
<ul className="mt-2"> | ||
<li> | ||
💻{' '} | ||
<Link href="https://tabby.tabbyml.com/docs/extensions/"> | ||
IDE/Editor Extensions | ||
</Link> | ||
</li> | ||
<li> | ||
⚙️{' '} | ||
<Link href="https://tabby.tabbyml.com/docs/configuration"> | ||
Configuration | ||
</Link> | ||
</li> | ||
</ul> | ||
</span> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.