mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-09 17:18:31 +00:00
Fix restartSite import
This commit is contained in:
parent
108cb6216c
commit
61fc2e5ea7
3 changed files with 10 additions and 15 deletions
|
|
@ -21,6 +21,7 @@ export enum ActionsEnum {
|
|||
getSite = "getSite",
|
||||
listSites = "listSites",
|
||||
updateSite = "updateSite",
|
||||
restartSite = "restartSite",
|
||||
resetSiteBandwidth = "resetSiteBandwidth",
|
||||
reGenerateSecret = "reGenerateSecret",
|
||||
createResource = "createResource",
|
||||
|
|
|
|||
|
|
@ -257,8 +257,8 @@ authenticated.delete(
|
|||
authenticated.post(
|
||||
"/site/:siteId/restart",
|
||||
verifySiteAccess,
|
||||
verifyUserHasAction(ActionsEnum.updateSite),
|
||||
logActionAudit(ActionsEnum.updateSite),
|
||||
verifyUserHasAction(ActionsEnum.restartSite),
|
||||
logActionAudit(ActionsEnum.restartSite),
|
||||
site.restartSite
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ import createHttpError from "http-errors";
|
|||
import logger from "@server/logger";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
import { sendToClient } from "../ws";
|
||||
import { canCompress } from "@server/lib/clientVersionChecks";
|
||||
import { sendToClient } from "#dynamic/routers/ws";
|
||||
|
||||
const updateSiteParamsSchema = z.strictObject({
|
||||
siteId: z.coerce.number().int().positive()
|
||||
|
|
@ -92,17 +91,12 @@ export async function restartSite(
|
|||
);
|
||||
}
|
||||
|
||||
await sendToClient(
|
||||
newt.newtId,
|
||||
{
|
||||
type: "newt/wg/restart",
|
||||
data: {}
|
||||
},
|
||||
{
|
||||
incrementConfigVersion: false,
|
||||
compress: canCompress(newt.version, "newt")
|
||||
}
|
||||
);
|
||||
logger.info(`Restarting site ${siteId}...`);
|
||||
|
||||
await sendToClient(newt.newtId, {
|
||||
type: "newt/wg/restart",
|
||||
data: {}
|
||||
});
|
||||
|
||||
return response(res, {
|
||||
data: null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue