mirror of https://gitee.com/bigwinds/arangodb
indicate at least some errors for failing uploads
This commit is contained in:
parent
123dc4be66
commit
cc9a26c268
|
@ -272,10 +272,19 @@
|
|||
dataType: 'json',
|
||||
complete: function(xhr) {
|
||||
if (xhr.readyState === 4 && xhr.status === 201) {
|
||||
result = true;
|
||||
result = true;
|
||||
} else {
|
||||
result = "Upload error";
|
||||
result = "Upload error";
|
||||
}
|
||||
|
||||
try {
|
||||
var data = JSON.parse(xhr.responseText);
|
||||
if (data.errors > 0) {
|
||||
result = "At least one error occurred during upload";
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
<button id="confirmDocImport" class="button-success btn-old-padding" style="float:right" disabled>
|
||||
<img id="uploadIndicator" class="upload-indicator" src="img/ajax-loader.gif"/>Import JSON
|
||||
</button>
|
||||
<div title='Example input data:</br></br> I. Line-wise: </br> { "_key": "key1", ... } { "_key": "key2", ... } or </br></br> II. JSON documents embedded into a list: </br> [ </br> { "_key": "key1", ... }, </br> { "_key": "key2", ... }, </br> ... </br> ]' class="upload-info" style="float:left; margin-top:7px; margin-right: 10px;"><i style="font-size: 13pt;" class="fa fa-info-circle"></i></div>
|
||||
<div title='Example input data:<br /><br /> I. Line-wise: <br /> { "_key": "key1", ... } <br /> { "_key": "key2", ... } <br /><br /> or <br /><br /> II. JSON documents embedded into a list: <br /> [ <br /> { "_key": "key1", ... }, <br /> { "_key": "key2", ... }, <br /> ... <br /> ]' class="upload-info" style="float:left; margin-top:7px; margin-right: 10px;"><i style="font-size: 13pt;" class="fa fa-info-circle"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -195,13 +195,11 @@
|
|||
this.showSpinner();
|
||||
result = this.collection.uploadDocuments(this.file);
|
||||
if (result !== true) {
|
||||
this.hideSpinner();
|
||||
if (result.substr(0, 5 ) === "Error") {
|
||||
this.hideImportModal();
|
||||
this.resetView();
|
||||
}
|
||||
arangoHelper.arangoError(result);
|
||||
return;
|
||||
this.hideSpinner();
|
||||
this.hideImportModal();
|
||||
this.resetView();
|
||||
arangoHelper.arangoError(result);
|
||||
return;
|
||||
}
|
||||
this.hideSpinner();
|
||||
this.hideImportModal();
|
||||
|
|
Loading…
Reference in New Issue