feat: implement system configuration page with core settings for S2A, pooling, and proxy.
This commit is contained in:
@@ -35,7 +35,7 @@ export default function Config() {
|
|||||||
try {
|
try {
|
||||||
const res = await fetch('/api/config')
|
const res = await fetch('/api/config')
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
if (data.success) {
|
if (data.code === 0 && data.data) {
|
||||||
setEditS2ABase(data.data.s2a_api_base || '')
|
setEditS2ABase(data.data.s2a_api_base || '')
|
||||||
setEditS2AKey(data.data.s2a_admin_key || '')
|
setEditS2AKey(data.data.s2a_admin_key || '')
|
||||||
setEditConcurrency(data.data.concurrency || 2)
|
setEditConcurrency(data.data.concurrency || 2)
|
||||||
@@ -80,11 +80,11 @@ export default function Config() {
|
|||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
if (data.success) {
|
if (data.code === 0) {
|
||||||
setMessage({ type: 'success', text: '配置已保存' })
|
setMessage({ type: 'success', text: '配置已保存' })
|
||||||
fetchServerConfig()
|
fetchServerConfig()
|
||||||
} else {
|
} else {
|
||||||
setMessage({ type: 'error', text: data.error || '保存失败' })
|
setMessage({ type: 'error', text: data.message || '保存失败' })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setMessage({ type: 'error', text: '网络错误' })
|
setMessage({ type: 'error', text: '网络错误' })
|
||||||
|
|||||||
Reference in New Issue
Block a user