diff --git a/.gitignore b/.gitignore index 5bbaf1d3ce..a796826372 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,14 @@ js-*.h 3rdParty/libev/ARCH.x64/ 3rdParty/libev/ARCH.ia32/ 3rdParty/zlib-1.2.7/ +3rdParty/libev/.libs/ +3rdParty/libev/config.h +3rdParty/libev/ev.lo +3rdParty/libev/event.lo +3rdParty/libev/libev.la +3rdParty/libev/libtool +3rdParty/libev/stamp-h1 +3rdParty/libev/BUILD/ build/ Build64/ diff --git a/arangod/V8Server/ApplicationV8.cpp b/arangod/V8Server/ApplicationV8.cpp index 72de435c03..2e14131d99 100644 --- a/arangod/V8Server/ApplicationV8.cpp +++ b/arangod/V8Server/ApplicationV8.cpp @@ -445,7 +445,6 @@ void ApplicationV8::exitContext(V8Context* context) { TRI_ASSERT(context->_locker->IsLocked(isolate)); TRI_ASSERT(v8::Locker::IsLocked(isolate)); - TRI_vocbase_t* vocbase = nullptr; bool canceled = false; // update data for later garbage collection @@ -453,11 +452,11 @@ void ApplicationV8::exitContext(V8Context* context) { TRI_GET_GLOBALS(); context->_hasActiveExternals = v8g->hasActiveExternals(); ++context->_numExecutions; - vocbase = v8g->_vocbase; + TRI_vocbase_t* vocbase = v8g->_vocbase; TRI_ASSERT(vocbase != nullptr); // release last recently used vocbase - TRI_ReleaseVocBase(static_cast(v8g->_vocbase)); + TRI_ReleaseVocBase(vocbase); // check for cancelation requests canceled = v8g->_canceled; diff --git a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js index af0dab01bd..99bd228156 100644 --- a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js +++ b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js @@ -437,28 +437,6 @@ isSystemCollection: function (val) { return val.name.substr(0, 1) === '_'; - // the below code is completely inappropriate as it will - // load the collection just for the check whether it - // is a system collection. as a consequence, the below - // code would load ALL collections when the web interface - // is called - /* - var returnVal = false; - $.ajax({ -type: "GET", -url: "/_api/collection/" + encodeURIComponent(val) + "/properties", -contentType: "application/json", -processData: false, -async: false, -success: function(data) { -returnVal = data.isSystem; -}, -error: function(data) { -returnVal = false; -} -}); -return returnVal; -*/ }, setDocumentStore : function (a) { diff --git a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js.gz b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js.gz index e12eba2f93..4e25785a4f 100644 Binary files a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js.gz and b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.js.gz differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.js b/js/apps/system/_admin/aardvark/APP/frontend/build/app.js index 688888db8f..bf5b35bd48 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/build/app.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/build/app.js @@ -10787,28 +10787,6 @@ function GraphViewer(svg, width, height, adapterConfig, config) { isSystemCollection: function (val) { return val.name.substr(0, 1) === '_'; - // the below code is completely inappropriate as it will - // load the collection just for the check whether it - // is a system collection. as a consequence, the below - // code would load ALL collections when the web interface - // is called - /* - var returnVal = false; - $.ajax({ -type: "GET", -url: "/_api/collection/" + encodeURIComponent(val) + "/properties", -contentType: "application/json", -processData: false, -async: false, -success: function(data) { -returnVal = data.isSystem; -}, -error: function(data) { -returnVal = false; -} -}); -return returnVal; -*/ }, setDocumentStore : function (a) { @@ -17347,7 +17325,7 @@ window.Users = Backbone.Model.extend({ case 3: return 'loaded'; case 4: - return 'will be unloaded'; + return 'in the process of being unloaded'; case 5: return 'deleted'; case 6: @@ -20364,6 +20342,9 @@ window.ArangoUsers = Backbone.Collection.extend({ $('#collection_' + model.get("name") + ' .corneredBadge').removeClass('inProgress'); $('#collection_' + model.get("name") + ' .corneredBadge').addClass('loaded'); } + if (model.get('status') === 'unloaded') { + $('#collection_' + model.get("name") + ' .icon_arangodb_info').addClass('disabled'); + } } }); @@ -22283,40 +22264,67 @@ window.ArangoUsers = Backbone.Collection.extend({ }, saveDocument: function () { + if ($('#saveDocumentButton').attr('disabled') === undefined) { + if (this.collection.first().attributes._id.substr(0, 1) === '_') { + + var buttons = [], tableContent = []; + tableContent.push( + window.modalView.createReadOnlyEntry( + 'doc-save-system-button', + 'Caution', + 'You are modifying a system collection. Really continue?', + undefined, + undefined, + false, + /[<>&'"]/ + ) + ); + buttons.push( + window.modalView.createSuccessButton('Save', this.confirmSaveDocument.bind(this)) + ); + window.modalView.show('modalTable.ejs', 'Modify System Collection', buttons, tableContent); + } + else { + this.confirmSaveDocument(); + } + } + }, + + confirmSaveDocument: function () { + + window.modalView.hide(); + var model, result; - if ($('#saveDocumentButton').attr('disabled') === undefined) { + try { + model = this.editor.get(); + } + catch (e) { + this.errorConfirmation(e); + this.disableSaveButton(); + return; + } - try { - model = this.editor.get(); - } - catch (e) { - this.errorConfirmation(e); - this.disableSaveButton(); + model = JSON.stringify(model); + + if (this.type === 'document') { + result = this.collection.saveDocument(this.colid, this.docid, model); + if (result === false) { + arangoHelper.arangoError('Document error:','Could not save'); return; } - - model = JSON.stringify(model); - - if (this.type === 'document') { - result = this.collection.saveDocument(this.colid, this.docid, model); - if (result === false) { - arangoHelper.arangoError('Document error:','Could not save'); - return; - } - } - else if (this.type === 'edge') { - result = this.collection.saveEdge(this.colid, this.docid, model); - if (result === false) { - arangoHelper.arangoError('Edge error:', 'Could not save'); - return; - } + } + else if (this.type === 'edge') { + result = this.collection.saveEdge(this.colid, this.docid, model); + if (result === false) { + arangoHelper.arangoError('Edge error:', 'Could not save'); + return; } + } - if (result === true) { - this.successConfirmation(); - this.disableSaveButton(); - } + if (result === true) { + this.successConfirmation(); + this.disableSaveButton(); } }, @@ -25866,11 +25874,29 @@ window.ArangoUsers = Backbone.Collection.extend({ templateSlow: templateEngine.createTemplate("queryManagementViewSlow.ejs"), table: templateEngine.createTemplate("arangoTable.ejs"), tabbar: templateEngine.createTemplate("arangoTabbar.ejs"), + active: true, + shouldRender: true, + timer: 0, + refreshRate: 2000, initialize: function () { + var self = this; this.activeCollection = new window.QueryManagementActive(); this.slowCollection = new window.QueryManagementSlow(); this.convertModelToJSON(true); + + window.setInterval(function() { + if (window.location.hash === '#queryManagement' && window.VISIBLE && self.shouldRender) { + if (self.active) { + self.convertModelToJSON(true); + self.renderActive(); + } + else { + self.convertModelToJSON(false); + self.renderSlow(); + } + } + }, self.refreshRate); }, events: { @@ -25896,9 +25922,11 @@ window.ArangoUsers = Backbone.Collection.extend({ switchTab: function(e) { if (e.currentTarget.id === 'activequeries') { + this.active = true; this.convertModelToJSON(true); } else if (e.currentTarget.id === 'slowqueries') { + this.active = false; this.convertModelToJSON(false); } }, @@ -25985,11 +26013,25 @@ window.ArangoUsers = Backbone.Collection.extend({ this.convertModelToJSON(true); }, + addEvents: function() { + var self = this; + $('#queryManagementContent tbody').on('mousedown', function() { + clearTimeout(self.timer); + self.shouldRender = false; + }); + $('#queryManagementContent tbody').on('mouseup', function() { + self.timer = window.setTimeout(function() { + self.shouldRender = true; + }, 3000); + }); + }, + renderActive: function() { this.$el.html(this.templateActive.render({})); $(this.id).html(this.tabbar.render({content: this.tabbarElements})); $(this.id).append(this.table.render({content: this.tableDescription})); $('#activequeries').addClass("arango-active-tab"); + this.addEvents(); }, renderSlow: function() { @@ -25999,6 +26041,7 @@ window.ArangoUsers = Backbone.Collection.extend({ content: this.tableDescription, })); $('#slowqueries').addClass("arango-active-tab"); + this.addEvents(); }, convertModelToJSON: function (active) { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.js.gz b/js/apps/system/_admin/aardvark/APP/frontend/build/app.js.gz index b5f865e8ce..2e09d6e3c4 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/app.js.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/app.js.gz differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html index 151462c745..65b1efb66c 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html +++ b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html @@ -268,6 +268,10 @@
<%= model.get('status') %>
+ <% } else { %> +
+ <%= model.get('status') %> +
<% } %> <% } %> diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html.gz b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html.gz index de6441b278..9916ff0be7 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html.gz differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone.html b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone.html index 35590bf693..635cee2c81 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone.html +++ b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone.html @@ -304,6 +304,10 @@
<%= model.get('status') %>
+ <% } else { %> +
+ <%= model.get('status') %> +
<% } %> <% } %> diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js b/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js index 4231c81e96..afffebc88b 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/arango/arango.js @@ -437,28 +437,6 @@ isSystemCollection: function (val) { return val.name.substr(0, 1) === '_'; - // the below code is completely inappropriate as it will - // load the collection just for the check whether it - // is a system collection. as a consequence, the below - // code would load ALL collections when the web interface - // is called - /* - var returnVal = false; - $.ajax({ -type: "GET", -url: "/_api/collection/" + encodeURIComponent(val) + "/properties", -contentType: "application/json", -processData: false, -async: false, -success: function(data) { -returnVal = data.isSystem; -}, -error: function(data) { -returnVal = false; -} -}); -return returnVal; -*/ }, setDocumentStore : function (a) { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/collections/arangoCollections.js b/js/apps/system/_admin/aardvark/APP/frontend/js/collections/arangoCollections.js index c04e04fd7c..3609560416 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/collections/arangoCollections.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/collections/arangoCollections.js @@ -154,21 +154,20 @@ return result; }, - newCollection: function (collName, wfs, isSystem, journalSize, collType, shards, keys) { - var returnobj = {}; + newCollection: function (object, callback) { var data = {}; - data.name = collName; - data.waitForSync = wfs; - if (journalSize > 0) { - data.journalSize = journalSize; + data.name = object.collName; + data.waitForSync = object.wfs; + if (object.journalSize > 0) { + data.journalSize = object.journalSize; } - data.isSystem = isSystem; - data.type = parseInt(collType, 10); - if (shards) { - data.numberOfShards = shards; - data.shardKeys = keys; + data.isSystem = object.isSystem; + data.type = parseInt(object.collType, 10); + if (object.shards) { + data.numberOfShards = object.shards; + data.shardKeys = object.keys; } - returnobj.status = false; + $.ajax({ cache: false, type: "POST", @@ -176,17 +175,13 @@ data: JSON.stringify(data), contentType: "application/json", processData: false, - async: false, success: function(data) { - returnobj.status = true; - returnobj.data = data; + callback(false, data); }, error: function(data) { - returnobj.status = false; - returnobj.errorMessage = JSON.parse(data.responseText).errorMessage; + callback(false, data); } }); - return returnobj; } }); }()); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/models/arangoCollectionModel.js b/js/apps/system/_admin/aardvark/APP/frontend/js/models/arangoCollectionModel.js index 45b2ea7044..2d0c76ad6b 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/models/arangoCollectionModel.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/models/arangoCollectionModel.js @@ -2,8 +2,6 @@ (function() { 'use strict'; window.arangoCollectionModel = Backbone.Model.extend({ - initialize: function () { - }, idAttribute: "name", @@ -74,26 +72,22 @@ return data2; }, - getIndex: function () { - var data2; + getIndex: function (callback) { $.ajax({ type: "GET", cache: false, url: "/_api/index/?collection=" + this.get("id"), contentType: "application/json", processData: false, - async: false, success: function(data) { - data2 = data; + callback(false, data); }, error: function(data) { - data2 = data; + callback(true, data); } }); - return data2; }, - createIndex: function (postParameter, callback) { var self = this; @@ -163,15 +157,14 @@ truncateCollection: function () { $.ajax({ - async: false, cache: false, type: 'PUT', url: "/_api/collection/" + this.get("id") + "/truncate", success: function () { - arangoHelper.arangoNotification('Collection truncated'); + arangoHelper.arangoNotification('Collection truncated.'); }, error: function () { - arangoHelper.arangoError('Collection error'); + arangoHelper.arangoError('Collection error.'); } }); }, @@ -207,36 +200,27 @@ callback(); }, - renameCollection: function (name) { - var self = this, - result = false; + renameCollection: function (name, callback) { + var self = this; + $.ajax({ cache: false, type: "PUT", - async: false, // sequential calls! url: "/_api/collection/" + this.get("id") + "/rename", data: JSON.stringify({ name: name }), contentType: "application/json", processData: false, success: function() { self.set("name", name); - result = true; + callback(false); }, - error: function(/*data*/) { - try { - console.log("error"); - //var parsed = JSON.parse(data.responseText); - //result = parsed.errorMessage; - } - catch (e) { - result = false; - } + error: function(data) { + callback(true, data); } }); - return result; }, - changeCollection: function (wfs, journalSize, indexBuckets) { + changeCollection: function (wfs, journalSize, indexBuckets, callback) { var result = false; if (wfs === "true") { wfs = true; @@ -253,22 +237,15 @@ $.ajax({ cache: false, type: "PUT", - async: false, // sequential calls! url: "/_api/collection/" + this.get("id") + "/properties", data: JSON.stringify(data), contentType: "application/json", processData: false, success: function() { - result = true; + callback(false); }, error: function(data) { - try { - var parsed = JSON.parse(data.responseText); - result = parsed.errorMessage; - } - catch (e) { - result = false; - } + callback(false, data); } }); return result; diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsItemView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsItemView.js index a172e29c31..8db40f97ef 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsItemView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsItemView.js @@ -138,7 +138,6 @@ truncateCollection: function () { this.model.truncateCollection(); - this.render(); window.modalView.hide(); }, @@ -189,40 +188,42 @@ return 0; } - var result; - if (this.model.get('name') !== newname) { - result = this.model.renameCollection(newname); - } - - if (result !== true) { - if (result !== undefined) { - arangoHelper.arangoError("Collection error: " + result); - return 0; + var callbackChange = function(error) { + if (error) { + arangoHelper.arangoError("Collection error: " + error.responseText); } - } - - var wfs = $('#change-collection-sync').val(); - var changeResult = this.model.changeCollection(wfs, journalSize, indexBuckets); - - if (changeResult !== true) { - arangoHelper.arangoNotification("Collection error", changeResult); - return 0; - } - - this.collectionsView.render(); - window.modalView.hide(); - } - else if (status === 'unloaded') { - if (this.model.get('name') !== newname) { - var result2 = this.model.renameCollection(newname); - - if (result2 === true) { + else { this.collectionsView.render(); window.modalView.hide(); } - else { - arangoHelper.arangoError("Collection error: " + result2); + }.bind(this); + + var callbackRename = function(error) { + if (error) { + arangoHelper.arangoError("Collection error: " + error.responseText); } + else { + var wfs = $('#change-collection-sync').val(); + this.model.changeCollection(wfs, journalSize, indexBuckets, callbackChange); + } + }.bind(this); + + this.model.renameCollection(newname, callbackRename); + } + else if (status === 'unloaded') { + if (this.model.get('name') !== newname) { + + var callbackRename2 = function(error, data) { + if (error) { + arangoHelper.arangoError("Collection error: " + data.responseText); + } + else { + this.collectionsView.render(); + window.modalView.hide(); + } + }.bind(this); + + this.model.renameCollection(newname, callbackRename2); } else { window.modalView.hide(); @@ -230,10 +231,6 @@ } }, - - - //modal dialogs - createEditPropertiesModal: function() { var collectionIsLoaded = false; @@ -392,7 +389,6 @@ else { $($('#infoTab').children()[1]).remove(); } - this.bindIndexEvents(); }, bindIndexEvents: function() { @@ -419,6 +415,7 @@ }); $('.deleteIndex').bind('click', function(e) { + console.log("asdasd"); self.prepDeleteIndex(e); }); @@ -643,7 +640,23 @@ }, getIndex: function () { - this.index = this.model.getIndex(); + + var callback = function(error, data) { + if (error) { + window.arangoHelper.arangoError('Index', data.errorMessage); + } + else { + this.renderIndex(data); + } + }.bind(this); + + this.model.getIndex(callback); + }, + + renderIndex: function(data) { + + this.index = data; + var cssClass = 'collectionInfoTh modal-text'; if (this.index) { var fieldString = ''; @@ -686,6 +699,7 @@ ); }); } + this.bindIndexEvents(); }, toggleNewIndexView: function () { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsView.js index 5427974a42..9ea88c2164 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/collectionsView.js @@ -358,14 +358,27 @@ return 0; } - var returnobj = this.collection.newCollection( - collName, wfs, isSystem, collSize, collType, shards, shardBy - ); - if (returnobj.status !== true) { - arangoHelper.arangoError("Collection error", returnobj.errorMessage); - } - this.updateCollectionsView(); - window.modalView.hide(); + var callback = function(error, data) { + + if (error) { + arangoHelper.arangoError("Collection error", data.errorMessage); + } + else { + this.updateCollectionsView(); + } + window.modalView.hide(); + + }.bind(this); + + this.collection.newCollection({ + collName: collName, + wfs: wfs, + isSystem: isSystem, + collSize: collSize, + collType: collType, + shards: shards, + shardBy: shardBy + }, callback); }, createNewCollectionModal: function() { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/documentView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/documentView.js index 454c850bdc..f7d6de044e 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/documentView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/documentView.js @@ -188,40 +188,67 @@ }, saveDocument: function () { + if ($('#saveDocumentButton').attr('disabled') === undefined) { + if (this.collection.first().attributes._id.substr(0, 1) === '_') { + + var buttons = [], tableContent = []; + tableContent.push( + window.modalView.createReadOnlyEntry( + 'doc-save-system-button', + 'Caution', + 'You are modifying a system collection. Really continue?', + undefined, + undefined, + false, + /[<>&'"]/ + ) + ); + buttons.push( + window.modalView.createSuccessButton('Save', this.confirmSaveDocument.bind(this)) + ); + window.modalView.show('modalTable.ejs', 'Modify System Collection', buttons, tableContent); + } + else { + this.confirmSaveDocument(); + } + } + }, + + confirmSaveDocument: function () { + + window.modalView.hide(); + var model, result; - if ($('#saveDocumentButton').attr('disabled') === undefined) { + try { + model = this.editor.get(); + } + catch (e) { + this.errorConfirmation(e); + this.disableSaveButton(); + return; + } - try { - model = this.editor.get(); - } - catch (e) { - this.errorConfirmation(e); - this.disableSaveButton(); + model = JSON.stringify(model); + + if (this.type === 'document') { + result = this.collection.saveDocument(this.colid, this.docid, model); + if (result === false) { + arangoHelper.arangoError('Document error:','Could not save'); return; } - - model = JSON.stringify(model); - - if (this.type === 'document') { - result = this.collection.saveDocument(this.colid, this.docid, model); - if (result === false) { - arangoHelper.arangoError('Document error:','Could not save'); - return; - } - } - else if (this.type === 'edge') { - result = this.collection.saveEdge(this.colid, this.docid, model); - if (result === false) { - arangoHelper.arangoError('Edge error:', 'Could not save'); - return; - } + } + else if (this.type === 'edge') { + result = this.collection.saveEdge(this.colid, this.docid, model); + if (result === false) { + arangoHelper.arangoError('Edge error:', 'Could not save'); + return; } + } - if (result === true) { - this.successConfirmation(); - this.disableSaveButton(); - } + if (result === true) { + this.successConfirmation(); + this.disableSaveButton(); } }, diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js index 37d518944b..f725950f86 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js @@ -14,11 +14,29 @@ templateSlow: templateEngine.createTemplate("queryManagementViewSlow.ejs"), table: templateEngine.createTemplate("arangoTable.ejs"), tabbar: templateEngine.createTemplate("arangoTabbar.ejs"), + active: true, + shouldRender: true, + timer: 0, + refreshRate: 2000, initialize: function () { + var self = this; this.activeCollection = new window.QueryManagementActive(); this.slowCollection = new window.QueryManagementSlow(); this.convertModelToJSON(true); + + window.setInterval(function() { + if (window.location.hash === '#queryManagement' && window.VISIBLE && self.shouldRender) { + if (self.active) { + self.convertModelToJSON(true); + self.renderActive(); + } + else { + self.convertModelToJSON(false); + self.renderSlow(); + } + } + }, self.refreshRate); }, events: { @@ -44,9 +62,11 @@ switchTab: function(e) { if (e.currentTarget.id === 'activequeries') { + this.active = true; this.convertModelToJSON(true); } else if (e.currentTarget.id === 'slowqueries') { + this.active = false; this.convertModelToJSON(false); } }, @@ -133,11 +153,25 @@ this.convertModelToJSON(true); }, + addEvents: function() { + var self = this; + $('#queryManagementContent tbody').on('mousedown', function() { + clearTimeout(self.timer); + self.shouldRender = false; + }); + $('#queryManagementContent tbody').on('mouseup', function() { + self.timer = window.setTimeout(function() { + self.shouldRender = true; + }, 3000); + }); + }, + renderActive: function() { this.$el.html(this.templateActive.render({})); $(this.id).html(this.tabbar.render({content: this.tabbarElements})); $(this.id).append(this.table.render({content: this.tableDescription})); $('#activequeries').addClass("arango-active-tab"); + this.addEvents(); }, renderSlow: function() { @@ -147,6 +181,7 @@ content: this.tableDescription, })); $('#slowqueries').addClass("arango-active-tab"); + this.addEvents(); }, convertModelToJSON: function (active) { diff --git a/js/apps/system/_admin/aardvark/APP/manifest.json b/js/apps/system/_admin/aardvark/APP/manifest.json index 18c6fd7a2d..1ac9365f35 100644 --- a/js/apps/system/_admin/aardvark/APP/manifest.json +++ b/js/apps/system/_admin/aardvark/APP/manifest.json @@ -6,7 +6,7 @@ "license": "Apache License, Version 2.0", "isSystem": true, "engines": { - "arangodb": "^3.0.0" + "arangodb": "^2.8.0" }, "repository": { diff --git a/js/apps/system/_api/gharial/APP/manifest.json b/js/apps/system/_api/gharial/APP/manifest.json index 6d9ee7c969..8894e7d96f 100644 --- a/js/apps/system/_api/gharial/APP/manifest.json +++ b/js/apps/system/_api/gharial/APP/manifest.json @@ -6,7 +6,7 @@ "license": "Apache License, Version 2.0", "isSystem": true, "engines": { - "arangodb": "^3.0.0" + "arangodb": "^2.8.0" }, "repository": { diff --git a/js/apps/system/_system/cerberus/APP/manifest.json b/js/apps/system/_system/cerberus/APP/manifest.json index 452c9cf3d9..4cf6928290 100644 --- a/js/apps/system/_system/cerberus/APP/manifest.json +++ b/js/apps/system/_system/cerberus/APP/manifest.json @@ -6,7 +6,7 @@ "license": "Apache License, Version 2.0", "isSystem": true, "engines": { - "arangodb": "^3.0.0" + "arangodb": "^2.8.0" }, "repository": { diff --git a/js/apps/system/_system/sessions/APP/manifest.json b/js/apps/system/_system/sessions/APP/manifest.json index 0cad8c4850..ae30989bb0 100644 --- a/js/apps/system/_system/sessions/APP/manifest.json +++ b/js/apps/system/_system/sessions/APP/manifest.json @@ -6,7 +6,7 @@ "license": "Apache License, Version 2.0", "isSystem": true, "engines": { - "arangodb": "^3.0.0" + "arangodb": "^2.8.0" }, "repository": { diff --git a/js/apps/system/_system/simple-auth/APP/manifest.json b/js/apps/system/_system/simple-auth/APP/manifest.json index a50fa719bb..9ab03f98cb 100644 --- a/js/apps/system/_system/simple-auth/APP/manifest.json +++ b/js/apps/system/_system/simple-auth/APP/manifest.json @@ -6,7 +6,7 @@ "license": "Apache License, Version 2.0", "isSystem": true, "engines": { - "arangodb": "^3.0.0" + "arangodb": "^2.8.0" }, "repository": { diff --git a/js/apps/system/_system/users/APP/manifest.json b/js/apps/system/_system/users/APP/manifest.json index 5c857261b9..6c803c73af 100644 --- a/js/apps/system/_system/users/APP/manifest.json +++ b/js/apps/system/_system/users/APP/manifest.json @@ -6,7 +6,7 @@ "license": "Apache License, Version 2.0", "isSystem": true, "engines": { - "arangodb": "^3.0.0" + "arangodb": "^2.8.0" }, "repository": {