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,9 +272,18 @@
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
complete: function(xhr) {
|
complete: function(xhr) {
|
||||||
if (xhr.readyState === 4 && xhr.status === 201) {
|
if (xhr.readyState === 4 && xhr.status === 201) {
|
||||||
result = true;
|
result = true;
|
||||||
} else {
|
} 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) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
<button id="confirmDocImport" class="button-success btn-old-padding" style="float:right" disabled>
|
<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
|
<img id="uploadIndicator" class="upload-indicator" src="img/ajax-loader.gif"/>Import JSON
|
||||||
</button>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -195,13 +195,11 @@
|
||||||
this.showSpinner();
|
this.showSpinner();
|
||||||
result = this.collection.uploadDocuments(this.file);
|
result = this.collection.uploadDocuments(this.file);
|
||||||
if (result !== true) {
|
if (result !== true) {
|
||||||
this.hideSpinner();
|
this.hideSpinner();
|
||||||
if (result.substr(0, 5 ) === "Error") {
|
this.hideImportModal();
|
||||||
this.hideImportModal();
|
this.resetView();
|
||||||
this.resetView();
|
arangoHelper.arangoError(result);
|
||||||
}
|
return;
|
||||||
arangoHelper.arangoError(result);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this.hideSpinner();
|
this.hideSpinner();
|
||||||
this.hideImportModal();
|
this.hideImportModal();
|
||||||
|
|
Loading…
Reference in New Issue