Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ipv6 to filters in Node Finder #2738

Merged
merged 11 commits into from
Jun 9, 2024
1 change: 1 addition & 0 deletions packages/grid_client/src/modules/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ class FilterOptions {
@Expose() @IsOptional() @Min(0) sru?: number; // GB
@Expose() @IsOptional() @Min(0) hru?: number; // GB
@Expose() @IsOptional() @IsBoolean() publicIPs?: boolean;
@Expose() @IsOptional() @IsBoolean() hasIPv6?: boolean;
@Expose() @IsOptional() @IsBoolean() accessNodeV4?: boolean;
@Expose() @IsOptional() @IsBoolean() accessNodeV6?: boolean;
@Expose() @IsOptional() @IsBoolean() gateway?: boolean;
Expand Down
1 change: 1 addition & 0 deletions packages/grid_client/src/primitives/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ class Nodes {
free_ips: options.publicIPs ? 1 : "",
ipv4: options.accessNodeV4,
ipv6: options.accessNodeV6,
has_ipv6: options.hasIPv6,
certification_type: options.certified ? "Certified" : "",
farm_ids: options.farmId ? [options.farmId] : options.farmIds,
farm_name: options.farmName,
Expand Down
3 changes: 3 additions & 0 deletions packages/gridproxy_client/src/builders/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface NodesQuery {
sortBy: SortBy;
sortOrder: SortOrder;
numGpu: number;
hasIPv6: boolean;
}

const NODES_MAPPER: BuilderMapper<NodesQuery> = {
Expand Down Expand Up @@ -117,6 +118,7 @@ const NODES_MAPPER: BuilderMapper<NodesQuery> = {
sortBy: "sort_by",
sortOrder: "sort_order",
numGpu: "num_gpu",
hasIPv6: "has_ipv6",
};

const NODES_VALIDATOR: BuilderValidator<NodesQuery> = {
Expand Down Expand Up @@ -174,6 +176,7 @@ const NODES_VALIDATOR: BuilderValidator<NodesQuery> = {
sortBy: assertString,
sortOrder: assertString,
numGpu: assertInt,
hasIPv6: assertBoolean,
};

export class NodesBuilder extends AbstractBuilder<NodesQuery> {
Expand Down
1 change: 1 addition & 0 deletions packages/playground/src/utils/nodeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export function normalizeNodeFilters(
(filters.solutionDisk ?? 0) + (filters.rootFilesystemSize ?? 0),
) || undefined,
publicIPs: filters.ipv4 || undefined,
hasIPv6: filters.ipv6 || undefined,
hasGPU: filters.hasGPU || undefined,
rentedBy: filters.dedicated ? options.twinId : undefined,
certified: filters.certified || undefined,
Expand Down
6 changes: 6 additions & 0 deletions packages/playground/src/views/nodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
/>
</TfFilter>

<TfFilter query-route="ipv6" v-model="filters.ipv6">
<v-switch color="primary" inset label="IPv6" v-model="filters.ipv6" density="compact" hide-details />
</TfFilter>

<TfFilter class="mt-4" query-route="node-status" v-model="filters.status">
<v-select
:model-value="filters.status || undefined"
Expand Down Expand Up @@ -509,6 +513,7 @@ export default {
dedicated: false,
numGpu: "",
rentable: false,
ipv6: false,
});

const loading = ref<boolean>(true);
Expand Down Expand Up @@ -556,6 +561,7 @@ export default {
numGpu: +filters.value.numGpu || undefined,
rentable: filters.value.rentable && profileManager.profile ? filters.value.rentable : undefined,
availableFor: filters.value.rentable && profileManager.profile ? profileManager.profile.twinId : undefined,
hasIPv6: filters.value.ipv6,
},
{ loadFarm: true },
);
Expand Down
Loading