mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-22 00:35:22 +00:00
Fix the linking out and deleting for target ones
This commit is contained in:
@@ -17,7 +17,7 @@ import HttpCode from "@server/types/HttpCode";
|
||||
import createHttpError from "http-errors";
|
||||
import logger from "@server/logger";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
import { and, eq, like, sql } from "drizzle-orm";
|
||||
import { and, eq, isNotNull, like, sql } from "drizzle-orm";
|
||||
import { NextFunction, Request, Response } from "express";
|
||||
import { z } from "zod";
|
||||
import { fromError } from "zod-validation-error";
|
||||
@@ -85,6 +85,7 @@ export async function listHealthChecks(
|
||||
|
||||
const whereClause = and(
|
||||
eq(targetHealthCheck.orgId, orgId),
|
||||
isNotNull(targetHealthCheck.hcMode), // filter out the null ones attached to targets
|
||||
query
|
||||
? like(
|
||||
sql`LOWER(${targetHealthCheck.name})`,
|
||||
|
||||
@@ -329,7 +329,7 @@ export default function HealthChecksTable({
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem
|
||||
disabled={!isPaid}
|
||||
disabled={!isPaid || !!r.resourceId}
|
||||
onClick={() => {
|
||||
setSelected(r);
|
||||
setDeleteOpen(true);
|
||||
@@ -339,8 +339,19 @@ export default function HealthChecksTable({
|
||||
{t("delete")}
|
||||
</span>
|
||||
</DropdownMenuItem>
|
||||
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
{r.resourceId && r.resourceName && r.resourceNiceId ? (
|
||||
<Link href={`/${orgId}/settings/resources/proxy/${r.resourceNiceId}`}>
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={!isPaid}
|
||||
>
|
||||
{t("edit")}
|
||||
</Button>
|
||||
</Link>
|
||||
) : (
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={!isPaid}
|
||||
@@ -351,6 +362,8 @@ export default function HealthChecksTable({
|
||||
>
|
||||
{t("edit")}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user