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) getStatistics().then(setStats)
}, []) }, [])
const totalDomainPurchase = (stats?.domainPurchased ?? 0) + (stats?.domainPurchaseFailed ?? 0)
const successRate = stats !== undefined ? const successRate = stats !== undefined ?
(stats.domainPurchaseFailed === 0 ? undefined : stats.domainPurchased / stats.domainPurchaseFailed) (totalDomainPurchase === 0 ? undefined : stats.domainPurchased / totalDomainPurchase)
: undefined : undefined
return <> return <>

View File

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

View File

@@ -486,33 +486,33 @@ msgstr ""
msgid "Sorry, the page you visited does not exist." msgid "Sorry, the page you visited does not exist."
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:32 #: assets/pages/StatisticsPage.tsx:34
msgid "RDAP queries" msgid "RDAP queries"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:41 #: assets/pages/StatisticsPage.tsx:43
msgid "Alerts sent" msgid "Alerts sent"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:55 #: assets/pages/StatisticsPage.tsx:57
msgid "Domain names in database" msgid "Domain names in database"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:66 #: assets/pages/StatisticsPage.tsx:68
msgid "Tracked domain names" msgid "Tracked domain names"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:80 #: assets/pages/StatisticsPage.tsx:82
msgid "Purchased domain names" msgid "Purchased domain names"
msgstr "" msgstr ""
#: assets/pages/StatisticsPage.tsx:90 #: assets/pages/StatisticsPage.tsx:92
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:93 #: assets/pages/StatisticsPage.tsx:95
msgid "Success rate" msgid "Success rate"
msgstr "" msgstr ""