mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 13:07:17 +08:00
修复配置界面打不开的问题
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
|
||||
@@ -28,7 +28,7 @@ export const config = {
|
||||
initShow: true,
|
||||
width: 600,
|
||||
height: 400,
|
||||
openDevTools: false,
|
||||
openDevTools: true,
|
||||
frame: true,
|
||||
transparent: false,
|
||||
hash: '/#config'
|
||||
|
||||
@@ -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 {}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user