From bc7f621396633d5cbb5236102c5fe082a3982af7 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Mon, 20 May 2024 17:37:42 +0300 Subject: [PATCH 1/7] Add ipv6 to filters in node finder --- packages/playground/src/views/nodes.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/playground/src/views/nodes.vue b/packages/playground/src/views/nodes.vue index 2f81eadfd8..9e6dd60188 100644 --- a/packages/playground/src/views/nodes.vue +++ b/packages/playground/src/views/nodes.vue @@ -38,6 +38,10 @@ /> + + + + (true); @@ -554,6 +559,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, + ipv6: filters.value.ipv6, }, { loadFarm: true }, ); From cbd6b0164ed1a2df22ad1b435c47e95ec8bce9a7 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Tue, 21 May 2024 13:14:56 +0300 Subject: [PATCH 2/7] Enable filtering by ipv6 in Node Selector --- packages/grid_client/src/modules/models.ts | 1 + packages/grid_client/src/primitives/nodes.ts | 1 + packages/playground/src/utils/nodeSelector.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/grid_client/src/modules/models.ts b/packages/grid_client/src/modules/models.ts index b3ebd6cd75..2fc315e5ef 100644 --- a/packages/grid_client/src/modules/models.ts +++ b/packages/grid_client/src/modules/models.ts @@ -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; diff --git a/packages/grid_client/src/primitives/nodes.ts b/packages/grid_client/src/primitives/nodes.ts index 38cb82f441..01bf8ca0b3 100644 --- a/packages/grid_client/src/primitives/nodes.ts +++ b/packages/grid_client/src/primitives/nodes.ts @@ -391,6 +391,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, diff --git a/packages/playground/src/utils/nodeSelector.ts b/packages/playground/src/utils/nodeSelector.ts index 6cd1b6e00c..543664fe29 100644 --- a/packages/playground/src/utils/nodeSelector.ts +++ b/packages/playground/src/utils/nodeSelector.ts @@ -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, From 471850360484c52d7834be3226db96a7cfaaad94 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Sun, 26 May 2024 16:58:08 +0300 Subject: [PATCH 3/7] Fix filter nodes by ipv6 --- packages/grid_client/src/primitives/nodes.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/grid_client/src/primitives/nodes.ts b/packages/grid_client/src/primitives/nodes.ts index 01bf8ca0b3..6b22470449 100644 --- a/packages/grid_client/src/primitives/nodes.ts +++ b/packages/grid_client/src/primitives/nodes.ts @@ -329,6 +329,9 @@ class Nodes { if (nodes.length) { nodes = nodes.filter(n => !(options.nodeExclude && options.nodeExclude?.includes(n.nodeId))); } + console.log("nodessss", nodes); + console.log("query", query); + return nodes; } async filterFarms(options: FilterOptions = {}, url = ""): Promise { @@ -390,8 +393,7 @@ class Nodes { free_hru: Math.ceil(this._g2b(options.hru)) || "", free_ips: options.publicIPs ? 1 : "", ipv4: options.accessNodeV4, - ipv6: options.accessNodeV6, - has_ipv6: options.hasIPv6, + ipv6: options.hasIPv6, certification_type: options.certified ? "Certified" : "", farm_ids: options.farmId ? [options.farmId] : options.farmIds, farm_name: options.farmName, From 53b6f3232dab88f2546cbe789b162b59bfdce2a1 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Sun, 26 May 2024 17:00:25 +0300 Subject: [PATCH 4/7] Remove logs --- packages/grid_client/src/primitives/nodes.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/grid_client/src/primitives/nodes.ts b/packages/grid_client/src/primitives/nodes.ts index 6b22470449..d1b60b164d 100644 --- a/packages/grid_client/src/primitives/nodes.ts +++ b/packages/grid_client/src/primitives/nodes.ts @@ -329,9 +329,6 @@ class Nodes { if (nodes.length) { nodes = nodes.filter(n => !(options.nodeExclude && options.nodeExclude?.includes(n.nodeId))); } - console.log("nodessss", nodes); - console.log("query", query); - return nodes; } async filterFarms(options: FilterOptions = {}, url = ""): Promise { From d4e40b9c3ac06f3b1e046d733adc88fa226c3145 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Mon, 27 May 2024 13:13:39 +0300 Subject: [PATCH 5/7] Add hasIPv6 to grid proxy and use it in node finder, Fix ipv6 filter in grid client --- packages/grid_client/src/primitives/nodes.ts | 3 ++- packages/gridproxy_client/src/builders/nodes.ts | 3 +++ packages/playground/src/views/nodes.vue | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/grid_client/src/primitives/nodes.ts b/packages/grid_client/src/primitives/nodes.ts index d1b60b164d..01bf8ca0b3 100644 --- a/packages/grid_client/src/primitives/nodes.ts +++ b/packages/grid_client/src/primitives/nodes.ts @@ -390,7 +390,8 @@ class Nodes { free_hru: Math.ceil(this._g2b(options.hru)) || "", free_ips: options.publicIPs ? 1 : "", ipv4: options.accessNodeV4, - ipv6: options.hasIPv6, + ipv6: options.accessNodeV6, + has_ipv6: options.hasIPv6, certification_type: options.certified ? "Certified" : "", farm_ids: options.farmId ? [options.farmId] : options.farmIds, farm_name: options.farmName, diff --git a/packages/gridproxy_client/src/builders/nodes.ts b/packages/gridproxy_client/src/builders/nodes.ts index 35776811c7..598a789e9a 100644 --- a/packages/gridproxy_client/src/builders/nodes.ts +++ b/packages/gridproxy_client/src/builders/nodes.ts @@ -74,6 +74,7 @@ export interface NodesQuery { sortBy: SortBy; sortOrder: SortOrder; numGpu: number; + hasIPv6: boolean; } const NODES_MAPPER: BuilderMapper = { @@ -117,6 +118,7 @@ const NODES_MAPPER: BuilderMapper = { sortBy: "sort_by", sortOrder: "sort_order", numGpu: "num_gpu", + hasIPv6: "has_ipv6", }; const NODES_VALIDATOR: BuilderValidator = { @@ -169,6 +171,7 @@ const NODES_VALIDATOR: BuilderValidator = { sortBy: assertString, sortOrder: assertString, numGpu: assertInt, + hasIPv6: assertBoolean, }; export class NodesBuilder extends AbstractBuilder { diff --git a/packages/playground/src/views/nodes.vue b/packages/playground/src/views/nodes.vue index 9e6dd60188..7aff254c38 100644 --- a/packages/playground/src/views/nodes.vue +++ b/packages/playground/src/views/nodes.vue @@ -559,7 +559,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, - ipv6: filters.value.ipv6, + hasIPv6: filters.value.ipv6, }, { loadFarm: true }, ); From e2250afac436044be51fd2fa279da6a5477926cf Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Sun, 9 Jun 2024 10:52:06 +0300 Subject: [PATCH 6/7] Merge global.scss --- packages/playground/src/global.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/playground/src/global.scss b/packages/playground/src/global.scss index 88970c4526..ccefb08160 100644 --- a/packages/playground/src/global.scss +++ b/packages/playground/src/global.scss @@ -155,9 +155,16 @@ a { } table { + --v-table-header-height: 45px; + thead { tr { th { + span { + font-weight: bold; + text-wrap: nowrap; + } + border-right: thin solid rgba(var(--v-border-color), var(--v-border-opacity)); &:not(.v-data-table__th--sorted) i { From c32e50dd745984cd6b0036fe147f90d8158553ae Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Sun, 9 Jun 2024 12:38:48 +0300 Subject: [PATCH 7/7] Update farm filters w nodeHasIPv6 in grid_ client, grid_proxy & playground --- packages/grid_client/src/modules/models.ts | 1 + packages/grid_client/src/primitives/nodes.ts | 1 + packages/gridproxy_client/src/builders/farms.ts | 3 +++ packages/playground/src/utils/nodeSelector.ts | 1 + 4 files changed, 6 insertions(+) diff --git a/packages/grid_client/src/modules/models.ts b/packages/grid_client/src/modules/models.ts index d127680bbd..061724c00c 100644 --- a/packages/grid_client/src/modules/models.ts +++ b/packages/grid_client/src/modules/models.ts @@ -630,6 +630,7 @@ class FarmFilterOptions { @Expose() @IsOptional() @Min(0) nodeSRU?: number; // GB @Expose() @IsOptional() @Min(0) nodeHRU?: number; // GB @Expose() @IsOptional() @IsBoolean() publicIp?: boolean; + @Expose() @IsOptional() @IsBoolean() nodeHasIPv6?: boolean; @Expose() @IsOptional() @IsBoolean() certificationType?: CertificationType; @Expose() @IsOptional() @IsString() farmName?: string; @Expose() @IsOptional() @IsString() country?: string; diff --git a/packages/grid_client/src/primitives/nodes.ts b/packages/grid_client/src/primitives/nodes.ts index 596d142dde..bfa9e73ede 100644 --- a/packages/grid_client/src/primitives/nodes.ts +++ b/packages/grid_client/src/primitives/nodes.ts @@ -449,6 +449,7 @@ class Nodes { country: options.country, dedicated: options.dedicated, node_available_for: options.availableFor, + node_has_ipv6: options.nodeHasIPv6, node_status: "up", page: options.page, size: options.size, diff --git a/packages/gridproxy_client/src/builders/farms.ts b/packages/gridproxy_client/src/builders/farms.ts index dc375f95dc..a39b328f63 100644 --- a/packages/gridproxy_client/src/builders/farms.ts +++ b/packages/gridproxy_client/src/builders/farms.ts @@ -22,6 +22,7 @@ export interface FarmsQuery { certificationType: CertificationType; dedicated: boolean; stellarAddress: string; + nodeHasIPv6: boolean; } const FARMS_MAPPER: BuilderMapper = { @@ -39,6 +40,7 @@ const FARMS_MAPPER: BuilderMapper = { stellarAddress: "stellar_address", totalIps: "total_ips", twinId: "twin_id", + nodeHasIPv6: "node_has_ipv6", }; const FARMS_VALIDATOR: BuilderValidator = { @@ -58,6 +60,7 @@ const FARMS_VALIDATOR: BuilderValidator = { }, dedicated: assertBoolean, stellarAddress: assertString, + nodeHasIPv6: assertBoolean, }; export class FarmsBuilder extends AbstractBuilder { diff --git a/packages/playground/src/utils/nodeSelector.ts b/packages/playground/src/utils/nodeSelector.ts index 543664fe29..580c87d962 100644 --- a/packages/playground/src/utils/nodeSelector.ts +++ b/packages/playground/src/utils/nodeSelector.ts @@ -104,6 +104,7 @@ export function normalizeFarmFilters( publicIp: filters.ipv4 || undefined, nodeCertified: filters.certified || undefined, nodeHasGPU: filters.hasGPU || undefined, + nodeHasIPv6: filters.ipv6 || undefined, }; }