mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: ttag translation
This commit is contained in:
@@ -41,37 +41,36 @@ type FieldType = {
|
||||
}
|
||||
|
||||
|
||||
const domainRole = {
|
||||
registrant: () => t`Registrant`,
|
||||
technical: () => t`Technical`,
|
||||
administrative: () => t`Administrative`,
|
||||
abuse: () => t`Abuse`,
|
||||
billing: () => t`Billing`,
|
||||
registrar: () => t`Registrar`,
|
||||
reseller: () => t`Reseller`,
|
||||
sponsor: () => t`Sponsor`,
|
||||
proxy: () => t`Proxy`,
|
||||
notifications: () => t`Notifications`,
|
||||
noc: () => t`Noc`
|
||||
}
|
||||
|
||||
const domainEvent = {
|
||||
registration: () => t`Registration`,
|
||||
reregistration: () => t`Reregistration`,
|
||||
'last changed': () => t`Last changed`,
|
||||
expiration: () => t`Expiration`,
|
||||
deletion: () => t`Deletion`,
|
||||
reinstantiation: () => t`Reinstantiation`,
|
||||
transfer: () => t`Transfer`,
|
||||
locked: () => t`Locked`,
|
||||
unlocked: () => t`Unlocked`,
|
||||
'registrar expiration': () => t`Registrar expiration`,
|
||||
'enum validation expiration': () => t`ENUM validation expiration`
|
||||
}
|
||||
|
||||
const locale = navigator.language.split('-')[0]
|
||||
|
||||
export default function DomainSearchPage() {
|
||||
const domainRole = {
|
||||
registrant: t`Registrant`,
|
||||
technical: t`Technical`,
|
||||
administrative: t`Administrative`,
|
||||
abuse: t`Abuse`,
|
||||
billing: t`Billing`,
|
||||
registrar: t`Registrar`,
|
||||
reseller: t`Reseller`,
|
||||
sponsor: t`Sponsor`,
|
||||
proxy: t`Proxy`,
|
||||
notifications: t`Notifications`,
|
||||
noc: t`Noc`
|
||||
}
|
||||
|
||||
const domainEvent = {
|
||||
registration: t`Registration`,
|
||||
reregistration: t`Reregistration`,
|
||||
'last changed': t`Last changed`,
|
||||
expiration: t`Expiration`,
|
||||
deletion: t`Deletion`,
|
||||
reinstantiation: t`Reinstantiation`,
|
||||
transfer: t`Transfer`,
|
||||
locked: t`Locked`,
|
||||
unlocked: t`Unlocked`,
|
||||
'registrar expiration': t`Registrar expiration`,
|
||||
'enum validation expiration': t`ENUM validation expiration`
|
||||
}
|
||||
|
||||
const [domain, setDomain] = useState<Domain | null>()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
@@ -170,7 +169,7 @@ export default function DomainSearchPage() {
|
||||
|
||||
return {
|
||||
label: new Date(date).toLocaleString(locale),
|
||||
children: Object.keys(domainEvent).includes(action) ? domainEvent[action as keyof typeof domainEvent]() : action,
|
||||
children: Object.keys(domainEvent).includes(action) ? domainEvent[action as keyof typeof domainEvent] : action,
|
||||
color,
|
||||
dot,
|
||||
pending: new Date(date).getTime() > new Date().getTime()
|
||||
@@ -209,7 +208,7 @@ export default function DomainSearchPage() {
|
||||
title={e.entity.handle}
|
||||
description={name}
|
||||
/>
|
||||
<div>{e.roles.map((r) => Object.keys(domainRole).includes(r) ? domainRole[r as keyof typeof domainRole]() : r).join(', ')}</div>
|
||||
<div>{e.roles.map((r) => Object.keys(domainRole).includes(r) ? domainRole[r as keyof typeof domainRole] : r).join(', ')}</div>
|
||||
</List.Item>
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -25,55 +25,57 @@ const formItemLayoutWithOutLabel = {
|
||||
},
|
||||
};
|
||||
|
||||
const triggerEventItems: { label: string, value: EventAction }[] = [
|
||||
{
|
||||
label: t`When a domain is expired`,
|
||||
value: 'expiration'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is deleted`,
|
||||
value: 'deletion'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is updated`,
|
||||
value: 'last changed'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is transferred`,
|
||||
value: 'transfer'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is locked`,
|
||||
value: 'locked'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is unlocked`,
|
||||
value: 'unlocked'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is reregistered`,
|
||||
value: 'reregistration'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is reinstantiated`,
|
||||
value: 'reinstantiation'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is registered`,
|
||||
value: 'registration'
|
||||
}
|
||||
]
|
||||
|
||||
const trigerActionItems = [
|
||||
{
|
||||
label: t`Send me an email`,
|
||||
value: 'email'
|
||||
}
|
||||
]
|
||||
|
||||
type Watchlist = { token: string, domains: { ldhName: string }[], triggers?: { event: EventAction, action: string }[] }
|
||||
|
||||
export default function WatchlistPage() {
|
||||
|
||||
const triggerEventItems: { label: string, value: EventAction }[] = [
|
||||
{
|
||||
label: t`When a domain is expired`,
|
||||
value: 'expiration'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is deleted`,
|
||||
value: 'deletion'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is updated`,
|
||||
value: 'last changed'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is transferred`,
|
||||
value: 'transfer'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is locked`,
|
||||
value: 'locked'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is unlocked`,
|
||||
value: 'unlocked'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is reregistered`,
|
||||
value: 'reregistration'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is reinstantiated`,
|
||||
value: 'reinstantiation'
|
||||
},
|
||||
{
|
||||
label: t`When a domain is registered`,
|
||||
value: 'registration'
|
||||
}
|
||||
]
|
||||
|
||||
const trigerActionItems = [
|
||||
{
|
||||
label: t`Send me an email`,
|
||||
value: 'email'
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
const [form] = Form.useForm()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [watchlists, setWatchlists] = useState<Watchlist[] | null>()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, {useEffect, useState} from "react";
|
||||
import {Card, Flex, Skeleton, Typography} from "antd";
|
||||
import {getUser, User} from "../../utils/api";
|
||||
import {t} from 'ttag'
|
||||
|
||||
export default function UserPage() {
|
||||
|
||||
@@ -12,12 +13,12 @@ export default function UserPage() {
|
||||
|
||||
return <Skeleton loading={user === null} active>
|
||||
<Flex gap="middle" align="center" justify="center" vertical>
|
||||
<Card title="My Account">
|
||||
<Card title={t`My Account`}>
|
||||
<Typography.Paragraph>
|
||||
Username : {user?.email}
|
||||
{t`Username`} : {user?.email}
|
||||
</Typography.Paragraph>
|
||||
<Typography.Paragraph>
|
||||
Roles : {user?.roles.join(',')}
|
||||
{t`Roles`} : {user?.roles.join(',')}
|
||||
</Typography.Paragraph>
|
||||
</Card>
|
||||
</Flex>
|
||||
|
||||
Reference in New Issue
Block a user