ref: remove google analytics (#3912)
This commit is contained in:
parent
0ff60d83eb
commit
5120590e47
9 changed files with 33 additions and 38 deletions
|
@ -1,7 +1,6 @@
|
|||
import React, { useEffect } from 'react';
|
||||
import ReactGA from 'react-ga';
|
||||
import React from 'react';
|
||||
import { hot } from 'react-hot-loader/root';
|
||||
import { Route, Router, Switch, useLocation } from 'react-router-dom';
|
||||
import { Route, Router, Switch } from 'react-router-dom';
|
||||
import { StoreProvider } from 'easy-peasy';
|
||||
import { store } from '@/state';
|
||||
import DashboardRouter from '@/routers/DashboardRouter';
|
||||
|
@ -33,16 +32,6 @@ interface ExtendedWindow extends Window {
|
|||
|
||||
setupInterceptors(history);
|
||||
|
||||
const Pageview = () => {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
ReactGA.pageview(pathname);
|
||||
}, [ pathname ]);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const { PterodactylUser, SiteConfiguration } = (window as ExtendedWindow);
|
||||
if (PterodactylUser && !store.getState().user.data) {
|
||||
|
@ -62,12 +51,6 @@ const App = () => {
|
|||
store.getActions().settings.setSettings(SiteConfiguration!);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (SiteConfiguration?.analytics) {
|
||||
ReactGA.initialize(SiteConfiguration!.analytics);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<GlobalStylesheet/>
|
||||
|
@ -76,7 +59,6 @@ const App = () => {
|
|||
<ProgressBar/>
|
||||
<div css={tw`mx-auto w-auto`}>
|
||||
<Router history={history}>
|
||||
{SiteConfiguration?.analytics && <Pageview/>}
|
||||
<Switch>
|
||||
<Route path="/server/:id" component={ServerRouter}/>
|
||||
<Route path="/auth" component={AuthenticationRouter}/>
|
||||
|
|
|
@ -7,7 +7,6 @@ export interface SiteSettings {
|
|||
enabled: boolean;
|
||||
siteKey: string;
|
||||
};
|
||||
analytics: string;
|
||||
}
|
||||
|
||||
export interface SettingsStore {
|
||||
|
|
|
@ -31,13 +31,6 @@
|
|||
<p class="text-muted"><small>This is the name that is used throughout the panel and in emails sent to clients.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label class="control-label">Google Analytics</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="app:analytics" value="{{ old('app:analytics', config('app.analytics')) }}" />
|
||||
<p class="text-muted"><small>This is your Google Analytics Tracking ID, Ex. UA-123723645-2</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label class="control-label">Require 2-Factor Authentication</label>
|
||||
<div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue