You've already forked AstralRinth
forked from didirus/AstralRinth
Remove analytics (#197)
This commit is contained in:
@@ -35,8 +35,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Popup from '~/components/ui/Popup'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ConfirmPopup',
|
name: 'ConfirmPopup',
|
||||||
|
components: {
|
||||||
|
Popup,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
confirmationText: {
|
confirmationText: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|||||||
@@ -138,6 +138,8 @@ import UserIcon from '~/assets/images/utils/user.svg?inline'
|
|||||||
import LogOutIcon from '~/assets/images/utils/log-out.svg?inline'
|
import LogOutIcon from '~/assets/images/utils/log-out.svg?inline'
|
||||||
import GitHubIcon from '~/assets/images/utils/github.svg?inline'
|
import GitHubIcon from '~/assets/images/utils/github.svg?inline'
|
||||||
|
|
||||||
|
import CookieConsent from '~/components/ads/CookieConsent'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ModrinthLogo,
|
ModrinthLogo,
|
||||||
@@ -150,6 +152,7 @@ export default {
|
|||||||
GitHubIcon,
|
GitHubIcon,
|
||||||
NotificationIcon,
|
NotificationIcon,
|
||||||
HamburgerIcon,
|
HamburgerIcon,
|
||||||
|
CookieConsent,
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ClickOutside,
|
ClickOutside,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export const DEFAULT_OPTIONS = {
|
export const DEFAULT_OPTIONS = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
script_url: 'https://example.com',
|
script_url: 'https://static.cloudflareinsights.com/beacon.min.js',
|
||||||
tracking_code: 'xxx',
|
token: 'xxx',
|
||||||
}
|
}
|
||||||
export const UNAMI_LIB_TAG_ID = 'unami-import'
|
export const CF_LIB_TAG_ID = 'cf-import'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DEFAULT_OPTIONS, UNAMI_LIB_TAG_ID } from './constants'
|
import { DEFAULT_OPTIONS, CF_LIB_TAG_ID } from './constants'
|
||||||
|
|
||||||
const { resolve } = require('path')
|
const { resolve } = require('path')
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ module.exports = async function module(moduleOptions) {
|
|||||||
|
|
||||||
const templatesOptions = {
|
const templatesOptions = {
|
||||||
...options,
|
...options,
|
||||||
UNAMI_LIB_TAG_ID,
|
CF_LIB_TAG_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addPlugin({
|
this.addPlugin({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export default async function (ctx, inject) {
|
|||||||
const config = (ctx.$config && ctx.$config.analytics) || {}
|
const config = (ctx.$config && ctx.$config.analytics) || {}
|
||||||
|
|
||||||
const url = config.script_url ?? '<%= options.script_url %>'
|
const url = config.script_url ?? '<%= options.script_url %>'
|
||||||
const tag = config.tracking_code ?? '<%= options.tracking_code %>'
|
const tag = config.token ?? '<%= options.token %>'
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
const enabled = config.enabled ?? ('<%= options.enabled || false %>' === 'true');
|
const enabled = config.enabled ?? ('<%= options.enabled || false %>' === 'true');
|
||||||
// Check if the parameters are not changed by runtime config:
|
// Check if the parameters are not changed by runtime config:
|
||||||
@@ -27,8 +27,10 @@ export default async function (ctx, inject) {
|
|||||||
const analyticsScript = {
|
const analyticsScript = {
|
||||||
hid: UNAMI_LIB_TAG_ID,
|
hid: UNAMI_LIB_TAG_ID,
|
||||||
src: url,
|
src: url,
|
||||||
'data-website-id': tag,
|
'data-cf-beacon': JSON.stringify({
|
||||||
async: true,
|
token: tag,
|
||||||
|
spa: true,
|
||||||
|
}),
|
||||||
defer: true,
|
defer: true,
|
||||||
}
|
}
|
||||||
injectScript(analyticsScript)
|
injectScript(analyticsScript)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@modrinth/analytics",
|
"name": "@modrinth/analytics",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Unami integration for Nuxtjs",
|
"description": "Cloudflare analytics integration for Nuxtjs",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -178,9 +178,12 @@ export default {
|
|||||||
networkCode: process.env.GAM_ID,
|
networkCode: process.env.GAM_ID,
|
||||||
},
|
},
|
||||||
analytics: {
|
analytics: {
|
||||||
enabled: process.env.ENABLE_ANALYTICS,
|
// enabled: process.env.ENABLE_ANALYTICS,
|
||||||
script_url: process.env.ANALYTICS_URL,
|
// script_url: process.env.ANALYTICS_URL,
|
||||||
tracking_code: process.env.ANALYTICS_ID,
|
// token: process.env.ANALYTICS_ID,
|
||||||
|
enabled: true,
|
||||||
|
script_url: 'https://static.cloudflareinsights.com/beacon.min.js',
|
||||||
|
token: '1e85158b8a414e7b9e2378e249908e5f',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
21073
package-lock.json
generated
21073
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -62,6 +62,8 @@ import FollowIcon from '~/assets/images/utils/heart.svg?inline'
|
|||||||
import UserIcon from '~/assets/images/utils/user.svg?inline'
|
import UserIcon from '~/assets/images/utils/user.svg?inline'
|
||||||
import ShieldIcon from '~/assets/images/utils/shield.svg?inline'
|
import ShieldIcon from '~/assets/images/utils/shield.svg?inline'
|
||||||
|
|
||||||
|
import MFooter from '~/components/layout/MFooter'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DashboardPage',
|
name: 'DashboardPage',
|
||||||
components: {
|
components: {
|
||||||
@@ -72,6 +74,7 @@ export default {
|
|||||||
FollowIcon,
|
FollowIcon,
|
||||||
UserIcon,
|
UserIcon,
|
||||||
ShieldIcon,
|
ShieldIcon,
|
||||||
|
MFooter,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
authUrl() {
|
authUrl() {
|
||||||
|
|||||||
Reference in New Issue
Block a user