From e697d3f2d9f3b261186903103485df5bac4745b1 Mon Sep 17 00:00:00 2001 From: Alexander Trost Date: Wed, 5 Feb 2025 21:47:22 +0100 Subject: [PATCH] fix: continue internet feature changes Signed-off-by: Alexander Trost --- .../internet/pages/NicRegistrar.vue | 40 ++- gen/go/proto/resources/internet/domain.pb.go | 75 +++- .../resources/internet/domain.pb.validate.go | 37 ++ gen/go/proto/services/internet/domain.pb.go | 339 +++++++----------- .../services/internet/domain.pb.sanitizer.go | 16 - .../services/internet/domain.pb.validate.go | 245 ++----------- .../proto/services/internet/domain_grpc.pb.go | 40 --- .../proto/services/internet/service_perms.go | 1 - gen/grpc-api.md | 35 +- gen/ts/resources/internet/domain.ts | 53 ++- gen/ts/services/internet/domain.client.ts | 17 - gen/ts/services/internet/domain.ts | 150 +++----- gen/ts/svcs.ts | 1 - go.mod | 4 +- go.sum | 12 +- go.work.sum | 6 +- proto/resources/internet/access.proto | 10 +- proto/resources/internet/domain.proto | 10 +- proto/services/internet/domain.proto | 40 +-- .../fivenet/model/fivenet_internet_domains.go | 25 +- query/fivenet/model/fivenet_jobs_timeclock.go | 6 +- .../fivenet/table/fivenet_internet_domains.go | 79 ++-- query/fivenet/table/fivenet_jobs_timeclock.go | 2 +- .../1734531087_internet_base.up.sql | 4 +- services/internet/domain.go | 30 +- services/internet/domain_utils.go | 24 +- services/internet/page_utilts.go | 1 + services/internet/tlds.go | 4 +- 28 files changed, 536 insertions(+), 770 deletions(-) diff --git a/app/components/internet/pages/NicRegistrar.vue b/app/components/internet/pages/NicRegistrar.vue index ade0be7f5..71c9bec3a 100644 --- a/app/components/internet/pages/NicRegistrar.vue +++ b/app/components/internet/pages/NicRegistrar.vue @@ -2,6 +2,7 @@ import type { FormSubmitEvent } from '#ui/types'; import { z } from 'zod'; import type { Tab } from '~/store/internet'; +import type { TLD } from '~~/gen/ts/resources/internet/domain'; import type { CheckDomainAvailabilityResponse } from '~~/gen/ts/services/internet/domain'; const props = defineProps<{ @@ -27,18 +28,35 @@ function updateTabInfo(): void { updateTabInfo(); const schema = z.object({ + tldID: z.number().positive().min(1), search: z.string().max(40), }); type Schema = z.output; const state = reactive({ + tldID: 1, search: '', }); +const { data: tlds } = useLazyAsyncData('internet-tlds', () => listTLDs()); + +async function listTLDs(): Promise { + try { + const call = getGRPCInternetDomainsClient().listTLDs({}); + const { response } = await call; + + return response.tlds; + } catch (e) { + handleGRPCError(e as RpcError); + throw e; + } +} + async function checkDomainAvailability(values: Schema): Promise { try { const call = getGRPCInternetDomainsClient().checkDomainAvailability({ + tldId: 1, // TODO name: values.search, }); const { response } = await call; @@ -73,11 +91,23 @@ const onSubmitThrottle = useThrottleFn(async (event: FormSubmitEvent) =>