Skip to content

Full Toolkit for Next-Level Domain Analysis

Display record TTL as human-readable string 👀

Felix Wotschofskye10dd9d4e684
diff --git a/app/lookup/[domain]/(dns)/_components/record-row.tsx b/app/lookup/[domain]/(dns)/_components/record-row.tsx
index 79374d5..3859d33 100644
--- a/app/lookup/[domain]/(dns)/_components/record-row.tsx
+++ b/app/lookup/[domain]/(dns)/_components/record-row.tsx
@@ -1,3 +1,4 @@
+import ms from 'ms';
import type { FC, ReactNode } from 'react';
import reactStringReplace from 'react-string-replace';
@@ -60,7 +61,12 @@ export const RecordRow: FC<RecordRowProps> = ({
return (
<TableRow className="whitespace-nowrap hover:bg-transparent">
<TableCell className="w-0 min-w-[20%] pl-0 pr-12">{name}</TableCell>
- <TableCell className="w-32 pr-12">{TTL}</TableCell>
+ <TableCell className="w-32 py-1 pr-12">
+ {TTL}
+ <RecordSubvalues
+ subvalues={[{ description: ms(TTL * 1000, { long: true }) }]}
+ />
+ </TableCell>
<TableCell
className={cn(
'whitespace-normal break-words pr-0',
diff --git a/package.json b/package.json
index d6a057e..2c21f82 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
"leaflet": "^1.9.4",
"leaflet-defaulticon-compatibility": "^0.1.2",
"lucide-react": "^0.429.0",
+ "ms": "^2.1.3",
"natural-compare-lite": "^1.4.0",
"next": "14.2.6",
"next-plausible": "^3.12.2",
@@ -72,6 +73,7 @@
"@types/dns-packet": "^5.6.5",
"@types/hyperscript": "^0.0.7",
"@types/leaflet": "^1.9.12",
+ "@types/ms": "^0.7.34",
"@types/natural-compare-lite": "^1.4.2",
"@types/node": "^22.5.0",
"@types/react": "18.3.4",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index bb28385..dd4f1a4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -86,6 +86,9 @@ importers:
lucide-react:
specifier: ^0.429.0
version: 0.429.0([email protected])
+ ms:
+ specifier: ^2.1.3
+ version: 2.1.3
natural-compare-lite:
specifier: ^1.4.0
version: 1.4.0
@@ -174,6 +177,9 @@ importers:
'@types/leaflet':
specifier: ^1.9.12
version: 1.9.12
+ '@types/ms':
+ specifier: ^0.7.34
+ version: 0.7.34
'@types/natural-compare-lite':
specifier: ^1.4.2
version: 1.4.2
@@ -1774,6 +1780,9 @@ packages:
resolution: {integrity: sha512-BK7XS+NyRI291HIo0HCfE18Lp8oA30H1gpi1tf0mF3TgiCEzanQjOqNZ4x126SXzzi2oNSZhZ5axJp1k0iM6jg==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==}
+
resolution: {integrity: sha512-kk1ie31cI6AUm17qOi72lEOBfpRhcknJPsJQoKBulaZC9y00MHUWqxGTk/luWEnenLB+lHoNThrKAKdYVydlew==}
@@ -5787,6 +5796,8 @@ snapshots:
dependencies:
'@types/geojson': 7946.0.14
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}