diff --git a/src/components/Common/List/index.tsx b/src/components/Common/List/index.tsx index 689fba5c..7a893708 100644 --- a/src/components/Common/List/index.tsx +++ b/src/components/Common/List/index.tsx @@ -3,15 +3,16 @@ import { withProperties } from '../../../utils/typeHelpers'; interface ListItemProps { title: string; + className?: string; } -const ListItem: React.FC = ({ title, children }) => { +const ListItem: React.FC = ({ title, className, children }) => { return (
{title}
- {children} + {children}
diff --git a/src/components/Layout/VersionStatus/index.tsx b/src/components/Layout/VersionStatus/index.tsx index 1677e682..f746dbc8 100644 --- a/src/components/Layout/VersionStatus/index.tsx +++ b/src/components/Layout/VersionStatus/index.tsx @@ -7,7 +7,7 @@ import { StatusResponse } from '../../../../server/interfaces/api/settingsInterf const messages = defineMessages({ streamdevelop: 'Overseerr Develop', streamstable: 'Overseerr Stable', - outofdate: 'Out of date', + outofdate: 'Out of Date', commitsbehind: '{commitsBehind} {commitsBehind, plural, one {commit} other {commits}} behind', }); @@ -24,7 +24,7 @@ const VersionStatus: React.FC = () => { const versionStream = data.commitTag === 'local' - ? 'Keep it up!' + ? 'Keep it up! 👍' : data.version.startsWith('develop-') ? intl.formatMessage(messages.streamdevelop) : intl.formatMessage(messages.streamstable); @@ -34,7 +34,7 @@ const VersionStatus: React.FC = () => { @@ -87,15 +87,19 @@ const VersionStatus: React.FC = () => {
{versionStream} - {data.commitTag === 'local' - ? '(⌐■_■)' - : data.commitsBehind > 0 - ? intl.formatMessage(messages.commitsbehind, { - commitsBehind: data.commitsBehind, - }) - : data.commitsBehind === -1 - ? intl.formatMessage(messages.outofdate) - : data.version.replace('develop-', '')} + {data.commitTag === 'local' ? ( + '(⌐■_■)' + ) : data.commitsBehind > 0 ? ( + intl.formatMessage(messages.commitsbehind, { + commitsBehind: data.commitsBehind, + }) + ) : data.commitsBehind === -1 ? ( + intl.formatMessage(messages.outofdate) + ) : ( + + {data.version.replace('develop-', '')} + + )}
{data.updateAvailable && ( diff --git a/src/components/Settings/SettingsAbout/index.tsx b/src/components/Settings/SettingsAbout/index.tsx index 26e66a95..e29c177e 100644 --- a/src/components/Settings/SettingsAbout/index.tsx +++ b/src/components/Settings/SettingsAbout/index.tsx @@ -1,14 +1,17 @@ import React from 'react'; +import { defineMessages, useIntl } from 'react-intl'; import useSWR from 'swr'; +import { + SettingsAboutResponse, + StatusResponse, +} from '../../../../server/interfaces/api/settingsInterfaces'; +import globalMessages from '../../../i18n/globalMessages'; import Error from '../../../pages/_error'; +import Badge from '../../Common/Badge'; import List from '../../Common/List'; import LoadingSpinner from '../../Common/LoadingSpinner'; -import { SettingsAboutResponse } from '../../../../server/interfaces/api/settingsInterfaces'; -import { defineMessages, useIntl } from 'react-intl'; -import Releases from './Releases'; -import Badge from '../../Common/Badge'; import PageTitle from '../../Common/PageTitle'; -import globalMessages from '../../../i18n/globalMessages'; +import Releases from './Releases'; const messages = defineMessages({ about: 'About', @@ -23,6 +26,8 @@ const messages = defineMessages({ helppaycoffee: 'Help Pay for Coffee', documentation: 'Documentation', preferredmethod: 'Preferred', + outofdate: 'Out of Date', + uptodate: 'Up to Date', }); const SettingsAbout: React.FC = () => { @@ -31,6 +36,8 @@ const SettingsAbout: React.FC = () => { '/api/v1/settings/about' ); + const { data: status } = useSWR('/api/v1/status'); + if (!data && !error) { return ; } @@ -49,8 +56,22 @@ const SettingsAbout: React.FC = () => { />
- - {data.version} + + {data.version.replace('develop-', '')} + {status?.updateAvailable ? ( + + {intl.formatMessage(messages.outofdate)} + + ) : ( + status?.commitTag !== 'local' && ( + + {intl.formatMessage(messages.uptodate)} + + ) + )} {intl.formatNumber(data.totalMediaItems)} diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index e7cf28a5..fac2ee8b 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -44,7 +44,7 @@ "components.Layout.UserDropdown.settings": "Settings", "components.Layout.UserDropdown.signout": "Sign Out", "components.Layout.VersionStatus.commitsbehind": "{commitsBehind} {commitsBehind, plural, one {commit} other {commits}} behind", - "components.Layout.VersionStatus.outofdate": "Out of date", + "components.Layout.VersionStatus.outofdate": "Out of Date", "components.Layout.VersionStatus.streamdevelop": "Overseerr Develop", "components.Layout.VersionStatus.streamstable": "Overseerr Stable", "components.Layout.alphawarning": "This is ALPHA software. Features may be broken and/or unstable. Please report any issues on GitHub!", @@ -390,12 +390,14 @@ "components.Settings.SettingsAbout.gettingsupport": "Getting Support", "components.Settings.SettingsAbout.githubdiscussions": "GitHub Discussions", "components.Settings.SettingsAbout.helppaycoffee": "Help Pay for Coffee", + "components.Settings.SettingsAbout.outofdate": "Out of Date", "components.Settings.SettingsAbout.overseerrinformation": "Overseerr Information", "components.Settings.SettingsAbout.preferredmethod": "Preferred", "components.Settings.SettingsAbout.supportoverseerr": "Support Overseerr", "components.Settings.SettingsAbout.timezone": "Time Zone", "components.Settings.SettingsAbout.totalmedia": "Total Media", "components.Settings.SettingsAbout.totalrequests": "Total Requests", + "components.Settings.SettingsAbout.uptodate": "Up to Date", "components.Settings.SettingsAbout.version": "Version", "components.Settings.SettingsJobsCache.cache": "Cache", "components.Settings.SettingsJobsCache.cacheDescription": "Overseerr caches requests to external API endpoints to optimize performance and avoid making unnecessary API calls.",