mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
589804303b
|
@ -80,6 +80,7 @@ WIKI = \
|
|||
SimpleQueries \
|
||||
Transactions \
|
||||
Upgrading \
|
||||
UpgradingGeneral \
|
||||
Upgrading11 \
|
||||
Upgrading12 \
|
||||
Upgrading13 \
|
||||
|
|
|
@ -3,6 +3,7 @@ Upgrading ArangoDB{#Upgrading}
|
|||
|
||||
- @ref NewFeatures14
|
||||
- @ref Upgrading14
|
||||
- @ref UpgradingGeneral
|
||||
|
||||
Older Releases:
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
General upgrade information {#UpgradingGeneral}
|
||||
===============================================
|
||||
|
||||
@NAVIGATE_UpgradingGeneral
|
||||
@EMBEDTOC{UpgradingGeneralTOC}
|
||||
|
||||
Recommended upgrade procedure {#UpgradingGeneralIntroduction}
|
||||
=============================================================
|
||||
|
||||
To upgrade an existing ArangoDB database to a newer version of ArangoDB (e.g. 1.2 to 1.3, or 1.3 to 1.4), the following method is recommended:
|
||||
- Check the CHANGELOG for API or other changes in the new version of ArangoDB, and make sure your applications can deal with them
|
||||
- Stop the "old" arangod service or binary
|
||||
- Copy the entire "old" data directory to a safe place (that is, a backup)
|
||||
- Install the new version of ArangoDB and start the server with the `--upgrade` option once. This might write to the logfile of ArangoDB, so you may want to check the logs for any issues before going on.
|
||||
- Start the "new" arangod service or binary regularly and check the logs for any issues. When you're confident everything went well, you may want to check the database directory for any files with the ending `.old`. These files are created by ArangoDB during upgrades and can be safely removed manually later.
|
||||
|
||||
If anything goes wrong during or shortly after the upgrade:
|
||||
- Stop the "new" arangod service or binary
|
||||
- Revert to the "old" arangod binary and restore the "old" data directory
|
||||
- Start the "old" version again
|
||||
|
||||
It is not supported to use datafiles created or modified by a newer version of ArangoDB with an older ArangoDB version. For example, it is unsupported and is likely to cause problems when using 1.4 datafiles with an ArangoDB 1.3 instance.
|
|
@ -0,0 +1,4 @@
|
|||
TOC {#UpgradingGeneralTOC}
|
||||
==========================
|
||||
|
||||
- @ref UpgradingGeneralIntroduction
|
|
@ -27,7 +27,8 @@
|
|||
</div>
|
||||
<div id="aqlEditor"></div>
|
||||
<button id="submitQueryButton" class="btn btn-success">Submit</button>
|
||||
<div id="shortcutDiv"><b>Submit:</b> CTRL/CMD + Return ; <b>Undo:</b> CTRL/CMD + Z ; <b>Redo:</b> CTRL/CMD + SHIFT + Z </div>
|
||||
<div id="shortcutDiv"><b>Submit:</b> CTRL/CMD + Return ; <b>Undo:</b> CTRL/CMD + Z ; <b>Redo:</b> CTRL/CMD + SHIFT + Z ;
|
||||
<b>Toggle Comments:</b> CTRL/CMD + SHIFT + C </div>
|
||||
</div>
|
||||
|
||||
<div id="new-aql-query" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
|
||||
|
|
|
@ -38,46 +38,46 @@ var queryView = Backbone.View.extend({
|
|||
},
|
||||
|
||||
listenKey: function (e) {
|
||||
if (e.keyCode === 13) {
|
||||
this.saveAQL(e);
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
this.saveAQL(e);
|
||||
}
|
||||
},
|
||||
|
||||
clearOutput: function () {
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.setValue('');
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.setValue('');
|
||||
},
|
||||
|
||||
clearInput: function () {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
inputEditor.setValue('');
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
inputEditor.setValue('');
|
||||
},
|
||||
|
||||
smallOutput: function () {
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.getSession().foldAll();
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.getSession().foldAll();
|
||||
},
|
||||
|
||||
bigOutput: function () {
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.getSession().unfold();
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.getSession().unfold();
|
||||
},
|
||||
|
||||
aqlShortcuts: function (e) {
|
||||
if (e.ctrlKey && e.keyCode === 13) {
|
||||
this.submitQuery();
|
||||
}
|
||||
else if (e.metaKey && ! e.ctrlKey && e.keyCode === 13) {
|
||||
this.submitQuery();
|
||||
}
|
||||
else if (e.ctrlKey && e.keyCode === 90) {
|
||||
// TODO: undo/redo seems to work even without this. check if can be removed
|
||||
this.undoText();
|
||||
}
|
||||
else if (e.ctrlKey && e.shiftKey && e.keyCode === 90) {
|
||||
// TODO: undo/redo seems to work even without this. check if can be removed
|
||||
this.redoText();
|
||||
}
|
||||
if (e.ctrlKey && e.keyCode === 13) {
|
||||
this.submitQuery();
|
||||
}
|
||||
else if (e.metaKey && !e.ctrlKey && e.keyCode === 13) {
|
||||
this.submitQuery();
|
||||
}
|
||||
else if (e.ctrlKey && e.keyCode === 90) {
|
||||
// TODO: undo/redo seems to work even without this. check if can be removed
|
||||
this.undoText();
|
||||
}
|
||||
else if (e.ctrlKey && e.shiftKey && e.keyCode === 90) {
|
||||
// TODO: undo/redo seems to work even without this. check if can be removed
|
||||
this.redoText();
|
||||
}
|
||||
},
|
||||
|
||||
queries: [
|
||||
|
@ -89,19 +89,19 @@ var queryView = Backbone.View.extend({
|
|||
|
||||
render: function () {
|
||||
$(this.el).html(this.template.text);
|
||||
|
||||
|
||||
// fill select box with # of results
|
||||
var querySize = 1000;
|
||||
if (typeof Storage) {
|
||||
if (localStorage.getItem("querySize") > 0) {
|
||||
querySize = parseInt(localStorage.getItem("querySize"), 10);
|
||||
}
|
||||
if (localStorage.getItem("querySize") > 0) {
|
||||
querySize = parseInt(localStorage.getItem("querySize"), 10);
|
||||
}
|
||||
}
|
||||
|
||||
var sizeBox = $('#querySize');
|
||||
var sizeBox = $('#querySize');
|
||||
sizeBox.empty();
|
||||
[ 100, 250, 500, 1000, 2500, 5000 ].forEach(function (value) {
|
||||
sizeBox.append('<option value="' + value + '"' + (querySize === value ? ' selected' : '') + '>' + value + ' results</option>');
|
||||
sizeBox.append('<option value="' + value + '"' + (querySize === value ? ' selected' : '') + '>' + value + ' results</option>');
|
||||
});
|
||||
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
|
@ -112,60 +112,69 @@ var queryView = Backbone.View.extend({
|
|||
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
inputEditor.getSession().setMode("ace/mode/aql");
|
||||
inputEditor.commands.addCommand({
|
||||
name: "togglecomment",
|
||||
bindKey: {win:"Ctrl-Shift-C", linux:"Ctrl-Shift-C", mac:"Command-Shift-C"},
|
||||
exec: function (editor) {
|
||||
editor.toggleCommentLines();
|
||||
},
|
||||
multiSelectAction: "forEach"
|
||||
});
|
||||
|
||||
inputEditor.getSession().selection.on('changeCursor', function (e) {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var session = inputEditor.getSession();
|
||||
var cursor = inputEditor.getCursorPosition();
|
||||
var token = session.getTokenAt(cursor.row, cursor.column);
|
||||
if (token) {
|
||||
if (token.type === "comment") {
|
||||
$("#commentText")
|
||||
.removeClass("arango-icon-comment")
|
||||
.addClass("arango-icon-uncomment")
|
||||
.attr("data-original-title", "Uncomment");
|
||||
} else {
|
||||
$("#commentText")
|
||||
.addClass("arango-icon-comment")
|
||||
.removeClass("arango-icon-uncomment")
|
||||
.attr("data-original-title", "Comment");
|
||||
}
|
||||
}
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var session = inputEditor.getSession();
|
||||
var cursor = inputEditor.getCursorPosition();
|
||||
var token = session.getTokenAt(cursor.row, cursor.column);
|
||||
if (token) {
|
||||
if (token.type === "comment") {
|
||||
$("#commentText")
|
||||
.removeClass("arango-icon-comment")
|
||||
.addClass("arango-icon-uncomment")
|
||||
.attr("data-original-title", "Uncomment");
|
||||
} else {
|
||||
$("#commentText")
|
||||
.addClass("arango-icon-comment")
|
||||
.removeClass("arango-icon-uncomment")
|
||||
.attr("data-original-title", "Comment");
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#queryOutput').resizable({
|
||||
handles: "s",
|
||||
ghost: true,
|
||||
stop: function () {
|
||||
setTimeout(function () {
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.resize();
|
||||
}, 200);
|
||||
}
|
||||
handles: "s",
|
||||
ghost: true,
|
||||
stop: function () {
|
||||
setTimeout(function () {
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
outputEditor.resize();
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
$('#aqlEditor').resizable({
|
||||
handles: "s",
|
||||
ghost: true,
|
||||
//helper: "resizable-helper",
|
||||
stop: function () {
|
||||
setTimeout(function () {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
inputEditor.resize();
|
||||
}, 200);
|
||||
}
|
||||
handles: "s",
|
||||
ghost: true,
|
||||
//helper: "resizable-helper",
|
||||
stop: function () {
|
||||
setTimeout(function () {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
inputEditor.resize();
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
$('.queryTooltips').tooltip({
|
||||
placement: "top"
|
||||
placement: "top"
|
||||
});
|
||||
|
||||
$('#aqlEditor .ace_text-input').focus();
|
||||
$.gritter.removeAll();
|
||||
|
||||
if (typeof Storage) {
|
||||
var queryContent = localStorage.getItem("queryContent");
|
||||
var queryOutput = localStorage.getItem("queryOutput");
|
||||
inputEditor.setValue(queryContent);
|
||||
outputEditor.setValue(queryOutput);
|
||||
var queryContent = localStorage.getItem("queryContent");
|
||||
var queryOutput = localStorage.getItem("queryOutput");
|
||||
inputEditor.setValue(queryContent);
|
||||
outputEditor.setValue(queryOutput);
|
||||
}
|
||||
|
||||
var windowHeight = $(window).height() - 250;
|
||||
|
@ -357,9 +366,9 @@ var queryView = Backbone.View.extend({
|
|||
this.deselect(ace.edit("aqlEditor"));
|
||||
},
|
||||
changeSize: function (e) {
|
||||
if (Storage) {
|
||||
localStorage.setItem("querySize", parseInt($('#' + e.currentTarget.id).val(), 10));
|
||||
}
|
||||
if (Storage) {
|
||||
localStorage.setItem("querySize", parseInt($('#' + e.currentTarget.id).val(), 10));
|
||||
}
|
||||
},
|
||||
renderSelectboxes: function (modal) {
|
||||
this.sortQueries();
|
||||
|
@ -401,65 +410,65 @@ var queryView = Backbone.View.extend({
|
|||
},
|
||||
commentText: function () {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var value;
|
||||
var newValue;
|
||||
var flag = false;
|
||||
var cursorPosition = inputEditor.getCursorPosition();
|
||||
var cursorRange = inputEditor.getSelection().getRange();
|
||||
inputEditor.toggleCommentLines();
|
||||
|
||||
var regExp = new RegExp(/\*\//);
|
||||
var regExp2 = new RegExp(/\/\*/);
|
||||
|
||||
if (cursorRange.end.row === cursorRange.start.row) {
|
||||
//single line comment /* */
|
||||
value = inputEditor.getSession().getLine(cursorRange.start.row);
|
||||
if (value.search(regExp) === -1 && value.search(regExp2) === -1) {
|
||||
newValue = '/*' + value + '*/';
|
||||
flag = true;
|
||||
}
|
||||
else if (value.search(regExp) !== -1 && value.search(regExp2) !== -1) {
|
||||
newValue = value.replace(regExp, '').replace(regExp2, '');
|
||||
flag = true;
|
||||
}
|
||||
if (flag === true) {
|
||||
inputEditor.find(value, {
|
||||
range: cursorRange
|
||||
});
|
||||
inputEditor.replace(newValue);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//multi line comment
|
||||
value = inputEditor.getSession().getLines(cursorRange.start.row, cursorRange.end.row);
|
||||
var arrayLength = value.length;
|
||||
var firstString = value[0];
|
||||
var lastString = value[value.length - 1];
|
||||
var newFirstString;
|
||||
var newLastString;
|
||||
|
||||
if (firstString.search(regExp2) === -1 && lastString.search(regExp) === -1) {
|
||||
newFirstString = '/*' + firstString;
|
||||
newLastString = lastString + '*/';
|
||||
flag = true;
|
||||
}
|
||||
else if (firstString.search(regExp2) !== -1 && lastString.search(regExp) !== -1) {
|
||||
newFirstString = firstString.replace(regExp2, '');
|
||||
newLastString = lastString.replace(regExp, '');
|
||||
flag = true;
|
||||
}
|
||||
if (flag === true) {
|
||||
inputEditor.find(firstString, {
|
||||
range: cursorRange
|
||||
});
|
||||
inputEditor.replace(newFirstString);
|
||||
inputEditor.find(lastString, {
|
||||
range: cursorRange
|
||||
});
|
||||
inputEditor.replace(newLastString);
|
||||
}
|
||||
}
|
||||
cursorRange.end.column = cursorRange.end.column + 2;
|
||||
inputEditor.getSelection().setSelectionRange(cursorRange, false);
|
||||
// var value;
|
||||
// var newValue;
|
||||
// var flag = false;
|
||||
// var cursorRange = inputEditor.getSelection().getRange();
|
||||
//
|
||||
// var regExp = new RegExp(/\*\//);
|
||||
// var regExp2 = new RegExp(/\/\*/);
|
||||
//
|
||||
// if (cursorRange.end.row === cursorRange.start.row) {
|
||||
// //single line comment /* */
|
||||
// value = inputEditor.getSession().getLine(cursorRange.start.row);
|
||||
// if (value.search(regExp) === -1 && value.search(regExp2) === -1) {
|
||||
// newValue = '/*' + value + '*/';
|
||||
// flag = true;
|
||||
// }
|
||||
// else if (value.search(regExp) !== -1 && value.search(regExp2) !== -1) {
|
||||
// newValue = value.replace(regExp, '').replace(regExp2, '');
|
||||
// flag = true;
|
||||
// }
|
||||
// if (flag === true) {
|
||||
// inputEditor.find(value, {
|
||||
// range: cursorRange
|
||||
// });
|
||||
// inputEditor.replace(newValue);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// //multi line comment
|
||||
// value = inputEditor.getSession().getLines(cursorRange.start.row, cursorRange.end.row);
|
||||
// var firstString = value[0];
|
||||
// var lastString = value[value.length - 1];
|
||||
// var newFirstString;
|
||||
// var newLastString;
|
||||
//
|
||||
// if (firstString.search(regExp2) === -1 && lastString.search(regExp) === -1) {
|
||||
// newFirstString = '/*' + firstString;
|
||||
// newLastString = lastString + '*/';
|
||||
// flag = true;
|
||||
// }
|
||||
// else if (firstString.search(regExp2) !== -1 && lastString.search(regExp) !== -1) {
|
||||
// newFirstString = firstString.replace(regExp2, '');
|
||||
// newLastString = lastString.replace(regExp, '');
|
||||
// flag = true;
|
||||
// }
|
||||
// if (flag === true) {
|
||||
// inputEditor.find(firstString, {
|
||||
// range: cursorRange
|
||||
// });
|
||||
// inputEditor.replace(newFirstString);
|
||||
// inputEditor.find(lastString, {
|
||||
// range: cursorRange
|
||||
// });
|
||||
// inputEditor.replace(newLastString);
|
||||
// }
|
||||
// }
|
||||
// cursorRange.end.column = cursorRange.end.column + 2;
|
||||
// inputEditor.getSelection().setSelectionRange(cursorRange, false);
|
||||
},
|
||||
sortQueries: function () {
|
||||
this.queries = _.sortBy(this.queries, 'name');
|
||||
|
@ -467,11 +476,11 @@ var queryView = Backbone.View.extend({
|
|||
},
|
||||
submitQuery: function () {
|
||||
var self = this;
|
||||
var sizeBox = $('#querySize');
|
||||
var sizeBox = $('#querySize');
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var data = {
|
||||
query: inputEditor.getValue(),
|
||||
batchSize: parseInt(sizeBox.val(), 10)
|
||||
query: inputEditor.getValue(),
|
||||
batchSize: parseInt(sizeBox.val(), 10)
|
||||
};
|
||||
var outputEditor = ace.edit("queryOutput");
|
||||
|
||||
|
@ -482,25 +491,25 @@ var queryView = Backbone.View.extend({
|
|||
contentType: "application/json",
|
||||
processData: false,
|
||||
success: function (data) {
|
||||
outputEditor.setValue(arangoHelper.FormatJSON(data.result));
|
||||
if (typeof Storage) {
|
||||
localStorage.setItem("queryContent", inputEditor.getValue());
|
||||
localStorage.setItem("queryOutput", outputEditor.getValue());
|
||||
}
|
||||
self.deselect(outputEditor);
|
||||
outputEditor.setValue(arangoHelper.FormatJSON(data.result));
|
||||
if (typeof Storage) {
|
||||
localStorage.setItem("queryContent", inputEditor.getValue());
|
||||
localStorage.setItem("queryOutput", outputEditor.getValue());
|
||||
}
|
||||
self.deselect(outputEditor);
|
||||
},
|
||||
error: function (data) {
|
||||
try {
|
||||
var temp = JSON.parse(data.responseText);
|
||||
outputEditor.setValue('[' + temp.errorNum + '] ' + temp.errorMessage);
|
||||
var temp = JSON.parse(data.responseText);
|
||||
outputEditor.setValue('[' + temp.errorNum + '] ' + temp.errorMessage);
|
||||
|
||||
if (typeof Storage) {
|
||||
localStorage.setItem("queryContent", inputEditor.getValue());
|
||||
localStorage.setItem("queryOutput", outputEditor.getValue());
|
||||
}
|
||||
if (typeof Storage) {
|
||||
localStorage.setItem("queryContent", inputEditor.getValue());
|
||||
localStorage.setItem("queryOutput", outputEditor.getValue());
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
outputEditor.setValue('ERROR');
|
||||
outputEditor.setValue('ERROR');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -253,11 +253,6 @@ namespace triagens {
|
|||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup HttpServer
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue