constantinSch commited on
Commit
44eddd9
·
1 Parent(s): b0eb97c

Add export button and functionality for annotations in the UI

Browse files
Files changed (1) hide show
  1. index.html +20 -0
index.html CHANGED
@@ -14,6 +14,11 @@
14
  position: sticky; top: 0; z-index: 10;
15
  }
16
  header h1 { font-size: 17px; font-weight: 600; white-space: nowrap; }
 
 
 
 
 
17
  .progress-box { margin-left: auto; font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 10px; }
18
  .progress-bar { width: 120px; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
19
  .progress-fill { height: 100%; background: #22c55e; transition: width .3s; }
@@ -219,6 +224,7 @@
219
 
220
  <header>
221
  <h1>Zusammenfassungs-Evaluation</h1>
 
222
  <div class="progress-box">
223
  <span id="progress-text">-</span>
224
  <div class="progress-bar"><div class="progress-fill" id="progress-fill" style="width:0"></div></div>
@@ -681,6 +687,20 @@ function toggleOriginal() {
681
  arrow.classList.toggle("open");
682
  }
683
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  /* ---------- Init ---------- */
685
  checkAuth();
686
  </script>
 
14
  position: sticky; top: 0; z-index: 10;
15
  }
16
  header h1 { font-size: 17px; font-weight: 600; white-space: nowrap; }
17
+ .btn-export {
18
+ padding: 4px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 4px;
19
+ background: transparent; color: #fff; font-size: 12px; cursor: pointer;
20
+ }
21
+ .btn-export:hover { background: rgba(255,255,255,.1); }
22
  .progress-box { margin-left: auto; font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 10px; }
23
  .progress-bar { width: 120px; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
24
  .progress-fill { height: 100%; background: #22c55e; transition: width .3s; }
 
224
 
225
  <header>
226
  <h1>Zusammenfassungs-Evaluation</h1>
227
+ <button class="btn-export" onclick="exportAnnotations()">Export</button>
228
  <div class="progress-box">
229
  <span id="progress-text">-</span>
230
  <div class="progress-bar"><div class="progress-fill" id="progress-fill" style="width:0"></div></div>
 
687
  arrow.classList.toggle("open");
688
  }
689
 
690
+ /* ---------- Export ---------- */
691
+
692
+ async function exportAnnotations() {
693
+ const res = await fetch("/api/export", { headers: authHeaders() });
694
+ if (!res.ok) { showToast("Export fehlgeschlagen", "error"); return; }
695
+ const blob = await res.blob();
696
+ const url = URL.createObjectURL(blob);
697
+ const a = document.createElement("a");
698
+ a.href = url;
699
+ a.download = "annotations.jsonl";
700
+ a.click();
701
+ URL.revokeObjectURL(url);
702
+ }
703
+
704
  /* ---------- Init ---------- */
705
  checkAuth();
706
  </script>