-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add link to home page on swagger ui #12601
Conversation
Signed-off-by: a1012112796 <1012112796@qq.com>
You could go back via webbrowser's button. |
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## master #12601 +/- ##
==========================================
- Coverage 43.43% 43.41% -0.03%
==========================================
Files 645 645
Lines 71288 71288
==========================================
- Hits 30967 30948 -19
- Misses 35309 35321 +12
- Partials 5012 5019 +7
Continue to review full report at Codecov.
|
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.
Can you put that link in the top-right of the page. I think it should not disrupt the page layout like that. Something like:
.swagger-back-link {
position: absolute;
top: 1rem;
right: 1rem;
}
Please cherry-pick silverwind@7f9d52e. |
@silverwind Looks good to me, Thanks |
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.
Actually I think we can window.history.back()
to return the user to the page they came frome instead of /
, will provide you another patch for that.
Hmm it's not impossible but not a simple implementation either. We can't be certain that a browser sends a referrer header (some don't in private mode) so we'd need to enumerate the browser history entries and find the first one that matches the origin but not the swagger page. Probably too much work and could be prone to break so this is LGTM. |
🚀 |
As title. I think it's useful. After view api documentation, maybe you will want to return to the home page.
example view: