-
Notifications
You must be signed in to change notification settings - Fork 12
feat(grafana): create a new Edge App for displaying Grafana dashboards #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍(Review updated until commit dd68464)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to dd68464 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 4b13573
Suggestions up to commit 487c3fb
|
- Add steps to enable embedding in self-hosted Grafana - Clarify support for Open Source and Enterprise editions - Add note about public accessibility requirement - Document that Grafana Cloud does not support embedding
|
Persistent review updated to latest commit 4b13573 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new Edge App for embedding Grafana dashboards in Screenly displays. The app uses a simple iframe-based approach to display Grafana content, with configurable dashboard URLs and theme integration.
Key Changes:
- New Grafana Edge App scaffolding with TypeScript/Bun build setup
- Configurable iframe embedding via
grafana_urlsetting - Theme integration using the
@screenly/edge-appslibrary
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
edge-apps/grafana/screenly.yml |
App manifest defining grafana_url setting and metadata |
edge-apps/grafana/screenly_qc.yml |
QC manifest mirroring production configuration |
edge-apps/grafana/package.json |
Build scripts and dependencies for Bun-based development |
edge-apps/grafana/tsconfig.json |
TypeScript configuration for browser target with Bun types |
edge-apps/grafana/src/main.ts |
Main app logic: theme setup, URL loading, iframe rendering |
edge-apps/grafana/src/main.test.ts |
Placeholder test structure with TODO for proper tests |
edge-apps/grafana/index.html |
HTML scaffold with asset includes and container markup |
edge-apps/grafana/static/css/style.css |
Base styling for fullscreen iframe container |
edge-apps/grafana/static/img/icon.svg |
QR code icon for the app |
edge-apps/grafana/.prettierrc.json |
Prettier configuration matching repository standards |
edge-apps/grafana/.ignore |
Ignore file for node_modules |
edge-apps/grafana/.gitignore |
Git ignore rules for build artifacts and dependencies |
edge-apps/grafana/README.md |
Comprehensive documentation with setup and configuration guides |
edge-apps/grafana/bun.lock |
Dependency lockfile for reproducible builds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace grafana_url setting with domain, dashboard_id, and dashboard_slug - Update to use nested help_text syntax with properties and schema_version - Change implementation to fetch dashboard as image via GET request - Add width (1920) and height (1080) parameters with kiosk mode enabled - Include Authorization bearer token in request headers - Add refresh_interval setting for dashboard refresh configuration - Move inline styles to style.css for better organization
- Replace iframe-based dashboard embedding with Grafana render API calls - Add service account token authentication (Bearer token) - Implement dynamic resolution based on screen dimensions - Add automatic refresh with configurable intervals - Extract rendering logic to separate render.ts module - Update manifest files with new settings (domain, dashboard_id, dashboard_slug, service_access_token, refresh_interval) - Add comprehensive test suite for URL construction and configuration - Update README with service account token setup instructions - Organize CSS styling to external stylesheet
|
Persistent review updated to latest commit dd68464 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… getAccessToken - Add optional tokenType parameter with 'access_token' default - Update function to dynamically use provided token type in URL
- We will be using `panic-overlay` for displaying error messages in future commits.
- Add panic-overlay import and configuration - Add display_errors setting to screenly.yml and screenly_qc.yml - Rename getAccessToken to getToken in edge-apps-library
- Integrate edge-apps-scripts for build, lint, and type-check - Move CSS from static/css to src/css with Tailwind import - Update package.json scripts to use edge-apps-scripts commands - Remove local tsconfig.json in favor of shared configuration - Update index.html paths to reference dist/ output directory
Refactor the CORS proxy server script so that the functions and the file don't exceed the line limits, excluding blank lines and comments: - 70 lines per function - 300 lines per file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 17 out of 20 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rver script is for development use only
- Add global.Node to JSDOM setup in edge-apps-library - Move @screenly/edge-apps/test import to beginning of menu-board test file to ensure globals are initialized before other imports
…shboard` succeeds
- Rename getToken to getCredentials and return token + optional metadata - Remove domain setting from grafana app configuration - Grafana domain now sourced from oauth service metadata - Update documentation to clarify dashboard selection via dropdown - Ensure domain is required from oauth metadata, not settings
PR Type
Enhancement, Documentation, Tests
Description
Introduce Grafana Edge App rendering
Add configurable settings and manifests
Document setup and embedding guidance
Include basic test and build tooling
Diagram Walkthrough
flowchart LR settings["screenly.yml settings (domain, dashboard_id, dashboard_slug, refresh_interval)"] mainjs["main.ts fetches render image via HTTPS"] image["Render dashboard PNG (1920x1080, kiosk)"] ui["index.html + style.css container"] ready["signalReady()"] settings -- "read with getSetting()" --> mainjs mainjs -- "GET /render/d/{id}/{slug}" --> image image -- "blob -> object URL" --> ui mainjs -- "append <img> to #content" --> ui ui -- "app ready" --> readyFile Walkthrough
1 files
Add placeholder unit test scaffold3 files
Fetch and render Grafana dashboard imageAdd responsive full-screen layout stylesAdd minimal app shell and script wiring7 files
Ignore Grafana app directory for PrettierIgnore node_modules in app contextAdd Prettier configuration for appDefine scripts, dev deps, and toolingDefine app settings and metadataQC manifest mirroring production settingsAdd TypeScript compiler configuration1 files
Document setup, embedding, and development