fix: success rate in the stats page

This commit is contained in:
Maël Gangloff 2025-11-02 12:10:33 +01:00
parent 39f607e95d
commit ba7bd33ba1
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
2 changed files with 9 additions and 11 deletions

View File

@ -18,10 +18,8 @@ export default function StatisticsPage() {
getStatistics().then(setStats) getStatistics().then(setStats)
}, []) }, [])
const totalDomainPurchase = (stats?.domainPurchased ?? 0) + (stats?.domainPurchaseFailed ?? 0)
const successRate = stats !== undefined const successRate = stats !== undefined
? (totalDomainPurchase === 0 ? undefined : stats.domainPurchased / totalDomainPurchase) ? (stats?.domainPurchased === 0 ? undefined : ((stats?.domainPurchased ?? 0) - (stats?.domainPurchaseFailed ?? 0)) / stats?.domainPurchased)
: undefined : undefined
return ( return (

View File

@ -191,7 +191,7 @@ msgid "Infrastructure"
msgstr "" msgstr ""
#: assets/components/Sider.tsx:70 #: assets/components/Sider.tsx:70
#: assets/pages/StatisticsPage.tsx:114 #: assets/pages/StatisticsPage.tsx:112
#: assets/pages/infrastructure/TldPage.tsx:81 #: assets/pages/infrastructure/TldPage.tsx:81
msgid "TLD" msgid "TLD"
msgstr "" msgstr ""
@ -698,33 +698,33 @@ msgid ""
"WHOIS by its registrar." "WHOIS by its registrar."
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:35 #: assets/pages/StatisticsPage.tsx:33
msgid "RDAP queries" msgid "RDAP queries"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:44 #: assets/pages/StatisticsPage.tsx:42
msgid "Alerts sent" msgid "Alerts sent"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:58 #: assets/pages/StatisticsPage.tsx:56
msgid "Domain names in database" msgid "Domain names in database"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:69 #: assets/pages/StatisticsPage.tsx:67
msgid "Tracked domain names" msgid "Tracked domain names"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:83 #: assets/pages/StatisticsPage.tsx:81
msgid "Purchased domain names" msgid "Purchased domain names"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:93 #: assets/pages/StatisticsPage.tsx:91
msgid "" msgid ""
"This value is based on the status code of the HTTP response from the " "This value is based on the status code of the HTTP response from the "
"providers following the domain order." "providers following the domain order."
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:97 #: assets/pages/StatisticsPage.tsx:95
msgid "Success rate" msgid "Success rate"
msgstr "" msgstr ""