feat: add tracked domains table

This commit is contained in:
Maël Gangloff
2024-09-09 11:31:33 +02:00
parent 124168380a
commit 0e96404302
12 changed files with 201 additions and 39 deletions

View File

@@ -59,6 +59,7 @@ export interface Domain {
nameservers: Nameserver[]
tld: Tld
deleted: boolean
updatedAt: string
}
export interface User {

View File

@@ -1,4 +1,4 @@
import {request, Watchlist, WatchlistRequest} from "./index";
import {Domain, request, Watchlist, WatchlistRequest} from "./index";
export async function getWatchlists() {
const response = await request({
@@ -40,4 +40,14 @@ export async function putWatchlist(watchlist: Partial<WatchlistRequest> & { toke
data: watchlist,
})
return response.data
}
}
export async function getTrackedDomainList(params: { page: number, itemsPerPage: number }): Promise<any> {
const response = await request({
method: 'GET',
url: 'tracked',
params
})
return response.data
}

View File

@@ -1,5 +1,5 @@
export const eppStatusCodeToColor = (s: string) =>
['active', 'ok'].includes(s) ? 'green' :
s.startsWith('client') ? 'purple' :
s.startsWith('server') ? 'geekblue' :
s.includes('prohibited') ? 'red' : 'blue'
['pending delete', 'redemption period'].includes(s) ? 'red' :
s.startsWith('client') ? 'purple' :
s.startsWith('server') ? 'geekblue' : 'blue'