Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tulsiojha committed Jan 14, 2024
2 parents a8166f7 + 8de1ad2 commit 7a9b35a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 47 deletions.
49 changes: 28 additions & 21 deletions src/apps/auth/server/gql/cli-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {},
}
),
Expand Down
51 changes: 26 additions & 25 deletions src/apps/auth/server/gql/queries/infra-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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) => {},
}
),
Expand Down
6 changes: 5 additions & 1 deletion src/apps/console/routes/_main+/$account+/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
});
Expand Down
8 changes: 8 additions & 0 deletions src/generated/gql/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7a9b35a

Please sign in to comment.