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

added copy to clipboard json_event #602

Merged
merged 3 commits into from
Sep 26, 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
3 changes: 3 additions & 0 deletions web/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@
document.getElementById("json_length").innerText = "";
renderjson.set_icons('▶','▼')
renderjson.set_collapse_msg(function (asd) {return "...";});
arr = [];
for (let i=1; i<=length; i++) {
value = document.getElementById("json_event_"+i).innerText;
arr.push(value);
document.getElementById("json_event_"+i).innerText = "";
document.getElementById("json_clipboard_"+i).addEventListener("click", function() { navigator.clipboard.writeText(arr[i-1]); });
document.getElementById("json_event_"+i).appendChild(renderjson(JSON.parse(value)));
}
</script>
Expand Down
3 changes: 3 additions & 0 deletions web/static/report/json_parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
document.getElementById("json_length").innerText = "";
renderjson.set_icons('▶','▼')
renderjson.set_collapse_msg(function (asd) {return "...";});
arr = [];
for (let i=1; i<=length; i++) {
value = document.getElementById("json_event_"+i).innerText;
arr.push(value);
document.getElementById("json_event_"+i).innerText = "";
document.getElementById("json_clipboard_"+i).addEventListener("click", function() { navigator.clipboard.writeText(arr[i-1]); });
document.getElementById("json_event_"+i).appendChild(renderjson(JSON.parse(value)));
}
</script>
5 changes: 4 additions & 1 deletion web/static/report/table_items.html
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td id="json_event_{5}">{6}</td></tr>
<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td><button id="json_clipboard_{5}"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.0486 7.94485V14.631C18.0486 15.3695 17.4499 15.9682 16.7114 15.9682C16.3421 15.9682 16.0428 15.6689 16.0428 15.2996V10.8466C16.0431 10.6428 15.9612 10.4475 15.8154 10.3051L13.4887 8.00502C13.0737 7.58342 12.5089 7.34306 11.9174 7.33641H9.3566C8.98734 7.33641 8.68799 7.03706 8.68799 6.66779V5.91894C8.68799 5.40885 8.89108 4.91975 9.25239 4.55968C9.61371 4.19962 10.1035 3.99823 10.6136 4.00001H14.164C14.666 4.00507 15.1461 4.20671 15.5012 4.56165L17.507 6.5675C17.8638 6.93614 18.0588 7.43192 18.0486 7.94485Z" fill="#22242B"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8124 10.6193L12.8065 8.61346C12.4522 8.25729 11.9716 8.05544 11.4693 8.05182H7.91893C6.85805 8.0555 5.99999 8.91655 6 9.97743V18.0744C6 19.1379 6.86213 20 7.92561 20H13.4684C14.5241 19.989 15.3741 19.1301 15.374 18.0744V11.9565C15.3792 11.4517 15.1873 10.9648 14.8391 10.5992L14.8124 10.6193Z" fill="#22242B"></path>
</svg></button><div id="json_event_{5}">{6}</div></td></tr>