mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add link on domain name tags
This commit is contained in:
21
assets/components/tracking/DomainToTag.tsx
Normal file
21
assets/components/tracking/DomainToTag.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import {Tag} from "antd";
|
||||
import {DeleteOutlined, ExclamationCircleOutlined} from "@ant-design/icons";
|
||||
import punycode from "punycode/punycode";
|
||||
import {Link} from "react-router-dom";
|
||||
import React from "react";
|
||||
|
||||
export function DomainToTag({domain}: { domain: { ldhName: string, deleted: boolean, status: string[] } }) {
|
||||
return <Link to={'/search/domain/' + domain.ldhName}>
|
||||
<Tag
|
||||
color={
|
||||
domain.deleted ? 'magenta' :
|
||||
domain.status.includes('redemption period') ? 'yellow' :
|
||||
domain.status.includes('pending delete') ? 'volcano' : 'default'
|
||||
}
|
||||
icon={
|
||||
domain.deleted ? <DeleteOutlined/> :
|
||||
domain.status.includes('redemption period') ? <ExclamationCircleOutlined/> :
|
||||
domain.status.includes('pending delete') ? <DeleteOutlined/> : null
|
||||
}>{punycode.toUnicode(domain.ldhName)}</Tag>
|
||||
</Link>
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import {rdapStatusCodeDetailTranslation} from "../../../utils/functions/rdapTran
|
||||
import {eppStatusCodeToColor} from "../../../utils/functions/eppStatusCodeToColor";
|
||||
import {Link} from "react-router-dom";
|
||||
import {ExceptionOutlined, MonitorOutlined} from '@ant-design/icons'
|
||||
import {DomainToTag} from "../DomainToTag";
|
||||
|
||||
|
||||
export function TrackedDomainTable() {
|
||||
@@ -42,7 +43,7 @@ export function TrackedDomainTable() {
|
||||
|
||||
return {
|
||||
key: d.ldhName,
|
||||
ldhName: d.ldhName,
|
||||
ldhName: <DomainToTag domain={d}/>,
|
||||
expirationDate: expirationDate ? new Date(expirationDate).toLocaleString() : '-',
|
||||
status: d.status.map(s => <Tooltip
|
||||
placement='bottomLeft'
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import {Card, Divider, Space, Table, Tag, Tooltip} from "antd";
|
||||
import {DeleteOutlined, DisconnectOutlined, ExclamationCircleOutlined, LinkOutlined} from "@ant-design/icons";
|
||||
import {DisconnectOutlined, LinkOutlined} from "@ant-design/icons";
|
||||
import {t} from "ttag";
|
||||
import {ViewDiagramWatchlistButton} from "./diagram/ViewDiagramWatchlistButton";
|
||||
import {UpdateWatchlistButton} from "./UpdateWatchlistButton";
|
||||
import {DeleteWatchlistButton} from "./DeleteWatchlistButton";
|
||||
import punycode from "punycode/punycode";
|
||||
import React from "react";
|
||||
import {Watchlist} from "../../../pages/tracking/WatchlistPage";
|
||||
import {Connector} from "../../../utils/api/connectors";
|
||||
@@ -13,6 +12,7 @@ import {CalendarWatchlistButton} from "./CalendarWatchlistButton";
|
||||
import {rdapEventDetailTranslation, rdapEventNameTranslation} from "../../../utils/functions/rdapTranslation";
|
||||
|
||||
import {actionToColor} from "../../../utils/functions/actionToColor";
|
||||
import {DomainToTag} from "../DomainToTag";
|
||||
|
||||
export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelete}: {
|
||||
watchlist: Watchlist,
|
||||
@@ -78,17 +78,7 @@ export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelet
|
||||
pagination={false}
|
||||
style={{width: '100%'}}
|
||||
dataSource={[{
|
||||
domains: watchlist.domains.map(d => <Tag
|
||||
color={
|
||||
d.deleted ? 'magenta' :
|
||||
d.status.includes('redemption period') ? 'yellow' :
|
||||
d.status.includes('pending delete') ? 'volcano' : 'default'
|
||||
}
|
||||
icon={
|
||||
d.deleted ? <DeleteOutlined/> :
|
||||
d.status.includes('redemption period') ? <ExclamationCircleOutlined/> :
|
||||
d.status.includes('pending delete') ? <DeleteOutlined/> : null
|
||||
}>{punycode.toUnicode(d.ldhName)}</Tag>),
|
||||
domains: watchlist.domains.map(d => <DomainToTag domain={d}/>),
|
||||
events: watchlist.triggers?.filter(t => t.action === 'email')
|
||||
.map(t => <Tooltip
|
||||
title={t.event in rdapEventDetailTranslated ? rdapEventDetailTranslated[t.event as keyof typeof rdapEventDetailTranslated] : undefined}>
|
||||
|
||||
Reference in New Issue
Block a user