-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate_file_report.html
More file actions
109 lines (98 loc) · 3.48 KB
/
create_file_report.html
File metadata and controls
109 lines (98 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{% set page_title = 'File Report' %}
<title>{{ page_title }}</title>
{% set bloom_mod = 'dewey' %}
<link rel="stylesheet" type="text/css" href="{{ style.skin_css }}">
<link rel="stylesheet" type="text/css" href="/static/style.css">
<script src="static/action_buttons.js"></script>
<style>
.floating-button {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #008CBA; /* Blue background */
color: white; /* White text */
border: none;
padding: 15px;
border-radius: 50%;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
}
</style>
<script>
function downloadTableAsTSV() {
const table = document.querySelector('table');
if (!table) {
alert('No table found!');
return;
}
let tsv = [];
const rows = table.querySelectorAll('tr');
for (const row of rows) {
const cols = row.querySelectorAll('td, th');
const rowData = [];
for (const col of cols) {
rowData.push(col.innerText);
}
tsv.push(rowData.join('\t'));
}
const tsvFile = new Blob([tsv.join('\n')], { type: 'text/tsv' });
const downloadLink = document.createElement('a');
const now = new Date();
const timestamp = now.getFullYear() + "-" +
(now.getMonth() + 1).toString().padStart(2, '0') + "-" +
now.getDate().toString().padStart(2, '0') + "_" +
now.getHours().toString().padStart(2, '0') + "-" +
now.getMinutes().toString().padStart(2, '0') + "-" +
now.getSeconds().toString().padStart(2, '0');
downloadLink.download = `dewey_file_create_log_${timestamp}.tsv`;
downloadLink.href = window.URL.createObjectURL(tsvFile);
downloadLink.style.display = 'none';
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
}
</script>
</head>
<body>
{% include 'bloom_header.html' %}
<h1>Create File Report</h1>
{% if file_set_euid %}
<p>File Set:
<a target="_blank" href="euid_details?euid={{ file_set_euid }}">
{{ file_set_name }}
</a>
</p>
{% endif %}
<hr>
<table>
<thead>
<tr>
<th>Identifier</th>
<th>Status</th>
<th>Original File Name/URL</th>
<th>S3 URI</th>
</tr>
</thead>
<tbody>
{% for result in results %}
<tr>
<td><a target=newxx href="euid_details?euid={{ result.identifier }}">{{ result.identifier }}</a></td>
<td>{{ result.status }}</td>
<td>{{ result.original }}</td>
<td>{{ result.current_s3_uri }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<hr>
<a href="/dewey">Back to Create File Form</a>
<button class="floating-button" onclick="downloadTableAsTSV()">⬇️</button>
</body>
</html>