Repository navigation
feat: new UI part 3 #5011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: new UI part 3 #5011
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f5508d6
feat: register json view, formInstance, launch model list, cache/env …
c6f24f1
fix: code review
5ebb6a9
fix: code review
a02608e
feat: LaunchDialog
39bd2e7
feat: LaunchDialog
3a658c6
Merge remote-tracking branch 'origin/main' into feat-new-ui-version-3
432bc5c
feat: RunningModel、RegisterModel update、LaunchDialog
e5b2671
fix: remove workbench
bde2cb9
fix: code review
65f0071
fix: code review
317625c
fix: For the parameters of the three interfaces: progress, cancel, an…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,13 +1,24 @@ | ||
| import LaunchModel from '@/components/pages/launch-model'; | ||
| import { getLaunchModelRouteType } from '@/components/pages/launch-model/utils'; | ||
| import { getLaunchModelRouteType, getInitialCustomType } from '@/components/pages/launch-model/utils'; | ||
|
|
||
| interface LaunchModelPageProps { | ||
| params: Promise<{ | ||
| modelType: string; | ||
| }>; | ||
|
|
||
| searchParams: Promise<{ | ||
| activeType?: string; | ||
| }>; | ||
| } | ||
|
|
||
| export default async function LaunchModelPage({ params }: LaunchModelPageProps) { | ||
| export default async function LaunchModelPage({ params, searchParams }: LaunchModelPageProps) { | ||
| const { modelType } = await params; | ||
| return <LaunchModel routeType={getLaunchModelRouteType(modelType)} />; | ||
| const { activeType } = await searchParams; | ||
|
|
||
| return ( | ||
| <LaunchModel | ||
| routeType={getLaunchModelRouteType(modelType)} | ||
| initialCustomType={getInitialCustomType(activeType)} | ||
| /> | ||
| ); | ||
| } |
14 changes: 14 additions & 0 deletions
14
frontend/src/app/register-model/[modelType]/[modelName]/page.tsx
This file contains hidden or 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,14 @@ | ||
| import RegisterModel from '@/components/pages/register-model'; | ||
| import { getRigisterModelTyps } from '@/components/pages/register-model/utils'; | ||
|
|
||
| interface RegisterModelPageProps { | ||
| params: Promise<{ | ||
| modelType: string; | ||
| modelName: string; | ||
| }>; | ||
| } | ||
|
|
||
| export default async function RegisterModelPage({ params }: RegisterModelPageProps) { | ||
| const { modelType, modelName } = await params; | ||
| return <RegisterModel modelType={getRigisterModelTyps(modelType)} modelName={modelName} />; | ||
| } |
This file contains hidden or 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,13 @@ | ||
| import RegisterModel from '@/components/pages/register-model'; | ||
| import { getRigisterModelTyps } from '@/components/pages/register-model/utils'; | ||
|
|
||
| interface RegisterModelPageProps { | ||
| params: Promise<{ | ||
| modelType: string; | ||
| }>; | ||
| } | ||
|
|
||
| export default async function RegisterModelPage({ params }: RegisterModelPageProps) { | ||
| const { modelType } = await params; | ||
| return <RegisterModel modelType={getRigisterModelTyps(modelType)} />; | ||
| } |
This file contains hidden or 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,5 +1,5 @@ | ||
| import RegisterModel from '@/components/pages/register-model'; | ||
| import { redirect } from 'next/navigation'; | ||
|
|
||
| export default function RegisterModelPage() { | ||
| return <RegisterModel />; | ||
| export default function LaunchModelPage() { | ||
| redirect('/register-model/LLM'); | ||
| } |
This file contains hidden or 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,6 +1,6 @@ | ||
| const RunningModel = ()=>{ | ||
| return ( | ||
| <div className="h-[2000px] overflow-y-auto"></div> | ||
| ) | ||
| } | ||
| export default RunningModel; | ||
| import RunningModel from '@/components/pages/running-model'; | ||
|
|
||
| const RunningModelPages = () => { | ||
| return <RunningModel />; | ||
| }; | ||
| export default RunningModelPages; |
This file contains hidden or 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,3 +1,8 @@ | ||
| export default function Page() { | ||
| return <div>workbench</div>; | ||
| } | ||
| return ( | ||
| <div className="mx-auto flex w-full max-w-3xl flex-col gap-8 py-8"> | ||
|
|
||
| </div> | ||
| ); | ||
| } | ||
|
|
This file contains hidden or 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 hidden or 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
66 changes: 66 additions & 0 deletions
66
frontend/src/components/pages/launch-model/custom-edit-dialog.tsx
This file contains hidden or 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,66 @@ | ||
| 'use client'; | ||
|
|
||
| import { FC, useState, useMemo } from 'react'; | ||
| import { SquarePen, Copy } from 'lucide-react'; | ||
| import { useRouter } from 'next/navigation'; | ||
| import { Button } from '@/components/ui/button'; | ||
| import { Textarea } from '@/components/ui/textarea'; | ||
| import { | ||
| Dialog, | ||
| DialogTrigger, | ||
| DialogContent, | ||
| DialogFooter, | ||
| DialogHeader, | ||
| DialogTitle, | ||
| } from '@/components/ui/dialog'; | ||
| import { useI18n } from '@/contexts/i18n-context'; | ||
| import type { CatalogModel, RequestModelType } from './types'; | ||
| import { copyText } from '@/lib/utils'; | ||
|
|
||
| interface EnvManagementDialogProps { | ||
| model: CatalogModel; | ||
| modelType: RequestModelType; | ||
| } | ||
| const CustomEditDialog: FC<EnvManagementDialogProps> = ({ model, modelType }) => { | ||
| const { t } = useI18n(); | ||
| const router = useRouter(); | ||
| const [open, setOpen] = useState(false); | ||
| const value = useMemo(() => JSON.stringify(model, null, 4), [model]); | ||
| const handleEdit = () => { | ||
| // set model detail | ||
| sessionStorage.setItem('customJsonData', JSON.stringify(model)); | ||
| router.push(`/register-model/${modelType}/${model.model_name}`); | ||
| }; | ||
| return ( | ||
| <Dialog open={open} onOpenChange={setOpen}> | ||
| <DialogTrigger asChild> | ||
| <button | ||
| type="button" | ||
| aria-label="Delete model" | ||
| className="rounded-full p-1 text-muted-foreground transition-colors hover:text-foreground" | ||
| > | ||
| <SquarePen className="size-5" /> | ||
| </button> | ||
| </DialogTrigger> | ||
| <DialogContent className="!max-w-2xl" showCloseButton={false}> | ||
| <DialogHeader className="flex !flex-row items-center justify-between"> | ||
| <DialogTitle className="truncate">{model.model_name}</DialogTitle> | ||
| <button | ||
| className="shrink-0 p-1 text-muted-foreground transition-colors hover:text-foreground" | ||
| onClick={() => copyText(value)} | ||
| > | ||
| <Copy className="size-4" /> | ||
| </button> | ||
| </DialogHeader> | ||
| <Textarea value={value} className="min-h-96" disabled /> | ||
| <DialogFooter> | ||
| <Button variant="outline" onClick={() => setOpen(false)}> | ||
| {t('common.cancel')} | ||
| </Button> | ||
| <Button onClick={handleEdit}>{t('common.edit')}</Button> | ||
| </DialogFooter> | ||
| </DialogContent> | ||
| </Dialog> | ||
| ); | ||
| }; | ||
| export default CustomEditDialog; | ||
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.