mirror of https://gitee.com/bigwinds/arangodb
a few small corrections in the upload web interface
This commit is contained in:
parent
a9c2dcc83d
commit
0e5c9c8a85
|
@ -5,7 +5,7 @@
|
|||
<!-- remove marker for docupdiv--!>
|
||||
<ul><li class="enabled"><a id="indexCollection"><span class="icon_arangodb_checklist" title="Index collection"></span></a></li></ul>
|
||||
<ul><li class="enabled"><a id="filterCollection"><span class="icon_arangodb_filter" title="Filter collection"></span></a></li></ul>
|
||||
<ul><li class="enabled"><a id="importCollection"><span class="icon_arangodb_import" title="Upload documents"></span></a></li></ul>
|
||||
<ul><li class="enabled"><a id="importCollection"><span class="icon_arangodb_import" title="Upload documents from JSON file"></span></a></li></ul>
|
||||
<ul>
|
||||
<li class="enabled"><a id="collectionPrev"><span class="icon_arangodb_arrowleft" title="Previous collection"></span></a></li>
|
||||
<li class="enabled"><a id="collectionNext"><span class="icon_arangodb_arrowright" title="Next collection"></span></a></li>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<div class="queryline">
|
||||
<input id="importDocuments" name="importDocuments" type="file" accept="application/json" />
|
||||
<button id="confirmDocImport" class="btn btn-success btn-old-padding" style="float:right">
|
||||
<img id="uploadIndicator" style="display: none;" src="img/ajax-loader.gif"/>Import
|
||||
<img id="uploadIndicator" style="display: none;" src="img/ajax-loader.gif"/>Import JSON
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
}
|
||||
|
||||
catch (e) {
|
||||
arangoHelper.arangoNotification("Error: "+ e);
|
||||
arangoHelper.arangoError("Error: " + e);
|
||||
self.hideSpinner();
|
||||
self.hideImportModal();
|
||||
self.resetView();
|
||||
|
@ -146,8 +146,8 @@
|
|||
}
|
||||
|
||||
if (data.errors === 0) {
|
||||
arangoHelper.arangoError("Upload successful. " +
|
||||
data.created + " document(s) imported.");
|
||||
arangoHelper.arangoNotification("Upload successful. " +
|
||||
data.created + " document(s) imported.");
|
||||
}
|
||||
else if (data.errors !== 0) {
|
||||
arangoHelper.arangoError("Upload failed." +
|
||||
|
@ -160,30 +160,20 @@
|
|||
}
|
||||
}
|
||||
self.hideSpinner();
|
||||
arangoHelper.arangoNotification("Upload error");
|
||||
arangoHelper.arangoError("Upload error");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
arangoHelper.arangoNotification("Unsupported filetype: " + self.file.type);
|
||||
}
|
||||
},
|
||||
|
||||
uploadSetup: function () {
|
||||
var self = this;
|
||||
|
||||
//$('#documentsUploadFile').change(function(e) {
|
||||
$('#importDocuments').change(function(e) {
|
||||
self.files = e.target.files || e.dataTransfer.files;
|
||||
self.file = self.files[0];
|
||||
|
||||
if (self.file.type !== 'application/json') {
|
||||
arangoHelper.arangoNotification("Unsupported filetype: " + self.file.type);
|
||||
self.allowUpload = false;
|
||||
}
|
||||
else {
|
||||
self.allowUpload = true;
|
||||
}
|
||||
self.allowUpload = true;
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue