Commit 43539bb
committed
fix: Grafana monitoring page iframe embedding and dynamic cluster configuration
This commit resolves multiple issues with Grafana integration in the dashboard:
1. **Fixed 405 Method Not Allowed on Grafana login**
- Updated router.go to properly detect Grafana login requests
- Added Content-Type header checking for POST login requests
- Grafana uses application/json while ChatUI uses form data
2. **Fixed localhost redirect loop after Grafana login**
- Added comprehensive Grafana server configuration
- Set GF_SERVER_ROOT_URL to Grafana's own route
- Added GF_SERVER_PROTOCOL=http to prevent HTTPS redirect loop
- Enabled anonymous access to avoid login redirects in iframe
3. **Fixed frontend iframe redirect loop**
- Removed two-step load process causing infinite redirects
- Load dashboard directly via goto endpoint
- Eliminated automatic redirect logic from useEffect
4. **Made Grafana configuration cluster-agnostic**
- Changed deployment.yaml to use DYNAMIC_GRAFANA_ROUTE_URL placeholder
- Updated deploy-to-openshift.sh to dynamically substitute route URL
- Configuration now works across different OpenShift clusters
Changes:
- dashboard/backend/router/router.go: Enhanced login routing logic
- dashboard/frontend/src/pages/MonitoringPage.tsx: Direct dashboard loading
- deploy/openshift/observability/grafana/deployment.yaml: Dynamic URL configuration
- deploy/openshift/deploy-to-openshift.sh: Added dynamic route URL substitution
Signed-off-by: szedan <szedan@redhat.com>1 parent bc80d0d commit 43539bb
File tree
3 files changed
+56
-34
lines changed- dashboard/frontend/src/pages
- deploy/openshift
- observability/grafana
3 files changed
+56
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
46 | 38 | | |
47 | | - | |
| 39 | + | |
48 | 40 | | |
49 | 41 | | |
50 | 42 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 43 | | |
67 | 44 | | |
68 | 45 | | |
| |||
95 | 72 | | |
96 | 73 | | |
97 | 74 | | |
98 | | - | |
| 75 | + | |
99 | 76 | | |
100 | 77 | | |
101 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
341 | | - | |
342 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
343 | 384 | | |
344 | 385 | | |
345 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
0 commit comments