mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add status column in tracking table
This commit is contained in:
@@ -10,7 +10,11 @@ import {eppStatusCodeToColor} from '../../../utils/functions/eppStatusCodeToColo
|
||||
import {Link} from 'react-router-dom'
|
||||
import {
|
||||
BankOutlined,
|
||||
CheckOutlined,
|
||||
DeleteOutlined,
|
||||
ExceptionOutlined,
|
||||
ExclamationCircleOutlined,
|
||||
FieldTimeOutlined,
|
||||
KeyOutlined,
|
||||
MonitorOutlined,
|
||||
SafetyCertificateOutlined
|
||||
@@ -40,6 +44,7 @@ export function TrackedDomainTable() {
|
||||
ldhName: ReactElement
|
||||
expirationDate: string
|
||||
status: ReactElement[]
|
||||
state: ReactElement
|
||||
updatedAt: string
|
||||
rawDomain: Domain
|
||||
}
|
||||
@@ -57,6 +62,7 @@ export function TrackedDomainTable() {
|
||||
const notices: ReactElement[] = []
|
||||
setDataTable(data['hydra:member'].map((d: Domain) => {
|
||||
const expirationDate = d.events.find(e => e.action === 'expiration' && !e.deleted)?.date
|
||||
const expiresInDays = d.expiresInDays ? -d.expiresInDays : undefined
|
||||
|
||||
if (d.status.includes('redemption period')) {
|
||||
if (!notices.includes(REDEMPTION_NOTICE)) notices.push(REDEMPTION_NOTICE)
|
||||
@@ -97,11 +103,45 @@ export function TrackedDomainTable() {
|
||||
icon={<KeyOutlined/>}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Flex>,
|
||||
state: <Flex wrap justify='center' align='center' gap='4px 0'>
|
||||
{
|
||||
d.expiresInDays && <Tooltip title={t`Estimated number of days until release`}>
|
||||
d.status.includes('auto renew period') ?
|
||||
<Tooltip title={t`Auto-Renew Grace Period`}>
|
||||
<Tag
|
||||
bordered={false}
|
||||
color='palevioletred'
|
||||
icon={<FieldTimeOutlined/>}
|
||||
/>
|
||||
</Tooltip> :
|
||||
d.status.includes('redemption period') ?
|
||||
<Tooltip title={t`Redemption Grace Period`}>
|
||||
<Tag
|
||||
bordered={false}
|
||||
color='magenta'
|
||||
icon={<ExclamationCircleOutlined/>}
|
||||
/>
|
||||
</Tooltip> :
|
||||
!d.status.includes('redemption period') && d.status.includes('pending delete') ?
|
||||
<Tooltip title={t`Pending Delete`}>
|
||||
<Tag
|
||||
bordered={false}
|
||||
color='orangered'
|
||||
icon={<DeleteOutlined/>}
|
||||
/>
|
||||
</Tooltip> : <Tooltip title={t`Active`}>
|
||||
<Tag
|
||||
bordered={false}
|
||||
color='green'
|
||||
icon={<CheckOutlined/>}
|
||||
/>
|
||||
</Tooltip>
|
||||
}
|
||||
{
|
||||
d.expiresInDays && <Tooltip title={t`Estimated number of days until WHOIS removal`}>
|
||||
<Tag bordered={false}
|
||||
color={d.expiresInDays <= 5 ? 'red' : d.expiresInDays <= 35 ? 'orange' : 'default'}>
|
||||
{t`J ${d.expiresInDays}`}
|
||||
{t`J ${expiresInDays}`}
|
||||
</Tag>
|
||||
</Tooltip>
|
||||
}
|
||||
@@ -124,13 +164,20 @@ export function TrackedDomainTable() {
|
||||
{
|
||||
title: t`Domain`,
|
||||
dataIndex: 'ldhName',
|
||||
width: '25%',
|
||||
width: '20%',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
title: t`Status`,
|
||||
dataIndex: 'state',
|
||||
width: '10%',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: t`Options`,
|
||||
dataIndex: 'options',
|
||||
width: '15%',
|
||||
width: '10%',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t`Expiration date`,
|
||||
@@ -142,7 +189,8 @@ export function TrackedDomainTable() {
|
||||
if (expirationDate1 === undefined || expirationDate2 === undefined) return 0
|
||||
return new Date(expirationDate1).getTime() - new Date(expirationDate2).getTime()
|
||||
},
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
align: 'center'
|
||||
},
|
||||
|
||||
{
|
||||
@@ -150,10 +198,11 @@ export function TrackedDomainTable() {
|
||||
dataIndex: 'updatedAt',
|
||||
responsive: ['md'],
|
||||
sorter: (a: RecordType, b: RecordType) => new Date(a.rawDomain.updatedAt).getTime() - new Date(b.rawDomain.updatedAt).getTime(),
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: t`Status`,
|
||||
title: t`EPP Status Codes`,
|
||||
dataIndex: 'status',
|
||||
responsive: ['md'],
|
||||
showSorterTooltip: {target: 'full-header'},
|
||||
|
||||
@@ -122,7 +122,7 @@ class Domain
|
||||
private ?bool $delegationSigned = null;
|
||||
|
||||
#[Groups(['domain:item', 'domain:list'])]
|
||||
private ?int $expiresInDays = null;
|
||||
protected ?int $expiresInDays = null;
|
||||
|
||||
private const IMPORTANT_EVENTS = [EventAction::Deletion->value, EventAction::Expiration->value];
|
||||
private const IMPORTANT_STATUS = [
|
||||
@@ -138,8 +138,6 @@ class Domain
|
||||
'server hold',
|
||||
];
|
||||
|
||||
private const DAY = 24 * 60 * 60;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->events = new ArrayCollection();
|
||||
@@ -463,6 +461,7 @@ class Domain
|
||||
private static function daysBetween(\DateTimeImmutable $start, \DateTimeImmutable $end): int
|
||||
{
|
||||
$interval = $start->diff($end);
|
||||
|
||||
return $interval->invert ? -$interval->days : $interval->days;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,18 +86,22 @@ msgid "Registration"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainLifecycleSteps.tsx:24
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:132
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainLifecycleSteps.tsx:29
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:110
|
||||
msgid "Auto-Renew Grace Period"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainLifecycleSteps.tsx:35
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:118
|
||||
msgid "Redemption Grace Period"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainLifecycleSteps.tsx:40
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:126
|
||||
msgid "Pending Delete"
|
||||
msgstr ""
|
||||
|
||||
@@ -109,7 +113,7 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainResult.tsx:64
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:82
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:88
|
||||
msgid "Registry Lock"
|
||||
msgstr ""
|
||||
|
||||
@@ -120,7 +124,7 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainResult.tsx:75
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:88
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:94
|
||||
msgid "Registrar Lock"
|
||||
msgstr ""
|
||||
|
||||
@@ -131,11 +135,12 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainResult.tsx:84
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:94
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:100
|
||||
msgid "DNSSEC"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainResult.tsx:90
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:205
|
||||
msgid "EPP Status Codes"
|
||||
msgstr ""
|
||||
|
||||
@@ -161,7 +166,7 @@ msgid "Search"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/Sider.tsx:41
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:125
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:165
|
||||
msgid "Domain"
|
||||
msgstr ""
|
||||
|
||||
@@ -413,58 +418,58 @@ msgstr ""
|
||||
msgid ".${ tld.tld } Registry"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:24
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:28
|
||||
msgid ""
|
||||
"At least one domain name is in redemption period and will potentially be "
|
||||
"deleted soon"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:32
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:36
|
||||
msgid ""
|
||||
"At least one domain name is pending deletion and will soon become available "
|
||||
"for registration again"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:101
|
||||
msgid "Estimated number of days until release"
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:141
|
||||
msgid "Estimated number of days until WHOIS removal"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:104
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:144
|
||||
#, javascript-format
|
||||
msgid "J ${ d.expiresInDays }"
|
||||
msgid "J ${ expiresInDays }"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:131
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:136
|
||||
msgid "Expiration date"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:149
|
||||
msgid "Updated at"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:156
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:171
|
||||
msgid "Status"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:176
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:177
|
||||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:183
|
||||
msgid "Expiration date"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:197
|
||||
msgid "Updated at"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:225
|
||||
msgid "No tracked domain names were found, please create your first Watchlist"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:185
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:234
|
||||
msgid ""
|
||||
"Please note that this table does not include domain names marked as expired "
|
||||
"or those with an unknown expiration date"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:190
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:239
|
||||
msgid "At least one domain name you are tracking requires special attention"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:196
|
||||
#: assets/components/tracking/watchlist/TrackedDomainTable.tsx:245
|
||||
msgid "The domain names below are subject to special monitoring"
|
||||
msgstr ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user