mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-06 01:15:42 +01:00
Display custom tracker script name.
This commit is contained in:
parent
8e350a2056
commit
c7a3505c39
@ -5,6 +5,8 @@ import Button from 'components/common/Button';
|
|||||||
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
||||||
import CopyButton from 'components/common/CopyButton';
|
import CopyButton from 'components/common/CopyButton';
|
||||||
|
|
||||||
|
const scriptName = process.env.TRACKER_SCRIPT_NAME || 'umami';
|
||||||
|
|
||||||
export default function TrackingCodeForm({ values, onClose }) {
|
export default function TrackingCodeForm({ values, onClose }) {
|
||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
const { basePath } = useRouter();
|
const { basePath } = useRouter();
|
||||||
@ -24,7 +26,7 @@ export default function TrackingCodeForm({ values, onClose }) {
|
|||||||
rows={3}
|
rows={3}
|
||||||
cols={60}
|
cols={60}
|
||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
defaultValue={`<script async defer data-website-id="${values.website_uuid}" src="${document.location.origin}${basePath}/umami.js"></script>`}
|
defaultValue={`<script async defer data-website-id="${values.website_uuid}" src="${document.location.origin}${basePath}/${scriptName}.js"></script>`}
|
||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
|
@ -6,6 +6,7 @@ module.exports = {
|
|||||||
VERSION: pkg.version,
|
VERSION: pkg.version,
|
||||||
FORCE_SSL: !!process.env.FORCE_SSL,
|
FORCE_SSL: !!process.env.FORCE_SSL,
|
||||||
DISABLE_LOGIN: !!process.env.DISABLE_LOGIN,
|
DISABLE_LOGIN: !!process.env.DISABLE_LOGIN,
|
||||||
|
TRACKER_SCRIPT_NAME: process.env.TRACKER_SCRIPT_NAME,
|
||||||
},
|
},
|
||||||
basePath: process.env.BASE_PATH,
|
basePath: process.env.BASE_PATH,
|
||||||
eslint: {
|
eslint: {
|
||||||
|
Loading…
Reference in New Issue
Block a user