@@ -299,22 +300,21 @@ export default function GeneralPage() {
},
{
accessorKey: "action",
- header: ({ column }) => {
+ header: () => {
return (
-
- {t("action")}
-
+
handleFilterChange("action", value)
}
- // placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
@@ -329,17 +329,14 @@ export default function GeneralPage() {
},
{
accessorKey: "ip",
- header: ({ column }) => {
- return t("ip");
- }
+ header: ({ column }) =>
{t("ip")}
},
{
accessorKey: "location",
header: ({ column }) => {
return (
-
- {t("location")}
-
+ ({
value: location,
@@ -351,8 +348,9 @@ export default function GeneralPage() {
handleFilterChange("location", value)
}
// placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ label={t("location")}
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
@@ -377,9 +375,8 @@ export default function GeneralPage() {
accessorKey: "resourceName",
header: ({ column }) => {
return (
-
- {t("resource")}
-
+ ({
value: res.id.toString(),
label: res.name || "Unnamed Resource"
@@ -388,9 +385,9 @@ export default function GeneralPage() {
onValueChange={(value) =>
handleFilterChange("resourceId", value)
}
- // placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ label={t("resource")}
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
@@ -417,9 +414,8 @@ export default function GeneralPage() {
accessorKey: "host",
header: ({ column }) => {
return (
-
- {t("host")}
-
+ ({
value: host,
label: host
@@ -428,9 +424,9 @@ export default function GeneralPage() {
onValueChange={(value) =>
handleFilterChange("host", value)
}
- // placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ label={t("host")}
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
@@ -452,9 +448,8 @@ export default function GeneralPage() {
accessorKey: "path",
header: ({ column }) => {
return (
-
- {t("path")}
-
+ ({
value: path,
label: path
@@ -463,9 +458,9 @@ export default function GeneralPage() {
onValueChange={(value) =>
handleFilterChange("path", value)
}
- // placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ label={t("path")}
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
@@ -482,9 +477,8 @@ export default function GeneralPage() {
accessorKey: "method",
header: ({ column }) => {
return (
-
- {t("method")}
-
+
handleFilterChange("method", value)
}
- // placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ label={t("method")}
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
@@ -510,9 +504,8 @@ export default function GeneralPage() {
accessorKey: "reason",
header: ({ column }) => {
return (
-
- {t("reason")}
-
+
handleFilterChange("reason", value)
}
- // placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ label={t("reason")}
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
@@ -556,9 +549,8 @@ export default function GeneralPage() {
accessorKey: "actor",
header: ({ column }) => {
return (
-
- {t("actor")}
-
+ ({
value: actor,
label: actor
@@ -567,9 +559,9 @@ export default function GeneralPage() {
onValueChange={(value) =>
handleFilterChange("actor", value)
}
- // placeholder=""
- searchPlaceholder="Search..."
- emptyMessage="None found"
+ label={t("actor")}
+ searchPlaceholder={t("searchPlaceholder")}
+ emptyMessage={t("emptySearchOptions")}
/>
);
diff --git a/src/app/[orgId]/settings/resources/private/page.tsx b/src/app/[orgId]/settings/resources/private/page.tsx
index f90bc91c7..23ff86296 100644
--- a/src/app/[orgId]/settings/resources/private/page.tsx
+++ b/src/app/[orgId]/settings/resources/private/page.tsx
@@ -108,10 +108,7 @@ export default async function ClientResourcesPage(
siteNiceId: siteResource.siteNiceIds[idx],
online: siteResource.siteOnlines[idx]
})),
- mode:
- siteResource.pamMode && siteResource.mode === "host"
- ? "ssh"
- : siteResource.mode,
+ mode: siteResource.mode,
scheme: siteResource.scheme,
ssl: siteResource.ssl,
siteNames: siteResource.siteNames,
diff --git a/src/app/[orgId]/settings/resources/public/ProxyResourceTargetsForm.tsx b/src/app/[orgId]/settings/resources/public/ProxyResourceTargetsForm.tsx
index 5863a50a8..b8042b2f3 100644
--- a/src/app/[orgId]/settings/resources/public/ProxyResourceTargetsForm.tsx
+++ b/src/app/[orgId]/settings/resources/public/ProxyResourceTargetsForm.tsx
@@ -10,7 +10,10 @@ import {
PathRewriteDisplay,
PathRewriteModal
} from "@app/components/PathMatchRenameModal";
-import { ResourceTargetAddressItem } from "@app/components/resource-target-address-item";
+import {
+ ResourceTargetAddressItem,
+ ResourceTargetSiteItem
+} from "@app/components/resource-target-address-item";
import {
SettingsSection,
SettingsSectionBody,
@@ -18,6 +21,7 @@ import {
SettingsSectionHeader,
SettingsSectionTitle
} from "@app/components/Settings";
+import { DataTableEmptyState } from "@app/components/ui/data-table-empty-state";
import {
Table,
TableBody,
@@ -65,6 +69,7 @@ import {
useMemo,
useState
} from "react";
+import { maxSize } from "zod";
export type LocalTarget = Omit<
ArrayElement
& {
@@ -138,11 +143,6 @@ export function ProxyResourceTargetsForm({
const [selectedTargetForHealthCheck, setSelectedTargetForHealthCheck] =
useState(null);
- const [bgDestination, setBgDestination] = useState("");
- const [bgDestinationPort, setBgDestinationPort] = useState("");
- const [bgSiteId, setBgSiteId] = useState(null);
- const [bgTargetId, setBgTargetId] = useState(null);
-
const initializeDockerForSite = async (siteId: number) => {
if (dockerStates.has(siteId)) {
return;
@@ -207,42 +207,6 @@ export function ProxyResourceTargetsForm({
})
);
- // Browser-gateway targets (edit mode only)
- const { data: bgTargetsResponse } = useQuery({
- queryKey: ["browserGatewayTargets", resource?.resourceId, orgId],
- queryFn: async () => {
- const res = await api.get(
- `/org/${orgId}/resource/${resource!.resourceId}/browser-gateway-targets`
- );
- return res.data.data as {
- targets: Array<{
- browserGatewayTargetId: number;
- resourceId: number;
- siteId: number;
- type: string;
- destination: string;
- destinationPort: number;
- }>;
- };
- },
- enabled: !!resource
- });
-
- useEffect(() => {
- if (!bgTargetsResponse?.targets?.length) return;
- const bgt = bgTargetsResponse.targets[0];
- setBgDestination(bgt.destination);
- setBgDestinationPort(String(bgt.destinationPort));
- setBgSiteId(bgt.siteId);
- setBgTargetId(bgt.browserGatewayTargetId);
- }, [bgTargetsResponse]);
-
- useEffect(() => {
- if (sites.length > 0 && bgSiteId === null) {
- setBgSiteId(sites[0].siteId);
- }
- }, [sites, bgSiteId]);
-
const updateTarget = useCallback(
(targetId: number, data: Partial) => {
setTargets((prevTargets) => {
@@ -269,7 +233,7 @@ export function ProxyResourceTargetsForm({
const priorityColumn: ColumnDef = {
id: "priority",
header: () => (
-
+
{t("priority")}
@@ -285,7 +249,6 @@ export function ProxyResourceTargetsForm({
),
cell: ({ row }) => {
return (
-
-
);
},
size: 120,
@@ -334,19 +296,15 @@ export function ProxyResourceTargetsForm({
{row.original.siteType === "newt" ? (
+
{getStatusText(status)}
) : (
-
@@ -441,13 +399,12 @@ export function ProxyResourceTargetsForm({
maxSize: 200
};
- const addressColumn: ColumnDef
= {
- accessorKey: "address",
- header: () => {t("address")},
+ const siteColumn: ColumnDef = {
+ accessorKey: "site",
+ header: () => {t("site")},
cell: ({ row }) => {
return (
-
);
},
- size: 400,
- minSize: 350,
- maxSize: 500
+ size: 220,
+ minSize: 180,
+ maxSize: 280
+ };
+
+ const addressColumn: ColumnDef = {
+ accessorKey: "address",
+ header: () => {t("address")},
+ cell: ({ row }) => {
+ return (
+
+ );
+ },
+ size: 350,
+ minSize: 300,
+ maxSize: 450
};
const rewritePathColumn: ColumnDef = {
@@ -535,7 +509,7 @@ export function ProxyResourceTargetsForm({
accessorKey: "enabled",
header: () => {t("enabled")},
cell: ({ row }) => (
-
+
@@ -554,9 +528,8 @@ export function ProxyResourceTargetsForm({
const actionsColumn: ColumnDef = {
id: "actions",
- header: () => {t("actions")},
cell: ({ row }) => (
-
+