fix(insights): better status

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2024-12-19 17:21:08 -05:00
parent 04f296cc73
commit 6bc4c0317f
5 changed files with 29 additions and 11 deletions

View file

@ -55,6 +55,16 @@ const AboutDialog = ({ open, onClose }) => {
const { permissions } = usePermissions()
const { data, loading } = useGetOne('insights', 'insights_status')
const lastRun = !loading && data?.lastRun
let insightsStatus = 'N/A'
if (lastRun === 'disabled') {
insightsStatus = translate('about.links.insights.disabled')
} else if (lastRun && lastRun?.startsWith('1969-12-31')) {
insightsStatus = translate('about.links.insights.waiting')
} else if (lastRun) {
insightsStatus = lastRun
}
return (
<Dialog onClose={onClose} aria-labelledby="about-dialog-title" open={open}>
<DialogTitle id="about-dialog-title" onClose={onClose}>
@ -97,9 +107,7 @@ const AboutDialog = ({ open, onClose }) => {
{translate(`about.links.lastInsightsCollection`)}:
</TableCell>
<TableCell align="left">
<Link href={INSIGHTS_DOC_URL}>
{(!loading && data?.lastRun) || 'N/A'}{' '}
</Link>
<Link href={INSIGHTS_DOC_URL}>{insightsStatus}</Link>
</TableCell>
</TableRow>
) : null}

View file

@ -438,7 +438,11 @@
"homepage": "Home page",
"source": "Source code",
"featureRequests": "Feature requests",
"lastInsightsCollection": "Last insights collection"
"lastInsightsCollection": "Last insights collection",
"insights": {
"disabled": "Disabled",
"waiting": "Waiting"
}
}
},
"activity": {