Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Improve GUI handler. #7290
Conversation
| } | ||
| // serveStatic serves the GUI static files. | ||
| func (h *guiHandler) serveStatic(w http.ResponseWriter, req *http.Request) { | ||
| + logger.Debugf("serving Juju GUI static files") |
hatched
Apr 28, 2017
Owner
should this not print out the path it's serving as well? Also for the other new serve logs below
|
QA OK |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Generating tarball failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
frankban commentedApr 27, 2017
•
Edited 1 time
-
frankban
Apr 27, 2017
Avoid using too much logic on the server side, and support all URLs starting from /gui/.
The GUI knows how to handle model connections based on the path.
This change fixes some weird issues in which some valid paths from the perspective of the GUI (for instance /u/{user}, the profile page) were not valid from the handler perspective, resulting in errors after refreshing.
This branch also simplifies the URLs for static files to no longer assume there is always a model connected.
QA:
juju bootstrap lxd local --config identity-url=https://api.jujucharms.com/identity --build-agent);juju gui --browser, then visit the GUI, log in and check that everything works correctly;/gui/u/bac;juju show-model | grep model-uuidto find your current model UUID, copy that and use that to make a request to the legacy GUI URL, like/gui/753a800d-80de-4d13-8552-e972376b5946: ensure everything works well in that case, and the GUI handler still handles correctly requests from old Juju clients; the whole URL is considered the base for the GUI, as it used to be;juju upgrade-gui 2.2.0in order to install an old version of the GUI, which didn't support the new "/u/user/model" paths;juju gui --browseragain, and check that even this old version works.