page_params: Add `web/src/stats/page_params.ts` for stat module

`stat.js` has its page params different from all other modules.
This commit is contained in:
Junyao Chen 2023-06-27 10:03:26 -04:00 committed by Tim Abbott
parent ab897fa3b9
commit 640de3ad29
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,11 @@
import $ from "jquery";
export const page_params: {
data_url_suffix: string;
guest_users: number;
upload_space_used: number;
} = $("#page-params").data("params");
if (!page_params) {
throw new Error("Missing page-params");
}

View File

@ -5,7 +5,8 @@ import PlotlyPie from "plotly.js/lib/pie";
import tippy from "tippy.js";
import {$t, $t_html} from "../i18n";
import {page_params} from "../page_params";
import {page_params} from "./page_params";
Plotly.register([PlotlyBar, PlotlyPie]);