feat: configure support for generic integrations
Co-authored-by: Gage Orsburn <gageorsburn@live.com>
This commit is contained in:
parent
1a30185047
commit
f0e4868252
10 changed files with 289 additions and 148 deletions
|
|
@ -5,7 +5,6 @@ import Code from '~/components/Code'
|
|||
import Notice from '~/components/Notice'
|
||||
import { loadContext } from '~/utils/config/headplane'
|
||||
import { loadConfig, patchConfig } from '~/utils/config/headscale'
|
||||
import { restartHeadscale } from '~/utils/docker'
|
||||
import { getSession } from '~/utils/sessions'
|
||||
import { useLiveData } from '~/utils/useLiveData'
|
||||
|
||||
|
|
@ -56,7 +55,11 @@ export async function action({ request }: ActionFunctionArgs) {
|
|||
|
||||
const data = await request.json() as Record<string, unknown>
|
||||
await patchConfig(data)
|
||||
await restartHeadscale()
|
||||
|
||||
if (context.integration?.restart) {
|
||||
await context.integration.restart()
|
||||
}
|
||||
|
||||
return json({ success: true })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue