Skip to content

Commit

Permalink
Replace setKioskmode() with &kiosk query param
Browse files Browse the repository at this point in the history
  • Loading branch information
intermittentnrg committed Jan 7, 2025
1 parent 36b61a2 commit ddd14d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
13 changes: 6 additions & 7 deletions grafanimate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@ def make_grafana(

view = "d"
slug = "foo"
query = ""
query = []
if options["dashboard-view"]:
view = options["dashboard-view"]
if options["panel-id"]:
if options["dashboard-view"] == "d-solo":
query = (
"?panelId="
+ options["panel-id"]
+ "&__feature.dashboardSceneSolo&fullscreen"
)
query.append("panelId=" + options["panel-id"])
query.append("__feature.dashboardSceneSolo&fullscreen")
else:
query = "?viewPanel=" + options["panel-id"]
query.append("viewPanel=" + options["panel-id"])
query.append("kiosk")
query = "?" + "&".join(query)

if url[-1] != "/":
url += "/"
Expand Down
14 changes: 0 additions & 14 deletions grafanimate/grafana-studio.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ class GrafanaStudioSrv {
_this.improveDashboardChrome();
_this.improvePanelChrome();
});

// Adjust user interface on dashboard load.
// FIXME: This happens too fast. Complex dashboards might not have finished loading here.
if (this.hasHeaderLayout("no-chrome", "studio")) {
this.setKioskMode();
}
}

improveDashboardChrome() {
Expand All @@ -158,7 +152,6 @@ class GrafanaStudioSrv {

// below CSS properteis are not working with Grafana 11 anymore
if (this.hasHeaderLayout("no-chrome", "studio")) {
//this.setKioskMode();

// Add some padding to content top.
$(".main-view").css("padding-top", "1rem");
Expand Down Expand Up @@ -262,13 +255,6 @@ class GrafanaStudioSrv {
return title;
}

setKioskMode() {
if (!document.querySelector('[title="Enable kiosk mode"]')) {
document.querySelector('[title="Toggle top search bar"]').click();
}
document.querySelector('[title="Enable kiosk mode"]').click();
}

addAttribution() {
// Hijack Leaflet attribution area for Grafana and grafanimate.
// TODO: Use alternative place if there 's not Worldmap in sight.
Expand Down

0 comments on commit ddd14d4

Please sign in to comment.