Relocate and fix jsesc issue

This commit is contained in:
Louis Lam 2023-02-04 16:58:39 +08:00
parent 10c6f3b688
commit 5f2affb38c
3 changed files with 21 additions and 18 deletions

View file

@ -4,7 +4,7 @@ const cheerio = require("cheerio");
const { UptimeKumaServer } = require("../uptime-kuma-server");
const jsesc = require("jsesc");
const Maintenance = require("./maintenance");
const googleAnalytics = require("../modules/google-analytics");
const googleAnalytics = require("../google-analytics");
class StatusPage extends BeanModel {
@ -55,9 +55,7 @@ class StatusPage extends BeanModel {
const head = $("head");
if (statusPage.googleAnalyticsTagId) {
let escapedGoogleAnalyticsScript = jsesc(googleAnalytics.getGoogleAnalyticsScript(statusPage.googleAnalyticsTagId), {
"isScriptContext": true
});
let escapedGoogleAnalyticsScript = googleAnalytics.getGoogleAnalyticsScript(statusPage.googleAnalyticsTagId);
head.append($(escapedGoogleAnalyticsScript));
}