mirror of
https://github.com/karma-riuk/crab-webapp.git
synced 2025-07-05 14:18:12 +02:00
unified the styles of the ids
This commit is contained in:
@ -20,30 +20,30 @@
|
|||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><strong>Download a Dataset</strong></legend>
|
<legend><strong>Download a Dataset</strong></legend>
|
||||||
<label for="datasetSelect">Dataset:</label>
|
<label for="dataset-select">Dataset:</label>
|
||||||
<select id="datasetSelect">
|
<select id="dataset-select">
|
||||||
<option value="comment_generation">Comment Generation</option>
|
<option value="comment_generation">Comment Generation</option>
|
||||||
<option value="code_refinement">Code Refinement</option>
|
<option value="code_refinement">Code Refinement</option>
|
||||||
</select>
|
</select>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="withContext">
|
<input type="checkbox" id="with-context">
|
||||||
Include context
|
Include context
|
||||||
</label>
|
</label>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<button id="downloadBtn">Download</button>
|
<button id="download-dataset">Download</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><strong>Upload Your Answers</strong></legend>
|
<legend><strong>Upload Your Answers</strong></legend>
|
||||||
<label for="answerType">Type:</label>
|
<label for="answer-cype">Type:</label>
|
||||||
<select id="answerType">
|
<select id="answer-cype">
|
||||||
<option value="comments">Comment Generation</option>
|
<option value="comments">Comment Generation</option>
|
||||||
<option value="refinement">Code Refinement</option>
|
<option value="refinement">Code Refinement</option>
|
||||||
</select>
|
</select>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<input type="file" id="fileInput" accept="application/json" />
|
<input type="file" id="file-cnput" accept="application/json" />
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<button id="uploadBtn">Upload JSON</button>
|
<button id="upload-btn">Upload JSON</button>
|
||||||
<span id="status" style="color: green;"> </span>
|
<span id="status" style="color: green;"> </span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
@ -57,7 +57,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="results-container">
|
<div id="results-container">
|
||||||
<h3>Results</h3>
|
<h3>Results<button id="download-results">Download</button></h3>
|
||||||
<table class="sortable">
|
<table class="sortable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -8,18 +8,18 @@ const statusEl = document.getElementById("status");
|
|||||||
const resultsContainer = document.getElementById("results-container");
|
const resultsContainer = document.getElementById("results-container");
|
||||||
|
|
||||||
// Download logic
|
// Download logic
|
||||||
document.getElementById("downloadBtn").onclick = () => {
|
document.getElementById("download-dataset").onclick = () => {
|
||||||
const ds = document.getElementById("datasetSelect").value;
|
const ds = document.getElementById("dataset-select").value;
|
||||||
const withCtx = document.getElementById("withContext").checked;
|
const withCtx = document.getElementById("with-context").checked;
|
||||||
const url =
|
const url =
|
||||||
`/datasets/download/${ds}` + (withCtx ? "?withContext=true" : "");
|
`/datasets/download/${ds}` + (withCtx ? "?withContext=true" : "");
|
||||||
window.location = url;
|
window.location = url;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Upload logic
|
// Upload logic
|
||||||
document.getElementById("uploadBtn").onclick = async () => {
|
document.getElementById("upload-btn").onclick = async () => {
|
||||||
const type = document.getElementById("answerType").value;
|
const type = document.getElementById("answer-cype").value;
|
||||||
const fileInput = document.getElementById("fileInput");
|
const fileInput = document.getElementById("file-cnput");
|
||||||
if (!fileInput.files.length) {
|
if (!fileInput.files.length) {
|
||||||
return alert("Please choose a JSON file first.");
|
return alert("Please choose a JSON file first.");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user