mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-11 20:17:28 +01:00
Fixed styling on update notice. Added private mode.
This commit is contained in:
parent
314bbee717
commit
dd88b1d901
@ -14,6 +14,7 @@ const frameAncestors = process.env.ALLOWED_FRAME_URLS || '';
|
|||||||
const disableLogin = process.env.DISABLE_LOGIN || '';
|
const disableLogin = process.env.DISABLE_LOGIN || '';
|
||||||
const disableUI = process.env.DISABLE_UI || '';
|
const disableUI = process.env.DISABLE_UI || '';
|
||||||
const hostURL = process.env.HOST_URL || '';
|
const hostURL = process.env.HOST_URL || '';
|
||||||
|
const privateMode = process.env.PRIVATE_MODE || '';
|
||||||
|
|
||||||
const contentSecurityPolicy = [
|
const contentSecurityPolicy = [
|
||||||
`default-src 'self'`,
|
`default-src 'self'`,
|
||||||
@ -120,6 +121,7 @@ const config = {
|
|||||||
disableLogin,
|
disableLogin,
|
||||||
disableUI,
|
disableUI,
|
||||||
hostURL,
|
hostURL,
|
||||||
|
privateMode,
|
||||||
},
|
},
|
||||||
basePath,
|
basePath,
|
||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
.notice {
|
.notice {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
margin: 80px auto;
|
margin: 60px auto;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
background: var(--base50);
|
background: var(--base50);
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border: 1px solid var(--base300);
|
border: 1px solid var(--base300);
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
z-index: var(--z-index-popup);
|
z-index: 9999;
|
||||||
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ import { Button } from 'react-basics';
|
|||||||
import { setItem } from 'next-basics';
|
import { setItem } from 'next-basics';
|
||||||
import useStore, { checkVersion } from 'store/version';
|
import useStore, { checkVersion } from 'store/version';
|
||||||
import { REPO_URL, VERSION_CHECK } from 'lib/constants';
|
import { REPO_URL, VERSION_CHECK } from 'lib/constants';
|
||||||
import styles from './UpdateNotice.module.css';
|
|
||||||
import { useMessages } from 'components/hooks';
|
import { useMessages } from 'components/hooks';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
|
import styles from './UpdateNotice.module.css';
|
||||||
|
|
||||||
export function UpdateNotice({ user, config }) {
|
export function UpdateNotice({ user, config }) {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
@ -16,8 +16,9 @@ export function UpdateNotice({ user, config }) {
|
|||||||
const allowUpdate =
|
const allowUpdate =
|
||||||
user?.isAdmin &&
|
user?.isAdmin &&
|
||||||
!config?.updatesDisabled &&
|
!config?.updatesDisabled &&
|
||||||
!config?.cloudMode &&
|
|
||||||
!pathname.includes('/share/') &&
|
!pathname.includes('/share/') &&
|
||||||
|
!process.env.cloudMode &&
|
||||||
|
!process.env.privateMode &&
|
||||||
!dismissed;
|
!dismissed;
|
||||||
|
|
||||||
const updateCheck = useCallback(() => {
|
const updateCheck = useCallback(() => {
|
||||||
|
@ -6,6 +6,10 @@ function getHostName(url: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Favicon({ domain, ...props }) {
|
export function Favicon({ domain, ...props }) {
|
||||||
|
if (process.env.privateMode) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const hostName = domain ? getHostName(domain) : null;
|
const hostName = domain ? getHostName(domain) : null;
|
||||||
|
|
||||||
return hostName ? (
|
return hostName ? (
|
||||||
|
@ -11,7 +11,7 @@ export function ProfileButton() {
|
|||||||
const { user } = useLogin();
|
const { user } = useLogin();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { dir } = useLocale();
|
const { dir } = useLocale();
|
||||||
const cloudMode = Boolean(process.env.cloudMode);
|
const cloudMode = !!process.env.cloudMode;
|
||||||
|
|
||||||
const handleSelect = (key: Key, close: () => void) => {
|
const handleSelect = (key: Key, close: () => void) => {
|
||||||
if (key === 'profile') {
|
if (key === 'profile') {
|
||||||
|
@ -6,7 +6,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
res.setHeader('content-type', 'text/javascript');
|
res.setHeader('content-type', 'text/javascript');
|
||||||
|
|
||||||
if (process.env.DISABLE_TELEMETRY) {
|
if (process.env.DISABLE_TELEMETRY || process.env.PRIVATE_MODE) {
|
||||||
return res.send('/* telemetry disabled */');
|
return res.send('/* telemetry disabled */');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user