mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-23 01:05:27 +00:00
Add logging when manually changing the hc status
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
} from "@server/db";
|
||||
import { eq } from "drizzle-orm";
|
||||
import logger from "@server/logger";
|
||||
import { fireSiteOfflineAlert } from "@server/lib/alerts";
|
||||
import { fireSiteOfflineAlert } from "#dynamic/lib/alerts";
|
||||
|
||||
/**
|
||||
* Handles disconnecting messages from sites to show disconnected in the ui
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import {
|
||||
db,
|
||||
newts,
|
||||
sites,
|
||||
targetHealthCheck,
|
||||
targets,
|
||||
statusHistory
|
||||
sites
|
||||
} from "@server/db";
|
||||
import { hasActiveConnections } from "#dynamic/routers/ws";
|
||||
import { eq, lt, isNull, and, or, ne, not, inArray } from "drizzle-orm";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
import { z } from "zod";
|
||||
import { db } from "@server/db";
|
||||
import { db, statusHistory } from "@server/db";
|
||||
import {
|
||||
siteProvisioningKeys,
|
||||
siteProvisioningKeyOrg,
|
||||
@@ -223,6 +223,14 @@ export async function registerNewt(
|
||||
})
|
||||
.returning();
|
||||
|
||||
await trx.insert(statusHistory).values({
|
||||
entityType: "site",
|
||||
entityId: newSite.siteId,
|
||||
orgId: orgId,
|
||||
status: "offline",
|
||||
timestamp: Math.floor(Date.now() / 1000)
|
||||
});
|
||||
|
||||
newSiteId = newSite.siteId;
|
||||
|
||||
// Grant admin role access to the new site
|
||||
|
||||
Reference in New Issue
Block a user