-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: finish all dashboard component and schema
- Loading branch information
Showing
7 changed files
with
399 additions
and
241 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ config.yaml | |
prisma/client/ | ||
|
||
.env | ||
config.json | ||
apps/server/.env | ||
|
||
# IDE | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,27 @@ | ||
import { OptionListItem, OptionListRoot } from '@/components/radix-ui-lib'; | ||
'use client'; | ||
|
||
import useSWR from 'swr'; | ||
|
||
import { Loading } from '@/components/loading'; | ||
import { OptionListRoot, OptionNode } from '@/components/radix-ui-lib'; | ||
import { useStore } from '@/store'; | ||
|
||
export default function AdminSettingPage() { | ||
const { fetcher } = useStore(); | ||
const { data } = useSWR('/dashboard/install', (url) => | ||
fetcher(url) | ||
.then((res) => res.json()) | ||
.then((res) => { | ||
console.log(res); | ||
return res; | ||
}), | ||
); | ||
if (!data) return <Loading />; | ||
return ( | ||
<> | ||
<OptionListItem | ||
schema={{ | ||
key: 'port', | ||
label: '端口', | ||
description: '设置端口', | ||
items: [ | ||
{ | ||
key: 'frontend', | ||
type: 'input', | ||
label: '前端端口', | ||
description: '设置前端端口', | ||
}, | ||
{ | ||
key: 'backend', | ||
type: 'input', | ||
label: '后端端口', | ||
description: '设置后端端口', | ||
}, | ||
{ | ||
key: '1', | ||
label: '原神人口普查', | ||
items: [ | ||
{ | ||
key: 'frontend', | ||
type: 'switch', | ||
label: '你氪金了没', | ||
description: '设置前端端口', | ||
}, | ||
{ | ||
key: 'backend', | ||
type: 'select', | ||
selectOptions: ['1', '2', '3'], | ||
label: '有几个五星', | ||
description: '设置后端端口', | ||
}, | ||
] | ||
} | ||
], | ||
}} | ||
/> | ||
<OptionListItem schema={{ | ||
key: '2', | ||
type: 'multi-input', | ||
label: '多输入', | ||
description: '设置多输入', | ||
keys: ['1', '2', '3'], | ||
}} /> | ||
</> | ||
<OptionListRoot> | ||
{data.map((item: any) => ( | ||
<OptionNode key={item.key} schema={item} /> | ||
))} | ||
</OptionListRoot> | ||
); | ||
} |
Oops, something went wrong.