From 0a377150e342304bb5d66be594fef29a828d6acd Mon Sep 17 00:00:00 2001 From: Pallavi Kumari Date: Wed, 8 Oct 2025 22:35:40 +0530 Subject: [PATCH] reorder columns --- .../resources/[niceId]/proxy/page.tsx | 260 ++++++++---------- 1 file changed, 109 insertions(+), 151 deletions(-) diff --git a/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx b/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx index eae1d116..1f7a3f3d 100644 --- a/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx +++ b/src/app/[orgId]/settings/resources/[niceId]/proxy/page.tsx @@ -671,6 +671,21 @@ export default function ReverseProxyTargets(props: { } const columns: ColumnDef[] = [ + { + accessorKey: "enabled", + header: t("enabled"), + cell: ({ row }) => ( + + updateTarget(row.original.targetId, { + ...row.original, + enabled: val + }) + } + /> + ) + }, { id: "priority", header: () => ( @@ -711,6 +726,82 @@ export default function ReverseProxyTargets(props: { ); } }, + { + accessorKey: "healthCheck", + header: t("healthCheck"), + cell: ({ row }) => { + const status = row.original.hcHealth || "unknown"; + const isEnabled = row.original.hcEnabled; + + const getStatusColor = (status: string) => { + switch (status) { + case "healthy": + return "green"; + case "unhealthy": + return "red"; + case "unknown": + default: + return "secondary"; + } + }; + + const getStatusText = (status: string) => { + switch (status) { + case "healthy": + return t("healthCheckHealthy"); + case "unhealthy": + return t("healthCheckUnhealthy"); + case "unknown": + default: + return t("healthCheckUnknown"); + } + }; + + const getStatusIcon = (status: string) => { + switch (status) { + case "healthy": + return ; + case "unhealthy": + return ; + case "unknown": + default: + return null; + } + }; + + return ( + <> + {row.original.siteType === "newt" ? ( + + + + ) : ( + + {t("healthCheckNotAvailable")} + + )} + + ); + } + }, { accessorKey: "path", header: t("matchPath"), @@ -744,42 +835,27 @@ export default function ReverseProxyTargets(props: { } /> - - ) : ( - - updateTarget(row.original.targetId, config) - } - trigger={ - - } - /> +
+ + updateTarget(row.original.targetId, config) + } + trigger={ + + } + /> + +
); } }, @@ -931,22 +1007,6 @@ export default function ReverseProxyTargets(props: { } /> - ) : ( @@ -1010,21 +1070,6 @@ export default function ReverseProxyTargets(props: { } /> - ) : ( // ), // }, - { - accessorKey: "healthCheck", - header: t("healthCheck"), - cell: ({ row }) => { - const status = row.original.hcHealth || "unknown"; - const isEnabled = row.original.hcEnabled; - const getStatusColor = (status: string) => { - switch (status) { - case "healthy": - return "green"; - case "unhealthy": - return "red"; - case "unknown": - default: - return "secondary"; - } - }; - - const getStatusText = (status: string) => { - switch (status) { - case "healthy": - return t("healthCheckHealthy"); - case "unhealthy": - return t("healthCheckUnhealthy"); - case "unknown": - default: - return t("healthCheckUnknown"); - } - }; - - const getStatusIcon = (status: string) => { - switch (status) { - case "healthy": - return ; - case "unhealthy": - return ; - case "unknown": - default: - return null; - } - }; - - return ( - <> - {row.original.siteType === "newt" ? ( -
- -
- {getStatusIcon(status)} - {getStatusText(status)} -
-
- -
- ) : ( - - {t("healthCheckNotAvailable")} - - )} - - ); - } - }, - { - accessorKey: "enabled", - header: t("enabled"), - cell: ({ row }) => ( - - updateTarget(row.original.targetId, { - ...row.original, - enabled: val - }) - } - /> - ) - }, { id: "actions", cell: ({ row }) => (