Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

UI bug: dashboard has several Main menu. #916

Closed
qinchen123 opened this issue Jul 18, 2018 · 7 comments
Closed

UI bug: dashboard has several Main menu. #916

qinchen123 opened this issue Jul 18, 2018 · 7 comments
Assignees

Comments

@qinchen123
Copy link
Contributor

Please check the screenshot.
uibug

repro steps:
click -> Dashboards->home ->dashboards->home>dashboards->home

@Gerhut
Copy link
Member

Gerhut commented Jul 19, 2018

@YitongFeng Please config root_url with suffix /grafana by setting environment variable GF_SERVER_ROOT_URL of docker container.

Reference:

@Gerhut Gerhut assigned YitongFeng and unassigned Gerhut Jul 19, 2018
@YitongFeng
Copy link
Contributor

@Gerhut 's method works, and I deployed grafana at int bed http://10.151.40.234/dashboard.html , it fix qingcha's issue, but occurs another issue: if we don't use pylon to access dashboard http://10.151.40.234:9286/dashboard.html , it can't show grafana.

@hwuu suggested that we shouldn't let services rely on pylon, for we can remove pylon anytime if needed. So we should figure out a better way to solve this issue?

@fanyangCS
Copy link
Contributor

@YitongFeng , yes, grafana shouldn't rely on pylon.

@Gerhut
Copy link
Member

Gerhut commented Jul 20, 2018

Link of Dashboards -> Home is configured in

https://github.com/grafana/grafana/blob/v4.6.3/pkg/api/index.go#L88

which comes from setting.AppSubUrl, calculated from Grafana's root_url global configuration.

https://github.com/grafana/grafana/blob/v4.6.3/pkg/setting/setting.go#L190-L204

At present, when root_url is set in either config file or environment variable, it cannot be changed during the runtime, by our request URL in the browser.

So assume that we can only view Grafana from webportal, we can unified the uri of grafana in webportal and grafana, or, either environment configs works:

Without pylon

- webportal:
    - GRAFANA_URI: `http://hostname:3000/`
- grafana:
    - GF_SERVER_ROOT_URL: `http://hostname:3000/` # Current, default

With pylon

- webportal:
    - GRAFANA_URI: `http://hostname/grafana` # Configs in this issue
- grafana:
    - GF_SERVER_ROOT_URL: `http://hostname/grafana` # Which I recommends

If we need to support both http://host/grafana/ and http://host:3000/ works at the runtime, perhaps we should write a customize Grafana plugin to mock it?

@Gerhut
Copy link
Member

Gerhut commented Jul 20, 2018

There is another workaround is that disable webportal dashboard display in grafana area of webportal dashboard. It will keep the Grafana's Dashboard -> Home link to the webportal dashboard when it is opened by user in http://host/grafana/

@Gerhut
Copy link
Member

Gerhut commented Jul 24, 2018

Sorry for mislead the error cause, I found that the GRAFANA_URI of environment variable in web portal is configured correctly, as http://hostname:3000/. And it works fine by port 9286.

On port 80, the configuration of GRAFANA_URI is sub-filter-ed by pylon. which replaced http://hostname:3000/ with http://hostname/grafana. Although pylon also replaced the base href in grafana page with http://hostname/grafana/, Grafana resolved "Home" link as "/", which drops subdirectory of base href, resolved into http://hostname/

So it cannot be totally fixed in web portal, any good idea? @hwuu

@hwuu
Copy link
Contributor

hwuu commented Jul 25, 2018

@Gerhut Yes. This should be handled by Pylon. I will fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants