forked from MapComplete/MapComplete
Fix statistics
This commit is contained in:
parent
25ec71aff1
commit
3aeeb3ad87
5 changed files with 45 additions and 11 deletions
|
@ -96,9 +96,6 @@ class StatsDownloader {
|
||||||
'Cache-Control': 'no-cache'
|
'Cache-Control': 'no-cache'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return []
|
|
||||||
|
|
||||||
while (url) {
|
while (url) {
|
||||||
ScriptUtils.erasableLog(`Downloading stats for ${year}-${month}-${day}, page ${page} ${url}`)
|
ScriptUtils.erasableLog(`Downloading stats for ${year}-${month}-${day}, page ${page} ${url}`)
|
||||||
const result = await Utils.downloadJson(url, headers)
|
const result = await Utils.downloadJson(url, headers)
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -102,9 +102,7 @@ constructor() {
|
||||||
return new StatisticsForOverviewFile(StatisticsGUI.homeUrl, paths)
|
return new StatisticsForOverviewFile(StatisticsGUI.homeUrl, paths)
|
||||||
|
|
||||||
}))
|
}))
|
||||||
this.SetClass("block w-full h-full").AttachTo("maindiv")
|
this.SetClass("block w-full h-full")
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import {Utils} from "./Utils";
|
import {Utils} from "./Utils";
|
||||||
import AllThemesGui from "./UI/AllThemesGui";
|
import AllThemesGui from "./UI/AllThemesGui";
|
||||||
import {QueryParameters} from "./Logic/Web/QueryParameters";
|
import {QueryParameters} from "./Logic/Web/QueryParameters";
|
||||||
|
import StatisticsGUI from "./UI/StatisticsGUI";
|
||||||
|
import {FixedUiElement} from "./UI/Base/FixedUiElement";
|
||||||
|
|
||||||
|
|
||||||
const layout = QueryParameters.GetQueryParameter("layout", undefined).data ?? ""
|
const layout = QueryParameters.GetQueryParameter("layout", undefined).data ?? ""
|
||||||
|
@ -19,4 +21,12 @@ if (layout !== "") {
|
||||||
|
|
||||||
Utils.DisableLongPresses()
|
Utils.DisableLongPresses()
|
||||||
document.getElementById("decoration-desktop").remove();
|
document.getElementById("decoration-desktop").remove();
|
||||||
new AllThemesGui().setup();
|
const mode = QueryParameters.GetQueryParameter("mode", "map", "The mode the application starts in, e.g. 'statistics'")
|
||||||
|
|
||||||
|
if (mode.data === "statistics") {
|
||||||
|
console.log("Statistics mode!")
|
||||||
|
new FixedUiElement("").AttachTo("centermessage")
|
||||||
|
new StatisticsGUI().SetClass("w-full h-full").AttachTo("topleft-tools")
|
||||||
|
} else{
|
||||||
|
new AllThemesGui().setup();
|
||||||
|
}
|
||||||
|
|
4
index.ts
4
index.ts
|
@ -41,9 +41,7 @@ class Init {
|
||||||
window.mapcomplete_state = State.state;
|
window.mapcomplete_state = State.state;
|
||||||
|
|
||||||
const mode = QueryParameters.GetQueryParameter("mode", "map", "The mode the application starts in, e.g. 'map', 'dashboard' or 'statistics'")
|
const mode = QueryParameters.GetQueryParameter("mode", "map", "The mode the application starts in, e.g. 'map', 'dashboard' or 'statistics'")
|
||||||
if (mode.data === "statistics") {
|
if (mode.data === "dashboard") {
|
||||||
new StatisticsGUI().AttachTo("leafletDiv")
|
|
||||||
} else if (mode.data === "dashboard") {
|
|
||||||
new DashboardGui(State.state, guiState).setup()
|
new DashboardGui(State.state, guiState).setup()
|
||||||
} else {
|
} else {
|
||||||
new DefaultGUI(State.state, guiState).setup()
|
new DefaultGUI(State.state, guiState).setup()
|
||||||
|
|
Loading…
Reference in a new issue