Skip to content

Commit

Permalink
fix: continue internet feature changes
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Feb 5, 2025
1 parent 6d0aef2 commit e697d3f
Show file tree
Hide file tree
Showing 28 changed files with 536 additions and 770 deletions.
40 changes: 35 additions & 5 deletions app/components/internet/pages/NicRegistrar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<{
Expand All @@ -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<typeof schema>;
const state = reactive<Schema>({
tldID: 1,
search: '',
});
const { data: tlds } = useLazyAsyncData('internet-tlds', () => listTLDs());
async function listTLDs(): Promise<TLD[]> {
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<CheckDomainAvailabilityResponse> {
try {
const call = getGRPCInternetDomainsClient().checkDomainAvailability({
tldId: 1, // TODO
name: values.search,
});
const { response } = await call;
Expand Down Expand Up @@ -73,11 +91,23 @@ const onSubmitThrottle = useThrottleFn(async (event: FormSubmitEvent<Schema>) =>
<template #links>
<UForm :schema="schema" :state="state" class="inline-flex gap-1" @submit="onSubmitThrottle">
<UFormGroup name="search">
<UInput v-model="state.search" type="text" class="w-full" size="xl" :placeholder="$t('common.domain')">
<template #trailing>
<span class="text-base text-gray-500 dark:text-gray-400">.ls</span>
</template>
</UInput>
<UInput
v-model="state.search"
type="text"
class="w-full"
size="xl"
:placeholder="$t('common.domain')"
/>
</UFormGroup>

<UFormGroup name="tldId">
<USelectMenu
v-model="state.tldID"
:options="tlds"
value-attribute="id"
option-attribute="name"
size="xl"
/>
</UFormGroup>

<UButton
Expand Down
75 changes: 56 additions & 19 deletions gen/go/proto/resources/internet/domain.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions gen/go/proto/resources/internet/domain.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e697d3f

Please sign in to comment.