mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
Render correct OS names.
This commit is contained in:
parent
c8eb76c7af
commit
e67282d7d8
@ -15,12 +15,7 @@ export function SettingsButton() {
|
|||||||
<Icons.Gear />
|
<Icons.Gear />
|
||||||
</Icon>
|
</Icon>
|
||||||
</Button>
|
</Button>
|
||||||
<Popup
|
<Popup className={styles.popup} position="bottom" alignment="end">
|
||||||
className={styles.popup}
|
|
||||||
position="bottom"
|
|
||||||
alignment="end"
|
|
||||||
onClick={e => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<Form>
|
<Form>
|
||||||
<FormRow label={formatMessage(labels.timezone)}>
|
<FormRow label={formatMessage(labels.timezone)}>
|
||||||
<TimezoneSetting />
|
<TimezoneSetting />
|
||||||
|
@ -2,14 +2,20 @@ import MetricsTable from './MetricsTable';
|
|||||||
import FilterLink from 'components/common/FilterLink';
|
import FilterLink from 'components/common/FilterLink';
|
||||||
import useMessages from 'components/hooks/useMessages';
|
import useMessages from 'components/hooks/useMessages';
|
||||||
|
|
||||||
|
const names = {
|
||||||
|
'Mac OS': 'macOS',
|
||||||
|
'Chrome OS': 'ChromeOS',
|
||||||
|
'Sun OS': 'SunOS',
|
||||||
|
};
|
||||||
|
|
||||||
export function OSTable({ websiteId, limit }: { websiteId: string; limit?: number }) {
|
export function OSTable({ websiteId, limit }: { websiteId: string; limit?: number }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
function renderLink({ x: os }) {
|
function renderLink({ x: os }) {
|
||||||
return (
|
return (
|
||||||
<FilterLink id="os" value={os}>
|
<FilterLink id="os" value={names[os] || os}>
|
||||||
<img
|
<img
|
||||||
src={`${process.env.basePath}/images/os/${
|
src={`${process.env.basePath || ''}/images/os/${
|
||||||
os?.toLowerCase().replaceAll(/\W/g, '-') || 'unknown'
|
os?.toLowerCase().replaceAll(/\W/g, '-') || 'unknown'
|
||||||
}.png`}
|
}.png`}
|
||||||
alt={os}
|
alt={os}
|
||||||
|
Loading…
Reference in New Issue
Block a user