feat: update deps and insight
This commit is contained in:
@@ -5,11 +5,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>aklive2d directory</title>
|
||||
<script
|
||||
id="counterscale-script"
|
||||
src="https://insight.halyul.dev/on-demand.js"
|
||||
defer
|
||||
></script>
|
||||
<link rel="canonical" href="https://arknights.halyul.dev/">
|
||||
<style>
|
||||
.loader {
|
||||
position: fixed;
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
import * as Counterscale from "@counterscale/tracker";
|
||||
import React from 'react';
|
||||
|
||||
export default (path = null, skipPageView = false) => {
|
||||
Counterscale.init({
|
||||
siteId: "aklive2d",
|
||||
reporterUrl: "https://insight.halyul.dev/collect",
|
||||
autoTrackPageviews: false,
|
||||
});
|
||||
|
||||
export default (path = "", skipPageView = false) => {
|
||||
React.useEffect(() => {
|
||||
if (!skipPageView && import.meta.env.MODE !== 'development') {
|
||||
try {
|
||||
window.counterscale = {
|
||||
q: [["set", "siteId", import.meta.env.VITE_INSIGHT_ID], ["trackPageview", {path}]],
|
||||
};
|
||||
window.counterscaleOnDemandTrack()
|
||||
Counterscale.trackPageview({
|
||||
url: `/${path}`
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn && console.warn(err.message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user