mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of ssh://github.com/ArangoDB/ArangoDB into devel
This commit is contained in:
commit
0ee64cfbfd
|
@ -11,7 +11,15 @@ if (OPENSSL_VERSION)
|
|||
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
|
||||
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
|
||||
if (${OPENSSL_VERSION_MAJOR} GREATER 0 AND ${OPENSSL_VERSION_MINOR} GREATER 0)
|
||||
add_definitions(-DOPENSSL_NO_SSL2)
|
||||
option(USE_OPENSSL_NO_SSL2
|
||||
"do not use OPENSSL_NO_SSL2"
|
||||
ON
|
||||
)
|
||||
else ()
|
||||
option(USE_OPENSSL_NO_SSL2
|
||||
"do not use OPENSSL_NO_SSL2"
|
||||
OFF
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ ExternalProject_Add(v8_build
|
|||
BUILD_IN_SOURCE TRUE
|
||||
SOURCE_DIR "${V8_DIR}"
|
||||
CONFIGURE_COMMAND ${PYTHON_EXECUTABLE} ${V8_GYP_ARGS}
|
||||
BUILD_COMMAND ${MAKE} ${V8_COMPILE_ARGS}
|
||||
BUILD_COMMAND $(MAKE) ${V8_COMPILE_ARGS}
|
||||
INSTALL_COMMAND "")
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -25,7 +25,7 @@ endif ()
|
|||
|
||||
find_package(Boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} EXACT COMPONENTS unit_test_framework)
|
||||
|
||||
if (${Boost_UNIT_TEST_FRAMEWORK_FOUND} STREQUAL "ON")
|
||||
if (DEFINED ${Boost_UNIT_TEST_FRAMEWORK_FOUND} AND ${Boost_UNIT_TEST_FRAMEWORK_FOUND} STREQUAL "ON")
|
||||
try_compile(
|
||||
HAVE_USABLE_BOOT_LIBRARIES
|
||||
"${CMAKE_BINARY_DIR}/temp"
|
||||
|
|
|
@ -453,6 +453,10 @@ add_definitions("-DARANGODB_LIBEV_VERSION=\"${LIBEV_VERSION}\"")
|
|||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
add_definitions(-DARANGODB_OPENSSL_VERSION=\"${BOOST_VERSION}\")
|
||||
|
||||
if (USE_OPENSSL_NO_SSL2)
|
||||
add_definitions(-DOPENSSL_NO_SSL2)
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## V8
|
||||
################################################################################
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
"frontend/js/lib/jquery.textfill.min.js",
|
||||
"frontend/js/lib/jquery.noty.packaged.min.js",
|
||||
"frontend/js/lib/select2.min.js",
|
||||
"frontend/js/lib/typeahead.bundle.min.js",
|
||||
"frontend/js/lib/numeral.min.js",
|
||||
"frontend/js/lib/sigma.min.js",
|
||||
"frontend/js/lib/jsoneditor-min.js",
|
||||
|
|
|
@ -257,6 +257,11 @@
|
|||
window.App.notificationList.add({title:title, content: content, info: info, type: 'error'});
|
||||
},
|
||||
|
||||
hideArangoNotifications: function() {
|
||||
$.noty.clearQueue();
|
||||
$.noty.closeAll();
|
||||
},
|
||||
|
||||
openDocEditor: function (id, type, callback) {
|
||||
var ids = id.split("/"),
|
||||
self = this;
|
||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -10607,6 +10607,11 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
window.App.notificationList.add({title:title, content: content, info: info, type: 'error'});
|
||||
},
|
||||
|
||||
hideArangoNotifications: function() {
|
||||
$.noty.clearQueue();
|
||||
$.noty.closeAll();
|
||||
},
|
||||
|
||||
openDocEditor: function (id, type, callback) {
|
||||
var ids = id.split("/"),
|
||||
self = this;
|
||||
|
@ -25884,6 +25889,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
$('.' + menuItem).addClass('active');
|
||||
}
|
||||
}
|
||||
arangoHelper.hideArangoNotifications();
|
||||
},
|
||||
|
||||
showDropdown: function (e) {
|
||||
|
@ -27636,7 +27642,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
|
||||
myQueriesTableDesc: {
|
||||
id: "arangoMyQueriesTable",
|
||||
titles: ["Name", "Actions"],
|
||||
titles: ["Name", "Query", "Actions"],
|
||||
rows: []
|
||||
},
|
||||
|
||||
|
@ -27662,6 +27668,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
"click #exportQuery": "exportCustomQueries",
|
||||
"click #importQuery": "openImportDialog",
|
||||
"click #removeResults": "removeResults",
|
||||
"click #querySpotlight": "showSpotlight",
|
||||
"click #deleteQuery": "selectAndDeleteQueryFromTable",
|
||||
"click #explQuery": "selectAndExplainQueryFromTable",
|
||||
"keyup #arangoBindParamTable input": "updateBindParams",
|
||||
|
@ -27987,6 +27994,9 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
removeOutputEditor: function(counter) {
|
||||
$('#outputEditorWrapper' + counter).hide();
|
||||
$('#outputEditorWrapper' + counter).remove();
|
||||
if ($('.outputEditorWrapper').length === 0) {
|
||||
$('#removeResults').hide();
|
||||
}
|
||||
},
|
||||
|
||||
getCachedQueryAfterRender: function() {
|
||||
|
@ -28072,6 +28082,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
this.fillSelectBoxes();
|
||||
this.makeResizeable();
|
||||
this.initQueryImport();
|
||||
this.initSpotlight();
|
||||
|
||||
//set height of editor wrapper
|
||||
$('.inputEditorWrapper').height($(window).height() / 10 * 3);
|
||||
|
@ -28081,6 +28092,45 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
self.deselect(self.aqlEditor);
|
||||
},
|
||||
|
||||
showSpotlight: function() {
|
||||
},
|
||||
|
||||
initSpotlight: function() {
|
||||
|
||||
var collections = [];
|
||||
window.App.arangoCollectionsStore.each(function(collection) {
|
||||
collections.push(collection.get("name"));
|
||||
});
|
||||
|
||||
var substringMatcher = function(strs) {
|
||||
return function findMatches(q, cb) {
|
||||
var matches, substrRegex;
|
||||
|
||||
matches = [];
|
||||
|
||||
substrRegex = new RegExp(q, 'i');
|
||||
|
||||
_.each(strs, function(str) {
|
||||
if (substrRegex.test(str)) {
|
||||
matches.push(str);
|
||||
}
|
||||
});
|
||||
|
||||
cb(matches);
|
||||
};
|
||||
};
|
||||
|
||||
$('#aql-spotlight .typeahead').typeahead({
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'collections',
|
||||
source: substringMatcher(collections)
|
||||
});
|
||||
},
|
||||
|
||||
resize: function() {
|
||||
this.resizeFunction();
|
||||
},
|
||||
|
@ -28101,12 +28151,13 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
this.queryPreview.resize();
|
||||
//fix my queries preview table resizing issues TODO
|
||||
$('#arangoMyQueriesTable thead').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable thead th').css('width', $('#queryTable').width() / 2);
|
||||
$('#arangoMyQueriesTable thead th').css('width', $('#queryTable').width() / 3);
|
||||
$('#arangoMyQueriesTable tr').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable tbody').css('height', $('#queryTable').height() - 18);
|
||||
$('#arangoMyQueriesTable tbody').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable tbody tr').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 2);
|
||||
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 3);
|
||||
$('#arangoMyQueriesTable tbody td .truncate').css('width', $('#queryTable').width() / 3);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -28314,7 +28365,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
|
||||
this.aqlEditor.commands.addCommand({
|
||||
name: "explainQuery",
|
||||
bindKey: {win: "Ctrl-Shift-E", mac: "Command-Shift-E", linux: "Ctrl-Shift-E"},
|
||||
bindKey: {win: "Ctrl-Shift-Return", mac: "Command-Shift-Return", linux: "Ctrl-Shift-Return"},
|
||||
exec: function() {
|
||||
self.explainQuery();
|
||||
}
|
||||
|
@ -28330,9 +28381,14 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
},
|
||||
|
||||
updateQueryTable: function () {
|
||||
var self = this;
|
||||
this.myQueriesTableDesc.rows = this.customQueries;
|
||||
|
||||
_.each(this.myQueriesTableDesc.rows, function(k) {
|
||||
k.secondRow = '<div class="truncate">' +
|
||||
JSON.stringify(self.collection.findWhere({name: k.name}).get('value')) +
|
||||
'</div>';
|
||||
|
||||
k.thirdRow = '<span class="spanWrapper">' +
|
||||
'<span id="copyQuery" title="Copy query"><i class="fa fa-copy"></i></span>' +
|
||||
'<span id="explQuery" title="Explain query"><i class="fa fa-comments"></i></i></span>' +
|
||||
|
@ -28346,7 +28402,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
});
|
||||
|
||||
// escape all columns but the third (which contains HTML)
|
||||
this.myQueriesTableDesc.unescaped = [ false, true ];
|
||||
this.myQueriesTableDesc.unescaped = [ false, true, true ];
|
||||
|
||||
this.$(this.myQueriesId).html(this.table.render({content: this.myQueriesTableDesc}));
|
||||
},
|
||||
|
@ -28572,10 +28628,9 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
error: function (data) {
|
||||
try {
|
||||
var temp = JSON.parse(data.responseText);
|
||||
outputEditor.setValue('[' + temp.errorNum + '] ' + temp.errorMessage);
|
||||
arangoHelper.arangoError('[' + temp.errorNum + ']', temp.errorMessage);
|
||||
}
|
||||
catch (e) {
|
||||
outputEditor.setValue('ERROR');
|
||||
arangoHelper.arangoError("Query error", "ERROR");
|
||||
}
|
||||
self.handleResult(counter);
|
||||
|
@ -28700,18 +28755,19 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
error.errorMessage.match(/'.*'/g)[0],
|
||||
error.errorMessage.match(/\d+:\d+/g)[0]
|
||||
);
|
||||
arangoHelper.arangoError("Query", error.errorMessage);
|
||||
}
|
||||
else {
|
||||
console.log(resp);
|
||||
self.markPositionError(
|
||||
error.errorMessage.match(/\(\w+\)/g)[0]
|
||||
);
|
||||
}
|
||||
arangoHelper.arangoError("Query", error.errorMessage);
|
||||
self.removeOutputEditor(counter);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
arangoHelper.arangoError("Query", "Something went wrong.");
|
||||
self.removeOutputEditor(counter);
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
window.progressView.hide();
|
||||
|
@ -28722,16 +28778,22 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
},
|
||||
|
||||
markPositionError: function(text, pos) {
|
||||
var row = pos.split(":")[0],
|
||||
line = pos.split(":")[1];
|
||||
text = text.substr(1, text.length - 2);
|
||||
var row;
|
||||
|
||||
this.aqlEditor.find(text);
|
||||
if (pos) {
|
||||
row = pos.split(":")[0];
|
||||
text = text.substr(1, text.length - 2);
|
||||
}
|
||||
|
||||
var found = this.aqlEditor.find(text);
|
||||
|
||||
if (!found && pos) {
|
||||
this.aqlEditor.selection.moveCursorToPosition({row: row, column: 0});
|
||||
this.aqlEditor.selection.selectLine();
|
||||
}
|
||||
window.setTimeout(function() {
|
||||
$('.ace_start').first().css('background', 'rgba(255, 129, 129, 0.7)');
|
||||
}, 100);
|
||||
|
||||
},
|
||||
|
||||
refreshAQL: function() {
|
||||
|
@ -30662,8 +30724,8 @@ window.ArangoUsers = Backbone.Collection.extend({
|
|||
"collection/:colid/documents/:pageid": "documents",
|
||||
"collection/:colid/:docid": "document",
|
||||
"shell": "shell",
|
||||
"query": "query",
|
||||
"query2": "query2",
|
||||
"query": "query2",
|
||||
"query2": "query",
|
||||
"queryManagement": "queryManagement",
|
||||
"workMonitor": "workMonitor",
|
||||
"databases": "databases",
|
||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1,3 +1,3 @@
|
|||
<script src="sharedLibs.js?version=1456340072524"></script>
|
||||
<script src="libs.js?version=1456340072524"></script>
|
||||
<script src="app.js?version=1456340072524"></script>
|
||||
<script src="sharedLibs.js?version=1456490219680"></script>
|
||||
<script src="libs.js?version=1456490219680"></script>
|
||||
<script src="app.js?version=1456490219680"></script>
|
||||
|
|
|
@ -2498,6 +2498,7 @@ if (list.length > 0) {
|
|||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<span id="querySpotlight"><i class="fa fa-search"></i></span>
|
||||
<div class="styled-select">
|
||||
<select id="querySize" class="query-size"/>
|
||||
</div>
|
||||
|
@ -2536,6 +2537,11 @@ if (list.length > 0) {
|
|||
<div id="outputEditors" class="outputEditors">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="aql-spotlight" style="display: none">
|
||||
<input class="typeahead" type="text" placeholder="Search for Collections, AQL and more">
|
||||
</div>
|
||||
|
||||
<div id="queryImportDialog" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
@ -2832,4 +2838,4 @@ var cutByResolution = function (str) {
|
|||
</div>
|
||||
|
||||
<div id="workMonitorContent" class="innerContent">
|
||||
</div></script></head><body><nav class="navbar"><div class="resizecontainer"><div class="navlogo"><a class="logo" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a></div><div id="progressPlaceholderIcon"></div><div class="statmenu" id="statisticBar"></div><div class="usermenu" id="userBar" style="float:right"></div><div class="notificationmenu" id="notificationBar" style="float:right"></div><div class="navmenu" id="navigationBar"></div></div></nav><div class="centralRow resizecontainer"><div id="content" class="centralContent"></div></div><div id="modalPlaceholder"></div><div id="progressPlaceholder" style="display:none"></div><footer class="footer"><div class="resizecontainer" id="footerBar"></div></footer><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="sharedLibs.js?version=1456340072524"></script><script src="libs.js?version=1456340072524"></script><script src="app.js?version=1456340072524"></script></body></html>
|
||||
</div></script></head><body><nav class="navbar"><div class="resizecontainer"><div class="navlogo"><a class="logo" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a></div><div id="progressPlaceholderIcon"></div><div class="statmenu" id="statisticBar"></div><div class="usermenu" id="userBar" style="float:right"></div><div class="notificationmenu" id="notificationBar" style="float:right"></div><div class="navmenu" id="navigationBar"></div></div></nav><div class="centralRow resizecontainer"><div id="content" class="centralContent"></div></div><div id="modalPlaceholder"></div><div id="progressPlaceholder" style="display:none"></div><footer class="footer"><div class="resizecontainer" id="footerBar"></div></footer><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="sharedLibs.js?version=1456490219680"></script><script src="libs.js?version=1456490219680"></script><script src="app.js?version=1456490219680"></script></body></html>
|
Binary file not shown.
|
@ -2690,6 +2690,7 @@ if (list.length > 0) {
|
|||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<span id="querySpotlight"><i class="fa fa-search"></i></span>
|
||||
<div class="styled-select">
|
||||
<select id="querySize" class="query-size"/>
|
||||
</div>
|
||||
|
@ -2728,6 +2729,11 @@ if (list.length > 0) {
|
|||
<div id="outputEditors" class="outputEditors">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="aql-spotlight" style="display: none">
|
||||
<input class="typeahead" type="text" placeholder="Search for Collections, AQL and more">
|
||||
</div>
|
||||
|
||||
<div id="queryImportDialog" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
@ -3109,9 +3115,9 @@ var cutByResolution = function (str) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="sharedLibs.js?version=1456340072524"></script>
|
||||
<script src="libs.js?version=1456340072524"></script>
|
||||
<script src="app.js?version=1456340072524"></script>
|
||||
<script src="sharedLibs.js?version=1456490219680"></script>
|
||||
<script src="libs.js?version=1456490219680"></script>
|
||||
<script src="app.js?version=1456490219680"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -6817,6 +6817,13 @@ toolbar {
|
|||
.inputEditorWrapper .aqlEditorWrapper table tbody {
|
||||
display: block;
|
||||
overflow-y: auto; }
|
||||
.inputEditorWrapper .bindParamEditorWrapper table .truncate,
|
||||
.inputEditorWrapper .aqlEditorWrapper table .truncate {
|
||||
opacity: 0.8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 30%; }
|
||||
.inputEditorWrapper .bindParamEditorWrapper table tr.noBgColor,
|
||||
.inputEditorWrapper .aqlEditorWrapper table tr.noBgColor {
|
||||
background-color: transparent !important; }
|
||||
|
|
Binary file not shown.
|
@ -257,6 +257,11 @@
|
|||
window.App.notificationList.add({title:title, content: content, info: info, type: 'error'});
|
||||
},
|
||||
|
||||
hideArangoNotifications: function() {
|
||||
$.noty.clearQueue();
|
||||
$.noty.closeAll();
|
||||
},
|
||||
|
||||
openDocEditor: function (id, type, callback) {
|
||||
var ids = id.split("/"),
|
||||
self = this;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -15,8 +15,8 @@
|
|||
"collection/:colid/documents/:pageid": "documents",
|
||||
"collection/:colid/:docid": "document",
|
||||
"shell": "shell",
|
||||
"query": "query",
|
||||
"query2": "query2",
|
||||
"query": "query2",
|
||||
"query2": "query",
|
||||
"queryManagement": "queryManagement",
|
||||
"workMonitor": "workMonitor",
|
||||
"databases": "databases",
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<span id="querySpotlight"><i class="fa fa-search"></i></span>
|
||||
<div class="styled-select">
|
||||
<select id="querySize" class="query-size"/>
|
||||
</div>
|
||||
|
@ -53,6 +54,12 @@
|
|||
<div id="outputEditors" class="outputEditors">
|
||||
</div>
|
||||
|
||||
<div class="aqlSpotlightWrapper">
|
||||
<div id="aql-spotlight">
|
||||
<input class="typeahead" type="text" placeholder="Search for Collections, AQL and more">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="queryImportDialog" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
|
|
@ -48,7 +48,7 @@ var cutByResolution = function (str) {
|
|||
</td>
|
||||
<td class="docsThirdCol">
|
||||
<a class="deleteButton">
|
||||
<span class="icon_arangodb_roundminus" data-original-title="Delete document" title="Delete document"></span></a>
|
||||
<span data-original-title="Delete document" title="Delete document"><i class="fa fa-minus-circle"></i></i></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<%
|
||||
|
|
|
@ -143,6 +143,7 @@
|
|||
$('.' + menuItem).addClass('active');
|
||||
}
|
||||
}
|
||||
arangoHelper.hideArangoNotifications();
|
||||
},
|
||||
|
||||
showDropdown: function (e) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
currentQuery: {},
|
||||
initDone: false,
|
||||
|
||||
bindParamRegExp: /@(@?)(\w+(\d*))/,
|
||||
bindParamRegExp: /@(@?\w+\d*)/,
|
||||
bindParamTableObj: {},
|
||||
|
||||
bindParamTableDesc: {
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
myQueriesTableDesc: {
|
||||
id: "arangoMyQueriesTable",
|
||||
titles: ["Name", "Actions"],
|
||||
titles: ["Name", "Query", "Actions"],
|
||||
rows: []
|
||||
},
|
||||
|
||||
|
@ -61,6 +61,7 @@
|
|||
"click #exportQuery": "exportCustomQueries",
|
||||
"click #importQuery": "openImportDialog",
|
||||
"click #removeResults": "removeResults",
|
||||
"click #querySpotlight": "showSpotlight",
|
||||
"click #deleteQuery": "selectAndDeleteQueryFromTable",
|
||||
"click #explQuery": "selectAndExplainQueryFromTable",
|
||||
"keyup #arangoBindParamTable input": "updateBindParams",
|
||||
|
@ -77,6 +78,14 @@
|
|||
this.aqlEditor.setValue('');
|
||||
},
|
||||
|
||||
openExportDialog: function() {
|
||||
$('#queryImportDialog').modal('show');
|
||||
},
|
||||
|
||||
closeExportDialo: function() {
|
||||
$('#queryImportDialog').modal('hide');
|
||||
},
|
||||
|
||||
initQueryImport: function () {
|
||||
var self = this;
|
||||
self.allowUpload = false;
|
||||
|
@ -160,7 +169,7 @@
|
|||
}
|
||||
|
||||
var divs = [
|
||||
"aqlEditor", "queryTable", "previewWrapper",
|
||||
"aqlEditor", "queryTable", "previewWrapper", "querySpotlight",
|
||||
"bindParamEditor", "toggleQueries1", "toggleQueries2",
|
||||
"saveCurrentQuery", "querySize", "executeQuery",
|
||||
"explainQuery", "clearQuery", "importQuery", "exportQuery"
|
||||
|
@ -186,7 +195,7 @@
|
|||
name = $(e.currentTarget).children().first().text();
|
||||
}
|
||||
else if ($(e.currentTarget).is('span')) {
|
||||
name = $(e.currentTarget).parent().parent().prev().text();
|
||||
name = $(e.currentTarget).parent().parent().prev().prev().text();
|
||||
}
|
||||
return name;
|
||||
},
|
||||
|
@ -313,8 +322,8 @@
|
|||
},
|
||||
|
||||
explainQuery: function() {
|
||||
if (this.aqlEditor.getValue().length === 0) {
|
||||
arangoHelper.arangoError("Query", "Your query is empty");
|
||||
|
||||
if (this.verifyQueryAndParams()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -358,6 +367,7 @@
|
|||
if (data.msg.includes('errorMessage')) {
|
||||
self.removeOutputEditor(counter);
|
||||
arangoHelper.arangoError("Explain error", data.msg);
|
||||
window.progressView.hide();
|
||||
}
|
||||
else {
|
||||
outputEditor.setValue(data.msg);
|
||||
|
@ -368,7 +378,6 @@
|
|||
}
|
||||
},
|
||||
error: function (data) {
|
||||
window.progressView.hide();
|
||||
try {
|
||||
var temp = JSON.parse(data.responseText);
|
||||
arangoHelper.arangoError("Explain error", temp.errorMessage);
|
||||
|
@ -376,6 +385,7 @@
|
|||
catch (e) {
|
||||
arangoHelper.arangoError("Explain error", "ERROR");
|
||||
}
|
||||
window.progressView.hide();
|
||||
self.handleResult(counter);
|
||||
this.removeOutputEditor(counter);
|
||||
}
|
||||
|
@ -386,6 +396,9 @@
|
|||
removeOutputEditor: function(counter) {
|
||||
$('#outputEditorWrapper' + counter).hide();
|
||||
$('#outputEditorWrapper' + counter).remove();
|
||||
if ($('.outputEditorWrapper').length === 0) {
|
||||
$('#removeResults').hide();
|
||||
}
|
||||
},
|
||||
|
||||
getCachedQueryAfterRender: function() {
|
||||
|
@ -480,6 +493,45 @@
|
|||
self.deselect(self.aqlEditor);
|
||||
},
|
||||
|
||||
showSpotlight: function() {
|
||||
var collections = [];
|
||||
window.App.arangoCollectionsStore.each(function(collection) {
|
||||
collections.push(collection.get("name"));
|
||||
});
|
||||
|
||||
var substringMatcher = function(strs) {
|
||||
return function findMatches(q, cb) {
|
||||
var matches, substrRegex;
|
||||
|
||||
matches = [];
|
||||
|
||||
substrRegex = new RegExp(q, 'i');
|
||||
|
||||
_.each(strs, function(str) {
|
||||
if (substrRegex.test(str)) {
|
||||
matches.push(str);
|
||||
}
|
||||
});
|
||||
|
||||
cb(matches);
|
||||
};
|
||||
};
|
||||
|
||||
$('#aql-spotlight .typeahead').typeahead({
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'collections',
|
||||
source: substringMatcher(collections)
|
||||
});
|
||||
},
|
||||
|
||||
initSpotlight: function() {
|
||||
|
||||
},
|
||||
|
||||
resize: function() {
|
||||
this.resizeFunction();
|
||||
},
|
||||
|
@ -500,12 +552,13 @@
|
|||
this.queryPreview.resize();
|
||||
//fix my queries preview table resizing issues TODO
|
||||
$('#arangoMyQueriesTable thead').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable thead th').css('width', $('#queryTable').width() / 2);
|
||||
$('#arangoMyQueriesTable thead th').css('width', $('#queryTable').width() / 3);
|
||||
$('#arangoMyQueriesTable tr').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable tbody').css('height', $('#queryTable').height() - 18);
|
||||
$('#arangoMyQueriesTable tbody').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable tbody tr').css('width', $('#queryTable').width());
|
||||
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 2);
|
||||
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 3);
|
||||
$('#arangoMyQueriesTable tbody td .truncate').css('width', $('#queryTable').width() / 3);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -592,6 +645,13 @@
|
|||
});
|
||||
});
|
||||
|
||||
_.each(words, function(word) {
|
||||
word = word.split(",");
|
||||
_.each(word, function(x) {
|
||||
words1.push(x);
|
||||
});
|
||||
});
|
||||
|
||||
_.each(words1, function(word) {
|
||||
// remove newlines and whitespaces
|
||||
words[pos] = word.replace(/(\r\n|\n|\r)/gm,"");
|
||||
|
@ -602,9 +662,10 @@
|
|||
var newObject = {};
|
||||
_.each(words1, function(word) {
|
||||
//found a valid bind param expression
|
||||
if (self.bindParamRegExp.test(word)) {
|
||||
var match = word.match(self.bindParamRegExp);
|
||||
if (match) {
|
||||
//if property is not available
|
||||
word = word.substr(1, word.length);
|
||||
word = match[1];
|
||||
newObject[word] = '';
|
||||
}
|
||||
});
|
||||
|
@ -713,7 +774,7 @@
|
|||
|
||||
this.aqlEditor.commands.addCommand({
|
||||
name: "explainQuery",
|
||||
bindKey: {win: "Ctrl-Shift-E", mac: "Command-Shift-E", linux: "Ctrl-Shift-E"},
|
||||
bindKey: {win: "Ctrl-Shift-Return", mac: "Command-Shift-Return", linux: "Ctrl-Shift-Return"},
|
||||
exec: function() {
|
||||
self.explainQuery();
|
||||
}
|
||||
|
@ -729,9 +790,14 @@
|
|||
},
|
||||
|
||||
updateQueryTable: function () {
|
||||
var self = this;
|
||||
this.myQueriesTableDesc.rows = this.customQueries;
|
||||
|
||||
_.each(this.myQueriesTableDesc.rows, function(k) {
|
||||
k.secondRow = '<div class="truncate">' +
|
||||
JSON.stringify(self.collection.findWhere({name: k.name}).get('value')) +
|
||||
'</div>';
|
||||
|
||||
k.thirdRow = '<span class="spanWrapper">' +
|
||||
'<span id="copyQuery" title="Copy query"><i class="fa fa-copy"></i></span>' +
|
||||
'<span id="explQuery" title="Explain query"><i class="fa fa-comments"></i></i></span>' +
|
||||
|
@ -745,7 +811,7 @@
|
|||
});
|
||||
|
||||
// escape all columns but the third (which contains HTML)
|
||||
this.myQueriesTableDesc.unescaped = [ false, true ];
|
||||
this.myQueriesTableDesc.unescaped = [ false, true, true ];
|
||||
|
||||
this.$(this.myQueriesId).html(this.table.render({content: this.myQueriesTableDesc}));
|
||||
},
|
||||
|
@ -888,9 +954,29 @@
|
|||
window.modalView.hide();
|
||||
},
|
||||
|
||||
executeQuery: function () {
|
||||
verifyQueryAndParams: function() {
|
||||
var quit = false;
|
||||
|
||||
if (this.aqlEditor.getValue().length === 0) {
|
||||
arangoHelper.arangoError("Query", "Your query is empty");
|
||||
quit = true;
|
||||
}
|
||||
|
||||
var keys = [];
|
||||
_.each(this.bindParamTableObj, function(val, key) {
|
||||
if (val === '') {
|
||||
quit = true;
|
||||
keys.push(key);
|
||||
}
|
||||
});
|
||||
arangoHelper.arangoError("Bind Parameter", JSON.stringify(keys) + " not defined.");
|
||||
|
||||
return quit;
|
||||
},
|
||||
|
||||
executeQuery: function () {
|
||||
|
||||
if (this.verifyQueryAndParams()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -971,10 +1057,9 @@
|
|||
error: function (data) {
|
||||
try {
|
||||
var temp = JSON.parse(data.responseText);
|
||||
outputEditor.setValue('[' + temp.errorNum + '] ' + temp.errorMessage);
|
||||
arangoHelper.arangoError('[' + temp.errorNum + ']', temp.errorMessage);
|
||||
}
|
||||
catch (e) {
|
||||
outputEditor.setValue('ERROR');
|
||||
arangoHelper.arangoError("Query error", "ERROR");
|
||||
}
|
||||
self.handleResult(counter);
|
||||
|
@ -1099,18 +1184,19 @@
|
|||
error.errorMessage.match(/'.*'/g)[0],
|
||||
error.errorMessage.match(/\d+:\d+/g)[0]
|
||||
);
|
||||
arangoHelper.arangoError("Query", error.errorMessage);
|
||||
}
|
||||
else {
|
||||
console.log(resp);
|
||||
self.markPositionError(
|
||||
error.errorMessage.match(/\(\w+\)/g)[0]
|
||||
);
|
||||
}
|
||||
arangoHelper.arangoError("Query", error.errorMessage);
|
||||
self.removeOutputEditor(counter);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
arangoHelper.arangoError("Query", "Something went wrong.");
|
||||
self.removeOutputEditor(counter);
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
window.progressView.hide();
|
||||
|
@ -1121,16 +1207,22 @@
|
|||
},
|
||||
|
||||
markPositionError: function(text, pos) {
|
||||
var row = pos.split(":")[0],
|
||||
line = pos.split(":")[1];
|
||||
text = text.substr(1, text.length - 2);
|
||||
var row;
|
||||
|
||||
this.aqlEditor.find(text);
|
||||
if (pos) {
|
||||
row = pos.split(":")[0];
|
||||
text = text.substr(1, text.length - 2);
|
||||
}
|
||||
|
||||
var found = this.aqlEditor.find(text);
|
||||
|
||||
if (!found && pos) {
|
||||
this.aqlEditor.selection.moveCursorToPosition({row: row, column: 0});
|
||||
this.aqlEditor.selection.selectLine();
|
||||
}
|
||||
window.setTimeout(function() {
|
||||
$('.ace_start').first().css('background', 'rgba(255, 129, 129, 0.7)');
|
||||
}, 100);
|
||||
|
||||
},
|
||||
|
||||
refreshAQL: function() {
|
||||
|
|
|
@ -79,19 +79,22 @@ button.disabled,
|
|||
.addButton {
|
||||
@extend %clickable;
|
||||
@extend %icon-positive;
|
||||
font-size: 22px;
|
||||
font-size: 16pt;
|
||||
margin-right: 7px;
|
||||
margin-top: 2px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.deleteButton {
|
||||
@extend %clickable;
|
||||
@extend %icon-negative;
|
||||
font-size: 22px;
|
||||
padding-right: 3px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
|
||||
i {
|
||||
@extend %clickable;
|
||||
@extend %icon-negative;
|
||||
font-size: 16pt;
|
||||
padding-right: 3px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
#closeBtnInfoView {
|
||||
|
|
|
@ -58,6 +58,14 @@
|
|||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.truncate {
|
||||
opacity: 0.8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
tr {
|
||||
&.noBgColor {
|
||||
background-color: rgba(0, 0, 0, 0) !important;
|
||||
|
|
|
@ -63,6 +63,7 @@ delete global.DEFINE_MODULE;
|
|||
const LOADING = [];
|
||||
|
||||
const GLOBAL_PATHS = [];
|
||||
const ROOT_PATH = fs.normalize(fs.makeAbsolute(internal.startupPath));
|
||||
global.MODULES_PATH.forEach(function (p) {
|
||||
p = fs.normalize(fs.makeAbsolute(p));
|
||||
GLOBAL_PATHS.push(p);
|
||||
|
@ -302,6 +303,10 @@ Module._nodeModulePaths = function(from, root) {
|
|||
var paths = [];
|
||||
var parts = from.split(splitRe);
|
||||
var inRoot = root && from.indexOf(root) === 0;
|
||||
if (!inRoot) {
|
||||
root = ROOT_PATH;
|
||||
inRoot = from.indexOf(root) === 0;
|
||||
}
|
||||
|
||||
for (var tip = parts.length - 1; tip >= 0; tip--) {
|
||||
// don't search in .../node_modules/node_modules
|
||||
|
|
Loading…
Reference in New Issue