From 3286e29f9d323cf41a36057486be9e7b771fedac Mon Sep 17 00:00:00 2001
From: hkernbach
Date: Wed, 17 Feb 2016 12:54:10 +0100
Subject: [PATCH 1/2] web ui better handling loading/unloading collections
---
.../system/_admin/aardvark/APP/aardvark.js | 5 +++--
.../js/models/arangoCollectionModel.js | 4 ++--
.../frontend/js/views/collectionsItemView.js | 22 ++++++++++++++++---
.../APP/frontend/js/views/collectionsView.js | 5 ++++-
.../APP/frontend/scss/_dataTables.scss | 2 +-
5 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/js/apps/system/_admin/aardvark/APP/aardvark.js b/js/apps/system/_admin/aardvark/APP/aardvark.js
index 05154e74ef..2eeb96aea8 100644
--- a/js/apps/system/_admin/aardvark/APP/aardvark.js
+++ b/js/apps/system/_admin/aardvark/APP/aardvark.js
@@ -323,13 +323,14 @@ controller.post("/graph-examples/create/:name", function(req, res) {
controller.post("/job", function(req, res) {
- if (req.body().id && req.body().collection && req.body().type) {
+ if (req.body().id && req.body().collection && req.body().type && req.body().desc) {
//store id in _system
db.aardvark.save({
id: req.body().id,
collection: req.body().collection,
- type: req.body().type
+ type: req.body().type,
+ desc: req.body().desc
});
res.json(true);
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 4b83a9417e..8b7fd2c9fd 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
@@ -112,6 +112,7 @@
window.arangoHelper.addAardvarkJob({
id: xhr.getResponseHeader('x-arango-async-id'),
type: 'index',
+ desc: 'Creating index...',
collection: self.get("id")
});
callback(false, data);
@@ -143,6 +144,7 @@
window.arangoHelper.addAardvarkJob({
id: xhr.getResponseHeader('x-arango-async-id'),
type: 'index',
+ desc: 'Removing index...',
collection: self.get("id")
});
callback(false, data);
@@ -176,7 +178,6 @@
loadCollection: function (callback) {
$.ajax({
- async: true,
cache: false,
type: 'PUT',
url: "/_api/collection/" + this.get("id") + "/load",
@@ -192,7 +193,6 @@
unloadCollection: function (callback) {
$.ajax({
- async: true,
cache: false,
type: 'PUT',
url: "/_api/collection/" + this.get("id") + "/unload?flush=true",
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 b2f3cd57fe..325d1ca5b6 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
@@ -26,6 +26,13 @@
render: function () {
if (this.model.get("locked")) {
$(this.el).addClass('locked');
+ }
+ else {
+ $(this.el).removeClass('locked');
+ }
+
+ if (this.model.get("status") === 'loading') {
+ $(this.el).addClass('locked');
}
$(this.el).html(this.template.render({
model: this.model
@@ -60,10 +67,19 @@
if (this.model.get("locked")) {
return 0;
}
+ if (this.model.get("status") === 'loading' ) {
+ return 0;
+ }
+
+ if (this.model.get("status") === 'unloaded' ) {
+ this.loadCollection();
+ }
+ else {
+ window.App.navigate(
+ "collection/" + encodeURIComponent(this.model.get("name")) + "/documents/1", {trigger: true}
+ );
+ }
- window.App.navigate(
- "collection/" + encodeURIComponent(this.model.get("name")) + "/documents/1", {trigger: true}
- );
},
noop: function(event) {
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 d1b2cee45a..74f2907241 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
@@ -31,12 +31,15 @@
});
this.collection.each(function(model) {
- if (model.get("locked")) {
+ if (model.get("locked") || model.get("status") === 'loading') {
$('#collection_' + model.get("name")).addClass('locked');
}
else {
$('#collection_' + model.get("name")).removeClass('locked');
}
+ if (model.get("status") === 'loading') {
+ $('#collection_' + model.get("name")).removeClass('loading');
+ }
});
},
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_dataTables.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_dataTables.scss
index c9aa4adb71..8d445fc0fe 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_dataTables.scss
+++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_dataTables.scss
@@ -84,7 +84,7 @@ table.arangoDataTable tr.odd {
}
#documentsTableID_wrapper {
- min-height: 480px !important;
+ min-height: 420px !important;
padding-bottom: 0 !important;
.fg-toolbar {
From 1f73f0611e6d073aeb669a6ce0dd14bfd2859433 Mon Sep 17 00:00:00 2001
From: hkernbach
Date: Wed, 17 Feb 2016 12:56:05 +0100
Subject: [PATCH 2/2] grunt build
---
.../APP/clusterFrontend/build/cluster.min.js | 6 +-
.../clusterFrontend/build/cluster.min.js.gz | Bin 21514 -> 21857 bytes
.../_admin/aardvark/APP/frontend/build/app.js | 83 ++++++++++++++----
.../aardvark/APP/frontend/build/app.js.gz | Bin 284947 -> 284811 bytes
.../aardvark/APP/frontend/build/app.min.js | 22 ++---
.../aardvark/APP/frontend/build/app.min.js.gz | Bin 164701 -> 165247 bytes
.../aardvark/APP/frontend/build/arangoes5.js | 6 +-
.../aardvark/APP/frontend/build/arangoes6.js | 40 ++++-----
.../APP/frontend/build/scripts.html.part | 6 +-
.../APP/frontend/build/standalone-min.html | 2 +-
.../APP/frontend/build/standalone-min.html.gz | Bin 25093 -> 25093 bytes
.../APP/frontend/build/standalone.html | 6 +-
.../APP/frontend/build/style-minified.css | 2 +-
.../APP/frontend/build/style-minified.css.gz | Bin 42195 -> 42204 bytes
.../aardvark/APP/frontend/build/style.css | 4 +-
.../aardvark/APP/frontend/build/style.css.gz | Bin 48836 -> 48840 bytes
16 files changed, 111 insertions(+), 66 deletions(-)
diff --git a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js
index 8cfae539ec..61998f6b40 100644
--- a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js
+++ b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js
@@ -1,3 +1,3 @@
-!function(){"use strict";var a;window.isCoordinator=function(){return void 0===a&&$.ajax("cluster/amICoordinator",{async:!1,success:function(b){a=b}}),a},window.versionHelper={fromString:function(a){var b=a.replace(/-[a-zA-Z0-9_\-]*$/g,"").split(".");return{major:parseInt(b[0],10)||0,minor:parseInt(b[1],10)||0,patch:parseInt(b[2],10)||0,toString:function(){return this.major+"."+this.minor+"."+this.patch}}},toString:function(a){return a.major+"."+a.minor+"."+a.patch}},window.arangoHelper={lastNotificationMessage:null,CollectionTypes:{},systemAttributes:function(){return{_id:!0,_rev:!0,_key:!0,_bidirectional:!0,_vertices:!0,_from:!0,_to:!0,$id:!0}},setCheckboxStatus:function(a){$.each($(a).find("ul").find("li"),function(a,b){$(b).hasClass("nav-header")||($(b).find("input").attr("checked")?$(b).find("i").hasClass("css-round-label")?$(b).find("i").addClass("fa-dot-circle-o"):$(b).find("i").addClass("fa-check-square-o"):$(b).find("i").hasClass("css-round-label")?$(b).find("i").addClass("fa-circle-o"):$(b).find("i").addClass("fa-square-o"))})},calculateCenterDivHeight:function(){var a=$(".navbar").height(),b=$(".footer").height(),c=$(window).height();return c-b-a-110},fixTooltips:function(a,b){$(a).tooltip({placement:b,hide:!1,show:!1})},currentDatabase:function(){var a=!1;return $.ajax({type:"GET",cache:!1,url:"/_api/database/current",contentType:"application/json",processData:!1,async:!1,success:function(b){a=b.result.name},error:function(){a=!1}}),a},allHotkeys:{global:{name:"Site wide",content:[{label:"scroll up",letter:"j"},{label:"scroll down",letter:"k"}]},jsoneditor:{name:"AQL editor",content:[{label:"Submit",letter:"Ctrl + Return"},{label:"Toggle comments",letter:"Ctrl + Shift + C"},{label:"Undo",letter:"Ctrl + Z"},{label:"Redo",letter:"Ctrl + Shift + Z"}]},doceditor:{name:"Document editor",content:[{label:"Insert",letter:"Ctrl + Insert"},{label:"Save",letter:"Ctrl + Return, CMD + Return"},{label:"Append",letter:"Ctrl + Shift + Insert"},{label:"Duplicate",letter:"Ctrl + D"},{label:"Remove",letter:"Ctrl + Delete"}]},modals:{name:"Modal",content:[{label:"Submit",letter:"Return"},{label:"Close",letter:"Esc"},{label:"Navigate buttons",letter:"Arrow keys"},{label:"Navigate content",letter:"Tab"}]}},hotkeysFunctions:{scrollDown:function(){window.scrollBy(0,180)},scrollUp:function(){window.scrollBy(0,-180)},showHotkeysModal:function(){var a=[],b=window.arangoHelper.allHotkeys;window.modalView.show("modalHotkeys.ejs","Keyboard Shortcuts",a,b)}},enableKeyboardHotkeys:function(a){var b=window.arangoHelper.hotkeysFunctions;a===!0&&($(document).on("keydown",null,"j",b.scrollDown),$(document).on("keydown",null,"k",b.scrollUp))},databaseAllowed:function(){var a=this.currentDatabase(),b=!1;return $.ajax({type:"GET",cache:!1,url:"/_db/"+encodeURIComponent(a)+"/_api/database/",contentType:"application/json",processData:!1,async:!1,success:function(){b=!0},error:function(){b=!1}}),b},arangoNotification:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"success"})},arangoError:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"error"})},openDocEditor:function(a,b,c){var d=a.split("/"),e=this,f=new window.DocumentView({collection:window.App.arangoDocumentStore});f.breadcrumb=function(){},f.colid=d[0],f.docid=d[1],f.el=".arangoFrame .innerDiv",f.render(),f.setType(b),$(".arangoFrame .headerBar").remove(),$(".arangoFrame .outerDiv").prepend(''),$(".arangoFrame .outerDiv").click(function(){e.closeDocEditor()}),$(".arangoFrame .innerDiv").click(function(a){a.stopPropagation()}),$(".fa-times").click(function(){e.closeDocEditor()}),$(".arangoFrame").show(),f.customView=!0,f.customDeleteFunction=function(){window.modalView.hide(),$(".arangoFrame").hide()},$(".arangoFrame #deleteDocumentButton").click(function(){f.deleteDocumentModal()}),$(".arangoFrame #saveDocumentButton").click(function(){f.saveDocument()}),$(".arangoFrame #deleteDocumentButton").css("display","none")},closeDocEditor:function(){$(".arangoFrame .outerDiv .fa-times").remove(),$(".arangoFrame").hide()},getRandomToken:function(){return Math.round((new Date).getTime())},isSystemAttribute:function(a){var b=this.systemAttributes();return b[a]},isSystemCollection:function(a){return"_"===a.name.substr(0,1)},setDocumentStore:function(a){this.arangoDocumentStore=a},collectionApiType:function(a,b){return(b||void 0===this.CollectionTypes[a])&&(this.CollectionTypes[a]=this.arangoDocumentStore.getCollectionInfo(a).type),3===this.CollectionTypes[a]?"edge":"document"},collectionType:function(a){if(!a||""===a.name)return"-";var b;return b=2===a.type?"document":3===a.type?"edge":"unknown",this.isSystemCollection(a)&&(b+=" (system)"),b},formatDT:function(a){var b=function(a){return 10>a?"0"+a:a};return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+" "+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())},escapeHtml:function(a){return String(a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}}}(),function(){"use strict";window.ClusterCollection=Backbone.Model.extend({defaults:{name:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),status:this.get("status")}}})}(),function(){"use strict";window.ClusterCoordinator=Backbone.Model.extend({defaults:{name:"",url:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),status:this.get("status"),url:this.get("url")}}})}(),function(){"use strict";window.ClusterDatabase=Backbone.Model.extend({defaults:{name:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),status:this.get("status")}}})}(),function(){"use strict";window.ClusterPlan=Backbone.Model.extend({defaults:{},url:"cluster/plan",idAttribute:"config",getVersion:function(){var a=this.get("version");return a||"2.0"},getCoordinator:function(){if(this._coord)return this._coord[this._lastStableCoord];var a,b,c,d,e=[];if(c=this.get("runInfo")){for(b=c.length-1;b>0;){if(c[b].isStartServers&&(d=c[b],d.endpoints))for(a=0;a1){do a=Math.floor(Math.random()*this._coord.length);while(a===b);this._lastStableCoord=a}},isAlive:function(){var a=!1;return $.ajax({cache:!1,type:"GET",async:!1,url:"cluster/healthcheck",success:function(b){a=b},error:function(a){}}),a},storeCredentials:function(a,b){var c=this;$.ajax({url:"cluster/plan/credentials",type:"PUT",data:JSON.stringify({user:a,passwd:b}),async:!1}).done(function(){c.fetch()})},isSymmetricSetup:function(){var a=this.get("config"),b=_.size(a.dispatchers);return b===a.numberOfCoordinators&&b===a.numberOfDBservers},isTestSetup:function(){return 1===_.size(this.get("config").dispatchers)},cleanUp:function(){$.ajax({url:"cluster/plan/cleanUp",type:"DELETE",async:!1})}})}(),function(){"use strict";window.ClusterServer=Backbone.Model.extend({defaults:{name:"",address:"",role:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),address:this.get("address"),status:this.get("status")}}})}(),function(){"use strict";window.ClusterShard=Backbone.Model.extend({defaults:{},idAttribute:"name",forList:function(){return{server:this.get("name"),shards:this.get("shards")}}})}(),function(){"use strict";window.ClusterType=Backbone.Model.extend({defaults:{type:"testPlan"}})}(),function(){"use strict";window.AutomaticRetryCollection=Backbone.Collection.extend({_retryCount:0,checkRetries:function(){var a=this;return this.updateUrl(),this._retryCount>10?(window.setTimeout(function(){a._retryCount=0},1e4),window.App.clusterUnreachable(),!1):!0},successFullTry:function(){this._retryCount=0},failureTry:function(a,b,c){401===c.status?window.App.requestAuth():(window.App.clusterPlan.rotateCoordinator(),this._retryCount++,a())}})}(),window.ClusterStatisticsCollection=Backbone.Collection.extend({model:window.Statistics,url:"/_admin/statistics",updateUrl:function(){this.url=window.App.getNewRoute("statistics")},initialize:function(){window.App.registerForUpdate(this)},fetch:function(a,b){this.forEach(function(c){c.fetch({beforeSend:window.App.addAuth.bind(window.App),error:function(){b(c)}}).done(function(){a(c)})})}}),function(){"use strict";window.ClusterCollections=window.AutomaticRetryCollection.extend({model:window.ClusterCollection,updateUrl:function(){this.url=window.App.getNewRoute(this.dbname+"/Collections")},url:function(){return"/_admin/aardvark/cluster/"+this.dbname+"/Collections"},initialize:function(){this.isUpdating=!1,this.timer=null,this.interval=1e3,window.App.registerForUpdate(this)},getList:function(a,b){if(void 0!==a&&(this.dbname=a,this.checkRetries())){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.getList.bind(c,a,b))}).done(function(){b(c.map(function(a){return a.forList()}))})}},stopUpdating:function(){window.clearTimeout(this.timer),this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.updateUrl(),a.fetch({beforeSend:window.App.addAuth.bind(window.App)})},this.interval)}}})}(),function(){"use strict";window.ClusterCoordinators=window.AutomaticRetryCollection.extend({model:window.ClusterCoordinator,url:"/_admin/aardvark/cluster/Coordinators",updateUrl:function(){this.url=window.App.getNewRoute("Coordinators")},initialize:function(){window.App.registerForUpdate(this)},statusClass:function(a){switch(a){case"ok":return"success";case"warning":return"warning";case"critical":return"danger";case"missing":return"inactive";default:return"danger"}},getStatuses:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.getStatuses.bind(c,a,b))}).done(function(){c.successFullTry(),c.forEach(function(b){a(c.statusClass(b.get("status")),b.get("address"))}),b()})}},byAddress:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.byAddress.bind(c,a,b))}).done(function(){c.successFullTry(),a=a||{},c.forEach(function(b){var c=b.get("address");c=c.split(":")[0],a[c]=a[c]||{},a[c].coords=a[c].coords||[],a[c].coords.push(b)}),b(a)})}},checkConnection:function(a){var b=this;this.checkRetries()&&this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.checkConnection.bind(b,a))}).done(function(){b.successFullTry(),a()})},getList:function(){throw"Do not use coordinator.getList"},getOverview:function(){throw"Do not use coordinator.getOverview"}})}(),function(){"use strict";window.ClusterDatabases=window.AutomaticRetryCollection.extend({model:window.ClusterDatabase,url:"/_admin/aardvark/cluster/Databases",updateUrl:function(){this.url=window.App.getNewRoute("Databases")},initialize:function(){window.App.registerForUpdate(this)},getList:function(a){if(this.checkRetries()){var b=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.getList.bind(b,a))}).done(function(){b.successFullTry(),a(b.map(function(a){return a.forList()}))})}}})}(),function(){"use strict";window.ClusterServers=window.AutomaticRetryCollection.extend({model:window.ClusterServer,url:"/_admin/aardvark/cluster/DBServers",updateUrl:function(){this.url=window.App.getNewRoute("DBServers")},initialize:function(){window.App.registerForUpdate(this)},statusClass:function(a){switch(a){case"ok":return"success";case"warning":return"warning";case"critical":return"danger";case"missing":return"inactive";default:return"danger"}},getStatuses:function(a){if(this.checkRetries()){var b=this,c=function(){b.successFullTry(),b._retryCount=0,b.forEach(function(c){a(b.statusClass(c.get("status")),c.get("address"))})};this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.getStatuses.bind(b,a))}).done(c)}},byAddress:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.byAddress.bind(c,a,b))}).done(function(){c.successFullTry(),a=a||{},c.forEach(function(b){var c=b.get("address");c=c.split(":")[0],a[c]=a[c]||{},a[c].dbs=a[c].dbs||[],a[c].dbs.push(b)}),b(a)})}},getList:function(a){throw"Do not use"},getOverview:function(){throw"Do not use DbServer.getOverview"}})}(),function(){"use strict";window.ClusterShards=window.AutomaticRetryCollection.extend({model:window.ClusterShard,updateUrl:function(){this.url=window.App.getNewRoute(this.dbname+"/"+this.colname+"/Shards")},url:function(){return"/_admin/aardvark/cluster/"+this.dbname+"/"+this.colname+"/Shards"},initialize:function(){this.isUpdating=!1,this.timer=null,this.interval=1e3,window.App.registerForUpdate(this)},getList:function(a,b,c){if(void 0!==a&&void 0!==b&&(this.dbname=a,this.colname=b,this.checkRetries())){var d=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:d.failureTry.bind(d,d.getList.bind(d,a,b,c))}).done(function(){c(d.map(function(a){return a.forList()}))})}},stopUpdating:function(){window.clearTimeout(this.timer),this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.updateUrl(),a.fetch({beforeSend:window.App.addAuth.bind(window.App)})},this.interval)}}})}(),window.arangoDocumentModel=Backbone.Model.extend({initialize:function(){"use strict"},urlRoot:"/_api/document",defaults:{_id:"",_rev:"",_key:""},getSorted:function(){"use strict";var a=this,b=Object.keys(a.attributes).sort(function(a,b){var c=arangoHelper.isSystemAttribute(a),d=arangoHelper.isSystemAttribute(b);return c!==d?c?-1:1:b>a?-1:1}),c={};return _.each(b,function(b){c[b]=a.attributes[b]}),c}}),window.Statistics=Backbone.Model.extend({defaults:{},url:function(){"use strict";return"/_admin/statistics"}}),window.StatisticsDescription=Backbone.Model.extend({defaults:{figures:"",groups:""},url:function(){"use strict";return"/_admin/statistics-description"}}),function(){"use strict";window.PaginatedCollection=Backbone.Collection.extend({page:0,pagesize:10,totalAmount:0,getPage:function(){return this.page+1},setPage:function(a){return a>=this.getLastPageNumber()?void(this.page=this.getLastPageNumber()-1):1>a?void(this.page=0):void(this.page=a-1)},getLastPageNumber:function(){return Math.max(Math.ceil(this.totalAmount/this.pagesize),1)},getOffset:function(){return this.page*this.pagesize},getPageSize:function(){return this.pagesize},setPageSize:function(a){if("all"===a)this.pagesize="all";else try{a=parseInt(a,10),this.pagesize=a}catch(b){}},setToFirst:function(){this.page=0},setToLast:function(){this.setPage(this.getLastPageNumber())},setToPrev:function(){this.setPage(this.getPage()-1)},setToNext:function(){this.setPage(this.getPage()+1)},setTotal:function(a){this.totalAmount=a},getTotal:function(){return this.totalAmount},setTotalMinusOne:function(){this.totalAmount--}})}(),window.StatisticsCollection=Backbone.Collection.extend({model:window.Statistics,url:"/_admin/statistics"}),function(){"use strict";window.arangoDocuments=window.PaginatedCollection.extend({collectionID:1,filters:[],MAX_SORT:12e3,lastQuery:{},sortAttribute:"_key",url:"/_api/documents",model:window.arangoDocumentModel,loadTotal:function(){var a=this;$.ajax({cache:!1,type:"GET",url:"/_api/collection/"+this.collectionID+"/count",contentType:"application/json",processData:!1,async:!1,success:function(b){a.setTotal(b.count)}})},setCollection:function(a){this.resetFilter(),this.collectionID=a,this.setPage(1),this.loadTotal()},setSort:function(a){this.sortAttribute=a},getSort:function(){return this.sortAttribute},addFilter:function(a,b,c){this.filters.push({attr:a,op:b,val:c})},setFiltersForQuery:function(a){if(0===this.filters.length)return"";var b=" FILTER",c="",d=_.map(this.filters,function(b,d){return"LIKE"===b.op?(c=" "+b.op+"(x.`"+b.attr+"`, @param",c+=d,c+=")"):(c="IN"===b.op||"NOT IN"===b.op?" ":" x.`",c+=b.attr,c+="IN"===b.op||"NOT IN"===b.op?" ":"` ",c+=b.op,c+="IN"===b.op||"NOT IN"===b.op?" x.@param":" @param",c+=d),a["param"+d]=b.val,c});return b+d.join(" &&")},setPagesize:function(a){this.setPageSize(a)},resetFilter:function(){this.filters=[]},moveDocument:function(a,b,c,d){var e,f,g,h,i={"@collection":b,filterid:a};e="FOR x IN @@collection",e+=" FILTER x._key == @filterid",e+=" INSERT x IN ",e+=c,f="FOR x in @@collection",f+=" FILTER x._key == @filterid",f+=" REMOVE x IN @@collection",g={query:e,bindVars:i},h={query:f,bindVars:i},window.progressView.show(),$.ajax({cache:!1,type:"POST",async:!0,url:"/_api/cursor",data:JSON.stringify(g),contentType:"application/json",success:function(a){$.ajax({cache:!1,type:"POST",async:!0,url:"/_api/cursor",data:JSON.stringify(h),contentType:"application/json",success:function(a){d&&d(),window.progressView.hide()},error:function(a){window.progressView.hide(),arangoHelper.arangoError("Document error","Documents inserted, but could not be removed.")}})},error:function(a){window.progressView.hide(),arangoHelper.arangoError("Document error","Could not move selected documents.")}})},getDocuments:function(a){window.progressView.showWithDelay(300,"Fetching documents...");var b,c,d,e,f=this;c={"@collection":this.collectionID,offset:this.getOffset(),count:this.getPageSize()},b="FOR x IN @@collection LET att = SLICE(ATTRIBUTES(x), 0, 25)",b+=this.setFiltersForQuery(c),this.getTotal()0)&&(e.options={fullCount:!0}),$.ajax({cache:!1,type:"POST",async:!0,url:"/_api/cursor",data:JSON.stringify(e),contentType:"application/json",success:function(b){window.progressView.toShow=!1,f.clearDocuments(),b.extra&&void 0!==b.extra.stats.fullCount&&f.setTotal(b.extra.stats.fullCount),0!==f.getTotal()&&_.each(b.result,function(a){f.add({id:a._id,rev:a._rev,key:a._key,content:a})}),f.lastQuery=e,a(),window.progressView.hide()},error:function(a){window.progressView.hide(),arangoHelper.arangoError("Document error","Could not fetch requested documents.")}})},clearDocuments:function(){this.reset()},buildDownloadDocumentQuery:function(){var a,b,c;return c={"@collection":this.collectionID},a="FOR x in @@collection",a+=this.setFiltersForQuery(c),this.getTotal()0&&(b="At least one error occurred during upload")}catch(d){}}}),b}})}(),function(){"use strict";if(!window.hasOwnProperty("TEST_BUILD")){var a=function(){var a={};return a.createTemplate=function(a){var b=$("#"+a.replace(".","\\.")).html();return{render:function(a){return _.template(b,a)}}},a};window.templateEngine=new a}}(),function(){"use strict";window.FooterView=Backbone.View.extend({el:"#footerBar",system:{},isOffline:!0,isOfflineCounter:0,firstLogin:!0,events:{"click .footer-center p":"showShortcutModal"},initialize:function(){var a=this;window.setInterval(function(){a.getVersion()},15e3),a.getVersion()},template:templateEngine.createTemplate("footerView.ejs"),showServerStatus:function(a){a===!0?($(".serverStatusIndicator").addClass("isOnline"),$(".serverStatusIndicator").addClass("fa-check-circle-o"),$(".serverStatusIndicator").removeClass("fa-times-circle-o")):($(".serverStatusIndicator").removeClass("isOnline"),$(".serverStatusIndicator").removeClass("fa-check-circle-o"),$(".serverStatusIndicator").addClass("fa-times-circle-o"))},showShortcutModal:function(){window.arangoHelper.hotkeysFunctions.showHotkeysModal()},getVersion:function(){var a=this;$.ajax({type:"GET",cache:!1,url:"/_api/version",contentType:"application/json",processData:!1,async:!0,success:function(b){a.showServerStatus(!0),a.isOffline===!0&&(a.isOffline=!1,a.isOfflineCounter=0,a.firstLogin?a.firstLogin=!1:window.setTimeout(function(){a.showServerStatus(!0)},1e3),a.system.name=b.server,a.system.version=b.version,a.render())},error:function(b){a.isOffline=!0,a.isOfflineCounter++,a.isOfflineCounter>=1&&a.showServerStatus(!1)}}),a.system.hasOwnProperty("database")||$.ajax({type:"GET",cache:!1,url:"/_api/database/current",contentType:"application/json",processData:!1,async:!0,success:function(b){var c=b.result.name;a.system.database=c;var d=window.setInterval(function(){var b=$("#databaseNavi");b&&(window.clearTimeout(d),d=null,"_system"===c?($(".logs-menu").css("visibility","visible"),$(".logs-menu").css("display","inline"),$("#databaseNavi").css("display","inline")):($(".logs-menu").css("visibility","hidden"),$(".logs-menu").css("display","none")),a.render())},50)}})},renderVersion:function(){this.system.hasOwnProperty("database")&&this.system.hasOwnProperty("name")&&$(this.el).html(this.template.render({name:this.system.name,version:this.system.version,database:this.system.database}))},render:function(){return this.system.version||this.getVersion(),$(this.el).html(this.template.render({name:this.system.name,version:this.system.version})),this}})}(),function(){"use strict";function a(a,b){return(void 0===a||null===a)&&(a=0),a.toFixed(b)}window.DashboardView=Backbone.View.extend({el:"#content",interval:1e4,defaultTimeFrame:12e5,defaultDetailFrame:1728e5,history:{},graphs:{},events:{},tendencies:{asyncPerSecondCurrent:["asyncPerSecondCurrent","asyncPerSecondPercentChange"],syncPerSecondCurrent:["syncPerSecondCurrent","syncPerSecondPercentChange"],clientConnectionsCurrent:["clientConnectionsCurrent","clientConnectionsPercentChange"],clientConnectionsAverage:["clientConnections15M","clientConnections15MPercentChange"],numberOfThreadsCurrent:["numberOfThreadsCurrent","numberOfThreadsPercentChange"],numberOfThreadsAverage:["numberOfThreads15M","numberOfThreads15MPercentChange"],virtualSizeCurrent:["virtualSizeCurrent","virtualSizePercentChange"],virtualSizeAverage:["virtualSize15M","virtualSize15MPercentChange"]},barCharts:{totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]},barChartsElementNames:{queueTimeDistributionPercent:"Queue",requestTimeDistributionPercent:"Computation",bytesSentDistributionPercent:"Bytes sent",bytesReceivedDistributionPercent:"Bytes received"},getDetailFigure:function(a){var b=$(a.currentTarget).attr("id").replace(/ChartButton/g,"");return b},showDetail:function(a){var b,c=this,d=this.getDetailFigure(a);b=this.dygraphConfig.getDetailChartConfig(d),this.getHistoryStatistics(d),this.detailGraphFigure=d,window.modalView.hideFooter=!0,window.modalView.hide(),window.modalView.show("modalGraph.ejs",b.header,void 0,void 0,void 0,void 0,this.events),window.modalView.hideFooter=!1,$("#modal-dialog").on("hidden",function(){c.hidden()}),$("#modal-dialog").toggleClass("modal-chart-detail",!0),b.height=.7*$(window).height(),b.width=$(".modal-inner-detail").width(),b.labelsDiv=$(b.labelsDiv)[0],this.detailGraph=new Dygraph(document.getElementById("lineChartDetail"),this.history[this.server][d],b)},hidden:function(){this.detailGraph.destroy(),delete this.detailGraph,delete this.detailGraphFigure},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},prepareDygraphs:function(){var a,b=this;this.dygraphConfig.getDashBoardFigures().forEach(function(c){a=b.dygraphConfig.getDefaultConfig(c);var d=b.getCurrentSize(a.div);a.height=d.height,a.width=d.width,b.graphs[c]=new Dygraph(document.getElementById(a.div),b.history[b.server][c]||[],a)})},initialize:function(){this.dygraphConfig=this.options.dygraphConfig,this.d3NotInitialized=!0,this.events["click .dashboard-sub-bar-menu-sign"]=this.showDetail.bind(this),this.events["mousedown .dygraph-rangesel-zoomhandle"]=this.stopUpdating.bind(this),this.events["mouseup .dygraph-rangesel-zoomhandle"]=this.startUpdating.bind(this),this.serverInfo=this.options.serverToShow,this.serverInfo?this.server=this.serverInfo.target:this.server="-local-",this.history[this.server]={}},updateCharts:function(){var a=this;return this.detailGraph?void this.updateLineChart(this.detailGraphFigure,!0):(this.prepareD3Charts(this.isUpdating),this.prepareResidentSize(this.isUpdating),this.updateTendencies(),void Object.keys(this.graphs).forEach(function(b){a.updateLineChart(b,!1)}))},updateTendencies:function(){var a=this,b=this.tendencies,c="";Object.keys(b).forEach(function(b){var d="",e=0;a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)&&(e=a.history[a.server][b][1]),0>e?c="#d05448":(c="#7da817",d="+"),a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)?$("#"+b).html(a.history[a.server][b][0]+'
'+d+e+"%"):$("#"+b).html('
data not ready yet')})},updateDateWindow:function(a,b){var c,d,e=(new Date).getTime();return b&&a.dateWindow_?(c=a.dateWindow_[0],d=e-a.dateWindow_[1]-5*this.interval>0?a.dateWindow_[1]:e,[c,d]):[e-this.defaultTimeFrame,e]},updateLineChart:function(a,b){var c=b?this.detailGraph:this.graphs[a],d={file:this.history[this.server][a],dateWindow:this.updateDateWindow(c,b)},e=0,f=[];_.each(d.file,function(a){var b=a[0].getSeconds()-a[0].getSeconds()%10;d.file[e][0].setSeconds(b),f.push(d.file[e][0]),e++});for(var g=new Date(Math.max.apply(null,f)),h=new Date(Math.min.apply(null,f)),i=new Date(h.getTime()),j=[],k=[];g>i;)i=new Date(i.setSeconds(i.getSeconds()+10)),k.push(i);_.each(k,function(a){var b=!1;_.each(d.file,function(c){Math.floor(a.getTime()/1e3)===Math.floor(c[0].getTime()/1e3)&&(b=!0)}),b===!1&&a1&&d.history[d.server][e].push(c))})},cutOffHistory:function(a,b){for(var c=this;0!==c.history[c.server][a].length;){var d=c.history[c.server][a][0][0];if(d>=b)break;c.history[c.server][a].shift()}},cutOffDygraphHistory:function(a){var b=this,c=new Date(a);this.dygraphConfig.getDashBoardFigures(!0).forEach(function(a){b.dygraphConfig.mapStatToFigure[a]&&b.history[b.server][a]&&b.cutOffHistory(a,c)})},mergeHistory:function(b){var c,d=this;for(c=0;c=0;--c)d.values.push({label:this.getLabel(b[a[0]].cuts,c),value:b[a[0]].values[c]}),e.values.push({label:this.getLabel(b[a[1]].cuts,c),value:b[a[1]].values[c]});return[d,e]},getLabel:function(a,b){return a[b]?0===b?"0 - "+a[b]:a[b-1]+" - "+a[b]:">"+a[b-1]},renderReplicationStatistics:function(a){$("#repl-numbers table tr:nth-child(1) > td:nth-child(2)").html(a.state.totalEvents),$("#repl-numbers table tr:nth-child(2) > td:nth-child(2)").html(a.state.totalRequests),$("#repl-numbers table tr:nth-child(3) > td:nth-child(2)").html(a.state.totalFailedConnects),a.state.lastAppliedContinuousTick?$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html(a.state.lastAppliedContinuousTick):$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastProcessedContinuousTick?$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html(a.state.lastProcessedContinuousTick):$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastAvailableContinuousTick?$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html(a.state.lastAvailableContinuousTick):$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html("no data available").addClass("no-data"),$("#repl-progress table tr:nth-child(1) > td:nth-child(2)").html(a.state.progress.message),$("#repl-progress table tr:nth-child(2) > td:nth-child(2)").html(a.state.progress.time),$("#repl-progress table tr:nth-child(3) > td:nth-child(2)").html(a.state.progress.failedConnects)},getReplicationStatistics:function(){var a=this;$.ajax("/_api/replication/applier-state",{async:!0}).done(function(b){if(b.hasOwnProperty("state")){var c;c=b.state.running?"active":"inactive",c=''+c+"",$("#replication-chart .dashboard-sub-bar").html("Replication "+c),a.renderReplicationStatistics(b)}})},getStatistics:function(a){var b=this,c="/_db/_system/_admin/aardvark/statistics/short",d="?start=";d+=b.nextStart?b.nextStart:((new Date).getTime()-b.defaultTimeFrame)/1e3,"-local-"!==b.server&&(c=b.serverInfo.endpoint+"/_admin/aardvark/statistics/cluster",d+="&type=short&DBserver="+b.serverInfo.target,b.history.hasOwnProperty(b.server)||(b.history[b.server]={})),$.ajax(c+d,{async:!0}).done(function(c){c.times.length>0&&(b.isUpdating=!0,b.mergeHistory(c)),b.isUpdating!==!1&&(a&&a(),b.updateCharts())}),this.getReplicationStatistics()},getHistoryStatistics:function(a){var b=this,c="statistics/long",d="?filter="+this.dygraphConfig.mapStatToFigure[a].join();"-local-"!==b.server&&(c=b.server.endpoint+"/_admin/aardvark/statistics/cluster",d+="&type=long&DBserver="+b.server.target,b.history.hasOwnProperty(b.server)||(b.history[b.server]={}));var e=window.location.href.split("/"),f=e[0]+"//"+e[2]+"/"+e[3]+"/_system/"+e[5]+"/"+e[6]+"/";$.ajax(f+c+d,{async:!0}).done(function(c){var d;for(b.history[b.server][a]=[],d=0;d data not ready yet
'),$("#totalTimeDistribution").prepend(' data not ready yet
'),$(".dashboard-bar-chart-title").prepend(' data not ready yet
'));
-},removeEmptyDataLabels:function(){$(".dataNotReadyYet").remove()},prepareResidentSize:function(b){var c=this,d=this.getCurrentSize("#residentSizeChartContainer"),e=c.history[c.server].residentSizeCurrent/1024/1024,f="";f=1025>e?a(e,2)+" MB":a(e/1024,2)+" GB";var g=a(100*c.history[c.server].residentSizePercent,2),h=[a(c.history[c.server].physicalMemory/1024/1024/1024,0)+" GB"];return void 0===c.history[c.server].residentSizeChart?void this.addEmptyDataLabels():(this.removeEmptyDataLabels(),void nv.addGraph(function(){var a=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,right:1,bottom:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,left:1}).showValues(!1).showYAxis(!1).showXAxis(!1).transitionDuration(100).tooltips(!1).showLegend(!1).showControls(!1).stacked(!0);return a.yAxis.tickFormat(function(a){return a+"%"}).showMaxMin(!1),a.xAxis.showMaxMin(!1),d3.select("#residentSizeChart svg").datum(c.history[c.server].residentSizeChart).call(a),d3.select("#residentSizeChart svg").select(".nv-zeroLine").remove(),b&&(d3.select("#residentSizeChart svg").select("#total").remove(),d3.select("#residentSizeChart svg").select("#percentage").remove()),d3.select(".dashboard-bar-chart-title .percentage").html(f+" ("+g+" %)"),d3.select(".dashboard-bar-chart-title .absolut").html(h[0]),nv.utils.windowResize(a.update),a},function(){d3.selectAll("#residentSizeChart .nv-bar").on("click",function(){})}))},prepareD3Charts:function(b){var c=this,d={totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]};this.d3NotInitialized&&(b=!1,this.d3NotInitialized=!1),_.each(Object.keys(d),function(b){var d=c.getCurrentSize("#"+b+"Container .dashboard-interior-chart"),e="#"+b+"Container svg";return void 0===c.history[c.server].residentSizeChart?void c.addEmptyDataLabels():(c.removeEmptyDataLabels(),void nv.addGraph(function(){var f=[0,.25,.5,.75,1],g=75,h=23,i=6;d.width<219?(f=[0,.5,1],g=72,h=21,i=5):d.width<299?(f=[0,.3334,.6667,1],g=77):d.width<379?g=87:d.width<459?g=95:d.width<539?g=100:d.width<619&&(g=105);var j=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:5,right:20,bottom:h,left:g}).showValues(!1).showYAxis(!0).showXAxis(!0).transitionDuration(100).tooltips(!1).showLegend(!1).showControls(!1).forceY([0,1]);j.yAxis.showMaxMin(!1);d3.select(".nv-y.nv-axis").selectAll("text").attr("transform","translate (0, "+i+")");return j.yAxis.tickValues(f).tickFormat(function(b){return a(100*b*100/100,0)+"%"}),d3.select(e).datum(c.history[c.server][b]).call(j),nv.utils.windowResize(j.update),j},function(){d3.selectAll(e+" .nv-bar").on("click",function(){})}))})},stopUpdating:function(){this.isUpdating=!1},startUpdating:function(){var a=this;a.timer||(a.timer=window.setInterval(function(){a.getStatistics()},a.interval))},resize:function(){if(this.isUpdating){var a,b=this;_.each(this.graphs,function(c){a=b.getCurrentSize(c.maindiv_.id),c.resize(a.width,a.height)}),this.detailGraph&&(a=this.getCurrentSize(this.detailGraph.maindiv_.id),this.detailGraph.resize(a.width,a.height)),this.prepareD3Charts(!0),this.prepareResidentSize(!0)}},template:templateEngine.createTemplate("dashboardView.ejs"),render:function(a){a||$(this.el).html(this.template.render());var b=function(){this.prepareDygraphs(),this.isUpdating&&(this.prepareD3Charts(),this.prepareResidentSize(),this.updateTendencies()),this.startUpdating()}.bind(this),c=this.options.database.hasSystemAccess();c?this.getStatistics(b):($(".contentDiv").remove(),$(".headerBar").remove(),$(".dashboard-headerbar").remove(),$(".dashboard-row").remove(),$("#content").append('You do not have permission to view this page.
'),$("#content").append("You can switch to '_system' to see the dashboard.
"))}})}(),function(){"use strict";var a=function(a,b,c,d){return{type:a,title:b,callback:c,confirm:d}},b=function(a,b,c,d,e,f,g,h,i,j,k){var l={type:a,label:b};return void 0!==c&&(l.value=c),void 0!==d&&(l.info=d),void 0!==e&&(l.placeholder=e),void 0!==f&&(l.mandatory=f),void 0!==h&&(l.addDelete=h),void 0!==i&&(l.addAdd=i),void 0!==j&&(l.maxEntrySize=j),void 0!==k&&(l.tags=k),g&&(l.validateInput=function(){return g}),l};window.ModalView=Backbone.View.extend({_validators:[],_validateWatchers:[],baseTemplate:templateEngine.createTemplate("modalBase.ejs"),tableTemplate:templateEngine.createTemplate("modalTable.ejs"),el:"#modalPlaceholder",contentEl:"#modalContent",hideFooter:!1,confirm:{list:"#modal-delete-confirmation",yes:"#modal-confirm-delete",no:"#modal-abort-delete"},enabledHotkey:!1,enableHotKeys:!0,buttons:{SUCCESS:"success",NOTIFICATION:"notification",DELETE:"danger",NEUTRAL:"neutral",CLOSE:"close"},tables:{READONLY:"readonly",TEXT:"text",BLOB:"blob",PASSWORD:"password",SELECT:"select",SELECT2:"select2",CHECKBOX:"checkbox"},initialize:function(){Object.freeze(this.buttons),Object.freeze(this.tables)},createModalHotkeys:function(){$(this.el).unbind("keydown"),$(this.el).unbind("return"),$(this.el).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body input").unbind("keydown"),$(".modal-body input").unbind("return"),$(".modal-body input",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body select").unbind("keydown"),$(".modal-body select").unbind("return"),$(".modal-body select",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()})},createInitModalHotkeys:function(){var a=this;$(this.el).bind("keydown","left",function(){a.navigateThroughButtons("left")}),$(this.el).bind("keydown","right",function(){a.navigateThroughButtons("right")})},navigateThroughButtons:function(a){var b=$(".createModalDialog .modal-footer button").is(":focus");b===!1?"left"===a?$(".createModalDialog .modal-footer button").first().focus():"right"===a&&$("..createModalDialog .modal-footer button").last().focus():b===!0&&("left"===a?$(":focus").prev().focus():"right"===a&&$(":focus").next().focus())},createCloseButton:function(b,c){var d=this;return a(this.buttons.CLOSE,b,function(){d.hide(),c&&c()})},createSuccessButton:function(b,c){return a(this.buttons.SUCCESS,b,c)},createNotificationButton:function(b,c){return a(this.buttons.NOTIFICATION,b,c)},createDeleteButton:function(b,c,d){return a(this.buttons.DELETE,b,c,d)},createNeutralButton:function(b,c){return a(this.buttons.NEUTRAL,b,c)},createDisabledButton:function(b){var c=a(this.buttons.NEUTRAL,b);return c.disabled=!0,c},createReadOnlyEntry:function(a,c,d,e,f,g){var h=b(this.tables.READONLY,c,d,e,void 0,void 0,void 0,f,g);return h.id=a,h},createTextEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.TEXT,c,d,e,f,g,h);return i.id=a,i},createBlobEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.BLOB,c,d,e,f,g,h);return i.id=a,i},createSelect2Entry:function(a,c,d,e,f,g,h,i,j,k){var l=b(this.tables.SELECT2,c,d,e,f,g,void 0,h,i,j,k);return l.id=a,l},createPasswordEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.PASSWORD,c,d,e,f,g,h);return i.id=a,i},createCheckboxEntry:function(a,c,d,e,f){var g=b(this.tables.CHECKBOX,c,d,e);return g.id=a,f&&(g.checked=f),g},createSelectEntry:function(a,c,d,e,f){var g=b(this.tables.SELECT,c,null,e);return g.id=a,d&&(g.selected=d),g.options=f,g},createOptionEntry:function(a,b){return{label:a,value:b||a}},show:function(a,b,c,d,e,f,g,h,i){var j,k,l=this,m=!1;c=c||[],h=Boolean(h),this.clearValidators(),c.length>0?(c.forEach(function(a){a.type===l.buttons.CLOSE&&(m=!0),a.type===l.buttons.DELETE&&(k=k||a.confirm)}),m||(j=c.pop(),c.push(l.createCloseButton("Cancel")),c.push(j))):c.push(l.createCloseButton("Close")),$(this.el).html(this.baseTemplate.render({title:b,buttons:c,hideFooter:this.hideFooter,confirm:k,tabBar:i})),_.each(c,function(a,b){return!a.disabled&&a.callback?a.type!==l.buttons.DELETE||h?void $("#modalButton"+b).bind("click",a.callback):void $("#modalButton"+b).bind("click",function(){$(l.confirm.yes).unbind("click"),$(l.confirm.yes).bind("click",a.callback),$(l.confirm.list).css("display","block")}):void 0}),$(this.confirm.no).bind("click",function(){$(l.confirm.list).css("display","none")});var n;if("string"==typeof a)n=templateEngine.createTemplate(a),$(".createModalDialog .modal-body").html(n.render({content:d,advancedContent:e,info:f}));else{var o=0;_.each(a,function(a){n=templateEngine.createTemplate(a),$(".createModalDialog .modal-body .tab-content #"+i[o]).html(n.render({content:d,advancedContent:e,info:f})),o++})}$(".createModalDialog .modalTooltips").tooltip({position:{my:"left top",at:"right+55 top-1"}});var p=d||[];e&&e.content&&(p=p.concat(e.content)),_.each(p,function(a){l.modalBindValidation(a),a.type===l.tables.SELECT2&&$("#"+a.id).select2({tags:a.tags||[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:a.maxEntrySize||8})}),g&&(this.events=g,this.delegateEvents()),$("#accordion2")&&($("#accordion2 .accordion-toggle").bind("click",function(){$("#collapseOne").is(":visible")?($("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)):($("#collapseOne").show(),setTimeout(function(){$(".accordion-toggle").removeClass("collapsed")},100))}),$("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)),$("#modal-dialog").modal("show"),this.enabledHotkey===!1&&(this.createInitModalHotkeys(),this.enabledHotkey=!0),this.enableHotKeys&&this.createModalHotkeys();var q=$("#modal-dialog").find("input");q&&setTimeout(function(){var a=$("#modal-dialog");a.length>0&&(a=a.find("input"),a.length>0&&$(a[0]).focus())},800)},modalBindValidation:function(a){var b=this;if(a.hasOwnProperty("id")&&a.hasOwnProperty("validateInput")){var c=function(){var b=$("#"+a.id),c=a.validateInput(b),d=!1;return _.each(c,function(a){var c=b.val();if(a.rule||(a={rule:a}),"function"==typeof a.rule)try{a.rule(c)}catch(e){d=a.msg||e.message}else{var f=Joi.validate(c,a.rule);f.error&&(d=a.msg||f.error.message)}return d?!1:void 0}),d?d:void 0},d=$("#"+a.id);d.on("keyup focusout",function(){var a=c(),e=d.next()[0];a?(d.addClass("invalid-input"),e?$(e).text(a):d.after(''+a+"
"),$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled")):(d.removeClass("invalid-input"),e&&$(e).remove(),b.modalTestAll())}),this._validators.push(c),this._validateWatchers.push(d)}},modalTestAll:function(){var a=_.map(this._validators,function(a){return a()}),b=_.any(a);return b?$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled"):$(".createModalDialog .modal-footer .button-success").prop("disabled",!1).removeClass("disabled"),!b},clearValidators:function(){this._validators=[],_.each(this._validateWatchers,function(a){a.unbind("keyup focusout")}),this._validateWatchers=[]},hide:function(){this.clearValidators(),$("#modal-dialog").modal("hide")}})}(),window.StatisticsDescriptionCollection=Backbone.Collection.extend({model:window.StatisticsDescription,url:"/_admin/statistics-description",parse:function(a){return a}}),function(){"use strict";window.ClusterDownView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("clusterDown.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),events:{"click #relaunchCluster":"relaunchCluster","click #upgradeCluster":"upgradeCluster","click #editPlan":"editPlan","click #submitEditPlan":"submitEditPlan","click #deletePlan":"deletePlan","click #submitDeletePlan":"submitDeletePlan"},render:function(){var a,b=window.versionHelper.fromString(window.App.clusterPlan.getVersion());$.ajax({type:"GET",cache:!1,url:"/_admin/database/target-version",contentType:"application/json",processData:!1,async:!1,success:function(b){a=b.version}}),a=window.versionHelper.fromString(a);var c=!1;(a.major>b.major||a.major===b.major&&a.minor>b.minor)&&(c=!0),$(this.el).html(this.template.render({canUpgrade:c})),$(this.el).append(this.modal.render({}))},relaunchCluster:function(){$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster will be relaunched"),$.ajax({cache:!1,type:"GET",url:"cluster/relaunch",success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.navigate("showCluster",{trigger:!0})}})},upgradeCluster:function(){$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster will be upgraded"),$.ajax({cache:!1,type:"GET",url:"cluster/upgrade",success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.clusterPlan.fetch(),window.App.navigate("showCluster",{trigger:!0})}})},editPlan:function(){$("#deletePlanModal").modal("hide"),$("#editPlanModal").modal("show")},submitEditPlan:function(){$("#editPlanModal").modal("hide"),window.App.clusterPlan.cleanUp();var a=window.App.clusterPlan;return a.isTestSetup()?void window.App.navigate("planTest",{trigger:!0}):void window.App.navigate("planAsymmetrical",{trigger:!0})},deletePlan:function(){$("#editPlanModal").modal("hide"),$("#deletePlanModal").modal("show")},submitDeletePlan:function(){$("#deletePlanModal").modal("hide"),window.App.clusterPlan.cleanUp(),window.App.clusterPlan.destroy(),window.App.clusterPlan=new window.ClusterPlan,window.App.planScenario()}})}(),function(){"use strict";window.ClusterUnreachableView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("clusterUnreachable.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),events:{"click #clusterShutdown":"shutdown"},initialize:function(){this.coordinators=new window.ClusterCoordinators([],{})},retryCounter:0,retryNavigation:function(){var a=this;if(10===this.retryCounter){this.retryCounter=0;var b=new XMLHttpRequest;b.open("GET",window.location.origin+window.location.pathname,!1),b.send(),200===b.status?window.location.reload():window.setTimeout(function(){a.retryCounter++,a.retryNavigation()},1e3)}else this.retryCounter++,window.setTimeout(function(){a.retryNavigation()},1e3)},retryConnection:function(){this.coordinators.checkConnection(function(){window.App.showCluster()}),this.retryNavigation()},shutdown:function(){window.clearTimeout(this.timer),window.App.shutdownView.clusterShutdown()},render:function(){var a=window.App.clusterPlan,b=[];if(a&&a.has("runInfo")){var c=_.where(a.get("runInfo"),{isStartServers:!0});_.each(_.filter(c,function(a){return _.contains(a.roles,"Coordinator")}),function(a){var c=a.endpoints[0].split("://")[1];c=c.split(":")[0],b.push(c)})}$(this.el).html(this.template.render({coordinators:b})),$(this.el).append(this.modal.render({})),this.timer=window.setTimeout(this.retryConnection.bind(this),1e4)}})}(),function(){"use strict";window.ServerDashboardView=window.DashboardView.extend({modal:!0,hide:function(){window.App.showClusterView.startUpdating(),this.stopUpdating()},render:function(){var a=this;window.modalView.hideFooter=!0,window.modalView.show("dashboardView.ejs",null,void 0,void 0,void 0,this.events),$("#modal-dialog").toggleClass("modal-chart-detail",!0),window.DashboardView.prototype.render.bind(this)(!0),window.modalView.hideFooter=!1,$("#modal-dialog").on("hidden",function(){a.hide()});var b=document.createElement("button");b.className="close",b.appendChild(document.createTextNode("×")),b=$(b),b.attr("data-dismiss","modal"),b.attr("aria-hidden","true"),b.attr("type","button"),$(".modal-body .headerBar:first-child").toggleClass("headerBar",!1).toggleClass("modal-dashboard-header",!0).append(b)}})}(),function(){"use strict";window.LoginModalView=Backbone.View.extend({template:templateEngine.createTemplate("loginModal.ejs"),el:"#modalPlaceholder",events:{"click #confirmLogin":"confirmLogin","hidden #loginModalLayer":"hidden"},hidden:function(){this.undelegateEvents(),window.App.isCheckingUser=!1,$(this.el).html("")},confirmLogin:function(){var a=$("#username").val(),b=$("#password").val();window.App.clusterPlan.storeCredentials(a,b),this.hideModal()},hideModal:function(){$("#loginModalLayer").modal("hide")},render:function(){$(this.el).html(this.template.render({})),$("#loginModalLayer").modal("show")}})}(),function(){"use strict";window.PlanScenarioSelectorView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("planScenarioSelector.ejs","planner"),events:{"click #multiServerAsymmetrical":"multiServerAsymmetrical","click #singleServer":"singleServer"},render:function(){$(this.el).html(this.template.render({}))},multiServerAsymmetrical:function(){window.App.navigate("planAsymmetrical",{trigger:!0})},singleServer:function(){window.App.navigate("planTest",{trigger:!0})}})}(),function(){"use strict";window.PlanSymmetricView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("symmetricPlan.ejs"),entryTemplate:templateEngine.createTemplate("serverEntry.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),connectionValidationKey:null,events:{"click #startSymmetricPlan":"startPlan","click .add":"addEntry","click .delete":"removeEntry","click #cancel":"cancel","click #test-all-connections":"checkAllConnections","focusout .host":"checkAllConnections","focusout .port":"checkAllConnections","focusout .user":"checkAllConnections","focusout .passwd":"checkAllConnections"},cancel:function(){window.App.clusterPlan.get("plan")?window.App.navigate("handleClusterDown",{trigger:!0}):window.App.navigate("planScenario",{trigger:!0})},startPlan:function(){var a=this,b={dispatchers:[]},c=!1,d=!1;if(b.useSSLonDBservers=!!$(".useSSLonDBservers").prop("checked"),b.useSSLonCoordinators=!!$(".useSSLonCoordinators").prop("checked"),$(".dispatcher").each(function(e,f){var g=$(".host",f).val(),h=$(".port",f).val(),i=$(".user",f).val(),j=$(".passwd",f).val();if(!g||0===g.length||!h||0===h.length)return!0;var k={host:g+":"+h};a.isSymmetric?(k.isDBServer=!0,k.isCoordinator=!0):(k.isDBServer=!!$(".isDBServer",f).prop("checked"),k.isCoordinator=!!$(".isCoordinator",f).prop("checked")),k.username=i,k.passwd=j,c=c||k.isCoordinator,d=d||k.isDBServer,b.dispatchers.push(k)}),a.isSymmetric){if(0===b.dispatchers.length)return void alert("Please provide at least one host")}else{if(!d)return void alert("Please provide at least one database server");if(!c)return void alert("Please provide at least one coordinator")}b.type=this.isSymmetric?"symmetricalSetup":"asymmetricalSetup",$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster is being launched"),delete window.App.clusterPlan._coord,window.App.clusterPlan.save(b,{success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.updateAllUrls(),window.App.navigate("showCluster",{trigger:!0})},error:function(a,b){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),alert("Error while starting the cluster: "+b.statusText)}})},addEntry:function(){this.disableLaunchButton();var a=$("#server_list div.control-group.dispatcher:last .user").val(),b=$("#server_list div.control-group.dispatcher:last .passwd").val();$("#server_list").append(this.entryTemplate.render({isSymmetric:this.isSymmetric,isFirst:!1,isCoordinator:!0,isDBServer:!0,host:"",port:"",user:a,passwd:b}))},removeEntry:function(a){$(a.currentTarget).closest(".control-group").remove(),this.checkAllConnections()},render:function(a){var b={},c=!0,d=window.App.clusterPlan.get("config");if(this.isSymmetric=a,$(this.el).html(this.template.render({isSymmetric:a,params:b,useSSLonDBservers:d&&d.useSSLonDBservers?d.useSSLonDBservers:!1,useSSLonCoordinators:d&&d.useSSLonCoordinators?d.useSSLonCoordinators:!1})),d){var e=this,f=!1,g=!1;_.each(d.dispatchers,function(b){g=void 0===b.allowDBservers?!0:b.allowDBservers,f=void 0===b.allowCoordinators?!0:b.allowCoordinators;var d=b.endpoint;d=d.split("//")[1],d=d.split(":"),"localhost"===d&&(d="127.0.0.1");var h=b.username,i=b.passwd,j=e.entryTemplate.render({isSymmetric:a,isFirst:c,host:d[0],port:d[1],isCoordinator:f,isDBServer:g,user:h,passwd:i});$("#server_list").append(j),c=!1})}else $("#server_list").append(this.entryTemplate.render({isSymmetric:a,isFirst:!0,isCoordinator:!0,isDBServer:!0,host:"",port:"",user:"",passwd:""}));this.disableLaunchButton(),$(this.el).append(this.modal.render({}))},readAllConnections:function(){var a=[];return $(".dispatcher").each(function(b,c){var d={host:$(".host",c).val(),port:$(".port",c).val(),user:$(".user",c).val(),passwd:$(".passwd",c).val()};d.host&&d.port&&a.push(d)}),a},checkAllConnections:function(){var a=this,b=Math.random();this.connectionValidationKey=b,$(".cluster-connection-check-success").remove(),$(".cluster-connection-check-fail").remove();var c=this.readAllConnections();if(c.length)try{$.ajax({async:!0,cache:!1,type:"POST",url:"/_admin/aardvark/cluster/communicationCheck",data:JSON.stringify(c),success:function(c){if(b===a.connectionValidationKey){var d=$(".dispatcher"),e=0;d.each(function(a,b){var d=$(".host",b).val(),f=$(".port",b).val();d&&f&&(c[e]?$(".controls:first",b).append('Connection: ok'):$(".controls:first",b).append('Connection: fail'),e++)}),a.checkDispatcherArray(c,b)}}})}catch(d){this.disableLaunchButton()}},checkDispatcherArray:function(a,b){_.every(a,function(a){return a})&&b===this.connectionValidationKey&&this.enableLaunchButton()},disableLaunchButton:function(){$("#startSymmetricPlan").attr("disabled","disabled"),$("#startSymmetricPlan").removeClass("button-success"),$("#startSymmetricPlan").addClass("button-neutral")},enableLaunchButton:function(){$("#startSymmetricPlan").attr("disabled",!1),$("#startSymmetricPlan").removeClass("button-neutral"),$("#startSymmetricPlan").addClass("button-success")}})}(),function(){"use strict";window.PlanTestView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("testPlan.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),events:{"click #startTestPlan":"startPlan","click #cancel":"cancel"},cancel:function(){window.App.clusterPlan.get("plan")?window.App.navigate("handleClusterDown",{trigger:!0}):window.App.navigate("planScenario",{trigger:!0})},startPlan:function(){$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster is being launched");var a=$("#host").val(),b=$("#port").val(),c=$("#coordinators").val(),d=$("#dbs").val();return a?b?!c||0>c?void alert("Please define a number of coordinators"):!d||0>d?void alert("Please define a number of database servers"):(delete window.App.clusterPlan._coord,void window.App.clusterPlan.save({type:"testSetup",dispatchers:a+":"+b,numberDBServers:parseInt(d,10),numberCoordinators:parseInt(c,10)},{success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.updateAllUrls(),window.App.navigate("showCluster",{trigger:!0})},error:function(a,b){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),alert("Error while starting the cluster: "+b.statusText)}})):void alert("Please define a port"):void alert("Please define a host")},render:function(){var a={},b=window.App.clusterPlan.get("config");if(b){a.dbs=b.numberOfDBservers,a.coords=b.numberOfCoordinators;var c=b.dispatchers.d1.endpoint;c=c.split("://")[1],c=c.split(":"),"localhost"===c&&(c="127.0.0.1"),a.hostname=c[0],a.port=c[1]}else a.dbs=3,a.coords=2,a.hostname=window.location.hostname,"localhost"===a.hostname&&(a.hostname="127.0.0.1"),a.port=window.location.port;$(this.el).html(this.template.render(a)),$(this.el).append(this.modal.render({}))}})}(),function(){"use strict";window.ShowClusterView=Backbone.View.extend({detailEl:"#modalPlaceholder",el:"#content",defaultFrame:12e5,template:templateEngine.createTemplate("showCluster.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),detailTemplate:templateEngine.createTemplate("detailView.ejs"),events:{"change #selectDB":"updateCollections","change #selectCol":"updateShards","click .dbserver.success":"dashboard","click .coordinator.success":"dashboard"},replaceSVGs:function(){$(".svgToReplace").each(function(){var a=$(this),b=a.attr("id"),c=a.attr("src");$.get(c,function(c){var d=$(c).find("svg");d.attr("id",b).attr("class","icon").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},updateServerTime:function(){this.serverTime=(new Date).getTime()},setShowAll:function(){this.graphShowAll=!0},resetShowAll:function(){this.graphShowAll=!1,this.renderLineChart()},initialize:function(){this.interval=1e4,this.isUpdating=!1,this.timer=null,this.knownServers=[],this.graph=void 0,this.graphShowAll=!1,this.updateServerTime(),this.dygraphConfig=this.options.dygraphConfig,this.dbservers=new window.ClusterServers([],{interval:this.interval}),this.coordinators=new window.ClusterCoordinators([],{interval:this.interval}),this.documentStore=new window.arangoDocuments,this.statisticsDescription=new window.StatisticsDescription,this.statisticsDescription.fetch({async:!1}),this.dbs=new window.ClusterDatabases([],{interval:this.interval}),this.cols=new window.ClusterCollections,this.shards=new window.ClusterShards,this.startUpdating()},listByAddress:function(a){var b={},c=this;this.dbservers.byAddress(b,function(b){c.coordinators.byAddress(b,a)})},updateCollections:function(){var a=this,b=$("#selectCol"),c=$("#selectDB").find(":selected").attr("id");if(c){var d=b.find(":selected").attr("id");b.html(""),this.cols.getList(c,function(c){_.each(_.pluck(c,"name"),function(a){b.append('")});var e=$("#"+d,b);1===e.length&&e.prop("selected",!0),a.updateShards()})}},updateShards:function(){var a=$("#selectDB").find(":selected").attr("id"),b=$("#selectCol").find(":selected").attr("id");this.shards.getList(a,b,function(a){$(".shardCounter").html("0"),_.each(a,function(a){$("#"+a.server+"Shards").html(a.shards.length)})})},updateServerStatus:function(a){var b=this,c=function(a,b,c){var d,e,f=c;f=f.replace(/\./g,"-"),f=f.replace(/\:/g,"_"),e=$("#id"+f),e.length<1||(d=e.attr("class").split(/\s+/)[1],e.attr("class",a+" "+d+" "+b),"coordinator"===a&&("success"===b?$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!1):$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!0)))};this.coordinators.getStatuses(c.bind(this,"coordinator"),function(){b.dbservers.getStatuses(c.bind(b,"dbserver")),a()})},updateDBDetailList:function(){var a=this,b=$("#selectDB"),c=b.find(":selected").attr("id");b.html(""),this.dbs.getList(function(d){_.each(_.pluck(d,"name"),function(a){b.append('")});var e=$("#"+c,b);1===e.length&&e.prop("selected",!0),a.updateCollections()})},rerender:function(){var a=this;this.updateServerStatus(function(){a.getServerStatistics(function(){a.updateServerTime(),a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList()})})},render:function(){this.knownServers=[],delete this.hist;var a=this;this.listByAddress(function(b){1===Object.keys(b).length?a.type="testPlan":a.type="other",a.updateDBDetailList(),a.dbs.getList(function(c){$(a.el).html(a.template.render({dbs:_.pluck(c,"name"),byAddress:b,type:a.type})),$(a.el).append(a.modal.render({})),a.replaceSVGs(),a.getServerStatistics(function(){a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList(),a.startUpdating()})})})},generatePieData:function(){var a=[],b=this;return this.data.forEach(function(c){a.push({key:c.get("name"),value:c.get("system").virtualSize,time:b.serverTime})}),a},addStatisticsItem:function(a,b,c,d){var e=this;e.hasOwnProperty("hist")||(e.hist={}),e.hist.hasOwnProperty(a)||(e.hist[a]=[]);var f=e.hist[a],g=f.length;if(0===g)f.push({time:b,snap:d,requests:c,requestsPerSecond:0});else{var h=f[g-1].time,i=f[g-1].requests;if(c>i){var j=b-h,k=0;j>0&&(k=(c-i)/j),f.push({time:b,snap:d,requests:c,requestsPerSecond:k})}}},getServerStatistics:function(a){var b=this,c=Math.round(b.serverTime/1e3);this.data=void 0;var d=new window.ClusterStatisticsCollection,e=this.coordinators.first();this.dbservers.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=e.get("protocol")+"://"+e.get("address")+"/_admin/clusterStatistics?DBserver="+a.get("name"),d.add(c)}}),this.coordinators.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=a.get("protocol")+"://"+a.get("address")+"/_admin/statistics",d.add(c)}});var f=d.size();this.data=[];var g=function(d){f--;var e=d.get("time"),g=d.get("name"),h=d.get("http").requestsTotal;b.addStatisticsItem(g,e,h,c),b.data.push(d),0===f&&a()},h=function(){f--,0===f&&a()};d.fetch(g,h)},renderPieChart:function(a){var b=$("#clusterGraphs svg").width(),c=$("#clusterGraphs svg").height(),d=Math.min(b,c)/2,e=this.dygraphConfig.colors,f=d3.svg.arc().outerRadius(d-20).innerRadius(0),g=d3.layout.pie().sort(function(a){return a.value}).value(function(a){return a.value});d3.select("#clusterGraphs").select("svg").remove();var h=d3.select("#clusterGraphs").append("svg").attr("class","clusterChart").append("g").attr("transform","translate("+b/2+","+(c/2-10)+")"),i=d3.svg.arc().outerRadius(d-2).innerRadius(d-2),j=h.selectAll(".arc").data(g(a)).enter().append("g").attr("class","slice");j.append("path").attr("d",f).style("fill",function(a,b){return e[b%e.length]}).style("stroke",function(a,b){return e[b%e.length]}),j.append("text").attr("transform",function(a){return"translate("+f.centroid(a)+")"}).style("text-anchor","middle").text(function(a){var b=a.data.value/1024/1024/1024;return b.toFixed(2)}),j.append("text").attr("transform",function(a){return"translate("+i.centroid(a)+")"}).style("text-anchor","middle").text(function(a){return a.data.key})},renderLineChart:function(){var a,b,c,d,e,f,g=this,h=1200,i=[],j=[],k=Math.round((new Date).getTime()/1e3)-h,l=g.knownServers,m=function(){return null};for(c=0;cf||(j.hasOwnProperty(f)?a=j[f]:(e=new Date(1e3*f),a=j[f]=[e].concat(l.map(m))),a[c+1]=b[d].requestsPerSecond);i=[],Object.keys(j).sort().forEach(function(a){i.push(j[a])});var n=this.dygraphConfig.getDefaultConfig("clusterRequestsPerSecond");n.labelsDiv=$("#lineGraphLegend")[0],n.labels=["datetime"].concat(l),g.graph=new Dygraph(document.getElementById("lineGraph"),i,n)},stopUpdating:function(){window.clearTimeout(this.timer),delete this.graph,this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.rerender()},this.interval)}},dashboard:function(a){this.stopUpdating();var b,c,d=$(a.currentTarget),e={},f=d.attr("id");f=f.replace(/\-/g,"."),f=f.replace(/\_/g,":"),f=f.substr(2),e.raw=f,e.isDBServer=d.hasClass("dbserver"),e.isDBServer?(b=this.dbservers.findWhere({address:e.raw}),c=this.coordinators.findWhere({status:"ok"}),e.endpoint=c.get("protocol")+"://"+c.get("address")):(b=this.coordinators.findWhere({address:e.raw}),e.endpoint=b.get("protocol")+"://"+b.get("address")),
-e.target=encodeURIComponent(b.get("name")),window.App.serverToShow=e,window.App.dashboard()},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},resize:function(){var a;this.graph&&(a=this.getCurrentSize(this.graph.maindiv_.id),this.graph.resize(a.width,a.height))}})}(),function(){"use strict";window.ShowShardsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("showShards.ejs"),events:{"change #selectDB":"updateCollections","change #selectCol":"updateShards"},initialize:function(){this.dbservers=new window.ClusterServers([],{interval:1e4}),this.dbservers.fetch({async:!1,beforeSend:window.App.addAuth.bind(window.App)}),this.dbs=new window.ClusterDatabases([],{interval:1e4}),this.cols=new window.ClusterCollections,this.shards=new window.ClusterShards},updateCollections:function(){var a=$("#selectDB").find(":selected").attr("id");$("#selectCol").html(""),_.each(_.pluck(this.cols.getList(a),"name"),function(a){$("#selectCol").append('")}),this.updateShards()},updateShards:function(){var a=$("#selectDB").find(":selected").attr("id"),b=$("#selectCol").find(":selected").attr("id"),c=this.shards.getList(a,b);$(".shardContainer").empty(),_.each(c,function(a){var b=$("#"+a.server+"Shards");$(".collectionName",b).html(a.server+": "+a.shards.length)})},render:function(){$(this.el).html(this.template.render({names:this.dbservers.pluck("name"),dbs:_.pluck(this.dbs.getList(),"name")})),this.updateCollections()}})}(),function(){"use strict";window.ShutdownButtonView=Backbone.View.extend({el:"#navigationBar",events:{"click #clusterShutdown":"clusterShutdown"},initialize:function(){this.overview=this.options.overview},template:templateEngine.createTemplate("shutdownButtonView.ejs"),clusterShutdown:function(){this.overview.stopUpdating(),$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster is shutting down"),$.ajax({cache:!1,type:"GET",url:"cluster/shutdown",success:function(a){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.navigate("handleClusterDown",{trigger:!0})}})},render:function(){return $(this.el).html(this.template.render({})),this},unrender:function(){$(this.el).html("")}})}(),function(){"use strict";window.ClusterRouter=Backbone.Router.extend({routes:{"":"initialRoute",planScenario:"planScenario",planTest:"planTest",planAsymmetrical:"planAsymmetric",shards:"showShards",showCluster:"showCluster",handleClusterDown:"handleClusterDown"},addAuth:function(a){var b=this.clusterPlan.get("user");if(!b)return a.abort(),void(this.isCheckingUser||this.requestAuth());var c=b.name,d=b.passwd,e=c.concat(":",d);a.setRequestHeader("Authorization","Basic "+btoa(e))},requestAuth:function(){this.isCheckingUser=!0,this.clusterPlan.set({user:null});var a=new window.LoginModalView;a.render()},getNewRoute:function(a){return"statistics"===a?this.clusterPlan.getCoordinator()+"/_admin/"+a:this.clusterPlan.getCoordinator()+"/_admin/aardvark/cluster/"+a},initialRoute:function(){this.initial()},updateAllUrls:function(){_.each(this.toUpdate,function(a){a.updateUrl()})},registerForUpdate:function(a){this.toUpdate.push(a),a.updateUrl()},initialize:function(){this.footerView=new window.FooterView,this.footerView.render();var a=this;this.dygraphConfig=window.dygraphConfig,window.modalView=new window.ModalView,this.initial=this.planScenario,this.isCheckingUser=!1,this.bind("all",function(b,c){b.split(":");"route"===b&&"showCluster"!==c&&(a.showClusterView&&(a.showClusterView.stopUpdating(),a.shutdownView.unrender()),a.dashboardView&&a.dashboardView.stopUpdating())}),this.toUpdate=[],this.clusterPlan=new window.ClusterPlan,this.clusterPlan.fetch({async:!1}),$(window).resize(function(){a.handleResize()})},showCluster:function(){this.showClusterView||(this.showClusterView=new window.ShowClusterView({dygraphConfig:this.dygraphConfig})),this.shutdownView||(this.shutdownView=new window.ShutdownButtonView({overview:this.showClusterView})),this.shutdownView.render(),this.showClusterView.render()},showShards:function(){this.showShardsView||(this.showShardsView=new window.ShowShardsView),this.showShardsView.render()},handleResize:function(){this.dashboardView&&this.dashboardView.resize(),this.showClusterView&&this.showClusterView.resize()},planTest:function(){this.planTestView||(this.planTestView=new window.PlanTestView({model:this.clusterPlan})),this.planTestView.render()},planAsymmetric:function(){this.planSymmetricView||(this.planSymmetricView=new window.PlanSymmetricView({model:this.clusterPlan})),this.planSymmetricView.render(!1)},planScenario:function(){this.planScenarioSelector||(this.planScenarioSelector=new window.PlanScenarioSelectorView),this.planScenarioSelector.render()},handleClusterDown:function(){this.clusterDownView||(this.clusterDownView=new window.ClusterDownView),this.clusterDownView.render()},dashboard:function(){var a=this.serverToShow;return a?(a.addAuth=this.addAuth.bind(this),this.dashboardView=new window.ServerDashboardView({dygraphConfig:this.dygraphConfig,serverToShow:this.serverToShow,database:{hasSystemAccess:function(){return!0}}}),void this.dashboardView.render()):void this.navigate("",{trigger:!0})},clusterUnreachable:function(){this.showClusterView&&(this.showClusterView.stopUpdating(),this.shutdownView.unrender()),this.unreachableView||(this.unreachableView=new window.ClusterUnreachableView),this.unreachableView.render()}})}(),function(){"use strict";$.get("cluster/amIDispatcher",function(a){if(!a){var b=window.location.origin;b+=window.location.pathname,b=b.replace("cluster","index"),window.location.replace(b)}}),window.location.hash="",$(document).ready(function(){window.App=new window.ClusterRouter,Backbone.history.start(),window.App.clusterPlan.get("plan")?window.App.clusterPlan.isAlive()?window.App.initial=window.App.showCluster:window.App.initial=window.App.handleClusterDown:window.App.initial=window.App.planScenario,window.App.initialRoute(),window.App.handleResize()})}();
\ No newline at end of file
+!function(){"use strict";var a;window.isCoordinator=function(){return void 0===a&&$.ajax("cluster/amICoordinator",{async:!1,success:function(b){a=b}}),a},window.versionHelper={fromString:function(a){var b=a.replace(/-[a-zA-Z0-9_\-]*$/g,"").split(".");return{major:parseInt(b[0],10)||0,minor:parseInt(b[1],10)||0,patch:parseInt(b[2],10)||0,toString:function(){return this.major+"."+this.minor+"."+this.patch}}},toString:function(a){return a.major+"."+a.minor+"."+a.patch}},window.arangoHelper={lastNotificationMessage:null,CollectionTypes:{},systemAttributes:function(){return{_id:!0,_rev:!0,_key:!0,_bidirectional:!0,_vertices:!0,_from:!0,_to:!0,$id:!0}},setCheckboxStatus:function(a){_.each($(a).find("ul").find("li"),function(a){$(a).hasClass("nav-header")||($(a).find("input").attr("checked")?$(a).find("i").hasClass("css-round-label")?$(a).find("i").addClass("fa-dot-circle-o"):$(a).find("i").addClass("fa-check-square-o"):$(a).find("i").hasClass("css-round-label")?$(a).find("i").addClass("fa-circle-o"):$(a).find("i").addClass("fa-square-o"))})},calculateCenterDivHeight:function(){var a=$(".navbar").height(),b=$(".footer").height(),c=$(window).height();return c-b-a-110},fixTooltips:function(a,b){$(a).tooltip({placement:b,hide:!1,show:!1})},currentDatabase:function(){var a=!1;return $.ajax({type:"GET",cache:!1,url:"/_api/database/current",contentType:"application/json",processData:!1,async:!1,success:function(b){a=b.result.name},error:function(){a=!1}}),a},allHotkeys:{global:{name:"Site wide",content:[{label:"scroll up",letter:"j"},{label:"scroll down",letter:"k"}]},jsoneditor:{name:"AQL editor",content:[{label:"Submit",letter:"Ctrl + Return"},{label:"Toggle comments",letter:"Ctrl + Shift + C"},{label:"Undo",letter:"Ctrl + Z"},{label:"Redo",letter:"Ctrl + Shift + Z"}]},doceditor:{name:"Document editor",content:[{label:"Insert",letter:"Ctrl + Insert"},{label:"Save",letter:"Ctrl + Return, CMD + Return"},{label:"Append",letter:"Ctrl + Shift + Insert"},{label:"Duplicate",letter:"Ctrl + D"},{label:"Remove",letter:"Ctrl + Delete"}]},modals:{name:"Modal",content:[{label:"Submit",letter:"Return"},{label:"Close",letter:"Esc"},{label:"Navigate buttons",letter:"Arrow keys"},{label:"Navigate content",letter:"Tab"}]}},hotkeysFunctions:{scrollDown:function(){window.scrollBy(0,180)},scrollUp:function(){window.scrollBy(0,-180)},showHotkeysModal:function(){var a=[],b=window.arangoHelper.allHotkeys;window.modalView.show("modalHotkeys.ejs","Keyboard Shortcuts",a,b)}},enableKeyboardHotkeys:function(a){var b=window.arangoHelper.hotkeysFunctions;a===!0&&($(document).on("keydown",null,"j",b.scrollDown),$(document).on("keydown",null,"k",b.scrollUp))},databaseAllowed:function(){var a=this.currentDatabase(),b=!1;return $.ajax({type:"GET",cache:!1,url:"/_db/"+encodeURIComponent(a)+"/_api/database/",contentType:"application/json",processData:!1,async:!1,success:function(){b=!0},error:function(){b=!1}}),b},arangoNotification:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"success"})},arangoError:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"error"})},openDocEditor:function(a,b,c){var d=a.split("/"),e=this,f=new window.DocumentView({collection:window.App.arangoDocumentStore});f.breadcrumb=function(){},f.colid=d[0],f.docid=d[1],f.el=".arangoFrame .innerDiv",f.render(),f.setType(b),$(".arangoFrame .headerBar").remove(),$(".arangoFrame .outerDiv").prepend(''),$(".arangoFrame .outerDiv").click(function(){e.closeDocEditor()}),$(".arangoFrame .innerDiv").click(function(a){a.stopPropagation()}),$(".fa-times").click(function(){e.closeDocEditor()}),$(".arangoFrame").show(),f.customView=!0,f.customDeleteFunction=function(){window.modalView.hide(),$(".arangoFrame").hide()},$(".arangoFrame #deleteDocumentButton").click(function(){f.deleteDocumentModal()}),$(".arangoFrame #saveDocumentButton").click(function(){f.saveDocument()}),$(".arangoFrame #deleteDocumentButton").css("display","none")},closeDocEditor:function(){$(".arangoFrame .outerDiv .fa-times").remove(),$(".arangoFrame").hide()},addAardvarkJob:function(a,b){$.ajax({cache:!1,type:"POST",url:"/_admin/aardvark/job",data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){b&&b(!1,a)},error:function(a){b&&b(!0,a)}})},deleteAardvarkJob:function(a,b){$.ajax({cache:!1,type:"DELETE",url:"/_admin/aardvark/job/"+encodeURIComponent(a),contentType:"application/json",processData:!1,success:function(a){b&&b(!1,a)},error:function(a){b&&b(!0,a)}})},deleteAllAardvarkJobs:function(a){$.ajax({cache:!1,type:"DELETE",url:"/_admin/aardvark/job",contentType:"application/json",processData:!1,success:function(b){a&&a(!1,b)},error:function(b){a&&a(!0,b)}})},getAardvarkJobs:function(a){var b;return $.ajax({cache:!1,type:"GET",url:"/_admin/aardvark/job",contentType:"application/json",processData:!1,async:!1,success:function(c){a&&a(!1,c),b=c},error:function(b){a&&a(!0,b)}}),b},getPendingJobs:function(){var a;return $.ajax({cache:!1,type:"GET",url:"/_api/job/pending",contentType:"application/json",processData:!1,async:!1,success:function(b){a=b},error:function(a){console.log("pending jobs error: "+a)}}),a},syncAndReturnUninishedAardvarkJobs:function(a){var b=this.getAardvarkJobs(),c=this.getPendingJobs(),d=[];return c.length>0?_.each(b,function(b){if(b.type===a||void 0===b.type){var e=!1;_.each(c,function(a){b.id===a&&(e=!0)}),e?d.push({collection:b.collection,id:b.id,type:b.type}):window.arangoHelper.deleteAardvarkJob(b.id)}}):this.deleteAllAardvarkJobs(),d},getRandomToken:function(){return Math.round((new Date).getTime())},isSystemAttribute:function(a){var b=this.systemAttributes();return b[a]},isSystemCollection:function(a){return"_"===a.name.substr(0,1)},setDocumentStore:function(a){this.arangoDocumentStore=a},collectionApiType:function(a,b){return(b||void 0===this.CollectionTypes[a])&&(this.CollectionTypes[a]=this.arangoDocumentStore.getCollectionInfo(a).type),3===this.CollectionTypes[a]?"edge":"document"},collectionType:function(a){if(!a||""===a.name)return"-";var b;return b=2===a.type?"document":3===a.type?"edge":"unknown",this.isSystemCollection(a)&&(b+=" (system)"),b},formatDT:function(a){var b=function(a){return 10>a?"0"+a:a};return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+" "+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())},escapeHtml:function(a){return String(a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}}}(),function(){"use strict";window.ClusterCollection=Backbone.Model.extend({defaults:{name:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),status:this.get("status")}}})}(),function(){"use strict";window.ClusterCoordinator=Backbone.Model.extend({defaults:{name:"",url:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),status:this.get("status"),url:this.get("url")}}})}(),function(){"use strict";window.ClusterDatabase=Backbone.Model.extend({defaults:{name:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),status:this.get("status")}}})}(),function(){"use strict";window.ClusterPlan=Backbone.Model.extend({defaults:{},url:"cluster/plan",idAttribute:"config",getVersion:function(){var a=this.get("version");return a||"2.0"},getCoordinator:function(){if(this._coord)return this._coord[this._lastStableCoord];var a,b,c,d,e=[];if(c=this.get("runInfo")){for(b=c.length-1;b>0;){if(c[b].isStartServers&&(d=c[b],d.endpoints))for(a=0;a1){do a=Math.floor(Math.random()*this._coord.length);while(a===b);this._lastStableCoord=a}},isAlive:function(){var a=!1;return $.ajax({cache:!1,type:"GET",async:!1,url:"cluster/healthcheck",success:function(b){a=b},error:function(a){}}),a},storeCredentials:function(a,b){var c=this;$.ajax({url:"cluster/plan/credentials",type:"PUT",data:JSON.stringify({user:a,passwd:b}),async:!1}).done(function(){c.fetch()})},isSymmetricSetup:function(){var a=this.get("config"),b=_.size(a.dispatchers);return b===a.numberOfCoordinators&&b===a.numberOfDBservers},isTestSetup:function(){return 1===_.size(this.get("config").dispatchers)},cleanUp:function(){$.ajax({url:"cluster/plan/cleanUp",type:"DELETE",async:!1})}})}(),function(){"use strict";window.ClusterServer=Backbone.Model.extend({defaults:{name:"",address:"",role:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),address:this.get("address"),status:this.get("status")}}})}(),function(){"use strict";window.ClusterShard=Backbone.Model.extend({defaults:{},idAttribute:"name",forList:function(){return{server:this.get("name"),shards:this.get("shards")}}})}(),function(){"use strict";window.ClusterType=Backbone.Model.extend({defaults:{type:"testPlan"}})}(),function(){"use strict";window.AutomaticRetryCollection=Backbone.Collection.extend({_retryCount:0,checkRetries:function(){var a=this;return this.updateUrl(),this._retryCount>10?(window.setTimeout(function(){a._retryCount=0},1e4),window.App.clusterUnreachable(),!1):!0},successFullTry:function(){this._retryCount=0},failureTry:function(a,b,c){401===c.status?window.App.requestAuth():(window.App.clusterPlan.rotateCoordinator(),this._retryCount++,a())}})}(),window.ClusterStatisticsCollection=Backbone.Collection.extend({model:window.Statistics,url:"/_admin/statistics",updateUrl:function(){this.url=window.App.getNewRoute("statistics")},initialize:function(){window.App.registerForUpdate(this)},fetch:function(a,b){this.forEach(function(c){c.fetch({beforeSend:window.App.addAuth.bind(window.App),error:function(){b(c)}}).done(function(){a(c)})})}}),function(){"use strict";window.ClusterCollections=window.AutomaticRetryCollection.extend({model:window.ClusterCollection,updateUrl:function(){this.url=window.App.getNewRoute(this.dbname+"/Collections")},url:function(){return"/_admin/aardvark/cluster/"+this.dbname+"/Collections"},initialize:function(){this.isUpdating=!1,this.timer=null,this.interval=1e3,window.App.registerForUpdate(this)},getList:function(a,b){if(void 0!==a&&(this.dbname=a,this.checkRetries())){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.getList.bind(c,a,b))}).done(function(){b(c.map(function(a){return a.forList()}))})}},stopUpdating:function(){window.clearTimeout(this.timer),this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.updateUrl(),a.fetch({beforeSend:window.App.addAuth.bind(window.App)})},this.interval)}}})}(),function(){"use strict";window.ClusterCoordinators=window.AutomaticRetryCollection.extend({model:window.ClusterCoordinator,url:"/_admin/aardvark/cluster/Coordinators",updateUrl:function(){this.url=window.App.getNewRoute("Coordinators")},initialize:function(){window.App.registerForUpdate(this)},statusClass:function(a){switch(a){case"ok":return"success";case"warning":return"warning";case"critical":return"danger";case"missing":return"inactive";default:return"danger"}},getStatuses:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.getStatuses.bind(c,a,b))}).done(function(){c.successFullTry(),c.forEach(function(b){a(c.statusClass(b.get("status")),b.get("address"))}),b()})}},byAddress:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.byAddress.bind(c,a,b))}).done(function(){c.successFullTry(),a=a||{},c.forEach(function(b){var c=b.get("address");c=c.split(":")[0],a[c]=a[c]||{},a[c].coords=a[c].coords||[],a[c].coords.push(b)}),b(a)})}},checkConnection:function(a){var b=this;this.checkRetries()&&this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.checkConnection.bind(b,a))}).done(function(){b.successFullTry(),a()})},getList:function(){throw"Do not use coordinator.getList"},getOverview:function(){throw"Do not use coordinator.getOverview"}})}(),function(){"use strict";window.ClusterDatabases=window.AutomaticRetryCollection.extend({model:window.ClusterDatabase,url:"/_admin/aardvark/cluster/Databases",updateUrl:function(){this.url=window.App.getNewRoute("Databases")},initialize:function(){window.App.registerForUpdate(this)},getList:function(a){if(this.checkRetries()){var b=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.getList.bind(b,a))}).done(function(){b.successFullTry(),a(b.map(function(a){return a.forList()}))})}}})}(),function(){"use strict";window.ClusterServers=window.AutomaticRetryCollection.extend({model:window.ClusterServer,url:"/_admin/aardvark/cluster/DBServers",updateUrl:function(){this.url=window.App.getNewRoute("DBServers")},initialize:function(){window.App.registerForUpdate(this)},statusClass:function(a){switch(a){case"ok":return"success";case"warning":return"warning";case"critical":return"danger";case"missing":return"inactive";default:return"danger"}},getStatuses:function(a){if(this.checkRetries()){var b=this,c=function(){b.successFullTry(),b._retryCount=0,b.forEach(function(c){a(b.statusClass(c.get("status")),c.get("address"))})};this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.getStatuses.bind(b,a))}).done(c)}},byAddress:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.byAddress.bind(c,a,b))}).done(function(){c.successFullTry(),a=a||{},c.forEach(function(b){var c=b.get("address");c=c.split(":")[0],a[c]=a[c]||{},a[c].dbs=a[c].dbs||[],a[c].dbs.push(b)}),b(a)})}},getList:function(a){throw"Do not use"},getOverview:function(){throw"Do not use DbServer.getOverview"}})}(),function(){"use strict";window.ClusterShards=window.AutomaticRetryCollection.extend({model:window.ClusterShard,updateUrl:function(){this.url=window.App.getNewRoute(this.dbname+"/"+this.colname+"/Shards")},url:function(){return"/_admin/aardvark/cluster/"+this.dbname+"/"+this.colname+"/Shards"},initialize:function(){this.isUpdating=!1,this.timer=null,this.interval=1e3,window.App.registerForUpdate(this)},getList:function(a,b,c){if(void 0!==a&&void 0!==b&&(this.dbname=a,this.colname=b,this.checkRetries())){var d=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:d.failureTry.bind(d,d.getList.bind(d,a,b,c))}).done(function(){c(d.map(function(a){return a.forList()}))})}},stopUpdating:function(){window.clearTimeout(this.timer),this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.updateUrl(),a.fetch({beforeSend:window.App.addAuth.bind(window.App)})},this.interval)}}})}(),window.arangoDocumentModel=Backbone.Model.extend({initialize:function(){"use strict"},urlRoot:"/_api/document",defaults:{_id:"",_rev:"",_key:""},getSorted:function(){"use strict";var a=this,b=Object.keys(a.attributes).sort(function(a,b){var c=arangoHelper.isSystemAttribute(a),d=arangoHelper.isSystemAttribute(b);return c!==d?c?-1:1:b>a?-1:1}),c={};return _.each(b,function(b){c[b]=a.attributes[b]}),c}}),window.Statistics=Backbone.Model.extend({defaults:{},url:function(){"use strict";return"/_admin/statistics"}}),window.StatisticsDescription=Backbone.Model.extend({defaults:{figures:"",groups:""},url:function(){"use strict";return"/_admin/statistics-description"}}),function(){"use strict";window.PaginatedCollection=Backbone.Collection.extend({page:0,pagesize:10,totalAmount:0,getPage:function(){return this.page+1},setPage:function(a){return a>=this.getLastPageNumber()?void(this.page=this.getLastPageNumber()-1):1>a?void(this.page=0):void(this.page=a-1)},getLastPageNumber:function(){return Math.max(Math.ceil(this.totalAmount/this.pagesize),1)},getOffset:function(){return this.page*this.pagesize},getPageSize:function(){return this.pagesize},setPageSize:function(a){if("all"===a)this.pagesize="all";else try{a=parseInt(a,10),this.pagesize=a}catch(b){}},setToFirst:function(){this.page=0},setToLast:function(){this.setPage(this.getLastPageNumber())},setToPrev:function(){this.setPage(this.getPage()-1)},setToNext:function(){this.setPage(this.getPage()+1)},setTotal:function(a){this.totalAmount=a},getTotal:function(){return this.totalAmount},setTotalMinusOne:function(){this.totalAmount--}})}(),window.StatisticsCollection=Backbone.Collection.extend({model:window.Statistics,url:"/_admin/statistics"}),function(){"use strict";window.arangoDocuments=window.PaginatedCollection.extend({collectionID:1,filters:[],MAX_SORT:12e3,lastQuery:{},sortAttribute:"_key",url:"/_api/documents",model:window.arangoDocumentModel,loadTotal:function(){var a=this;$.ajax({cache:!1,type:"GET",url:"/_api/collection/"+this.collectionID+"/count",contentType:"application/json",processData:!1,async:!1,success:function(b){a.setTotal(b.count)}})},setCollection:function(a){this.resetFilter(),this.collectionID=a,this.setPage(1),this.loadTotal()},setSort:function(a){this.sortAttribute=a},getSort:function(){return this.sortAttribute},addFilter:function(a,b,c){this.filters.push({attr:a,op:b,val:c})},setFiltersForQuery:function(a){if(0===this.filters.length)return"";var b=" FILTER",c="",d=_.map(this.filters,function(b,d){return"LIKE"===b.op?(c=" "+b.op+"(x.`"+b.attr+"`, @param",c+=d,c+=")"):(c="IN"===b.op||"NOT IN"===b.op?" ":" x.`",c+=b.attr,c+="IN"===b.op||"NOT IN"===b.op?" ":"` ",c+=b.op,c+="IN"===b.op||"NOT IN"===b.op?" x.@param":" @param",c+=d),a["param"+d]=b.val,c});return b+d.join(" &&")},setPagesize:function(a){this.setPageSize(a)},resetFilter:function(){this.filters=[]},moveDocument:function(a,b,c,d){var e,f,g,h,i={"@collection":b,filterid:a};e="FOR x IN @@collection",e+=" FILTER x._key == @filterid",e+=" INSERT x IN ",e+=c,f="FOR x in @@collection",f+=" FILTER x._key == @filterid",f+=" REMOVE x IN @@collection",g={query:e,bindVars:i},h={query:f,bindVars:i},window.progressView.show(),$.ajax({cache:!1,type:"POST",async:!0,url:"/_api/cursor",data:JSON.stringify(g),contentType:"application/json",success:function(a){$.ajax({cache:!1,type:"POST",async:!0,url:"/_api/cursor",data:JSON.stringify(h),contentType:"application/json",success:function(a){d&&d(),window.progressView.hide()},error:function(a){window.progressView.hide(),arangoHelper.arangoError("Document error","Documents inserted, but could not be removed.")}})},error:function(a){window.progressView.hide(),arangoHelper.arangoError("Document error","Could not move selected documents.")}})},getDocuments:function(a){window.progressView.showWithDelay(300,"Fetching documents...");var b,c,d,e,f=this;c={"@collection":this.collectionID,offset:this.getOffset(),count:this.getPageSize()},b="FOR x IN @@collection LET att = SLICE(ATTRIBUTES(x), 0, 25)",b+=this.setFiltersForQuery(c),this.getTotal()0)&&(e.options={fullCount:!0}),$.ajax({cache:!1,type:"POST",async:!0,url:"/_api/cursor",data:JSON.stringify(e),contentType:"application/json",success:function(b){window.progressView.toShow=!1,f.clearDocuments(),b.extra&&void 0!==b.extra.stats.fullCount&&f.setTotal(b.extra.stats.fullCount),0!==f.getTotal()&&_.each(b.result,function(a){f.add({id:a._id,rev:a._rev,key:a._key,content:a})}),f.lastQuery=e,a(),window.progressView.hide()},error:function(a){window.progressView.hide(),arangoHelper.arangoError("Document error","Could not fetch requested documents.")}})},clearDocuments:function(){this.reset()},buildDownloadDocumentQuery:function(){var a,b,c;return c={"@collection":this.collectionID},a="FOR x in @@collection",a+=this.setFiltersForQuery(c),this.getTotal()0&&(b="At least one error occurred during upload")}catch(d){}}}),b}})}(),function(){"use strict";if(!window.hasOwnProperty("TEST_BUILD")){var a=function(){var a={};return a.createTemplate=function(a){var b=$("#"+a.replace(".","\\.")).html();return{render:function(a){return _.template(b,a)}}},a};window.templateEngine=new a}}(),function(){"use strict";window.FooterView=Backbone.View.extend({el:"#footerBar",system:{},isOffline:!0,isOfflineCounter:0,firstLogin:!0,events:{"click .footer-center p":"showShortcutModal"},initialize:function(){var a=this;window.setInterval(function(){a.getVersion()},15e3),a.getVersion()},template:templateEngine.createTemplate("footerView.ejs"),showServerStatus:function(a){a===!0?($(".serverStatusIndicator").addClass("isOnline"),$(".serverStatusIndicator").addClass("fa-check-circle-o"),$(".serverStatusIndicator").removeClass("fa-times-circle-o")):($(".serverStatusIndicator").removeClass("isOnline"),$(".serverStatusIndicator").removeClass("fa-check-circle-o"),$(".serverStatusIndicator").addClass("fa-times-circle-o"))},showShortcutModal:function(){window.arangoHelper.hotkeysFunctions.showHotkeysModal()},getVersion:function(){var a=this;$.ajax({type:"GET",cache:!1,url:"/_api/version",contentType:"application/json",processData:!1,async:!0,success:function(b){a.showServerStatus(!0),a.isOffline===!0&&(a.isOffline=!1,a.isOfflineCounter=0,a.firstLogin?a.firstLogin=!1:window.setTimeout(function(){a.showServerStatus(!0)},1e3),a.system.name=b.server,a.system.version=b.version,a.render())},error:function(b){a.isOffline=!0,a.isOfflineCounter++,a.isOfflineCounter>=1&&a.showServerStatus(!1)}}),a.system.hasOwnProperty("database")||$.ajax({type:"GET",cache:!1,url:"/_api/database/current",contentType:"application/json",processData:!1,async:!0,success:function(b){var c=b.result.name;a.system.database=c;var d=window.setInterval(function(){var b=$("#databaseNavi");b&&(window.clearTimeout(d),d=null,"_system"===c?($(".logs-menu").css("visibility","visible"),$(".logs-menu").css("display","inline"),$("#databaseNavi").css("display","inline")):($(".logs-menu").css("visibility","hidden"),$(".logs-menu").css("display","none")),a.render())},50)}})},renderVersion:function(){this.system.hasOwnProperty("database")&&this.system.hasOwnProperty("name")&&$(this.el).html(this.template.render({name:this.system.name,version:this.system.version,database:this.system.database}))},render:function(){return this.system.version||this.getVersion(),$(this.el).html(this.template.render({name:this.system.name,version:this.system.version})),this}})}(),function(){"use strict";function a(a,b){return(void 0===a||null===a)&&(a=0),a.toFixed(b)}window.DashboardView=Backbone.View.extend({el:"#content",interval:1e4,defaultTimeFrame:12e5,defaultDetailFrame:1728e5,history:{},graphs:{},events:{},tendencies:{asyncPerSecondCurrent:["asyncPerSecondCurrent","asyncPerSecondPercentChange"],syncPerSecondCurrent:["syncPerSecondCurrent","syncPerSecondPercentChange"],clientConnectionsCurrent:["clientConnectionsCurrent","clientConnectionsPercentChange"],clientConnectionsAverage:["clientConnections15M","clientConnections15MPercentChange"],numberOfThreadsCurrent:["numberOfThreadsCurrent","numberOfThreadsPercentChange"],numberOfThreadsAverage:["numberOfThreads15M","numberOfThreads15MPercentChange"],virtualSizeCurrent:["virtualSizeCurrent","virtualSizePercentChange"],virtualSizeAverage:["virtualSize15M","virtualSize15MPercentChange"]},barCharts:{totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]},barChartsElementNames:{queueTimeDistributionPercent:"Queue",requestTimeDistributionPercent:"Computation",bytesSentDistributionPercent:"Bytes sent",bytesReceivedDistributionPercent:"Bytes received"},getDetailFigure:function(a){var b=$(a.currentTarget).attr("id").replace(/ChartButton/g,"");return b},showDetail:function(a){var b,c=this,d=this.getDetailFigure(a);b=this.dygraphConfig.getDetailChartConfig(d),this.getHistoryStatistics(d),this.detailGraphFigure=d,window.modalView.hideFooter=!0,window.modalView.hide(),window.modalView.show("modalGraph.ejs",b.header,void 0,void 0,void 0,void 0,this.events),window.modalView.hideFooter=!1,$("#modal-dialog").on("hidden",function(){c.hidden()}),$("#modal-dialog").toggleClass("modal-chart-detail",!0),b.height=.7*$(window).height(),b.width=$(".modal-inner-detail").width(),b.labelsDiv=$(b.labelsDiv)[0],this.detailGraph=new Dygraph(document.getElementById("lineChartDetail"),this.history[this.server][d],b)},hidden:function(){this.detailGraph.destroy(),delete this.detailGraph,delete this.detailGraphFigure},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},prepareDygraphs:function(){var a,b=this;this.dygraphConfig.getDashBoardFigures().forEach(function(c){a=b.dygraphConfig.getDefaultConfig(c);var d=b.getCurrentSize(a.div);a.height=d.height,a.width=d.width,b.graphs[c]=new Dygraph(document.getElementById(a.div),b.history[b.server][c]||[],a)})},initialize:function(){this.dygraphConfig=this.options.dygraphConfig,this.d3NotInitialized=!0,this.events["click .dashboard-sub-bar-menu-sign"]=this.showDetail.bind(this),this.events["mousedown .dygraph-rangesel-zoomhandle"]=this.stopUpdating.bind(this),this.events["mouseup .dygraph-rangesel-zoomhandle"]=this.startUpdating.bind(this),this.serverInfo=this.options.serverToShow,this.serverInfo?this.server=this.serverInfo.target:this.server="-local-",this.history[this.server]={}},updateCharts:function(){var a=this;return this.detailGraph?void this.updateLineChart(this.detailGraphFigure,!0):(this.prepareD3Charts(this.isUpdating),this.prepareResidentSize(this.isUpdating),this.updateTendencies(),void Object.keys(this.graphs).forEach(function(b){a.updateLineChart(b,!1)}))},updateTendencies:function(){var a=this,b=this.tendencies,c="";Object.keys(b).forEach(function(b){var d="",e=0;a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)&&(e=a.history[a.server][b][1]),0>e?c="#d05448":(c="#7da817",d="+"),a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)?$("#"+b).html(a.history[a.server][b][0]+'
'+d+e+"%"):$("#"+b).html('
data not ready yet')})},updateDateWindow:function(a,b){var c,d,e=(new Date).getTime();return b&&a.dateWindow_?(c=a.dateWindow_[0],d=e-a.dateWindow_[1]-5*this.interval>0?a.dateWindow_[1]:e,[c,d]):[e-this.defaultTimeFrame,e]},updateLineChart:function(a,b){var c=b?this.detailGraph:this.graphs[a],d={file:this.history[this.server][a],dateWindow:this.updateDateWindow(c,b)},e=0,f=[];_.each(d.file,function(a){var b=a[0].getSeconds()-a[0].getSeconds()%10;d.file[e][0].setSeconds(b),f.push(d.file[e][0]),e++});for(var g=new Date(Math.max.apply(null,f)),h=new Date(Math.min.apply(null,f)),i=new Date(h.getTime()),j=[],k=[];g>i;)i=new Date(i.setSeconds(i.getSeconds()+10)),k.push(i);_.each(k,function(a){var b=!1;_.each(d.file,function(c){Math.floor(a.getTime()/1e3)===Math.floor(c[0].getTime()/1e3)&&(b=!0)}),b===!1&&a1&&d.history[d.server][e].push(c))})},cutOffHistory:function(a,b){for(var c=this;0!==c.history[c.server][a].length;){var d=c.history[c.server][a][0][0];if(d>=b)break;c.history[c.server][a].shift()}},cutOffDygraphHistory:function(a){var b=this,c=new Date(a);this.dygraphConfig.getDashBoardFigures(!0).forEach(function(a){b.dygraphConfig.mapStatToFigure[a]&&b.history[b.server][a]&&b.cutOffHistory(a,c)})},mergeHistory:function(b){var c,d=this;for(c=0;c=0;--c)d.values.push({label:this.getLabel(b[a[0]].cuts,c),value:b[a[0]].values[c]}),e.values.push({label:this.getLabel(b[a[1]].cuts,c),value:b[a[1]].values[c]});return[d,e]},getLabel:function(a,b){return a[b]?0===b?"0 - "+a[b]:a[b-1]+" - "+a[b]:">"+a[b-1]},renderReplicationStatistics:function(a){$("#repl-numbers table tr:nth-child(1) > td:nth-child(2)").html(a.state.totalEvents),$("#repl-numbers table tr:nth-child(2) > td:nth-child(2)").html(a.state.totalRequests),$("#repl-numbers table tr:nth-child(3) > td:nth-child(2)").html(a.state.totalFailedConnects),a.state.lastAppliedContinuousTick?$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html(a.state.lastAppliedContinuousTick):$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastProcessedContinuousTick?$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html(a.state.lastProcessedContinuousTick):$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastAvailableContinuousTick?$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html(a.state.lastAvailableContinuousTick):$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html("no data available").addClass("no-data"),$("#repl-progress table tr:nth-child(1) > td:nth-child(2)").html(a.state.progress.message),$("#repl-progress table tr:nth-child(2) > td:nth-child(2)").html(a.state.progress.time),$("#repl-progress table tr:nth-child(3) > td:nth-child(2)").html(a.state.progress.failedConnects)},getReplicationStatistics:function(){var a=this;$.ajax("/_api/replication/applier-state",{async:!0}).done(function(b){if(b.hasOwnProperty("state")){var c;c=b.state.running?"active":"inactive",c=''+c+"",
+$("#replication-chart .dashboard-sub-bar").html("Replication "+c),a.renderReplicationStatistics(b)}})},getStatistics:function(a){var b=this,c="/_db/_system/_admin/aardvark/statistics/short",d="?start=";d+=b.nextStart?b.nextStart:((new Date).getTime()-b.defaultTimeFrame)/1e3,"-local-"!==b.server&&(c=b.serverInfo.endpoint+"/_admin/aardvark/statistics/cluster",d+="&type=short&DBserver="+b.serverInfo.target,b.history.hasOwnProperty(b.server)||(b.history[b.server]={})),$.ajax(c+d,{async:!0}).done(function(c){c.times.length>0&&(b.isUpdating=!0,b.mergeHistory(c)),b.isUpdating!==!1&&(a&&a(),b.updateCharts())}),this.getReplicationStatistics()},getHistoryStatistics:function(a){var b=this,c="statistics/long",d="?filter="+this.dygraphConfig.mapStatToFigure[a].join();"-local-"!==b.server&&(c=b.server.endpoint+"/_admin/aardvark/statistics/cluster",d+="&type=long&DBserver="+b.server.target,b.history.hasOwnProperty(b.server)||(b.history[b.server]={}));var e=window.location.href.split("/"),f=e[0]+"//"+e[2]+"/"+e[3]+"/_system/"+e[5]+"/"+e[6]+"/";$.ajax(f+c+d,{async:!0}).done(function(c){var d;for(b.history[b.server][a]=[],d=0;d data not ready yet '),$("#totalTimeDistribution").prepend(' data not ready yet
'),$(".dashboard-bar-chart-title").prepend(' data not ready yet
'))},removeEmptyDataLabels:function(){$(".dataNotReadyYet").remove()},prepareResidentSize:function(b){var c=this,d=this.getCurrentSize("#residentSizeChartContainer"),e=c.history[c.server].residentSizeCurrent/1024/1024,f="";f=1025>e?a(e,2)+" MB":a(e/1024,2)+" GB";var g=a(100*c.history[c.server].residentSizePercent,2),h=[a(c.history[c.server].physicalMemory/1024/1024/1024,0)+" GB"];return void 0===c.history[c.server].residentSizeChart?void this.addEmptyDataLabels():(this.removeEmptyDataLabels(),void nv.addGraph(function(){var a=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,right:1,bottom:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,left:1}).showValues(!1).showYAxis(!1).showXAxis(!1).transitionDuration(100).tooltips(!1).showLegend(!1).showControls(!1).stacked(!0);return a.yAxis.tickFormat(function(a){return a+"%"}).showMaxMin(!1),a.xAxis.showMaxMin(!1),d3.select("#residentSizeChart svg").datum(c.history[c.server].residentSizeChart).call(a),d3.select("#residentSizeChart svg").select(".nv-zeroLine").remove(),b&&(d3.select("#residentSizeChart svg").select("#total").remove(),d3.select("#residentSizeChart svg").select("#percentage").remove()),d3.select(".dashboard-bar-chart-title .percentage").html(f+" ("+g+" %)"),d3.select(".dashboard-bar-chart-title .absolut").html(h[0]),nv.utils.windowResize(a.update),a},function(){d3.selectAll("#residentSizeChart .nv-bar").on("click",function(){})}))},prepareD3Charts:function(b){var c=this,d={totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]};this.d3NotInitialized&&(b=!1,this.d3NotInitialized=!1),_.each(Object.keys(d),function(b){var d=c.getCurrentSize("#"+b+"Container .dashboard-interior-chart"),e="#"+b+"Container svg";return void 0===c.history[c.server].residentSizeChart?void c.addEmptyDataLabels():(c.removeEmptyDataLabels(),void nv.addGraph(function(){var f=[0,.25,.5,.75,1],g=75,h=23,i=6;d.width<219?(f=[0,.5,1],g=72,h=21,i=5):d.width<299?(f=[0,.3334,.6667,1],g=77):d.width<379?g=87:d.width<459?g=95:d.width<539?g=100:d.width<619&&(g=105);var j=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:5,right:20,bottom:h,left:g}).showValues(!1).showYAxis(!0).showXAxis(!0).transitionDuration(100).tooltips(!1).showLegend(!1).showControls(!1).forceY([0,1]);j.yAxis.showMaxMin(!1);d3.select(".nv-y.nv-axis").selectAll("text").attr("transform","translate (0, "+i+")");return j.yAxis.tickValues(f).tickFormat(function(b){return a(100*b*100/100,0)+"%"}),d3.select(e).datum(c.history[c.server][b]).call(j),nv.utils.windowResize(j.update),j},function(){d3.selectAll(e+" .nv-bar").on("click",function(){})}))})},stopUpdating:function(){this.isUpdating=!1},startUpdating:function(){var a=this;a.timer||(a.timer=window.setInterval(function(){a.getStatistics()},a.interval))},resize:function(){if(this.isUpdating){var a,b=this;_.each(this.graphs,function(c){a=b.getCurrentSize(c.maindiv_.id),c.resize(a.width,a.height)}),this.detailGraph&&(a=this.getCurrentSize(this.detailGraph.maindiv_.id),this.detailGraph.resize(a.width,a.height)),this.prepareD3Charts(!0),this.prepareResidentSize(!0)}},template:templateEngine.createTemplate("dashboardView.ejs"),render:function(a){a||$(this.el).html(this.template.render());var b=function(){this.prepareDygraphs(),this.isUpdating&&(this.prepareD3Charts(),this.prepareResidentSize(),this.updateTendencies()),this.startUpdating()}.bind(this),c=this.options.database.hasSystemAccess();c?this.getStatistics(b):($(".contentDiv").remove(),$(".headerBar").remove(),$(".dashboard-headerbar").remove(),$(".dashboard-row").remove(),$("#content").append('You do not have permission to view this page.
'),$("#content").append("You can switch to '_system' to see the dashboard.
"))}})}(),function(){"use strict";var a=function(a,b,c,d){return{type:a,title:b,callback:c,confirm:d}},b=function(a,b,c,d,e,f,g,h,i,j,k){var l={type:a,label:b};return void 0!==c&&(l.value=c),void 0!==d&&(l.info=d),void 0!==e&&(l.placeholder=e),void 0!==f&&(l.mandatory=f),void 0!==h&&(l.addDelete=h),void 0!==i&&(l.addAdd=i),void 0!==j&&(l.maxEntrySize=j),void 0!==k&&(l.tags=k),g&&(l.validateInput=function(){return g}),l};window.ModalView=Backbone.View.extend({_validators:[],_validateWatchers:[],baseTemplate:templateEngine.createTemplate("modalBase.ejs"),tableTemplate:templateEngine.createTemplate("modalTable.ejs"),el:"#modalPlaceholder",contentEl:"#modalContent",hideFooter:!1,confirm:{list:"#modal-delete-confirmation",yes:"#modal-confirm-delete",no:"#modal-abort-delete"},enabledHotkey:!1,enableHotKeys:!0,buttons:{SUCCESS:"success",NOTIFICATION:"notification",DELETE:"danger",NEUTRAL:"neutral",CLOSE:"close"},tables:{READONLY:"readonly",TEXT:"text",BLOB:"blob",PASSWORD:"password",SELECT:"select",SELECT2:"select2",CHECKBOX:"checkbox"},initialize:function(){Object.freeze(this.buttons),Object.freeze(this.tables)},createModalHotkeys:function(){$(this.el).unbind("keydown"),$(this.el).unbind("return"),$(this.el).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body input").unbind("keydown"),$(".modal-body input").unbind("return"),$(".modal-body input",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body select").unbind("keydown"),$(".modal-body select").unbind("return"),$(".modal-body select",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()})},createInitModalHotkeys:function(){var a=this;$(this.el).bind("keydown","left",function(){a.navigateThroughButtons("left")}),$(this.el).bind("keydown","right",function(){a.navigateThroughButtons("right")})},navigateThroughButtons:function(a){var b=$(".createModalDialog .modal-footer button").is(":focus");b===!1?"left"===a?$(".createModalDialog .modal-footer button").first().focus():"right"===a&&$("..createModalDialog .modal-footer button").last().focus():b===!0&&("left"===a?$(":focus").prev().focus():"right"===a&&$(":focus").next().focus())},createCloseButton:function(b,c){var d=this;return a(this.buttons.CLOSE,b,function(){d.hide(),c&&c()})},createSuccessButton:function(b,c){return a(this.buttons.SUCCESS,b,c)},createNotificationButton:function(b,c){return a(this.buttons.NOTIFICATION,b,c)},createDeleteButton:function(b,c,d){return a(this.buttons.DELETE,b,c,d)},createNeutralButton:function(b,c){return a(this.buttons.NEUTRAL,b,c)},createDisabledButton:function(b){var c=a(this.buttons.NEUTRAL,b);return c.disabled=!0,c},createReadOnlyEntry:function(a,c,d,e,f,g){var h=b(this.tables.READONLY,c,d,e,void 0,void 0,void 0,f,g);return h.id=a,h},createTextEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.TEXT,c,d,e,f,g,h);return i.id=a,i},createBlobEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.BLOB,c,d,e,f,g,h);return i.id=a,i},createSelect2Entry:function(a,c,d,e,f,g,h,i,j,k){var l=b(this.tables.SELECT2,c,d,e,f,g,void 0,h,i,j,k);return l.id=a,l},createPasswordEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.PASSWORD,c,d,e,f,g,h);return i.id=a,i},createCheckboxEntry:function(a,c,d,e,f){var g=b(this.tables.CHECKBOX,c,d,e);return g.id=a,f&&(g.checked=f),g},createSelectEntry:function(a,c,d,e,f){var g=b(this.tables.SELECT,c,null,e);return g.id=a,d&&(g.selected=d),g.options=f,g},createOptionEntry:function(a,b){return{label:a,value:b||a}},show:function(a,b,c,d,e,f,g,h,i){var j,k,l=this,m=!1;c=c||[],h=Boolean(h),this.clearValidators(),c.length>0?(c.forEach(function(a){a.type===l.buttons.CLOSE&&(m=!0),a.type===l.buttons.DELETE&&(k=k||a.confirm)}),m||(j=c.pop(),c.push(l.createCloseButton("Cancel")),c.push(j))):c.push(l.createCloseButton("Close")),$(this.el).html(this.baseTemplate.render({title:b,buttons:c,hideFooter:this.hideFooter,confirm:k,tabBar:i})),_.each(c,function(a,b){return!a.disabled&&a.callback?a.type!==l.buttons.DELETE||h?void $("#modalButton"+b).bind("click",a.callback):void $("#modalButton"+b).bind("click",function(){$(l.confirm.yes).unbind("click"),$(l.confirm.yes).bind("click",a.callback),$(l.confirm.list).css("display","block")}):void 0}),$(this.confirm.no).bind("click",function(){$(l.confirm.list).css("display","none")});var n;if("string"==typeof a)n=templateEngine.createTemplate(a),$(".createModalDialog .modal-body").html(n.render({content:d,advancedContent:e,info:f}));else{var o=0;_.each(a,function(a){n=templateEngine.createTemplate(a),$(".createModalDialog .modal-body .tab-content #"+i[o]).html(n.render({content:d,advancedContent:e,info:f})),o++})}$(".createModalDialog .modalTooltips").tooltip({position:{my:"left top",at:"right+55 top-1"}});var p=d||[];e&&e.content&&(p=p.concat(e.content)),_.each(p,function(a){l.modalBindValidation(a),a.type===l.tables.SELECT2&&$("#"+a.id).select2({tags:a.tags||[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:a.maxEntrySize||8})}),g&&(this.events=g,this.delegateEvents()),$("#accordion2")&&($("#accordion2 .accordion-toggle").bind("click",function(){$("#collapseOne").is(":visible")?($("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)):($("#collapseOne").show(),setTimeout(function(){$(".accordion-toggle").removeClass("collapsed")},100))}),$("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)),$("#modal-dialog").modal("show"),this.enabledHotkey===!1&&(this.createInitModalHotkeys(),this.enabledHotkey=!0),this.enableHotKeys&&this.createModalHotkeys();var q=$("#modal-dialog").find("input");q&&setTimeout(function(){var a=$("#modal-dialog");a.length>0&&(a=a.find("input"),a.length>0&&$(a[0]).focus())},800)},modalBindValidation:function(a){var b=this;if(a.hasOwnProperty("id")&&a.hasOwnProperty("validateInput")){var c=function(){var b=$("#"+a.id),c=a.validateInput(b),d=!1;return _.each(c,function(a){var c=b.val();if(a.rule||(a={rule:a}),"function"==typeof a.rule)try{a.rule(c)}catch(e){d=a.msg||e.message}else{var f=Joi.validate(c,a.rule);f.error&&(d=a.msg||f.error.message)}return d?!1:void 0}),d?d:void 0},d=$("#"+a.id);d.on("keyup focusout",function(){var a=c(),e=d.next()[0];a?(d.addClass("invalid-input"),e?$(e).text(a):d.after(''+a+"
"),$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled")):(d.removeClass("invalid-input"),e&&$(e).remove(),b.modalTestAll())}),this._validators.push(c),this._validateWatchers.push(d)}},modalTestAll:function(){var a=_.map(this._validators,function(a){return a()}),b=_.any(a);return b?$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled"):$(".createModalDialog .modal-footer .button-success").prop("disabled",!1).removeClass("disabled"),!b},clearValidators:function(){this._validators=[],_.each(this._validateWatchers,function(a){a.unbind("keyup focusout")}),this._validateWatchers=[]},hide:function(){this.clearValidators(),$("#modal-dialog").modal("hide")}})}(),window.StatisticsDescriptionCollection=Backbone.Collection.extend({model:window.StatisticsDescription,url:"/_admin/statistics-description",parse:function(a){return a}}),function(){"use strict";window.ClusterDownView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("clusterDown.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),events:{"click #relaunchCluster":"relaunchCluster","click #upgradeCluster":"upgradeCluster","click #editPlan":"editPlan","click #submitEditPlan":"submitEditPlan","click #deletePlan":"deletePlan","click #submitDeletePlan":"submitDeletePlan"},render:function(){var a,b=window.versionHelper.fromString(window.App.clusterPlan.getVersion());$.ajax({type:"GET",cache:!1,url:"/_admin/database/target-version",contentType:"application/json",processData:!1,async:!1,success:function(b){a=b.version}}),a=window.versionHelper.fromString(a);var c=!1;(a.major>b.major||a.major===b.major&&a.minor>b.minor)&&(c=!0),$(this.el).html(this.template.render({canUpgrade:c})),$(this.el).append(this.modal.render({}))},relaunchCluster:function(){$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster will be relaunched"),$.ajax({cache:!1,type:"GET",url:"cluster/relaunch",success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.navigate("showCluster",{trigger:!0})}})},upgradeCluster:function(){$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster will be upgraded"),$.ajax({cache:!1,type:"GET",url:"cluster/upgrade",success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.clusterPlan.fetch(),window.App.navigate("showCluster",{trigger:!0})}})},editPlan:function(){$("#deletePlanModal").modal("hide"),$("#editPlanModal").modal("show")},submitEditPlan:function(){$("#editPlanModal").modal("hide"),window.App.clusterPlan.cleanUp();var a=window.App.clusterPlan;return a.isTestSetup()?void window.App.navigate("planTest",{trigger:!0}):void window.App.navigate("planAsymmetrical",{trigger:!0})},deletePlan:function(){$("#editPlanModal").modal("hide"),$("#deletePlanModal").modal("show")},submitDeletePlan:function(){$("#deletePlanModal").modal("hide"),window.App.clusterPlan.cleanUp(),window.App.clusterPlan.destroy(),window.App.clusterPlan=new window.ClusterPlan,window.App.planScenario()}})}(),function(){"use strict";window.ClusterUnreachableView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("clusterUnreachable.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),events:{"click #clusterShutdown":"shutdown"},initialize:function(){this.coordinators=new window.ClusterCoordinators([],{})},retryCounter:0,retryNavigation:function(){var a=this;if(10===this.retryCounter){this.retryCounter=0;var b=new XMLHttpRequest;b.open("GET",window.location.origin+window.location.pathname,!1),b.send(),200===b.status?window.location.reload():window.setTimeout(function(){a.retryCounter++,a.retryNavigation()},1e3)}else this.retryCounter++,window.setTimeout(function(){a.retryNavigation()},1e3)},retryConnection:function(){this.coordinators.checkConnection(function(){window.App.showCluster()}),this.retryNavigation()},shutdown:function(){window.clearTimeout(this.timer),window.App.shutdownView.clusterShutdown()},render:function(){var a=window.App.clusterPlan,b=[];if(a&&a.has("runInfo")){var c=_.where(a.get("runInfo"),{isStartServers:!0});_.each(_.filter(c,function(a){return _.contains(a.roles,"Coordinator")}),function(a){var c=a.endpoints[0].split("://")[1];c=c.split(":")[0],b.push(c)})}$(this.el).html(this.template.render({coordinators:b})),$(this.el).append(this.modal.render({})),this.timer=window.setTimeout(this.retryConnection.bind(this),1e4)}})}(),function(){"use strict";window.ServerDashboardView=window.DashboardView.extend({modal:!0,hide:function(){window.App.showClusterView.startUpdating(),this.stopUpdating()},render:function(){var a=this;window.modalView.hideFooter=!0,window.modalView.show("dashboardView.ejs",null,void 0,void 0,void 0,this.events),$("#modal-dialog").toggleClass("modal-chart-detail",!0),window.DashboardView.prototype.render.bind(this)(!0),window.modalView.hideFooter=!1,$("#modal-dialog").on("hidden",function(){a.hide()});var b=document.createElement("button");b.className="close",b.appendChild(document.createTextNode("×")),b=$(b),b.attr("data-dismiss","modal"),b.attr("aria-hidden","true"),b.attr("type","button"),$(".modal-body .headerBar:first-child").toggleClass("headerBar",!1).toggleClass("modal-dashboard-header",!0).append(b)}})}(),function(){"use strict";window.LoginModalView=Backbone.View.extend({template:templateEngine.createTemplate("loginModal.ejs"),el:"#modalPlaceholder",events:{"click #confirmLogin":"confirmLogin","hidden #loginModalLayer":"hidden"},hidden:function(){this.undelegateEvents(),window.App.isCheckingUser=!1,$(this.el).html("")},confirmLogin:function(){var a=$("#username").val(),b=$("#password").val();window.App.clusterPlan.storeCredentials(a,b),this.hideModal()},hideModal:function(){$("#loginModalLayer").modal("hide")},render:function(){$(this.el).html(this.template.render({})),$("#loginModalLayer").modal("show")}})}(),function(){"use strict";window.PlanScenarioSelectorView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("planScenarioSelector.ejs","planner"),events:{"click #multiServerAsymmetrical":"multiServerAsymmetrical","click #singleServer":"singleServer"},render:function(){$(this.el).html(this.template.render({}))},multiServerAsymmetrical:function(){window.App.navigate("planAsymmetrical",{trigger:!0})},singleServer:function(){window.App.navigate("planTest",{trigger:!0})}})}(),function(){"use strict";window.PlanSymmetricView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("symmetricPlan.ejs"),entryTemplate:templateEngine.createTemplate("serverEntry.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),connectionValidationKey:null,events:{"click #startSymmetricPlan":"startPlan","click .add":"addEntry","click .delete":"removeEntry","click #cancel":"cancel","click #test-all-connections":"checkAllConnections","focusout .host":"checkAllConnections","focusout .port":"checkAllConnections","focusout .user":"checkAllConnections","focusout .passwd":"checkAllConnections"},cancel:function(){window.App.clusterPlan.get("plan")?window.App.navigate("handleClusterDown",{trigger:!0}):window.App.navigate("planScenario",{trigger:!0})},startPlan:function(){var a=this,b={dispatchers:[]},c=!1,d=!1;if(b.useSSLonDBservers=!!$(".useSSLonDBservers").prop("checked"),b.useSSLonCoordinators=!!$(".useSSLonCoordinators").prop("checked"),$(".dispatcher").each(function(e,f){var g=$(".host",f).val(),h=$(".port",f).val(),i=$(".user",f).val(),j=$(".passwd",f).val();if(!g||0===g.length||!h||0===h.length)return!0;var k={host:g+":"+h};a.isSymmetric?(k.isDBServer=!0,k.isCoordinator=!0):(k.isDBServer=!!$(".isDBServer",f).prop("checked"),k.isCoordinator=!!$(".isCoordinator",f).prop("checked")),k.username=i,k.passwd=j,c=c||k.isCoordinator,d=d||k.isDBServer,b.dispatchers.push(k)}),a.isSymmetric){if(0===b.dispatchers.length)return void alert("Please provide at least one host")}else{if(!d)return void alert("Please provide at least one database server");if(!c)return void alert("Please provide at least one coordinator")}b.type=this.isSymmetric?"symmetricalSetup":"asymmetricalSetup",$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster is being launched"),delete window.App.clusterPlan._coord,window.App.clusterPlan.save(b,{success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.updateAllUrls(),window.App.navigate("showCluster",{trigger:!0})},error:function(a,b){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),alert("Error while starting the cluster: "+b.statusText)}})},addEntry:function(){this.disableLaunchButton();var a=$("#server_list div.control-group.dispatcher:last .user").val(),b=$("#server_list div.control-group.dispatcher:last .passwd").val();$("#server_list").append(this.entryTemplate.render({isSymmetric:this.isSymmetric,isFirst:!1,isCoordinator:!0,isDBServer:!0,host:"",port:"",user:a,passwd:b}))},removeEntry:function(a){$(a.currentTarget).closest(".control-group").remove(),this.checkAllConnections()},render:function(a){var b={},c=!0,d=window.App.clusterPlan.get("config");if(this.isSymmetric=a,$(this.el).html(this.template.render({isSymmetric:a,params:b,useSSLonDBservers:d&&d.useSSLonDBservers?d.useSSLonDBservers:!1,useSSLonCoordinators:d&&d.useSSLonCoordinators?d.useSSLonCoordinators:!1})),d){var e=this,f=!1,g=!1;_.each(d.dispatchers,function(b){g=void 0===b.allowDBservers?!0:b.allowDBservers,f=void 0===b.allowCoordinators?!0:b.allowCoordinators;var d=b.endpoint;d=d.split("//")[1],d=d.split(":"),"localhost"===d&&(d="127.0.0.1");var h=b.username,i=b.passwd,j=e.entryTemplate.render({isSymmetric:a,isFirst:c,host:d[0],port:d[1],isCoordinator:f,isDBServer:g,user:h,passwd:i});$("#server_list").append(j),c=!1})}else $("#server_list").append(this.entryTemplate.render({isSymmetric:a,isFirst:!0,isCoordinator:!0,isDBServer:!0,host:"",port:"",user:"",passwd:""}));this.disableLaunchButton(),$(this.el).append(this.modal.render({}))},readAllConnections:function(){var a=[];return $(".dispatcher").each(function(b,c){var d={host:$(".host",c).val(),port:$(".port",c).val(),user:$(".user",c).val(),passwd:$(".passwd",c).val()};d.host&&d.port&&a.push(d)}),a},checkAllConnections:function(){var a=this,b=Math.random();this.connectionValidationKey=b,$(".cluster-connection-check-success").remove(),$(".cluster-connection-check-fail").remove();var c=this.readAllConnections();if(c.length)try{$.ajax({async:!0,cache:!1,type:"POST",url:"/_admin/aardvark/cluster/communicationCheck",data:JSON.stringify(c),success:function(c){if(b===a.connectionValidationKey){var d=$(".dispatcher"),e=0;d.each(function(a,b){var d=$(".host",b).val(),f=$(".port",b).val();d&&f&&(c[e]?$(".controls:first",b).append('Connection: ok'):$(".controls:first",b).append('Connection: fail'),e++)}),a.checkDispatcherArray(c,b)}}})}catch(d){this.disableLaunchButton()}},checkDispatcherArray:function(a,b){_.every(a,function(a){return a})&&b===this.connectionValidationKey&&this.enableLaunchButton()},disableLaunchButton:function(){$("#startSymmetricPlan").attr("disabled","disabled"),$("#startSymmetricPlan").removeClass("button-success"),$("#startSymmetricPlan").addClass("button-neutral")},enableLaunchButton:function(){$("#startSymmetricPlan").attr("disabled",!1),$("#startSymmetricPlan").removeClass("button-neutral"),$("#startSymmetricPlan").addClass("button-success")}})}(),function(){"use strict";window.PlanTestView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("testPlan.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),events:{"click #startTestPlan":"startPlan","click #cancel":"cancel"},cancel:function(){window.App.clusterPlan.get("plan")?window.App.navigate("handleClusterDown",{trigger:!0}):window.App.navigate("planScenario",{trigger:!0})},startPlan:function(){$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster is being launched");var a=$("#host").val(),b=$("#port").val(),c=$("#coordinators").val(),d=$("#dbs").val();return a?b?!c||0>c?void alert("Please define a number of coordinators"):!d||0>d?void alert("Please define a number of database servers"):(delete window.App.clusterPlan._coord,void window.App.clusterPlan.save({type:"testSetup",dispatchers:a+":"+b,numberDBServers:parseInt(d,10),numberCoordinators:parseInt(c,10)},{success:function(){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.updateAllUrls(),window.App.navigate("showCluster",{trigger:!0})},error:function(a,b){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),alert("Error while starting the cluster: "+b.statusText)}})):void alert("Please define a port"):void alert("Please define a host")},render:function(){var a={},b=window.App.clusterPlan.get("config");if(b){a.dbs=b.numberOfDBservers,a.coords=b.numberOfCoordinators;var c=b.dispatchers.d1.endpoint;c=c.split("://")[1],c=c.split(":"),"localhost"===c&&(c="127.0.0.1"),a.hostname=c[0],a.port=c[1]}else a.dbs=3,a.coords=2,a.hostname=window.location.hostname,"localhost"===a.hostname&&(a.hostname="127.0.0.1"),a.port=window.location.port;$(this.el).html(this.template.render(a)),$(this.el).append(this.modal.render({}))}})}(),function(){"use strict";window.ShowClusterView=Backbone.View.extend({detailEl:"#modalPlaceholder",el:"#content",defaultFrame:12e5,template:templateEngine.createTemplate("showCluster.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),detailTemplate:templateEngine.createTemplate("detailView.ejs"),events:{"change #selectDB":"updateCollections","change #selectCol":"updateShards","click .dbserver.success":"dashboard","click .coordinator.success":"dashboard"},replaceSVGs:function(){$(".svgToReplace").each(function(){var a=$(this),b=a.attr("id"),c=a.attr("src");$.get(c,function(c){var d=$(c).find("svg");d.attr("id",b).attr("class","icon").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},updateServerTime:function(){this.serverTime=(new Date).getTime()},setShowAll:function(){this.graphShowAll=!0},resetShowAll:function(){this.graphShowAll=!1,this.renderLineChart()},initialize:function(){this.interval=1e4,this.isUpdating=!1,this.timer=null,this.knownServers=[],this.graph=void 0,this.graphShowAll=!1,this.updateServerTime(),this.dygraphConfig=this.options.dygraphConfig,this.dbservers=new window.ClusterServers([],{interval:this.interval}),this.coordinators=new window.ClusterCoordinators([],{interval:this.interval}),this.documentStore=new window.arangoDocuments,this.statisticsDescription=new window.StatisticsDescription,this.statisticsDescription.fetch({async:!1}),this.dbs=new window.ClusterDatabases([],{interval:this.interval}),this.cols=new window.ClusterCollections,this.shards=new window.ClusterShards,this.startUpdating()},listByAddress:function(a){var b={},c=this;this.dbservers.byAddress(b,function(b){c.coordinators.byAddress(b,a)})},updateCollections:function(){var a=this,b=$("#selectCol"),c=$("#selectDB").find(":selected").attr("id");if(c){var d=b.find(":selected").attr("id");b.html(""),this.cols.getList(c,function(c){_.each(_.pluck(c,"name"),function(a){b.append('")});var e=$("#"+d,b);1===e.length&&e.prop("selected",!0),a.updateShards()})}},updateShards:function(){var a=$("#selectDB").find(":selected").attr("id"),b=$("#selectCol").find(":selected").attr("id");this.shards.getList(a,b,function(a){$(".shardCounter").html("0"),_.each(a,function(a){$("#"+a.server+"Shards").html(a.shards.length)})})},updateServerStatus:function(a){var b=this,c=function(a,b,c){var d,e,f=c;f=f.replace(/\./g,"-"),f=f.replace(/\:/g,"_"),e=$("#id"+f),e.length<1||(d=e.attr("class").split(/\s+/)[1],e.attr("class",a+" "+d+" "+b),"coordinator"===a&&("success"===b?$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!1):$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!0)))};this.coordinators.getStatuses(c.bind(this,"coordinator"),function(){b.dbservers.getStatuses(c.bind(b,"dbserver")),a()})},updateDBDetailList:function(){var a=this,b=$("#selectDB"),c=b.find(":selected").attr("id");b.html(""),this.dbs.getList(function(d){_.each(_.pluck(d,"name"),function(a){b.append('")});var e=$("#"+c,b);1===e.length&&e.prop("selected",!0),a.updateCollections()})},rerender:function(){var a=this;this.updateServerStatus(function(){a.getServerStatistics(function(){a.updateServerTime(),a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList()})})},render:function(){this.knownServers=[],delete this.hist;var a=this;this.listByAddress(function(b){1===Object.keys(b).length?a.type="testPlan":a.type="other",a.updateDBDetailList(),a.dbs.getList(function(c){$(a.el).html(a.template.render({dbs:_.pluck(c,"name"),byAddress:b,type:a.type})),$(a.el).append(a.modal.render({})),a.replaceSVGs(),a.getServerStatistics(function(){a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList(),a.startUpdating()})})})},generatePieData:function(){var a=[],b=this;return this.data.forEach(function(c){a.push({key:c.get("name"),value:c.get("system").virtualSize,time:b.serverTime})}),a},addStatisticsItem:function(a,b,c,d){var e=this;e.hasOwnProperty("hist")||(e.hist={}),e.hist.hasOwnProperty(a)||(e.hist[a]=[]);var f=e.hist[a],g=f.length;if(0===g)f.push({time:b,snap:d,requests:c,requestsPerSecond:0});else{var h=f[g-1].time,i=f[g-1].requests;if(c>i){var j=b-h,k=0;j>0&&(k=(c-i)/j),f.push({time:b,snap:d,requests:c,requestsPerSecond:k})}}},getServerStatistics:function(a){var b=this,c=Math.round(b.serverTime/1e3);this.data=void 0;var d=new window.ClusterStatisticsCollection,e=this.coordinators.first();this.dbservers.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=e.get("protocol")+"://"+e.get("address")+"/_admin/clusterStatistics?DBserver="+a.get("name"),d.add(c)}}),this.coordinators.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=a.get("protocol")+"://"+a.get("address")+"/_admin/statistics",d.add(c)}});var f=d.size();this.data=[];var g=function(d){f--;var e=d.get("time"),g=d.get("name"),h=d.get("http").requestsTotal;b.addStatisticsItem(g,e,h,c),b.data.push(d),0===f&&a()},h=function(){f--,0===f&&a()};d.fetch(g,h)},renderPieChart:function(a){var b=$("#clusterGraphs svg").width(),c=$("#clusterGraphs svg").height(),d=Math.min(b,c)/2,e=this.dygraphConfig.colors,f=d3.svg.arc().outerRadius(d-20).innerRadius(0),g=d3.layout.pie().sort(function(a){return a.value}).value(function(a){return a.value});d3.select("#clusterGraphs").select("svg").remove();var h=d3.select("#clusterGraphs").append("svg").attr("class","clusterChart").append("g").attr("transform","translate("+b/2+","+(c/2-10)+")"),i=d3.svg.arc().outerRadius(d-2).innerRadius(d-2),j=h.selectAll(".arc").data(g(a)).enter().append("g").attr("class","slice");j.append("path").attr("d",f).style("fill",function(a,b){return e[b%e.length]}).style("stroke",function(a,b){return e[b%e.length]}),j.append("text").attr("transform",function(a){return"translate("+f.centroid(a)+")"}).style("text-anchor","middle").text(function(a){
+var b=a.data.value/1024/1024/1024;return b.toFixed(2)}),j.append("text").attr("transform",function(a){return"translate("+i.centroid(a)+")"}).style("text-anchor","middle").text(function(a){return a.data.key})},renderLineChart:function(){var a,b,c,d,e,f,g=this,h=1200,i=[],j=[],k=Math.round((new Date).getTime()/1e3)-h,l=g.knownServers,m=function(){return null};for(c=0;cf||(j.hasOwnProperty(f)?a=j[f]:(e=new Date(1e3*f),a=j[f]=[e].concat(l.map(m))),a[c+1]=b[d].requestsPerSecond);i=[],Object.keys(j).sort().forEach(function(a){i.push(j[a])});var n=this.dygraphConfig.getDefaultConfig("clusterRequestsPerSecond");n.labelsDiv=$("#lineGraphLegend")[0],n.labels=["datetime"].concat(l),g.graph=new Dygraph(document.getElementById("lineGraph"),i,n)},stopUpdating:function(){window.clearTimeout(this.timer),delete this.graph,this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.rerender()},this.interval)}},dashboard:function(a){this.stopUpdating();var b,c,d=$(a.currentTarget),e={},f=d.attr("id");f=f.replace(/\-/g,"."),f=f.replace(/\_/g,":"),f=f.substr(2),e.raw=f,e.isDBServer=d.hasClass("dbserver"),e.isDBServer?(b=this.dbservers.findWhere({address:e.raw}),c=this.coordinators.findWhere({status:"ok"}),e.endpoint=c.get("protocol")+"://"+c.get("address")):(b=this.coordinators.findWhere({address:e.raw}),e.endpoint=b.get("protocol")+"://"+b.get("address")),e.target=encodeURIComponent(b.get("name")),window.App.serverToShow=e,window.App.dashboard()},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},resize:function(){var a;this.graph&&(a=this.getCurrentSize(this.graph.maindiv_.id),this.graph.resize(a.width,a.height))}})}(),function(){"use strict";window.ShowShardsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("showShards.ejs"),events:{"change #selectDB":"updateCollections","change #selectCol":"updateShards"},initialize:function(){this.dbservers=new window.ClusterServers([],{interval:1e4}),this.dbservers.fetch({async:!1,beforeSend:window.App.addAuth.bind(window.App)}),this.dbs=new window.ClusterDatabases([],{interval:1e4}),this.cols=new window.ClusterCollections,this.shards=new window.ClusterShards},updateCollections:function(){var a=$("#selectDB").find(":selected").attr("id");$("#selectCol").html(""),_.each(_.pluck(this.cols.getList(a),"name"),function(a){$("#selectCol").append('")}),this.updateShards()},updateShards:function(){var a=$("#selectDB").find(":selected").attr("id"),b=$("#selectCol").find(":selected").attr("id"),c=this.shards.getList(a,b);$(".shardContainer").empty(),_.each(c,function(a){var b=$("#"+a.server+"Shards");$(".collectionName",b).html(a.server+": "+a.shards.length)})},render:function(){$(this.el).html(this.template.render({names:this.dbservers.pluck("name"),dbs:_.pluck(this.dbs.getList(),"name")})),this.updateCollections()}})}(),function(){"use strict";window.ShutdownButtonView=Backbone.View.extend({el:"#navigationBar",events:{"click #clusterShutdown":"clusterShutdown"},initialize:function(){this.overview=this.options.overview},template:templateEngine.createTemplate("shutdownButtonView.ejs"),clusterShutdown:function(){this.overview.stopUpdating(),$("#waitModalLayer").modal("show"),$(".modal-backdrop.fade.in").addClass("waitModalBackdrop"),$("#waitModalMessage").html("Please be patient while your cluster is shutting down"),$.ajax({cache:!1,type:"GET",url:"cluster/shutdown",success:function(a){$(".modal-backdrop.fade.in").removeClass("waitModalBackdrop"),$("#waitModalLayer").modal("hide"),window.App.navigate("handleClusterDown",{trigger:!0})}})},render:function(){return $(this.el).html(this.template.render({})),this},unrender:function(){$(this.el).html("")}})}(),function(){"use strict";window.ClusterRouter=Backbone.Router.extend({routes:{"":"initialRoute",planScenario:"planScenario",planTest:"planTest",planAsymmetrical:"planAsymmetric",shards:"showShards",showCluster:"showCluster",handleClusterDown:"handleClusterDown"},addAuth:function(a){var b=this.clusterPlan.get("user");if(!b)return a.abort(),void(this.isCheckingUser||this.requestAuth());var c=b.name,d=b.passwd,e=c.concat(":",d);a.setRequestHeader("Authorization","Basic "+btoa(e))},requestAuth:function(){this.isCheckingUser=!0,this.clusterPlan.set({user:null});var a=new window.LoginModalView;a.render()},getNewRoute:function(a){return"statistics"===a?this.clusterPlan.getCoordinator()+"/_admin/"+a:this.clusterPlan.getCoordinator()+"/_admin/aardvark/cluster/"+a},initialRoute:function(){this.initial()},updateAllUrls:function(){_.each(this.toUpdate,function(a){a.updateUrl()})},registerForUpdate:function(a){this.toUpdate.push(a),a.updateUrl()},initialize:function(){this.footerView=new window.FooterView,this.footerView.render();var a=this;this.dygraphConfig=window.dygraphConfig,window.modalView=new window.ModalView,this.initial=this.planScenario,this.isCheckingUser=!1,this.bind("all",function(b,c){b.split(":");"route"===b&&"showCluster"!==c&&(a.showClusterView&&(a.showClusterView.stopUpdating(),a.shutdownView.unrender()),a.dashboardView&&a.dashboardView.stopUpdating())}),this.toUpdate=[],this.clusterPlan=new window.ClusterPlan,this.clusterPlan.fetch({async:!1}),$(window).resize(function(){a.handleResize()})},showCluster:function(){this.showClusterView||(this.showClusterView=new window.ShowClusterView({dygraphConfig:this.dygraphConfig})),this.shutdownView||(this.shutdownView=new window.ShutdownButtonView({overview:this.showClusterView})),this.shutdownView.render(),this.showClusterView.render()},showShards:function(){this.showShardsView||(this.showShardsView=new window.ShowShardsView),this.showShardsView.render()},handleResize:function(){this.dashboardView&&this.dashboardView.resize(),this.showClusterView&&this.showClusterView.resize()},planTest:function(){this.planTestView||(this.planTestView=new window.PlanTestView({model:this.clusterPlan})),this.planTestView.render()},planAsymmetric:function(){this.planSymmetricView||(this.planSymmetricView=new window.PlanSymmetricView({model:this.clusterPlan})),this.planSymmetricView.render(!1)},planScenario:function(){this.planScenarioSelector||(this.planScenarioSelector=new window.PlanScenarioSelectorView),this.planScenarioSelector.render()},handleClusterDown:function(){this.clusterDownView||(this.clusterDownView=new window.ClusterDownView),this.clusterDownView.render()},dashboard:function(){var a=this.serverToShow;return a?(a.addAuth=this.addAuth.bind(this),this.dashboardView=new window.ServerDashboardView({dygraphConfig:this.dygraphConfig,serverToShow:this.serverToShow,database:{hasSystemAccess:function(){return!0}}}),void this.dashboardView.render()):void this.navigate("",{trigger:!0})},clusterUnreachable:function(){this.showClusterView&&(this.showClusterView.stopUpdating(),this.shutdownView.unrender()),this.unreachableView||(this.unreachableView=new window.ClusterUnreachableView),this.unreachableView.render()}})}(),function(){"use strict";$.get("cluster/amIDispatcher",function(a){if(!a){var b=window.location.origin;b+=window.location.pathname,b=b.replace("cluster","index"),window.location.replace(b)}}),window.location.hash="",$(document).ready(function(){window.App=new window.ClusterRouter,Backbone.history.start(),window.App.clusterPlan.get("plan")?window.App.clusterPlan.isAlive()?window.App.initial=window.App.showCluster:window.App.initial=window.App.handleClusterDown:window.App.initial=window.App.planScenario,window.App.initialRoute(),window.App.handleResize()})}();
\ No newline at end of file
diff --git a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js.gz b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js.gz
index 1f84f588158fb2b60e73c222d58b2b5d714b6a74..0c891c98adbdc1304869941c4036510a6b178efc 100644
GIT binary patch
literal 21857
zcmV($K;yq3iwFP!000041MPk3b{ol&?*DlTsMNy-Ob}eua@(LFS|Ta8#@a@t+V-V&
zGzClUXllGE3)+*|>2&$&$uKuh)xL
zR=(@RALGx>XfRsj^K`ZzpFIy6NA1fvzZeg?_cq)4VlYVayzBbww=Uye|LUsMj<4Eg
z=<{@zV|qWOqiH(pT^`RSX9t+#_{2AhTbG<|zZZ9A>2wqi(&qZwQM~q#C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
}
- else {
+ else if (!error && error !== undefined) {
$("tr th:contains('"+ this.lastId+"')").parent().remove();
+ this.model.set("locked", false);
+ this.refreshCollectionsView();
}
}.bind(this);
+ this.model.set("locked", true);
this.model.deleteIndex(this.lastId, callback);
+
+ this.refreshCollectionsView();
+
$("tr th:contains('"+ this.lastId+"')").parent().children().last().html(
''
);
@@ -20244,12 +20291,15 @@ window.ArangoUsers = Backbone.Collection.extend({
});
this.collection.each(function(model) {
- if (model.get("locked")) {
+ if (model.get("locked") || model.get("status") === 'loading') {
$('#collection_' + model.get("name")).addClass('locked');
}
else {
$('#collection_' + model.get("name")).removeClass('locked');
}
+ if (model.get("status") === 'loading') {
+ $('#collection_' + model.get("name")).removeClass('loading');
+ }
});
},
@@ -26761,6 +26811,8 @@ window.ArangoUsers = Backbone.Collection.extend({
if (typeof callback === "function") {
callback();
}
+ $.noty.clearQueue();
+ $.noty.closeAll();
},
error: function (data) {
window.progressView.hide();
@@ -26952,7 +27004,8 @@ window.ArangoUsers = Backbone.Collection.extend({
if (xhr.getResponseHeader('x-arango-async-id')) {
self.queryCallbackFunction(xhr.getResponseHeader('x-arango-async-id'), callback);
}
-
+ $.noty.clearQueue();
+ $.noty.closeAll();
},
error: function (data) {
self.switchTab("result-switch");
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 e40d940da9f5258c7a5b53ed67d002994370f2ec..39b2a382f823e86b9aa5e5ffb706e94561ba7898 100644
GIT binary patch
delta 219454
zcmV(vKu(vNbUq`z-m=4ELKa0*eocZI57thLs>jyY~~j4{WIouos!
zHr!Gu6sC0}aCKSc^1tY~>3*DC}k_!rJ0cYe0Dvw!+5Fsj2yWr#!Co1V&byUjFQCdz{mfocS
z=Gwe*XMM~Xe)
zXcoub>*j+=CP15IQ#;CgjmPXfq7E((lu9Mk=TR!XTzw3^dLB{*YVR;n0ywWHwe9XpbW?i$BG&FN!|_4xQq*DCO11~^xVf@bZXe#986P0zq5=B
zRFQoAW(R4Bx67cd9^T<%jwGcnT&j99Jq8_#=MJW>G
zKgbxje=KHHyrAT1@Jmuxv<-*@mrM