Skip to content
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

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

nizamial09-zz
Copy link

@nizamial09-zz nizamial09-zz commented Sep 16, 2020

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

log_download

Fixes: https://tracker.ceph.com/issues/47498
Signed-off-by: Nizamudeen A [email protected]

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

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

@nizamial09-zz nizamial09-zz requested a review from a team as a code owner September 16, 2020 14:02
@nizamial09-zz nizamial09-zz added dashboard feature skip-teuthology For PRs whose changes do not have an effect on QA runs/changes are not being tested in Teuthology labels Sep 16, 2020
@epuertat
Copy link
Member

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:

  • Icon only, no text and in the same place.
  • Icon only, no text, but within the tab heading area: once together with "Cluster Logs", and another one with "Audit Logs"?

Thanks!

@nizamial09-zz
Copy link
Author

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:

  • Icon only, no text and in the same place.
  • Icon only, no text, but within the tab heading area: once together with "Cluster Logs", and another one with "Audit Logs"?

Thanks!

Will do.

@nizamial09-zz
Copy link
Author

@epuertat
Icon only, no text and in the same place.
icon_only_same_place

**Icon only and along with Tab Heading (btn-accent) **
btn-accent

Same with btn-light
btn-light

When only one of the log entry present
btn-light2

@nizamial09-zz
Copy link
Author

jenkins test dashboard

@bk201
Copy link
Contributor

bk201 commented Sep 17, 2020

**Icon only and along with Tab Heading (btn-accent) **

I feel it's a bit odd to add the button to the tab heading, normally it's a better place for infomation badges.
For example, on this Github pull request page, there are badges that indicate number of items.

Screen Shot 2020-09-17 at 4 50 26 PM

@nizamial09-zz
Copy link
Author

**Icon only and along with Tab Heading (btn-accent) **

I feel it's a bit odd to add the button to the tab heading, normally it's a better place for infomation badges.
For example, on this Github pull request page, there are badges that indicate number of items.

Screen Shot 2020-09-17 at 4 50 26 PM

@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.

@LenzGr
Copy link
Contributor

LenzGr commented Sep 17, 2020

For the record, here's how Jenkins is doing it in their "Blue" theme:
Screenshot from 2020-09-17 11-07-59

I think I too would prefer just an icon (red is fine) in the top right. Would it make sense to have it above the log output area? How would that look?

Copy link
Contributor

@aaSharma14 aaSharma14 left a 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.!

@nizamial09-zz
Copy link
Author

For the record, here's how Jenkins is doing it in their "Blue" theme:
Screenshot from 2020-09-17 11-07-59

I think I too would prefer just an icon (red is fine) in the top right. Would it make sense to have it above the log output area? How would that look?

I'll try like that and I'll get back.

@nizamial09-zz
Copy link
Author

Just an icon in the top right looks good.!

Thanks @aaSharma14

@epuertat
Copy link
Member

@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.

@nizamial09-zz
Copy link
Author

@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.

@nizamial09-zz
Copy link
Author

nizamial09-zz commented Sep 18, 2020

@epuertat @LenzGr @bk201 @aaSharma14 Updated the PR with suggested change. Screenshot updated in description.

@nizamial09-zz nizamial09-zz changed the title mgr/dashboard: Created a Download option for the logs mgr/dashboard: Created a Download and Copy-to-Clipboard option for the logs Sep 18, 2020
@nizamial09-zz
Copy link
Author

jenkins test make check

@nizamial09-zz
Copy link
Author

jenkins test dashboard

@nizamial09 nizamial09 requested a review from votdev October 7, 2020 08:25
@nizamial09
Copy link
Member

@epuertat @votdev @tspmelo @LenzGr
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.
Screenshot of telemetry component.
telemetry

Screenshot for the log page is updated in description

@epuertat
Copy link
Member

epuertat commented Oct 7, 2020

@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).

@nizamial09
Copy link
Member

@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.

@LenzGr
Copy link
Contributor

LenzGr commented Oct 8, 2020

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'd be in favor of "JSON" and "Text".

Copy link
Member

@s0nea s0nea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@nizamial09
Copy link
Member

nizamial09 commented Oct 19, 2020

@epuertat @LenzGr Updated the PR with dropdown texts as JSON and Text and also added the logos. Screenshot is updated.

@epuertat
Copy link
Member

@nizamial09 looks good! Thanks!

@nizamial09
Copy link
Member

@votdev PTAL, thanks.

Copy link
Member

@votdev votdev left a 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]>
@nizamial09
Copy link
Member

[title]="title"

Thanks @votdev Addressed and pushed the changes.

@nizamial09
Copy link
Member

jenkins test api

1 similar comment
@votdev
Copy link
Member

votdev commented Oct 23, 2020

jenkins test api

@LenzGr LenzGr merged commit 6434564 into ceph:master Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard feature skip-teuthology For PRs whose changes do not have an effect on QA runs/changes are not being tested in Teuthology
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants