Skip to content

Commit 6537da6

Browse files
committed
chore: fix issues with connect
1 parent d305fcc commit 6537da6

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

api/generated-schema.graphql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,11 +1164,16 @@ type Info implements Node {
11641164

11651165
type ContainerPort {
11661166
ip: String
1167-
privatePort: Int!
1168-
publicPort: Int!
1167+
privatePort: Port
1168+
publicPort: Port
11691169
type: ContainerPortType!
11701170
}
11711171

1172+
"""
1173+
A field whose value is a valid TCP port within the range of 0 to 65535: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_ports
1174+
"""
1175+
scalar Port
1176+
11721177
enum ContainerPortType {
11731178
TCP
11741179
UDP
@@ -1352,6 +1357,7 @@ enum VmState {
13521357
type Vms {
13531358
id: ID!
13541359
domains: [VmDomain!]
1360+
domain: [VmDomain!]
13551361
}
13561362

13571363
type Uptime {

api/src/unraid-api/graph/resolvers/docker/docker.model.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Field, ID, Int, ObjectType, registerEnumType } from '@nestjs/graphql';
22

3+
import { GraphQLPort } from 'graphql-scalars';
34
import { GraphQLJSONObject } from 'graphql-type-json';
45

56
import { Node } from '@app/unraid-api/graph/resolvers/base.model.js';
@@ -18,11 +19,11 @@ export class ContainerPort {
1819
@Field(() => String, { nullable: true })
1920
ip?: string;
2021

21-
@Field(() => Int)
22-
privatePort!: number;
22+
@Field(() => GraphQLPort, { nullable: true })
23+
privatePort?: number;
2324

24-
@Field(() => Int)
25-
publicPort!: number;
25+
@Field(() => GraphQLPort, { nullable: true })
26+
publicPort?: number;
2627

2728
@Field(() => ContainerPortType)
2829
type!: ContainerPortType;

api/src/unraid-api/graph/resolvers/vms/vms.model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ export class Vms {
3636

3737
@Field(() => [VmDomain], { nullable: true })
3838
domains?: VmDomain[];
39+
40+
@Field(() => [VmDomain], { nullable: true })
41+
domain?: VmDomain[];
3942
}

api/src/unraid-api/graph/resolvers/vms/vms.resolver.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,15 @@ export class VmsResolver {
3232
);
3333
}
3434
}
35+
36+
@ResolveField(() => [VmDomain])
37+
public async domain(): Promise<Array<VmDomain>> {
38+
try {
39+
return await this.vmsService.getDomains();
40+
} catch (error) {
41+
throw new Error(
42+
`Failed to retrieve VM domains: ${error instanceof Error ? error.message : 'Unknown error'}`
43+
);
44+
}
45+
}
3546
}

0 commit comments

Comments
 (0)