Skip to content

PMM-13722 PMM Navigation - Iframe communication #3787

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
fb0bf37
PMM-13722 Switch to turborepo, add grafana plugin, shared package
matejkubinec Mar 17, 2025
3be89df
PMM-13722 Update build & switch to yarn
matejkubinec Mar 24, 2025
c41f3cf
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Mar 24, 2025
4becaf0
PMM-13722 Fix directory
matejkubinec Mar 24, 2025
34ebfe4
PMM-13722 Temporarily keep comments in grafana plugin
matejkubinec Mar 25, 2025
3e2efa1
PMM-13722 Create subroute for UI with navigation & allow embedding
matejkubinec Mar 25, 2025
9f3c2a9
PMM-13722 Move nvmrc
matejkubinec Mar 25, 2025
f77457f
PMM-13722 Cleanup files
matejkubinec Mar 25, 2025
3451b82
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Apr 11, 2025
d6e9e51
PMM-13722 Handle navigation between iframe and PMM
matejkubinec Apr 17, 2025
7a02c8e
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Apr 17, 2025
b8c4719
PMM-13722 Add most menu items & handle dashboard variables
matejkubinec Apr 22, 2025
939382e
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Apr 22, 2025
0471631
PMM-13722 Don't enable pmm-compat unitl navigation is ready
matejkubinec Apr 22, 2025
9ffd769
PMM-13722 Refactoring & fixes
matejkubinec Apr 23, 2025
ecf5d69
PMM-13722 Use correct path for plugin & add description
matejkubinec Apr 24, 2025
dedf921
PMM-13722 Fix plugin image
matejkubinec Apr 24, 2025
33c295f
PMM-13722 Fix updates page
matejkubinec Apr 24, 2025
418d391
PMM-13722 Improve setup for turborepo
matejkubinec Apr 24, 2025
fa974db
PMM-13722 Sync Grafana theme to PMM UI (light)
matejkubinec Apr 24, 2025
71366fa
Merge branch 'v3' of github.com:percona/pmm into PMM-13722-pmm-naviga…
matejkubinec Apr 24, 2025
a5acb1f
PMM-13722 Refactor messenger & add unit tests
matejkubinec Apr 25, 2025
fcb460b
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Apr 25, 2025
d74c221
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec May 15, 2025
2736334
PMM-13722 Adjust styles after grafana upgrade
matejkubinec May 15, 2025
b70fc0f
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec May 15, 2025
b72805b
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec May 19, 2025
15444ca
PMM-13722 Handle linking to home page
matejkubinec May 30, 2025
8da5c8c
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec May 30, 2025
66ed932
PMM-13722 Update documentation and cleanup code
matejkubinec May 30, 2025
074e8f8
PMM-13722 Added in license, author fields and misc cleanup
matejkubinec May 30, 2025
5904b1d
PMM-13722 Adjust styling
matejkubinec May 30, 2025
dcd2199
PMM-13722 Add in some navigation items
matejkubinec Jun 2, 2025
7f5acc5
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Jun 2, 2025
d86f9eb
PMM-13722 Run linter
matejkubinec Jun 2, 2025
64d38ac
PMM-13722 Format code
matejkubinec Jun 2, 2025
995bb86
PMM-13722 Fix home link
matejkubinec Jun 2, 2025
9831ab5
PMM-13722 Address feedback, remove logs
matejkubinec Jun 3, 2025
e1cfaac
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Jun 3, 2025
b17ce97
PMM-13722 Change grafana_image to oss
matejkubinec Jun 3, 2025
fa48198
PMM-13722 Adjust according to comments
matejkubinec Jun 10, 2025
52928c5
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Jun 10, 2025
7257951
PMM-13722 Re-enable kiosk mode, shortcuts & search
matejkubinec Jun 23, 2025
0a523b8
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Jun 23, 2025
9ae68a3
PMM-13722 Replace require with import
matejkubinec Jun 23, 2025
886bd8c
PMM-13722 Handle anonymous mode
matejkubinec Jun 30, 2025
59a8da9
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Jun 30, 2025
71608a0
PMM-13722 Fix lint
matejkubinec Jun 30, 2025
965db57
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Jun 30, 2025
051ab47
Merge branch 'PMM-13652-native-navigation' into PMM-13722-pmm-navigat…
matejkubinec Jul 1, 2025
51a5c05
Bump crate-ci/typos from 1.33.1 to 1.34.0 (#4190)
dependabot[bot] Jul 1, 2025
a298f48
PMM-12548 Doc for Mongolog query source. (#4171)
JiriCtvrtka Jul 2, 2025
285f0be
PMM-13978 Perfschema query examples (#4172)
JiriCtvrtka Jul 2, 2025
7c63f77
[DOCS] Improve HA topic (#3511)
catalinaadam Jul 3, 2025
6ca5341
PMM-14151 Fix TlsSkipVerify value in GetAgent response (#4198)
ademidoff Jul 3, 2025
094375f
PMM-13722 Handle browser history & document title
matejkubinec Jul 8, 2025
00c8293
Merge branch 'v3' into PMM-13722-pmm-navigation-iframe
matejkubinec Jul 8, 2025
a49a496
Merge branch 'PMM-13652-native-navigation' into PMM-13722-pmm-navigat…
matejkubinec Jul 8, 2025
247935e
PMM-13722 Add in missing prop value
matejkubinec Jul 8, 2025
c281e19
PMM-13722 Add in missing provider value in tests
matejkubinec Jul 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build/ansible/roles/grafana/files/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ enabled = true

[plugins]
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
allow_loading_unsigned_plugins = grafana-polystat-panel,pmm-app,pmm-check-panel-home,pmm-update,pmm-qan-app-panel,pmm-pt-summary-panel,pmm-pt-summary-datasource
allow_loading_unsigned_plugins = pmm-app,pmm-check-panel-home,pmm-update,pmm-qan-app-panel,pmm-pt-summary-panel,pmm-pt-summary-datasource,pmm-compat-app

[feature_toggles]
# there are currently two ways to enable feature toggles in the `grafana.ini`.
Expand Down Expand Up @@ -111,6 +111,10 @@ angularDeprecationUI = false
# Hide "Migrate to Grafana Cloud" option
onPremToCloudMigrations = false

[security]
# Enable inclusion of grafana into an iframe
allow_embedding = true

#################################### Support Bundles #####################################
[support_bundles]
# Enable support bundle creation (default: true)
Expand Down
3 changes: 3 additions & 0 deletions build/ansible/roles/grafana/files/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ apiVersion: 1
apps:
- type: pmm-app
uid: pmm-app
# Don't enable by default until new navigation is ready
# - type: pmm-compat-app
# uid: pmm-compat-app
2 changes: 1 addition & 1 deletion build/ansible/roles/nginx/files/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ http {

## TODO https://jira.percona.com/browse/PMM-4670
# CWE-693, CWE-16
add_header X-Frame-Options DENY;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
# TODO X-XSS-Protection useless for modern browsers which support CSP. We need to implement CSP instead.
add_header X-XSS-Protection "1; mode=block";
Expand Down
8 changes: 7 additions & 1 deletion build/packages/rpm/server/SPECS/pmm-managed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ install -d -p %{buildroot}%{_bindir}
install -d -p %{buildroot}%{_sbindir}
install -d -p %{buildroot}%{_datadir}/%{name}
install -d -p %{buildroot}%{_datadir}/pmm-ui
install -d -p %{buildroot}%{_datadir}/percona-dashboards/panels/pmm-compat-app
install -p -m 0755 bin/pmm-managed %{buildroot}%{_sbindir}/pmm-managed
install -p -m 0755 bin/pmm-encryption-rotation %{buildroot}%{_sbindir}/pmm-encryption-rotation
install -p -m 0755 bin/pmm-managed-init %{buildroot}%{_sbindir}/pmm-managed-init
install -p -m 0755 bin/pmm-managed-starlark %{buildroot}%{_sbindir}/pmm-managed-starlark

cd src/github.com/percona/pmm
cp -pa ./api/swagger %{buildroot}%{_datadir}/%{name}
cp -pa ./ui/dist/. %{buildroot}%{_datadir}/pmm-ui
cp -pa ./ui/apps/pmm/dist/. %{buildroot}%{_datadir}/pmm-ui
cp -pa ./ui/apps/pmm-compat/dist/. %{buildroot}%{_datadir}/percona-dashboards/panels/pmm-compat-app

%files
%license src/%{provider}/LICENSE
Expand All @@ -68,8 +70,12 @@ cp -pa ./ui/dist/. %{buildroot}%{_datadir}/pmm-ui
%{_sbindir}/pmm-managed-starlark
%{_datadir}/%{name}
%{_datadir}/pmm-ui
%{_datadir}/percona-dashboards/panels/pmm-compat-app

%changelog
* Thu Apr 24 2024 Matej Kubinec <[email protected]> - 3.2.0-1
- PMM-13722 add pmm compat plugin

* Mon Sep 23 2024 Jiri Ctvrtka <[email protected]> - 3.0.0-1
- PMM-13132 add PMM encryption rotation tool

Expand Down
54 changes: 33 additions & 21 deletions ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
.pnp.js

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
build
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

testdata/*
# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
.DS_Store
*.pem
7 changes: 7 additions & 0 deletions ui/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"eslint.workingDirectories": [
{
"mode": "auto"
}
]
}
4 changes: 2 additions & 2 deletions ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ test: setup
yarn test

setup:
yarn install --frozen-lockfile
yarn install

build: setup
yarn build

release: build

clean:
rm -r dist
yarn clean
12 changes: 11 additions & 1 deletion ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Make sure you have the following installed:

This repo uses the following stack across its packages:

- Yarn to manage packages (https://yarnpkg.com/)
- Yarn (https://yarnpkg.com/)
- Turborepo (https://turborepo.com/)
- Typescript (https://www.typescriptlang.org/);
- React (https://react.dev/);
- Rollup to bundle the different common packages (https://rollupjs.org/);
Expand All @@ -44,3 +45,12 @@ make dev
```bash
make build
```

## Apps

- **pmm** - main PMM UI application
- **pmm-compat** - Grafana plugin that handles communication between Grafana and PMM UI

## Packages

- **shared** - common code between applications
3 changes: 3 additions & 0 deletions ui/apps/pmm-compat/.config/.cprc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "5.19.0"
}
31 changes: 31 additions & 0 deletions ui/apps/pmm-compat/.config/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
*
* In order to extend the configuration follow the steps in
* https://grafana.com/developers/plugin-tools/get-started/set-up-development-environment#extend-the-eslint-config
*/
{
"extends": ["@grafana/eslint-config"],
"root": true,
"rules": {
"react/prop-types": "off"
},
"overrides": [
{
"plugins": ["deprecation"],
"files": ["src/**/*.{ts,tsx}"],
"rules": {
"deprecation/deprecation": "warn"
},
"parserOptions": {
"project": "./tsconfig.json"
}
},
{
"files": ["./tests/**/*"],
"rules": {
"react-hooks/rules-of-hooks": "off"
}
}
]
}
16 changes: 16 additions & 0 deletions ui/apps/pmm-compat/.config/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
*
* In order to extend the configuration follow the steps in .config/README.md
*/

module.exports = {
endOfLine: 'auto',
printWidth: 120,
trailingComma: 'es5',
semi: true,
jsxSingleQuote: false,
singleQuote: true,
useTabs: false,
tabWidth: 2,
};
54 changes: 54 additions & 0 deletions ui/apps/pmm-compat/.config/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ARG grafana_version=latest
ARG grafana_image=oss

FROM grafana/${grafana_image}:${grafana_version}

ARG anonymous_auth_enabled=true
ARG development=false
ARG TARGETARCH


ENV DEV="${development}"

# Make it as simple as possible to access the grafana instance for development purposes
# Do NOT enable these settings in a public facing / production grafana instance
ENV GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
ENV GF_AUTH_ANONYMOUS_ENABLED="${anonymous_auth_enabled}"
ENV GF_AUTH_BASIC_ENABLED=false
# Set development mode so plugins can be loaded without the need to sign
ENV GF_DEFAULT_APP_MODE=development


LABEL maintainer="Grafana Labs <[email protected]>"

ENV GF_PATHS_HOME="/usr/share/grafana"
WORKDIR $GF_PATHS_HOME

USER root

# Installing supervisor and inotify-tools
RUN if [ "${development}" = "true" ]; then \
if grep -i -q alpine /etc/issue; then \
apk add supervisor inotify-tools git; \
elif grep -i -q ubuntu /etc/issue; then \
DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y supervisor inotify-tools git && \
rm -rf /var/lib/apt/lists/*; \
else \
echo 'ERROR: Unsupported base image' && /bin/false; \
fi \
fi

COPY supervisord/supervisord.conf /etc/supervisor.d/supervisord.ini
COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf



# Inject livereload script into grafana index.html
RUN sed -i 's|</body>|<script src="http://localhost:35729/livereload.js"></script></body>|g' /usr/share/grafana/public/views/index.html


COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
Loading
Loading