mirror of
https://github.com/umami-software/umami.git
synced 2026-02-24 14:35:35 +01:00
Compare commits
7 commits
6d9d8b353f
...
1c7f9da320
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c7f9da320 | ||
|
|
a84b890b23 | ||
|
|
0ae5c28da7 | ||
|
|
23838c57fb | ||
|
|
3acb34d599 | ||
|
|
39c99997ce | ||
|
|
c5298d5d45 |
9 changed files with 34 additions and 20 deletions
|
|
@ -117,22 +117,22 @@ const redirects = [
|
||||||
{
|
{
|
||||||
source: '/settings',
|
source: '/settings',
|
||||||
destination: '/settings/preferences',
|
destination: '/settings/preferences',
|
||||||
permanent: true,
|
permanent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: '/teams/:id',
|
source: '/teams/:id',
|
||||||
destination: '/teams/:id/websites',
|
destination: '/teams/:id/websites',
|
||||||
permanent: true,
|
permanent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: '/teams/:id/settings',
|
source: '/teams/:id/settings',
|
||||||
destination: '/teams/:id/settings/preferences',
|
destination: '/teams/:id/settings/preferences',
|
||||||
permanent: true,
|
permanent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: '/admin',
|
source: '/admin',
|
||||||
destination: '/admin/users',
|
destination: '/admin/users',
|
||||||
permanent: true,
|
permanent: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@umami/components",
|
"name": "@umami/components",
|
||||||
"version": "0.123.0",
|
"version": "0.125.0",
|
||||||
"description": "Umami React components.",
|
"description": "Umami React components.",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export function WebsiteMenu({ websiteId }: { websiteId: string }) {
|
||||||
if (id === 'compare') {
|
if (id === 'compare') {
|
||||||
router.push(updateParams({ compare: 'prev' }));
|
router.push(updateParams({ compare: 'prev' }));
|
||||||
} else if (id === 'edit') {
|
} else if (id === 'edit') {
|
||||||
router.push(renderUrl(`/settings/websites/${websiteId}`));
|
router.push(renderUrl(`/websites/${websiteId}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ export function WebsiteData({ websiteId, onSave }: { websiteId: string; onSave?:
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
touch('websites');
|
touch('websites');
|
||||||
onSave?.();
|
onSave?.();
|
||||||
router.push(renderUrl(`/settings/websites`));
|
router.push(renderUrl(`/websites`));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = async () => {
|
const handleReset = async () => {
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@ import { Row, Column, Text } from '@umami/react-zen';
|
||||||
|
|
||||||
export function ActionForm({ label, description, children }) {
|
export function ActionForm({ label, description, children }) {
|
||||||
return (
|
return (
|
||||||
<Row padding="6" border borderRadius="3" justifyContent="space-between" shadow="2">
|
<Row alignItems="center" justifyContent="space-between" gap>
|
||||||
<Column gap>
|
<Column gap="2">
|
||||||
<Text weight="bold">{label}</Text>
|
<Text weight="bold">{label}</Text>
|
||||||
<Text>{description}</Text>
|
<Text color="muted">{description}</Text>
|
||||||
</Column>
|
</Column>
|
||||||
<Row gap="3" alignItems="center">
|
<Row alignItems="center" gap>
|
||||||
{children}
|
{children}
|
||||||
</Row>
|
</Row>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ export function useUserTeamsQuery(userId: string) {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['teams', { userId, modified }],
|
queryKey: ['teams', { userId, modified }],
|
||||||
queryFn: () => {
|
queryFn: () => {
|
||||||
return get(`/users/${userId}/teams`, { userId });
|
return get(`/users/${userId}/teams`);
|
||||||
},
|
},
|
||||||
enabled: !!userId,
|
enabled: !!userId,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export function SettingsButton() {
|
||||||
const handleAction = (id: Key) => {
|
const handleAction = (id: Key) => {
|
||||||
if (id === 'settings') {
|
if (id === 'settings') {
|
||||||
if (cloudMode) {
|
if (cloudMode) {
|
||||||
window.location.href = `${cloudUrl}/dashboard`;
|
window.location.href = `${cloudUrl}/settings`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
export * from '@/app/(main)/settings/preferences/LanguageSetting';
|
||||||
|
export * from '@/app/(main)/settings/preferences/PreferenceSettings';
|
||||||
|
export * from '@/app/(main)/settings/preferences/PreferencesPage';
|
||||||
|
export * from '@/app/(main)/settings/preferences/ThemeSetting';
|
||||||
|
|
||||||
export * from '@/app/(main)/teams/[teamId]/TeamMemberEditButton';
|
export * from '@/app/(main)/teams/[teamId]/TeamMemberEditButton';
|
||||||
export * from '@/app/(main)/teams/[teamId]/TeamMemberEditForm';
|
export * from '@/app/(main)/teams/[teamId]/TeamMemberEditForm';
|
||||||
export * from '@/app/(main)/teams/[teamId]/TeamMemberRemoveButton';
|
export * from '@/app/(main)/teams/[teamId]/TeamMemberRemoveButton';
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,18 @@
|
||||||
|
|
||||||
/* Helper functions */
|
/* Helper functions */
|
||||||
|
|
||||||
|
const normalize = raw => {
|
||||||
|
if (!raw) return raw;
|
||||||
|
try {
|
||||||
|
const u = new URL(raw, location.href);
|
||||||
|
if (excludeSearch) u.search = '';
|
||||||
|
if (excludeHash) u.hash = '';
|
||||||
|
return u.toString();
|
||||||
|
} catch (e) {
|
||||||
|
return raw;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const getPayload = () => ({
|
const getPayload = () => ({
|
||||||
website,
|
website,
|
||||||
screen,
|
screen,
|
||||||
|
|
@ -61,11 +73,7 @@
|
||||||
if (!url) return;
|
if (!url) return;
|
||||||
|
|
||||||
currentRef = currentUrl;
|
currentRef = currentUrl;
|
||||||
currentUrl = new URL(url, location.href);
|
currentUrl = normalize(new URL(url, location.href).toString());
|
||||||
|
|
||||||
if (excludeSearch) currentUrl.search = '';
|
|
||||||
if (excludeHash) currentUrl.hash = '';
|
|
||||||
currentUrl = currentUrl.toString();
|
|
||||||
|
|
||||||
if (currentUrl !== currentRef) {
|
if (currentUrl !== currentRef) {
|
||||||
setTimeout(track, delayDuration);
|
setTimeout(track, delayDuration);
|
||||||
|
|
@ -211,8 +219,9 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let currentUrl = href;
|
let currentUrl = normalize(href);
|
||||||
let currentRef = referrer.startsWith(origin) ? '' : referrer;
|
let currentRef = normalize(referrer.startsWith(origin) ? '' : referrer);
|
||||||
|
|
||||||
let initialized = false;
|
let initialized = false;
|
||||||
let disabled = false;
|
let disabled = false;
|
||||||
let cache;
|
let cache;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue