fix: domain purchase stat

This commit is contained in:
Maël Gangloff
2024-08-24 11:50:44 +02:00
parent 72ad9629a0
commit 12176727ac
3 changed files with 11 additions and 8 deletions

View File

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

View File

@@ -35,6 +35,7 @@ class DomainRefreshController extends AbstractController
* @throws ExceptionInterface
* @throws \Exception
* @throws HttpExceptionInterface
* @throws \Throwable
*/
public function __invoke(string $ldhName, KernelInterface $kernel): ?Domain
{

View File

@@ -486,33 +486,33 @@ msgstr ""
msgid "Sorry, the page you visited does not exist."
msgstr ""
#: assets/pages/StatisticsPage.tsx:32
#: assets/pages/StatisticsPage.tsx:34
msgid "RDAP queries"
msgstr ""
#: assets/pages/StatisticsPage.tsx:41
#: assets/pages/StatisticsPage.tsx:43
msgid "Alerts sent"
msgstr ""
#: assets/pages/StatisticsPage.tsx:55
#: assets/pages/StatisticsPage.tsx:57
msgid "Domain names in database"
msgstr ""
#: assets/pages/StatisticsPage.tsx:66
#: assets/pages/StatisticsPage.tsx:68
msgid "Tracked domain names"
msgstr ""
#: assets/pages/StatisticsPage.tsx:80
#: assets/pages/StatisticsPage.tsx:82
msgid "Purchased domain names"
msgstr ""
#: assets/pages/StatisticsPage.tsx:90
#: assets/pages/StatisticsPage.tsx:92
msgid ""
"This value is based on the status code of the HTTP response from the "
"providers following the domain order."
msgstr ""
#: assets/pages/StatisticsPage.tsx:93
#: assets/pages/StatisticsPage.tsx:95
msgid "Success rate"
msgstr ""