-
Notifications
You must be signed in to change notification settings - Fork 6k
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
mgr/dashboard: Created a Download and Copy-to-Clipboard option for the logs #37193
Conversation
Nice & quick job, @nizamial09 ! I'd add some extra space between the icon and the Download text. And, coming back to the previous discussion, could you please provide additional screenshots for:
Thanks! |
Will do. |
@epuertat |
aad04cb
to
fb9ef6a
Compare
jenkins test dashboard |
@bk201 Yup. That really makes sense. Also the download button wont always be there. Whenever their is no log the button wont be present and if there is log available for one tab only then the icon is visible only for one tab. That wont be looking good I think. |
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.
Just an icon in the top right looks good.!
Thanks @aaSharma14 |
@nizamial09 I realy like @LenzGr's example, as also brings in another suggestion: having both clipboard + download buttons. An also like the subtle styling in those buttons... Red is too eye-catching for something that shouldn't divert attention from what is relevant there: logs and potential error conditions. |
Having a clipboard is a good suggestion. Also it feels good to make the icons light when I was trying it out. |
fb9ef6a
to
8bb23c5
Compare
@epuertat @LenzGr @bk201 @aaSharma14 Updated the PR with suggested change. Screenshot updated in description. |
8bb23c5
to
46b971e
Compare
jenkins test make check |
jenkins test dashboard |
@epuertat @votdev @tspmelo @LenzGr Screenshot for the log page is updated in description |
@nizamial09: JSON and Text vs. .json and .txt? What do you (and others) think? I would also suggest you to look for TXT and JSON icons (as we are also using icons for the download and copy buttons). |
I'm happy with eitherway (JSON and Text or .json and .txt). I'll try it locally. Also will ask for more opinions. |
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html
Outdated
Show resolved
Hide resolved
...gr/dashboard/frontend/src/app/shared/components/download-button/download-button.component.ts
Outdated
Show resolved
Hide resolved
I'd be in favor of "JSON" and "Text". |
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.
LGTM 👍
6eaaa28
to
52d0576
Compare
52d0576
to
1b672e0
Compare
@nizamial09 looks good! Thanks! |
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts
Outdated
Show resolved
Hide resolved
1b672e0
to
374b04c
Compare
@votdev PTAL, 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.
I'm missing a tooltip for the download button.
--- src/pybind/mgr/dashboard/frontend/src/app/shared/components/download-button/download-button.component.html (revision 2d99b415e52e1799dc4365752e798abb99bd7e71)
+++ src/pybind/mgr/dashboard/frontend/src/app/shared/components/download-button/download-button.component.html (date 1603355128415)
@@ -1,6 +1,7 @@
<div ngbDropdown
placement="bottom-right">
<button type="button"
+ [title]="title"
class="btn btn-light dropdown-toggle-split"
ngbDropdownToggle>
<i [ngClass]="[icons.download]"></i>
===================================================================
--- src/pybind/mgr/dashboard/frontend/src/app/shared/components/download-button/download-button.component.ts (revision 2d99b415e52e1799dc4365752e798abb99bd7e71)
+++ src/pybind/mgr/dashboard/frontend/src/app/shared/components/download-button/download-button.component.ts (date 1603356020873)
@@ -12,6 +12,7 @@
@Input() objectItem: object;
@Input() textItem: string;
@Input() fileName: any;
+ @Input() title = $localize`Download`;
icons = Icons;
constructor(private textToDownloadService: TextToDownloadService) {}
…e logs Created Download Button Component. Added a Download and Copy-to-Clipboard button for the Cluster and Audit Logs in the Log section. Also added a flag in the current Copy2ClipboardButton directive to indicate the incoming string is actually a log. Fixes: https://tracker.ceph.com/issues/47498 Signed-off-by: Nizamudeen A <[email protected]>
374b04c
to
f4c3ac1
Compare
Thanks @votdev Addressed and pushed the changes. |
jenkins test api |
1 similar comment
jenkins test api |
I've created a Download-button component which can be used to download .json and .txt file (either or both). This component is also now used in the telemetry component where it downloads the report.json file.
Added a Download and Copy-to-Clipboard button for the Cluster and Audit Logs in the Log section. Also added a flag in the current Copy2ClipboardButton directive to indicate the incoming string is actually a log.
Sample log files
audit_log_16_09_2020.log
cluster_log_16_09_2020.log
Fixes: https://tracker.ceph.com/issues/47498
Signed-off-by: Nizamudeen A [email protected]
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox