diff --git a/src/apps/auth/server/gql/cli-queries.ts b/src/apps/auth/server/gql/cli-queries.ts index 014eb3ce0..f56cee3cb 100644 --- a/src/apps/auth/server/gql/cli-queries.ts +++ b/src/apps/auth/server/gql/cli-queries.ts @@ -540,33 +540,40 @@ export const cliQueries = (executor: IExecutor) => ({ ), cli_listDevices: executor( gql` - query Core_listVPNDevicesForUser { - core_listVPNDevicesForUser { - displayName - environmentName - markedForDeletion - metadata { - name - namespace - } - projectName - spec { - cnameRecords { - host - target - } - deviceNamespace - disabled - ports { - port - targetPort + query Infra_listVPNDevices($pq: CursorPaginationIn) { + infra_listVPNDevices(pq: $pq) { + edges { + node { + displayName + metadata { + name + } + spec { + deviceNamespace + disabled + nodeSelector + ports { + port + targetPort + } + } + status { + isReady + message { + RawMessage + } + } + wireguardConfig { + encoding + value + } } } } } `, { - transformer: (data: any) => data.core_listVPNDevicesForUser, + transformer: (data: any) => data.infra_listVPNDevices, vars: (_: any) => {}, } ), diff --git a/src/apps/auth/server/gql/queries/infra-queries.ts b/src/apps/auth/server/gql/queries/infra-queries.ts index efb015342..9942877e1 100644 --- a/src/apps/auth/server/gql/queries/infra-queries.ts +++ b/src/apps/auth/server/gql/queries/infra-queries.ts @@ -5,15 +5,10 @@ export const infraQueries = (executor: IExecutor) => ({ cli_CoreCheckNameAvailability: executor( gql` query Core_checkNameAvailability( - $projectName: String! $resType: ConsoleResType! $name: String! ) { - core_checkNameAvailability( - projectName: $projectName - resType: $resType - name: $name - ) { + core_checkNameAvailability(resType: $resType, name: $name) { result suggestedNames } @@ -26,31 +21,37 @@ export const infraQueries = (executor: IExecutor) => ({ ), cli_listCoreDevices: executor( gql` - query Core_listVPNDevices($pq: CursorPaginationIn) { - core_listVPNDevices(pq: $pq) { - edges { - cursor - node { - displayName - environmentName - metadata { - name - } - projectName - spec { - disabled - ports { - port - targetPort - } - } + query Core_listVPNDevicesForUser { + core_listVPNDevicesForUser { + displayName + environmentName + metadata { + name + } + projectName + status { + isReady + message { + RawMessage + } + } + spec { + cnameRecords { + host + target + } + deviceNamespace + disabled + ports { + port + targetPort } } } } `, { - transformer: (data: any) => data.core_listVPNDevices, + transformer: (data: any) => data.core_listVPNDevicesForUser, vars: (_: any) => {}, } ), diff --git a/src/apps/console/routes/_main+/$account+/_layout.tsx b/src/apps/console/routes/_main+/$account+/_layout.tsx index c022cb950..87ec4feec 100644 --- a/src/apps/console/routes/_main+/$account+/_layout.tsx +++ b/src/apps/console/routes/_main+/$account+/_layout.tsx @@ -31,7 +31,10 @@ import { } from '~/console/server/gql/queries/account-queries'; import { parseName, parseNodes } from '~/console/server/r-utils/common'; -import { ensureAccountClientSide } from '~/console/server/utils/auth-utils'; +import { + ensureAccountClientSide, + ensureAccountSet, +} from '~/console/server/utils/auth-utils'; import { GQLServerHandler } from '~/console/server/gql/saved-queries'; import MenuSelect from '~/console/components/menu-select'; import { BreadcrumButtonContent } from '~/console/utils/commons'; @@ -297,6 +300,7 @@ export const loader = async (ctx: IRemixCtx) => { let acccountData: IAccount; try { + ensureAccountSet(ctx); const { data, errors } = await GQLServerHandler(ctx.request).getAccount({ accountName: account, }); diff --git a/src/generated/gql/server.ts b/src/generated/gql/server.ts index 2603ed614..d7d7921c5 100644 --- a/src/generated/gql/server.ts +++ b/src/generated/gql/server.ts @@ -4976,12 +4976,20 @@ export type ConsoleListConsoleVpnDevicesForUserQueryVariables = Exact<{ export type ConsoleListConsoleVpnDevicesForUserQuery = { core_listVPNDevicesForUser?: Array<{ accountName: string; +<<<<<<< HEAD apiVersion?: string; +======= + apiVersion: string; +>>>>>>> 8de1ad26b8e04b8e252c65c4b81ddcc837464b6d creationTime: any; displayName: string; environmentName?: string; id: string; +<<<<<<< HEAD kind?: string; +======= + kind: string; +>>>>>>> 8de1ad26b8e04b8e252c65c4b81ddcc837464b6d markedForDeletion?: boolean; projectName?: string; recordVersion: number;