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

[digdag-ui] added a button to copy logs to clipboard #1760

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions digdag-ui/console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
faAngleDown,
faSignOutAlt,
faCheckCircle,
faCopy,
faExclamationCircle,
faPlayCircle,
faSyncAlt
Expand Down Expand Up @@ -2031,6 +2032,17 @@ class LogFileView extends React.Component<LogFileViewProps> {

<div className='card bg-light my-2'>
<div className='card-body p-2'>
<button
className="btn btn-sm btn-outline-secondary copy-btn"
title="Copy to clipboard"
onClick={() =>
navigator.clipboard.writeText(
pako.inflate(this.state.data, { to: "string" })
)
}
>
<FontAwesomeIcon icon={faCopy} />
</button>
<pre className='m-0 small'>
<code>
{pako.inflate(this.state.data, { to: 'string' })}
Expand Down
9 changes: 9 additions & 0 deletions digdag-ui/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,12 @@ pre {
padding-top: 50px;
margin-top: -50px;
}

.copy-btn {
display: flex;
margin-left: auto;
visibility: hidden;
:hover > & {
visibility: visible;
}
}