修复配置界面打不开的问题

This commit is contained in:
yuruo
2024-06-25 17:34:56 +08:00
parent 4d666f769d
commit 4050cf6d24
4 changed files with 10 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"

View File

@@ -28,7 +28,7 @@ export const config = {
initShow: true,
width: 600,
height: 400,
openDevTools: false,
openDevTools: true,
frame: true,
transparent: false,
hash: '/#config'

View File

@@ -1,11 +1,11 @@
export default async ({request})=>{
export default async ({ request }) => {
const formData = await request.formData()
const data = Object.fromEntries(formData)
window.api.sql(`update config set content=@content where id = 1`,
'update',
{
content: JSON.stringify(data)
}
)
'update',
{
content: JSON.stringify(data)
}
)
return {}
}

View File

@@ -8,6 +8,7 @@ export const Setting = () => {
const {config} = useLoaderData() as {
config: ConfigDataType
}
console.log("config:", config)
const submit = useSubmit()
return (
<Form method="POST">
@@ -43,7 +44,7 @@ export const Setting = () => {
<h5></h5>
<input
type="text"
name="LLM"
name="llm"
defaultValue={JSON.stringify(config.llm)}
onChange={(e)=>{
submit(e.currentTarget.value)