mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add stats page
This commit is contained in:
@@ -88,6 +88,16 @@ export interface InstanceConfig {
|
||||
registerEnabled: boolean
|
||||
}
|
||||
|
||||
export interface Statistics {
|
||||
rdapQueries: number
|
||||
alertSent: number
|
||||
domainPurchased: number
|
||||
domainPurchaseFailed: number
|
||||
domainCount: {tld: string, domain: number}[]
|
||||
domainCountTotal: number
|
||||
domainTracked: number
|
||||
}
|
||||
|
||||
export async function request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig): Promise<R> {
|
||||
const axiosConfig: AxiosRequestConfig = {
|
||||
...config,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {InstanceConfig, request, User} from "./index";
|
||||
import {InstanceConfig, request, Statistics, User} from "./index";
|
||||
|
||||
|
||||
export async function login(email: string, password: string): Promise<boolean> {
|
||||
@@ -32,4 +32,11 @@ export async function getConfiguration(): Promise<InstanceConfig> {
|
||||
url: 'config'
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function getStatistics(): Promise<Statistics> {
|
||||
const response = await request<Statistics>({
|
||||
url: 'stats'
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
Reference in New Issue
Block a user