return'<tr><th scope="row">'+safename+'</th><td><a href="?type='+getType()+"&oid="+dataset[1]+'">'+dataset[1]+'</a></td><input class="form-check-input bulk-delete-checkboxes" type="checkbox" value="" id="'+dataset[1]+'"><td></td></tr>'// TODO add a checkbx that "knows" the oid somehow
}
/*
...
...
@@ -129,8 +129,17 @@ function getMetadataPropertyHTMLString(property, value, readonly=true) {
* collect metadata from any present metadata inputs. If none are there, return an empty dict.
varalertHTML='<div class="alert alert-danger" role="alert">Invalid response from server! Either the API server is down, or the dataset creation failed. Response code: '+this.status+'<hr>Please try agagin later, and if the error persists, contact the server administrator.</div>';
varalertHTML='<div class="alert alert-danger" role="alert">Invalid response from server! Either the API server is down, or the dataset creation failed. Response code: '+this.status+'<hr>Please try again later, and if the error persists, contact the server administrator.</div>';
$('#storageTypeChooser').after(alertHTML);
return;
}
...
...
@@ -218,7 +227,7 @@ function showSuccessfullyChangedDataset() {
if (this.status>=400){
// some error occured while getting the data
// show an alert and don't do anything else
varalertHTML='<div class="alert alert-danger" role="alert">Invalid response from server! Either the API server is down, or the dataset modification failed. Response code: '+this.status+'<hr>Please try agagin later, and if the error persists, contact the server administrator.</div>';
varalertHTML='<div class="alert alert-danger" role="alert">Invalid response from server! Either the API server is down, or the dataset modification failed. Response code: '+this.status+'<hr>Please try again later, and if the error persists, contact the server administrator.</div>';
$('#storageTypeChooser').after(alertHTML);
return;
}
...
...
@@ -228,18 +237,21 @@ function showSuccessfullyChangedDataset() {
}
// XMLHttpRequest EVENTLISTENER: show banner with success message for deletion
functionshowSuccessfullyDeletedDataset(){
functionsuccessfullyDeletedDataset(){
console.log("Response to DELETE dataset: "+this.responseText);
if (this.status>=400){
// some error occured while getting the data
// show an alert and don't do anything else
varalertHTML='<div class="alert alert-danger" role="alert">Invalid response from server! Either the API server is down, or the dataset deletion failed. Response code: '+this.status+'<hr>Please try agagin later, and if the error persists, contact the server administrator.</div>';
varalertHTML='<div class="alert alert-danger" role="alert">Invalid response from server! Either the API server is down, or the dataset deletion failed. Response code: '+this.status+'<hr>Please try again later, and if the error persists, contact the server administrator.</div>';
$('#storageTypeChooser').after(alertHTML);
return;
}
varalertHTML='<div class="alert alert-danger" role="alert">Dataset was successfully deleted!</div>';
$('#storageTypeChooser').after(alertHTML);
$('#spinner').remove();
// redirect to storage
window.location.replace("?type="+datatype);
}
// XMLHttpRequest EVENTLISTENER: show dataset in table
...
...
@@ -504,7 +516,7 @@ function deleteDataset(oid, datatype) {
varfullUrl=apiUrl+datatype+"/"+oid;
console.log("Sending DELETE request to "+fullUrl+" for deleting dataset.")