"),$(".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 1f84f58815..0c891c98ad 100644
Binary files a/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js.gz and b/js/apps/system/_admin/aardvark/APP/clusterFrontend/build/cluster.min.js.gz differ
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.js b/js/apps/system/_admin/aardvark/APP/frontend/build/app.js
index 307622717a..3f095da1c3 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/build/app.js
+++ b/js/apps/system/_admin/aardvark/APP/frontend/build/app.js
@@ -13078,7 +13078,7 @@ module.define("underscore", function(exports, module) {
////////////////////////////////////////////////////////////////////////////////
/// @brief ArangoError
////////////////////////////////////////////////////////////////////////////////
-if(global.ArangoError){exports.ArangoError = global.ArangoError;delete global.ArangoError;}else {exports.ArangoError = function(error){if(error !== undefined){this.error = error.error;this.code = error.code;this.errorNum = error.errorNum;this.errorMessage = error.errorMessage;}this.message = this.toString();};exports.ArangoError.prototype = new Error();}exports.ArangoError.prototype._PRINT = function(context){context.output += this.toString();};exports.ArangoError.prototype.toString = function(){var errorNum=this.errorNum;var errorMessage=this.errorMessage || this.message;return '[ArangoError ' + errorNum + ': ' + errorMessage + ']';}; ////////////////////////////////////////////////////////////////////////////////
+if(global.ArangoError){exports.ArangoError = global.ArangoError;delete global.ArangoError;}else {exports.ArangoError = function(error){if(error !== undefined){this.error = error.error;this.code = error.code;this.errorNum = error.errorNum;this.errorMessage = error.errorMessage;}};exports.ArangoError.prototype = new Error();}Object.defineProperty(exports.ArangoError.prototype,'message',{configurable:true,enumerable:true,get:function get(){return this.errorMessage;}});exports.ArangoError.prototype.name = 'ArangoError';exports.ArangoError.prototype._PRINT = function(context){context.output += '[' + this.toString() + ']';};exports.ArangoError.prototype.toString = function(){return this.name + ' ' + this.errorNum + ': ' + this.message;}; ////////////////////////////////////////////////////////////////////////////////
/// @brief threadNumber
////////////////////////////////////////////////////////////////////////////////
exports.threadNumber = 0;if(global.THREAD_NUMBER){exports.threadNumber = global.THREAD_NUMBER;delete global.THREAD_NUMBER;} ////////////////////////////////////////////////////////////////////////////////
@@ -13420,7 +13420,7 @@ global.start_color_print = function start_color_print(color){require('internal')
global.stop_color_print = function stop_color_print(){require('internal').stopColorPrint();};if(global.EXPORTS_SLOW_BUFFER){Object.keys(global.EXPORTS_SLOW_BUFFER).forEach(function(key){exports[key] = global.EXPORTS_SLOW_BUFFER[key];});delete global.EXPORTS_SLOW_BUFFER;}if(global.APP_PATH){exports.appPath = global.APP_PATH;delete global.APP_PATH;}return exports;})()); /*jshint maxlen: 240 */ /*global require */ ////////////////////////////////////////////////////////////////////////////////
/// @brief auto-generated file generated from errors.dat
////////////////////////////////////////////////////////////////////////////////
-(function(){"use strict";var internal=require("internal");internal.errors = {"ERROR_NO_ERROR":{"code":0,"message":"no error"},"ERROR_FAILED":{"code":1,"message":"failed"},"ERROR_SYS_ERROR":{"code":2,"message":"system error"},"ERROR_OUT_OF_MEMORY":{"code":3,"message":"out of memory"},"ERROR_INTERNAL":{"code":4,"message":"internal error"},"ERROR_ILLEGAL_NUMBER":{"code":5,"message":"illegal number"},"ERROR_NUMERIC_OVERFLOW":{"code":6,"message":"numeric overflow"},"ERROR_ILLEGAL_OPTION":{"code":7,"message":"illegal option"},"ERROR_DEAD_PID":{"code":8,"message":"dead process identifier"},"ERROR_NOT_IMPLEMENTED":{"code":9,"message":"not implemented"},"ERROR_BAD_PARAMETER":{"code":10,"message":"bad parameter"},"ERROR_FORBIDDEN":{"code":11,"message":"forbidden"},"ERROR_OUT_OF_MEMORY_MMAP":{"code":12,"message":"out of memory in mmap"},"ERROR_CORRUPTED_CSV":{"code":13,"message":"csv is corrupt"},"ERROR_FILE_NOT_FOUND":{"code":14,"message":"file not found"},"ERROR_CANNOT_WRITE_FILE":{"code":15,"message":"cannot write file"},"ERROR_CANNOT_OVERWRITE_FILE":{"code":16,"message":"cannot overwrite file"},"ERROR_TYPE_ERROR":{"code":17,"message":"type error"},"ERROR_LOCK_TIMEOUT":{"code":18,"message":"lock timeout"},"ERROR_CANNOT_CREATE_DIRECTORY":{"code":19,"message":"cannot create directory"},"ERROR_CANNOT_CREATE_TEMP_FILE":{"code":20,"message":"cannot create temporary file"},"ERROR_REQUEST_CANCELED":{"code":21,"message":"canceled request"},"ERROR_DEBUG":{"code":22,"message":"intentional debug error"},"ERROR_AID_NOT_FOUND":{"code":23,"message":"internal error with attribute ID in shaper"},"ERROR_LEGEND_INCOMPLETE":{"code":24,"message":"internal error if a legend could not be created"},"ERROR_IP_ADDRESS_INVALID":{"code":25,"message":"IP address is invalid"},"ERROR_LEGEND_NOT_IN_WAL_FILE":{"code":26,"message":"internal error if a legend for a marker does not yet exist in the same WAL file"},"ERROR_FILE_EXISTS":{"code":27,"message":"file exists"},"ERROR_LOCKED":{"code":28,"message":"locked"},"ERROR_DEADLOCK":{"code":29,"message":"deadlock detected"},"ERROR_HTTP_BAD_PARAMETER":{"code":400,"message":"bad parameter"},"ERROR_HTTP_UNAUTHORIZED":{"code":401,"message":"unauthorized"},"ERROR_HTTP_FORBIDDEN":{"code":403,"message":"forbidden"},"ERROR_HTTP_NOT_FOUND":{"code":404,"message":"not found"},"ERROR_HTTP_METHOD_NOT_ALLOWED":{"code":405,"message":"method not supported"},"ERROR_HTTP_PRECONDITION_FAILED":{"code":412,"message":"precondition failed"},"ERROR_HTTP_SERVER_ERROR":{"code":500,"message":"internal server error"},"ERROR_HTTP_CORRUPTED_JSON":{"code":600,"message":"invalid JSON object"},"ERROR_HTTP_SUPERFLUOUS_SUFFICES":{"code":601,"message":"superfluous URL suffices"},"ERROR_ARANGO_ILLEGAL_STATE":{"code":1000,"message":"illegal state"},"ERROR_ARANGO_SHAPER_FAILED":{"code":1001,"message":"could not shape document"},"ERROR_ARANGO_DATAFILE_SEALED":{"code":1002,"message":"datafile sealed"},"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE":{"code":1003,"message":"unknown type"},"ERROR_ARANGO_READ_ONLY":{"code":1004,"message":"read only"},"ERROR_ARANGO_DUPLICATE_IDENTIFIER":{"code":1005,"message":"duplicate identifier"},"ERROR_ARANGO_DATAFILE_UNREADABLE":{"code":1006,"message":"datafile unreadable"},"ERROR_ARANGO_DATAFILE_EMPTY":{"code":1007,"message":"datafile empty"},"ERROR_ARANGO_RECOVERY":{"code":1008,"message":"logfile recovery error"},"ERROR_ARANGO_CORRUPTED_DATAFILE":{"code":1100,"message":"corrupted datafile"},"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE":{"code":1101,"message":"illegal or unreadable parameter file"},"ERROR_ARANGO_CORRUPTED_COLLECTION":{"code":1102,"message":"corrupted collection"},"ERROR_ARANGO_MMAP_FAILED":{"code":1103,"message":"mmap failed"},"ERROR_ARANGO_FILESYSTEM_FULL":{"code":1104,"message":"filesystem full"},"ERROR_ARANGO_NO_JOURNAL":{"code":1105,"message":"no journal"},"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS":{"code":1106,"message":"cannot create/rename datafile because it already exists"},"ERROR_ARANGO_DATADIR_LOCKED":{"code":1107,"message":"database directory is locked"},"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS":{"code":1108,"message":"cannot create/rename collection because directory already exists"},"ERROR_ARANGO_MSYNC_FAILED":{"code":1109,"message":"msync failed"},"ERROR_ARANGO_DATADIR_UNLOCKABLE":{"code":1110,"message":"cannot lock database directory"},"ERROR_ARANGO_SYNC_TIMEOUT":{"code":1111,"message":"sync timeout"},"ERROR_ARANGO_CONFLICT":{"code":1200,"message":"conflict"},"ERROR_ARANGO_DATADIR_INVALID":{"code":1201,"message":"invalid database directory"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND":{"code":1202,"message":"document not found"},"ERROR_ARANGO_COLLECTION_NOT_FOUND":{"code":1203,"message":"collection not found"},"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING":{"code":1204,"message":"parameter 'collection' not found"},"ERROR_ARANGO_DOCUMENT_HANDLE_BAD":{"code":1205,"message":"illegal document handle"},"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL":{"code":1206,"message":"maximal size of journal too small"},"ERROR_ARANGO_DUPLICATE_NAME":{"code":1207,"message":"duplicate name"},"ERROR_ARANGO_ILLEGAL_NAME":{"code":1208,"message":"illegal name"},"ERROR_ARANGO_NO_INDEX":{"code":1209,"message":"no suitable index known"},"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED":{"code":1210,"message":"unique constraint violated"},"ERROR_ARANGO_INDEX_NOT_FOUND":{"code":1212,"message":"index not found"},"ERROR_ARANGO_CROSS_COLLECTION_REQUEST":{"code":1213,"message":"cross collection request not allowed"},"ERROR_ARANGO_INDEX_HANDLE_BAD":{"code":1214,"message":"illegal index handle"},"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED":{"code":1215,"message":"cap constraint already defined"},"ERROR_ARANGO_DOCUMENT_TOO_LARGE":{"code":1216,"message":"document too large"},"ERROR_ARANGO_COLLECTION_NOT_UNLOADED":{"code":1217,"message":"collection must be unloaded"},"ERROR_ARANGO_COLLECTION_TYPE_INVALID":{"code":1218,"message":"collection type invalid"},"ERROR_ARANGO_VALIDATION_FAILED":{"code":1219,"message":"validator failed"},"ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED":{"code":1220,"message":"parsing attribute name definition failed"},"ERROR_ARANGO_DOCUMENT_KEY_BAD":{"code":1221,"message":"illegal document key"},"ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED":{"code":1222,"message":"unexpected document key"},"ERROR_ARANGO_DATADIR_NOT_WRITABLE":{"code":1224,"message":"server database directory not writable"},"ERROR_ARANGO_OUT_OF_KEYS":{"code":1225,"message":"out of keys"},"ERROR_ARANGO_DOCUMENT_KEY_MISSING":{"code":1226,"message":"missing document key"},"ERROR_ARANGO_DOCUMENT_TYPE_INVALID":{"code":1227,"message":"invalid document type"},"ERROR_ARANGO_DATABASE_NOT_FOUND":{"code":1228,"message":"database not found"},"ERROR_ARANGO_DATABASE_NAME_INVALID":{"code":1229,"message":"database name invalid"},"ERROR_ARANGO_USE_SYSTEM_DATABASE":{"code":1230,"message":"operation only allowed in system database"},"ERROR_ARANGO_ENDPOINT_NOT_FOUND":{"code":1231,"message":"endpoint not found"},"ERROR_ARANGO_INVALID_KEY_GENERATOR":{"code":1232,"message":"invalid key generator"},"ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE":{"code":1233,"message":"edge attribute missing"},"ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING":{"code":1234,"message":"index insertion warning - attribute missing in document"},"ERROR_ARANGO_INDEX_CREATION_FAILED":{"code":1235,"message":"index creation failed"},"ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT":{"code":1236,"message":"write-throttling timeout"},"ERROR_ARANGO_COLLECTION_TYPE_MISMATCH":{"code":1237,"message":"collection type mismatch"},"ERROR_ARANGO_COLLECTION_NOT_LOADED":{"code":1238,"message":"collection not loaded"},"ERROR_ARANGO_DATAFILE_FULL":{"code":1300,"message":"datafile full"},"ERROR_ARANGO_EMPTY_DATADIR":{"code":1301,"message":"server database directory is empty"},"ERROR_REPLICATION_NO_RESPONSE":{"code":1400,"message":"no response"},"ERROR_REPLICATION_INVALID_RESPONSE":{"code":1401,"message":"invalid response"},"ERROR_REPLICATION_MASTER_ERROR":{"code":1402,"message":"master error"},"ERROR_REPLICATION_MASTER_INCOMPATIBLE":{"code":1403,"message":"master incompatible"},"ERROR_REPLICATION_MASTER_CHANGE":{"code":1404,"message":"master change"},"ERROR_REPLICATION_LOOP":{"code":1405,"message":"loop detected"},"ERROR_REPLICATION_UNEXPECTED_MARKER":{"code":1406,"message":"unexpected marker"},"ERROR_REPLICATION_INVALID_APPLIER_STATE":{"code":1407,"message":"invalid applier state"},"ERROR_REPLICATION_UNEXPECTED_TRANSACTION":{"code":1408,"message":"invalid transaction"},"ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION":{"code":1410,"message":"invalid replication applier configuration"},"ERROR_REPLICATION_RUNNING":{"code":1411,"message":"cannot perform operation while applier is running"},"ERROR_REPLICATION_APPLIER_STOPPED":{"code":1412,"message":"replication stopped"},"ERROR_REPLICATION_NO_START_TICK":{"code":1413,"message":"no start tick"},"ERROR_REPLICATION_START_TICK_NOT_PRESENT":{"code":1414,"message":"start tick not present"},"ERROR_CLUSTER_NO_AGENCY":{"code":1450,"message":"could not connect to agency"},"ERROR_CLUSTER_NO_COORDINATOR_HEADER":{"code":1451,"message":"missing coordinator header"},"ERROR_CLUSTER_COULD_NOT_LOCK_PLAN":{"code":1452,"message":"could not lock plan in agency"},"ERROR_CLUSTER_COLLECTION_ID_EXISTS":{"code":1453,"message":"collection ID already exists"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN":{"code":1454,"message":"could not create collection in plan"},"ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION":{"code":1455,"message":"could not read version in current in agency"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION":{"code":1456,"message":"could not create collection"},"ERROR_CLUSTER_TIMEOUT":{"code":1457,"message":"timeout in cluster operation"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN":{"code":1458,"message":"could not remove collection from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT":{"code":1459,"message":"could not remove collection from current"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN":{"code":1460,"message":"could not create database in plan"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE":{"code":1461,"message":"could not create database"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN":{"code":1462,"message":"could not remove database from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT":{"code":1463,"message":"could not remove database from current"},"ERROR_CLUSTER_SHARD_GONE":{"code":1464,"message":"no responsible shard found"},"ERROR_CLUSTER_CONNECTION_LOST":{"code":1465,"message":"cluster internal HTTP connection broken"},"ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY":{"code":1466,"message":"must not specify _key for this collection"},"ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS":{"code":1467,"message":"got contradicting answers from different shards"},"ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN":{"code":1468,"message":"not all sharding attributes given"},"ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES":{"code":1469,"message":"must not change the value of a shard key attribute"},"ERROR_CLUSTER_UNSUPPORTED":{"code":1470,"message":"unsupported operation or parameter"},"ERROR_CLUSTER_ONLY_ON_COORDINATOR":{"code":1471,"message":"this operation is only valid on a coordinator in a cluster"},"ERROR_CLUSTER_READING_PLAN_AGENCY":{"code":1472,"message":"error reading Plan in agency"},"ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION":{"code":1473,"message":"could not truncate collection"},"ERROR_CLUSTER_AQL_COMMUNICATION":{"code":1474,"message":"error in cluster internal communication for AQL"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED":{"code":1475,"message":"document not found or sharding attributes changed"},"ERROR_CLUSTER_COULD_NOT_DETERMINE_ID":{"code":1476,"message":"could not determine my ID from my local info"},"ERROR_CLUSTER_ONLY_ON_DBSERVER":{"code":1477,"message":"this operation is only valid on a DBserver in a cluster"},"ERROR_QUERY_KILLED":{"code":1500,"message":"query killed"},"ERROR_QUERY_PARSE":{"code":1501,"message":"%s"},"ERROR_QUERY_EMPTY":{"code":1502,"message":"query is empty"},"ERROR_QUERY_SCRIPT":{"code":1503,"message":"runtime error '%s'"},"ERROR_QUERY_NUMBER_OUT_OF_RANGE":{"code":1504,"message":"number out of range"},"ERROR_QUERY_VARIABLE_NAME_INVALID":{"code":1510,"message":"variable name '%s' has an invalid format"},"ERROR_QUERY_VARIABLE_REDECLARED":{"code":1511,"message":"variable '%s' is assigned multiple times"},"ERROR_QUERY_VARIABLE_NAME_UNKNOWN":{"code":1512,"message":"unknown variable '%s'"},"ERROR_QUERY_COLLECTION_LOCK_FAILED":{"code":1521,"message":"unable to read-lock collection %s"},"ERROR_QUERY_TOO_MANY_COLLECTIONS":{"code":1522,"message":"too many collections"},"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED":{"code":1530,"message":"document attribute '%s' is assigned multiple times"},"ERROR_QUERY_FUNCTION_NAME_UNKNOWN":{"code":1540,"message":"usage of unknown function '%s()'"},"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH":{"code":1541,"message":"invalid number of arguments for function '%s()', expected number of arguments: minimum: %d, maximum: %d"},"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH":{"code":1542,"message":"invalid argument type in call to function '%s()'"},"ERROR_QUERY_INVALID_REGEX":{"code":1543,"message":"invalid regex value"},"ERROR_QUERY_BIND_PARAMETERS_INVALID":{"code":1550,"message":"invalid structure of bind parameters"},"ERROR_QUERY_BIND_PARAMETER_MISSING":{"code":1551,"message":"no value specified for declared bind parameter '%s'"},"ERROR_QUERY_BIND_PARAMETER_UNDECLARED":{"code":1552,"message":"bind parameter '%s' was not declared in the query"},"ERROR_QUERY_BIND_PARAMETER_TYPE":{"code":1553,"message":"bind parameter '%s' has an invalid value or type"},"ERROR_QUERY_INVALID_LOGICAL_VALUE":{"code":1560,"message":"invalid logical value"},"ERROR_QUERY_INVALID_ARITHMETIC_VALUE":{"code":1561,"message":"invalid arithmetic value"},"ERROR_QUERY_DIVISION_BY_ZERO":{"code":1562,"message":"division by zero"},"ERROR_QUERY_ARRAY_EXPECTED":{"code":1563,"message":"array expected"},"ERROR_QUERY_FAIL_CALLED":{"code":1569,"message":"FAIL(%s) called"},"ERROR_QUERY_GEO_INDEX_MISSING":{"code":1570,"message":"no suitable geo index found for geo restriction on '%s'"},"ERROR_QUERY_FULLTEXT_INDEX_MISSING":{"code":1571,"message":"no suitable fulltext index found for fulltext query on '%s'"},"ERROR_QUERY_INVALID_DATE_VALUE":{"code":1572,"message":"invalid date value"},"ERROR_QUERY_MULTI_MODIFY":{"code":1573,"message":"multi-modify query"},"ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION":{"code":1574,"message":"invalid aggregate expression"},"ERROR_QUERY_COMPILE_TIME_OPTIONS":{"code":1575,"message":"query options must be readable at query compile time"},"ERROR_QUERY_EXCEPTION_OPTIONS":{"code":1576,"message":"query options expected"},"ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION":{"code":1577,"message":"collection '%s' used as expression operand"},"ERROR_QUERY_DISALLOWED_DYNAMIC_CALL":{"code":1578,"message":"disallowed dynamic call to '%s'"},"ERROR_QUERY_ACCESS_AFTER_MODIFICATION":{"code":1579,"message":"access after data-modification"},"ERROR_QUERY_FUNCTION_INVALID_NAME":{"code":1580,"message":"invalid user function name"},"ERROR_QUERY_FUNCTION_INVALID_CODE":{"code":1581,"message":"invalid user function code"},"ERROR_QUERY_FUNCTION_NOT_FOUND":{"code":1582,"message":"user function '%s()' not found"},"ERROR_QUERY_FUNCTION_RUNTIME_ERROR":{"code":1583,"message":"user function runtime error: %s"},"ERROR_QUERY_BAD_JSON_PLAN":{"code":1590,"message":"bad execution plan JSON"},"ERROR_QUERY_NOT_FOUND":{"code":1591,"message":"query ID not found"},"ERROR_QUERY_IN_USE":{"code":1592,"message":"query with this ID is in use"},"ERROR_CURSOR_NOT_FOUND":{"code":1600,"message":"cursor not found"},"ERROR_CURSOR_BUSY":{"code":1601,"message":"cursor is busy"},"ERROR_TRANSACTION_INTERNAL":{"code":1650,"message":"internal transaction error"},"ERROR_TRANSACTION_NESTED":{"code":1651,"message":"nested transactions detected"},"ERROR_TRANSACTION_UNREGISTERED_COLLECTION":{"code":1652,"message":"unregistered collection used in transaction"},"ERROR_TRANSACTION_DISALLOWED_OPERATION":{"code":1653,"message":"disallowed operation inside transaction"},"ERROR_TRANSACTION_ABORTED":{"code":1654,"message":"transaction aborted"},"ERROR_USER_INVALID_NAME":{"code":1700,"message":"invalid user name"},"ERROR_USER_INVALID_PASSWORD":{"code":1701,"message":"invalid password"},"ERROR_USER_DUPLICATE":{"code":1702,"message":"duplicate user"},"ERROR_USER_NOT_FOUND":{"code":1703,"message":"user not found"},"ERROR_USER_CHANGE_PASSWORD":{"code":1704,"message":"user must change his password"},"ERROR_APPLICATION_INVALID_NAME":{"code":1750,"message":"invalid application name"},"ERROR_APPLICATION_INVALID_MOUNT":{"code":1751,"message":"invalid mount"},"ERROR_APPLICATION_DOWNLOAD_FAILED":{"code":1752,"message":"application download failed"},"ERROR_APPLICATION_UPLOAD_FAILED":{"code":1753,"message":"application upload failed"},"ERROR_KEYVALUE_INVALID_KEY":{"code":1800,"message":"invalid key declaration"},"ERROR_KEYVALUE_KEY_EXISTS":{"code":1801,"message":"key already exists"},"ERROR_KEYVALUE_KEY_NOT_FOUND":{"code":1802,"message":"key not found"},"ERROR_KEYVALUE_KEY_NOT_UNIQUE":{"code":1803,"message":"key is not unique"},"ERROR_KEYVALUE_KEY_NOT_CHANGED":{"code":1804,"message":"key value not changed"},"ERROR_KEYVALUE_KEY_NOT_REMOVED":{"code":1805,"message":"key value not removed"},"ERROR_KEYVALUE_NO_VALUE":{"code":1806,"message":"missing value"},"ERROR_TASK_INVALID_ID":{"code":1850,"message":"invalid task id"},"ERROR_TASK_DUPLICATE_ID":{"code":1851,"message":"duplicate task id"},"ERROR_TASK_NOT_FOUND":{"code":1852,"message":"task not found"},"ERROR_GRAPH_INVALID_GRAPH":{"code":1901,"message":"invalid graph"},"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH":{"code":1902,"message":"could not create graph"},"ERROR_GRAPH_INVALID_VERTEX":{"code":1903,"message":"invalid vertex"},"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX":{"code":1904,"message":"could not create vertex"},"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX":{"code":1905,"message":"could not change vertex"},"ERROR_GRAPH_INVALID_EDGE":{"code":1906,"message":"invalid edge"},"ERROR_GRAPH_COULD_NOT_CREATE_EDGE":{"code":1907,"message":"could not create edge"},"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE":{"code":1908,"message":"could not change edge"},"ERROR_GRAPH_TOO_MANY_ITERATIONS":{"code":1909,"message":"too many iterations - try increasing the value of 'maxIterations'"},"ERROR_GRAPH_INVALID_FILTER_RESULT":{"code":1910,"message":"invalid filter result"},"ERROR_GRAPH_COLLECTION_MULTI_USE":{"code":1920,"message":"multi use of edge collection in edge def"},"ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS":{"code":1921,"message":"edge collection already used in edge def"},"ERROR_GRAPH_CREATE_MISSING_NAME":{"code":1922,"message":"missing graph name"},"ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION":{"code":1923,"message":"malformed edge definition"},"ERROR_GRAPH_NOT_FOUND":{"code":1924,"message":"graph not found"},"ERROR_GRAPH_DUPLICATE":{"code":1925,"message":"graph already exists"},"ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST":{"code":1926,"message":"vertex collection does not exist or is not part of the graph"},"ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX":{"code":1927,"message":"not a vertex collection"},"ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION":{"code":1928,"message":"not in orphan collection"},"ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF":{"code":1929,"message":"collection already used in edge def"},"ERROR_GRAPH_EDGE_COLLECTION_NOT_USED":{"code":1930,"message":"edge collection not used in graph"},"ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION":{"code":1931,"message":" is not an ArangoCollection"},"ERROR_GRAPH_NO_GRAPH_COLLECTION":{"code":1932,"message":"collection _graphs does not exist"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING":{"code":1933,"message":"Invalid example type. Has to be String, Array or Object"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT":{"code":1934,"message":"Invalid example type. Has to be Array or Object"},"ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS":{"code":1935,"message":"Invalid number of arguments. Expected: "},"ERROR_GRAPH_INVALID_PARAMETER":{"code":1936,"message":"Invalid parameter type."},"ERROR_GRAPH_INVALID_ID":{"code":1937,"message":"Invalid id"},"ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS":{"code":1938,"message":"collection used in orphans"},"ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST":{"code":1939,"message":"edge collection does not exist or is not part of the graph"},"ERROR_GRAPH_EMPTY":{"code":1940,"message":"empty graph"},"ERROR_SESSION_UNKNOWN":{"code":1950,"message":"unknown session"},"ERROR_SESSION_EXPIRED":{"code":1951,"message":"session expired"},"SIMPLE_CLIENT_UNKNOWN_ERROR":{"code":2000,"message":"unknown client error"},"SIMPLE_CLIENT_COULD_NOT_CONNECT":{"code":2001,"message":"could not connect to server"},"SIMPLE_CLIENT_COULD_NOT_WRITE":{"code":2002,"message":"could not write to server"},"SIMPLE_CLIENT_COULD_NOT_READ":{"code":2003,"message":"could not read from server"},"ERROR_MALFORMED_MANIFEST_FILE":{"code":3000,"message":"malformed manifest file"},"ERROR_INVALID_APPLICATION_MANIFEST":{"code":3001,"message":"manifest file is invalid"},"ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING":{"code":3002,"message":"missing manifest attribute"},"ERROR_CANNOT_EXTRACT_APPLICATION_ROOT":{"code":3003,"message":"unable to extract app root path"},"ERROR_INVALID_FOXX_OPTIONS":{"code":3004,"message":"invalid foxx options"},"ERROR_FAILED_TO_EXECUTE_SCRIPT":{"code":3005,"message":"failed to execute script"},"ERROR_SYNTAX_ERROR_IN_SCRIPT":{"code":3006,"message":"syntax error in script"},"ERROR_INVALID_MOUNTPOINT":{"code":3007,"message":"mountpoint is invalid"},"ERROR_NO_FOXX_FOUND":{"code":3008,"message":"No foxx found at this location"},"ERROR_APP_NOT_FOUND":{"code":3009,"message":"App not found"},"ERROR_APP_NEEDS_CONFIGURATION":{"code":3010,"message":"App not configured"},"ERROR_MODULE_NOT_FOUND":{"code":3100,"message":"cannot locate module"},"ERROR_MODULE_SYNTAX_ERROR":{"code":3101,"message":"syntax error in module"},"ERROR_MODULE_BAD_WRAPPER":{"code":3102,"message":"failed to wrap module"},"ERROR_MODULE_FAILURE":{"code":3103,"message":"failed to invoke module"},"ERROR_MODULE_UNKNOWN_FILE_TYPE":{"code":3110,"message":"unknown file type"},"ERROR_MODULE_PATH_MUST_BE_ABSOLUTE":{"code":3111,"message":"path must be absolute"},"ERROR_MODULE_CAN_NOT_ESCAPE":{"code":3112,"message":"cannot use '..' to escape top-level-directory"},"ERROR_MODULE_DRIVE_LETTER":{"code":3113,"message":"drive local path is not supported"},"ERROR_MODULE_BAD_MODULE_ORIGIN":{"code":3120,"message":"corrupted module origin"},"ERROR_MODULE_BAD_PACKAGE_ORIGIN":{"code":3121,"message":"corrupted package origin"},"ERROR_MODULE_DOCUMENT_IS_EMPTY":{"code":3125,"message":"no content"},"ERROR_MODULE_MAIN_NOT_READABLE":{"code":3130,"message":"cannot read main file"},"ERROR_MODULE_MAIN_NOT_JS":{"code":3131,"message":"main file is not of type 'js'"},"RESULT_ELEMENT_EXISTS":{"code":10000,"message":"element not inserted into structure, because it already exists"},"RESULT_ELEMENT_NOT_FOUND":{"code":10001,"message":"element not found in structure"},"ERROR_APP_ALREADY_EXISTS":{"code":20000,"message":"newest version of app already installed"},"ERROR_QUEUE_ALREADY_EXISTS":{"code":21000,"message":"named queue already exists"},"ERROR_DISPATCHER_IS_STOPPING":{"code":21001,"message":"dispatcher stopped"},"ERROR_QUEUE_UNKNOWN":{"code":21002,"message":"named queue does not exist"},"ERROR_QUEUE_FULL":{"code":21003,"message":"named queue is full"}};})(); /*jshint -W051:true */ /*global jqconsole, Symbol */ /*eslint-disable */global.DEFINE_MODULE('console',(function(){'use strict'; /*eslint-enable */ ////////////////////////////////////////////////////////////////////////////////
+(function(){"use strict";var internal=require("internal");internal.errors = {"ERROR_NO_ERROR":{"code":0,"message":"no error"},"ERROR_FAILED":{"code":1,"message":"failed"},"ERROR_SYS_ERROR":{"code":2,"message":"system error"},"ERROR_OUT_OF_MEMORY":{"code":3,"message":"out of memory"},"ERROR_INTERNAL":{"code":4,"message":"internal error"},"ERROR_ILLEGAL_NUMBER":{"code":5,"message":"illegal number"},"ERROR_NUMERIC_OVERFLOW":{"code":6,"message":"numeric overflow"},"ERROR_ILLEGAL_OPTION":{"code":7,"message":"illegal option"},"ERROR_DEAD_PID":{"code":8,"message":"dead process identifier"},"ERROR_NOT_IMPLEMENTED":{"code":9,"message":"not implemented"},"ERROR_BAD_PARAMETER":{"code":10,"message":"bad parameter"},"ERROR_FORBIDDEN":{"code":11,"message":"forbidden"},"ERROR_OUT_OF_MEMORY_MMAP":{"code":12,"message":"out of memory in mmap"},"ERROR_CORRUPTED_CSV":{"code":13,"message":"csv is corrupt"},"ERROR_FILE_NOT_FOUND":{"code":14,"message":"file not found"},"ERROR_CANNOT_WRITE_FILE":{"code":15,"message":"cannot write file"},"ERROR_CANNOT_OVERWRITE_FILE":{"code":16,"message":"cannot overwrite file"},"ERROR_TYPE_ERROR":{"code":17,"message":"type error"},"ERROR_LOCK_TIMEOUT":{"code":18,"message":"lock timeout"},"ERROR_CANNOT_CREATE_DIRECTORY":{"code":19,"message":"cannot create directory"},"ERROR_CANNOT_CREATE_TEMP_FILE":{"code":20,"message":"cannot create temporary file"},"ERROR_REQUEST_CANCELED":{"code":21,"message":"canceled request"},"ERROR_DEBUG":{"code":22,"message":"intentional debug error"},"ERROR_AID_NOT_FOUND":{"code":23,"message":"internal error with attribute ID in shaper"},"ERROR_LEGEND_INCOMPLETE":{"code":24,"message":"internal error if a legend could not be created"},"ERROR_IP_ADDRESS_INVALID":{"code":25,"message":"IP address is invalid"},"ERROR_LEGEND_NOT_IN_WAL_FILE":{"code":26,"message":"internal error if a legend for a marker does not yet exist in the same WAL file"},"ERROR_FILE_EXISTS":{"code":27,"message":"file exists"},"ERROR_LOCKED":{"code":28,"message":"locked"},"ERROR_DEADLOCK":{"code":29,"message":"deadlock detected"},"ERROR_HTTP_BAD_PARAMETER":{"code":400,"message":"bad parameter"},"ERROR_HTTP_UNAUTHORIZED":{"code":401,"message":"unauthorized"},"ERROR_HTTP_FORBIDDEN":{"code":403,"message":"forbidden"},"ERROR_HTTP_NOT_FOUND":{"code":404,"message":"not found"},"ERROR_HTTP_METHOD_NOT_ALLOWED":{"code":405,"message":"method not supported"},"ERROR_HTTP_PRECONDITION_FAILED":{"code":412,"message":"precondition failed"},"ERROR_HTTP_SERVER_ERROR":{"code":500,"message":"internal server error"},"ERROR_HTTP_CORRUPTED_JSON":{"code":600,"message":"invalid JSON object"},"ERROR_HTTP_SUPERFLUOUS_SUFFICES":{"code":601,"message":"superfluous URL suffices"},"ERROR_ARANGO_ILLEGAL_STATE":{"code":1000,"message":"illegal state"},"ERROR_ARANGO_SHAPER_FAILED":{"code":1001,"message":"could not shape document"},"ERROR_ARANGO_DATAFILE_SEALED":{"code":1002,"message":"datafile sealed"},"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE":{"code":1003,"message":"unknown type"},"ERROR_ARANGO_READ_ONLY":{"code":1004,"message":"read only"},"ERROR_ARANGO_DUPLICATE_IDENTIFIER":{"code":1005,"message":"duplicate identifier"},"ERROR_ARANGO_DATAFILE_UNREADABLE":{"code":1006,"message":"datafile unreadable"},"ERROR_ARANGO_DATAFILE_EMPTY":{"code":1007,"message":"datafile empty"},"ERROR_ARANGO_RECOVERY":{"code":1008,"message":"logfile recovery error"},"ERROR_ARANGO_CORRUPTED_DATAFILE":{"code":1100,"message":"corrupted datafile"},"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE":{"code":1101,"message":"illegal or unreadable parameter file"},"ERROR_ARANGO_CORRUPTED_COLLECTION":{"code":1102,"message":"corrupted collection"},"ERROR_ARANGO_MMAP_FAILED":{"code":1103,"message":"mmap failed"},"ERROR_ARANGO_FILESYSTEM_FULL":{"code":1104,"message":"filesystem full"},"ERROR_ARANGO_NO_JOURNAL":{"code":1105,"message":"no journal"},"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS":{"code":1106,"message":"cannot create/rename datafile because it already exists"},"ERROR_ARANGO_DATADIR_LOCKED":{"code":1107,"message":"database directory is locked"},"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS":{"code":1108,"message":"cannot create/rename collection because directory already exists"},"ERROR_ARANGO_MSYNC_FAILED":{"code":1109,"message":"msync failed"},"ERROR_ARANGO_DATADIR_UNLOCKABLE":{"code":1110,"message":"cannot lock database directory"},"ERROR_ARANGO_SYNC_TIMEOUT":{"code":1111,"message":"sync timeout"},"ERROR_ARANGO_CONFLICT":{"code":1200,"message":"conflict"},"ERROR_ARANGO_DATADIR_INVALID":{"code":1201,"message":"invalid database directory"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND":{"code":1202,"message":"document not found"},"ERROR_ARANGO_COLLECTION_NOT_FOUND":{"code":1203,"message":"collection not found"},"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING":{"code":1204,"message":"parameter 'collection' not found"},"ERROR_ARANGO_DOCUMENT_HANDLE_BAD":{"code":1205,"message":"illegal document handle"},"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL":{"code":1206,"message":"maximal size of journal too small"},"ERROR_ARANGO_DUPLICATE_NAME":{"code":1207,"message":"duplicate name"},"ERROR_ARANGO_ILLEGAL_NAME":{"code":1208,"message":"illegal name"},"ERROR_ARANGO_NO_INDEX":{"code":1209,"message":"no suitable index known"},"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED":{"code":1210,"message":"unique constraint violated"},"ERROR_ARANGO_INDEX_NOT_FOUND":{"code":1212,"message":"index not found"},"ERROR_ARANGO_CROSS_COLLECTION_REQUEST":{"code":1213,"message":"cross collection request not allowed"},"ERROR_ARANGO_INDEX_HANDLE_BAD":{"code":1214,"message":"illegal index handle"},"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED":{"code":1215,"message":"cap constraint already defined"},"ERROR_ARANGO_DOCUMENT_TOO_LARGE":{"code":1216,"message":"document too large"},"ERROR_ARANGO_COLLECTION_NOT_UNLOADED":{"code":1217,"message":"collection must be unloaded"},"ERROR_ARANGO_COLLECTION_TYPE_INVALID":{"code":1218,"message":"collection type invalid"},"ERROR_ARANGO_VALIDATION_FAILED":{"code":1219,"message":"validator failed"},"ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED":{"code":1220,"message":"parsing attribute name definition failed"},"ERROR_ARANGO_DOCUMENT_KEY_BAD":{"code":1221,"message":"illegal document key"},"ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED":{"code":1222,"message":"unexpected document key"},"ERROR_ARANGO_DATADIR_NOT_WRITABLE":{"code":1224,"message":"server database directory not writable"},"ERROR_ARANGO_OUT_OF_KEYS":{"code":1225,"message":"out of keys"},"ERROR_ARANGO_DOCUMENT_KEY_MISSING":{"code":1226,"message":"missing document key"},"ERROR_ARANGO_DOCUMENT_TYPE_INVALID":{"code":1227,"message":"invalid document type"},"ERROR_ARANGO_DATABASE_NOT_FOUND":{"code":1228,"message":"database not found"},"ERROR_ARANGO_DATABASE_NAME_INVALID":{"code":1229,"message":"database name invalid"},"ERROR_ARANGO_USE_SYSTEM_DATABASE":{"code":1230,"message":"operation only allowed in system database"},"ERROR_ARANGO_ENDPOINT_NOT_FOUND":{"code":1231,"message":"endpoint not found"},"ERROR_ARANGO_INVALID_KEY_GENERATOR":{"code":1232,"message":"invalid key generator"},"ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE":{"code":1233,"message":"edge attribute missing"},"ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING":{"code":1234,"message":"index insertion warning - attribute missing in document"},"ERROR_ARANGO_INDEX_CREATION_FAILED":{"code":1235,"message":"index creation failed"},"ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT":{"code":1236,"message":"write-throttling timeout"},"ERROR_ARANGO_COLLECTION_TYPE_MISMATCH":{"code":1237,"message":"collection type mismatch"},"ERROR_ARANGO_COLLECTION_NOT_LOADED":{"code":1238,"message":"collection not loaded"},"ERROR_ARANGO_DATAFILE_FULL":{"code":1300,"message":"datafile full"},"ERROR_ARANGO_EMPTY_DATADIR":{"code":1301,"message":"server database directory is empty"},"ERROR_REPLICATION_NO_RESPONSE":{"code":1400,"message":"no response"},"ERROR_REPLICATION_INVALID_RESPONSE":{"code":1401,"message":"invalid response"},"ERROR_REPLICATION_MASTER_ERROR":{"code":1402,"message":"master error"},"ERROR_REPLICATION_MASTER_INCOMPATIBLE":{"code":1403,"message":"master incompatible"},"ERROR_REPLICATION_MASTER_CHANGE":{"code":1404,"message":"master change"},"ERROR_REPLICATION_LOOP":{"code":1405,"message":"loop detected"},"ERROR_REPLICATION_UNEXPECTED_MARKER":{"code":1406,"message":"unexpected marker"},"ERROR_REPLICATION_INVALID_APPLIER_STATE":{"code":1407,"message":"invalid applier state"},"ERROR_REPLICATION_UNEXPECTED_TRANSACTION":{"code":1408,"message":"invalid transaction"},"ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION":{"code":1410,"message":"invalid replication applier configuration"},"ERROR_REPLICATION_RUNNING":{"code":1411,"message":"cannot perform operation while applier is running"},"ERROR_REPLICATION_APPLIER_STOPPED":{"code":1412,"message":"replication stopped"},"ERROR_REPLICATION_NO_START_TICK":{"code":1413,"message":"no start tick"},"ERROR_REPLICATION_START_TICK_NOT_PRESENT":{"code":1414,"message":"start tick not present"},"ERROR_CLUSTER_NO_AGENCY":{"code":1450,"message":"could not connect to agency"},"ERROR_CLUSTER_NO_COORDINATOR_HEADER":{"code":1451,"message":"missing coordinator header"},"ERROR_CLUSTER_COULD_NOT_LOCK_PLAN":{"code":1452,"message":"could not lock plan in agency"},"ERROR_CLUSTER_COLLECTION_ID_EXISTS":{"code":1453,"message":"collection ID already exists"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN":{"code":1454,"message":"could not create collection in plan"},"ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION":{"code":1455,"message":"could not read version in current in agency"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION":{"code":1456,"message":"could not create collection"},"ERROR_CLUSTER_TIMEOUT":{"code":1457,"message":"timeout in cluster operation"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN":{"code":1458,"message":"could not remove collection from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT":{"code":1459,"message":"could not remove collection from current"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN":{"code":1460,"message":"could not create database in plan"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE":{"code":1461,"message":"could not create database"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN":{"code":1462,"message":"could not remove database from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT":{"code":1463,"message":"could not remove database from current"},"ERROR_CLUSTER_SHARD_GONE":{"code":1464,"message":"no responsible shard found"},"ERROR_CLUSTER_CONNECTION_LOST":{"code":1465,"message":"cluster internal HTTP connection broken"},"ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY":{"code":1466,"message":"must not specify _key for this collection"},"ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS":{"code":1467,"message":"got contradicting answers from different shards"},"ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN":{"code":1468,"message":"not all sharding attributes given"},"ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES":{"code":1469,"message":"must not change the value of a shard key attribute"},"ERROR_CLUSTER_UNSUPPORTED":{"code":1470,"message":"unsupported operation or parameter"},"ERROR_CLUSTER_ONLY_ON_COORDINATOR":{"code":1471,"message":"this operation is only valid on a coordinator in a cluster"},"ERROR_CLUSTER_READING_PLAN_AGENCY":{"code":1472,"message":"error reading Plan in agency"},"ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION":{"code":1473,"message":"could not truncate collection"},"ERROR_CLUSTER_AQL_COMMUNICATION":{"code":1474,"message":"error in cluster internal communication for AQL"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED":{"code":1475,"message":"document not found or sharding attributes changed"},"ERROR_CLUSTER_COULD_NOT_DETERMINE_ID":{"code":1476,"message":"could not determine my ID from my local info"},"ERROR_CLUSTER_ONLY_ON_DBSERVER":{"code":1477,"message":"this operation is only valid on a DBserver in a cluster"},"ERROR_QUERY_KILLED":{"code":1500,"message":"query killed"},"ERROR_QUERY_PARSE":{"code":1501,"message":"%s"},"ERROR_QUERY_EMPTY":{"code":1502,"message":"query is empty"},"ERROR_QUERY_SCRIPT":{"code":1503,"message":"runtime error '%s'"},"ERROR_QUERY_NUMBER_OUT_OF_RANGE":{"code":1504,"message":"number out of range"},"ERROR_QUERY_VARIABLE_NAME_INVALID":{"code":1510,"message":"variable name '%s' has an invalid format"},"ERROR_QUERY_VARIABLE_REDECLARED":{"code":1511,"message":"variable '%s' is assigned multiple times"},"ERROR_QUERY_VARIABLE_NAME_UNKNOWN":{"code":1512,"message":"unknown variable '%s'"},"ERROR_QUERY_COLLECTION_LOCK_FAILED":{"code":1521,"message":"unable to read-lock collection %s"},"ERROR_QUERY_TOO_MANY_COLLECTIONS":{"code":1522,"message":"too many collections"},"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED":{"code":1530,"message":"document attribute '%s' is assigned multiple times"},"ERROR_QUERY_FUNCTION_NAME_UNKNOWN":{"code":1540,"message":"usage of unknown function '%s()'"},"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH":{"code":1541,"message":"invalid number of arguments for function '%s()', expected number of arguments: minimum: %d, maximum: %d"},"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH":{"code":1542,"message":"invalid argument type in call to function '%s()'"},"ERROR_QUERY_INVALID_REGEX":{"code":1543,"message":"invalid regex value"},"ERROR_QUERY_BIND_PARAMETERS_INVALID":{"code":1550,"message":"invalid structure of bind parameters"},"ERROR_QUERY_BIND_PARAMETER_MISSING":{"code":1551,"message":"no value specified for declared bind parameter '%s'"},"ERROR_QUERY_BIND_PARAMETER_UNDECLARED":{"code":1552,"message":"bind parameter '%s' was not declared in the query"},"ERROR_QUERY_BIND_PARAMETER_TYPE":{"code":1553,"message":"bind parameter '%s' has an invalid value or type"},"ERROR_QUERY_INVALID_LOGICAL_VALUE":{"code":1560,"message":"invalid logical value"},"ERROR_QUERY_INVALID_ARITHMETIC_VALUE":{"code":1561,"message":"invalid arithmetic value"},"ERROR_QUERY_DIVISION_BY_ZERO":{"code":1562,"message":"division by zero"},"ERROR_QUERY_ARRAY_EXPECTED":{"code":1563,"message":"array expected"},"ERROR_QUERY_FAIL_CALLED":{"code":1569,"message":"FAIL(%s) called"},"ERROR_QUERY_GEO_INDEX_MISSING":{"code":1570,"message":"no suitable geo index found for geo restriction on '%s'"},"ERROR_QUERY_FULLTEXT_INDEX_MISSING":{"code":1571,"message":"no suitable fulltext index found for fulltext query on '%s'"},"ERROR_QUERY_INVALID_DATE_VALUE":{"code":1572,"message":"invalid date value"},"ERROR_QUERY_MULTI_MODIFY":{"code":1573,"message":"multi-modify query"},"ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION":{"code":1574,"message":"invalid aggregate expression"},"ERROR_QUERY_COMPILE_TIME_OPTIONS":{"code":1575,"message":"query options must be readable at query compile time"},"ERROR_QUERY_EXCEPTION_OPTIONS":{"code":1576,"message":"query options expected"},"ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION":{"code":1577,"message":"collection '%s' used as expression operand"},"ERROR_QUERY_DISALLOWED_DYNAMIC_CALL":{"code":1578,"message":"disallowed dynamic call to '%s'"},"ERROR_QUERY_ACCESS_AFTER_MODIFICATION":{"code":1579,"message":"access after data-modification"},"ERROR_QUERY_FUNCTION_INVALID_NAME":{"code":1580,"message":"invalid user function name"},"ERROR_QUERY_FUNCTION_INVALID_CODE":{"code":1581,"message":"invalid user function code"},"ERROR_QUERY_FUNCTION_NOT_FOUND":{"code":1582,"message":"user function '%s()' not found"},"ERROR_QUERY_FUNCTION_RUNTIME_ERROR":{"code":1583,"message":"user function runtime error: %s"},"ERROR_QUERY_BAD_JSON_PLAN":{"code":1590,"message":"bad execution plan JSON"},"ERROR_QUERY_NOT_FOUND":{"code":1591,"message":"query ID not found"},"ERROR_QUERY_IN_USE":{"code":1592,"message":"query with this ID is in use"},"ERROR_CURSOR_NOT_FOUND":{"code":1600,"message":"cursor not found"},"ERROR_CURSOR_BUSY":{"code":1601,"message":"cursor is busy"},"ERROR_TRANSACTION_INTERNAL":{"code":1650,"message":"internal transaction error"},"ERROR_TRANSACTION_NESTED":{"code":1651,"message":"nested transactions detected"},"ERROR_TRANSACTION_UNREGISTERED_COLLECTION":{"code":1652,"message":"unregistered collection used in transaction"},"ERROR_TRANSACTION_DISALLOWED_OPERATION":{"code":1653,"message":"disallowed operation inside transaction"},"ERROR_TRANSACTION_ABORTED":{"code":1654,"message":"transaction aborted"},"ERROR_USER_INVALID_NAME":{"code":1700,"message":"invalid user name"},"ERROR_USER_INVALID_PASSWORD":{"code":1701,"message":"invalid password"},"ERROR_USER_DUPLICATE":{"code":1702,"message":"duplicate user"},"ERROR_USER_NOT_FOUND":{"code":1703,"message":"user not found"},"ERROR_USER_CHANGE_PASSWORD":{"code":1704,"message":"user must change his password"},"ERROR_APPLICATION_INVALID_NAME":{"code":1750,"message":"invalid application name"},"ERROR_APPLICATION_INVALID_MOUNT":{"code":1751,"message":"invalid mount"},"ERROR_APPLICATION_DOWNLOAD_FAILED":{"code":1752,"message":"application download failed"},"ERROR_APPLICATION_UPLOAD_FAILED":{"code":1753,"message":"application upload failed"},"ERROR_KEYVALUE_INVALID_KEY":{"code":1800,"message":"invalid key declaration"},"ERROR_KEYVALUE_KEY_EXISTS":{"code":1801,"message":"key already exists"},"ERROR_KEYVALUE_KEY_NOT_FOUND":{"code":1802,"message":"key not found"},"ERROR_KEYVALUE_KEY_NOT_UNIQUE":{"code":1803,"message":"key is not unique"},"ERROR_KEYVALUE_KEY_NOT_CHANGED":{"code":1804,"message":"key value not changed"},"ERROR_KEYVALUE_KEY_NOT_REMOVED":{"code":1805,"message":"key value not removed"},"ERROR_KEYVALUE_NO_VALUE":{"code":1806,"message":"missing value"},"ERROR_TASK_INVALID_ID":{"code":1850,"message":"invalid task id"},"ERROR_TASK_DUPLICATE_ID":{"code":1851,"message":"duplicate task id"},"ERROR_TASK_NOT_FOUND":{"code":1852,"message":"task not found"},"ERROR_GRAPH_INVALID_GRAPH":{"code":1901,"message":"invalid graph"},"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH":{"code":1902,"message":"could not create graph"},"ERROR_GRAPH_INVALID_VERTEX":{"code":1903,"message":"invalid vertex"},"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX":{"code":1904,"message":"could not create vertex"},"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX":{"code":1905,"message":"could not change vertex"},"ERROR_GRAPH_INVALID_EDGE":{"code":1906,"message":"invalid edge"},"ERROR_GRAPH_COULD_NOT_CREATE_EDGE":{"code":1907,"message":"could not create edge"},"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE":{"code":1908,"message":"could not change edge"},"ERROR_GRAPH_TOO_MANY_ITERATIONS":{"code":1909,"message":"too many iterations - try increasing the value of 'maxIterations'"},"ERROR_GRAPH_INVALID_FILTER_RESULT":{"code":1910,"message":"invalid filter result"},"ERROR_GRAPH_COLLECTION_MULTI_USE":{"code":1920,"message":"multi use of edge collection in edge def"},"ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS":{"code":1921,"message":"edge collection already used in edge def"},"ERROR_GRAPH_CREATE_MISSING_NAME":{"code":1922,"message":"missing graph name"},"ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION":{"code":1923,"message":"malformed edge definition"},"ERROR_GRAPH_NOT_FOUND":{"code":1924,"message":"graph not found"},"ERROR_GRAPH_DUPLICATE":{"code":1925,"message":"graph already exists"},"ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST":{"code":1926,"message":"vertex collection does not exist or is not part of the graph"},"ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX":{"code":1927,"message":"not a vertex collection"},"ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION":{"code":1928,"message":"not in orphan collection"},"ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF":{"code":1929,"message":"collection already used in edge def"},"ERROR_GRAPH_EDGE_COLLECTION_NOT_USED":{"code":1930,"message":"edge collection not used in graph"},"ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION":{"code":1931,"message":" is not an ArangoCollection"},"ERROR_GRAPH_NO_GRAPH_COLLECTION":{"code":1932,"message":"collection _graphs does not exist"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING":{"code":1933,"message":"Invalid example type. Has to be String, Array or Object"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT":{"code":1934,"message":"Invalid example type. Has to be Array or Object"},"ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS":{"code":1935,"message":"Invalid number of arguments. Expected: "},"ERROR_GRAPH_INVALID_PARAMETER":{"code":1936,"message":"Invalid parameter type."},"ERROR_GRAPH_INVALID_ID":{"code":1937,"message":"Invalid id"},"ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS":{"code":1938,"message":"collection used in orphans"},"ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST":{"code":1939,"message":"edge collection does not exist or is not part of the graph"},"ERROR_GRAPH_EMPTY":{"code":1940,"message":"empty graph"},"ERROR_SESSION_UNKNOWN":{"code":1950,"message":"unknown session"},"ERROR_SESSION_EXPIRED":{"code":1951,"message":"session expired"},"SIMPLE_CLIENT_UNKNOWN_ERROR":{"code":2000,"message":"unknown client error"},"SIMPLE_CLIENT_COULD_NOT_CONNECT":{"code":2001,"message":"could not connect to server"},"SIMPLE_CLIENT_COULD_NOT_WRITE":{"code":2002,"message":"could not write to server"},"SIMPLE_CLIENT_COULD_NOT_READ":{"code":2003,"message":"could not read from server"},"ERROR_MALFORMED_MANIFEST_FILE":{"code":3000,"message":"malformed manifest file"},"ERROR_INVALID_APPLICATION_MANIFEST":{"code":3001,"message":"manifest file is invalid"},"ERROR_INVALID_FOXX_OPTIONS":{"code":3004,"message":"invalid foxx options"},"ERROR_INVALID_MOUNTPOINT":{"code":3007,"message":"mountpoint is invalid"},"ERROR_APP_NOT_FOUND":{"code":3009,"message":"App not found"},"ERROR_APP_NEEDS_CONFIGURATION":{"code":3010,"message":"App not configured"},"ERROR_MODULE_NOT_FOUND":{"code":3100,"message":"cannot locate module"},"ERROR_MODULE_FAILURE":{"code":3103,"message":"failed to invoke module"},"RESULT_ELEMENT_EXISTS":{"code":10000,"message":"element not inserted into structure, because it already exists"},"RESULT_ELEMENT_NOT_FOUND":{"code":10001,"message":"element not found in structure"},"ERROR_QUEUE_ALREADY_EXISTS":{"code":21000,"message":"named queue already exists"},"ERROR_DISPATCHER_IS_STOPPING":{"code":21001,"message":"dispatcher stopped"},"ERROR_QUEUE_UNKNOWN":{"code":21002,"message":"named queue does not exist"},"ERROR_QUEUE_FULL":{"code":21003,"message":"named queue is full"}};})(); /*jshint -W051:true */ /*global jqconsole, Symbol */ /*eslint-disable */global.DEFINE_MODULE('console',(function(){'use strict'; /*eslint-enable */ ////////////////////////////////////////////////////////////////////////////////
/// @brief module "console"
///
/// @file
@@ -14234,7 +14234,7 @@ exports.createHelpHeadline = function(text){var i;var p="";var x=Math.abs(78 - t
/// throws an exception in case of an an error
////////////////////////////////////////////////////////////////////////////////
// must came after the export of createHelpHeadline
-var arangodb=require("@arangodb");var ArangoError=arangodb.ArangoError;exports.checkRequestResult = function(requestResult){if(requestResult === undefined){throw new ArangoError({"error":true,"code":500,"errorNum":arangodb.ERROR_INTERNAL,"errorMessage":"Unknown error. Request result is empty"});}if(requestResult.hasOwnProperty('error')){if(requestResult.error){if(requestResult.errorNum === arangodb.ERROR_TYPE_ERROR){throw new TypeError(requestResult.errorMessage);}throw new ArangoError(requestResult);} // remove the property from the original object
+var arangodb=require("@arangodb");var ArangoError=arangodb.ArangoError;exports.checkRequestResult = function(requestResult){if(requestResult === undefined){throw new ArangoError({"error":true,"code":500,"errorNum":arangodb.ERROR_INTERNAL,"errorMessage":"Unknown error. Request result is empty"});}if(requestResult.hasOwnProperty('error')){if(requestResult.error){if(requestResult.errorNum === arangodb.ERROR_TYPE_ERROR){throw new TypeError(requestResult.errorMessage);}var error=new ArangoError(requestResult);error.message = requestResult.message;throw error;} // remove the property from the original object
delete requestResult.error;}return requestResult;}; ////////////////////////////////////////////////////////////////////////////////
/// @brief general help
////////////////////////////////////////////////////////////////////////////////
@@ -16528,12 +16528,12 @@ var __fs__=require("fs");var __rcf__=__fs__.join(__fs__.home(),".arangosh.rc");i
data: JSON.stringify(postParameter),
contentType: "application/json",
processData: false,
- async: true,
success: function (data, textStatus, xhr) {
if (xhr.getResponseHeader('x-arango-async-id')) {
window.arangoHelper.addAardvarkJob({
id: xhr.getResponseHeader('x-arango-async-id'),
type: 'index',
+ desc: 'Creating index...',
collection: self.get("id")
});
callback(false, data);
@@ -16550,13 +16550,29 @@ var __fs__=require("fs");var __rcf__=__fs__.join(__fs__.home(),".arangosh.rc");i
},
deleteIndex: function (id, callback) {
+
+ var self = this;
+
$.ajax({
cache: false,
type: 'DELETE',
url: "/_api/index/"+ this.get("name") +"/"+encodeURIComponent(id),
- async: true,
- success: function () {
- callback(false);
+ headers: {
+ 'x-arango-async': 'store'
+ },
+ success: function (data, textStatus, xhr) {
+ if (xhr.getResponseHeader('x-arango-async-id')) {
+ window.arangoHelper.addAardvarkJob({
+ id: xhr.getResponseHeader('x-arango-async-id'),
+ type: 'index',
+ desc: 'Removing index...',
+ collection: self.get("id")
+ });
+ callback(false, data);
+ }
+ else {
+ callback(true, data);
+ }
},
error: function (data) {
callback(true, data);
@@ -16583,7 +16599,6 @@ var __fs__=require("fs");var __rcf__=__fs__.join(__fs__.home(),".arangosh.rc");i
loadCollection: function (callback) {
$.ajax({
- async: true,
cache: false,
type: 'PUT',
url: "/_api/collection/" + this.get("id") + "/load",
@@ -16599,7 +16614,6 @@ var __fs__=require("fs");var __rcf__=__fs__.join(__fs__.home(),".arangosh.rc");i
unloadCollection: function (callback) {
$.ajax({
- async: true,
cache: false,
type: 'PUT',
url: "/_api/collection/" + this.get("id") + "/unload?flush=true",
@@ -19533,6 +19547,13 @@ window.ArangoUsers = Backbone.Collection.extend({
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
@@ -19567,10 +19588,19 @@ window.ArangoUsers = Backbone.Collection.extend({
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) {
@@ -20098,6 +20128,15 @@ window.ArangoUsers = Backbone.Collection.extend({
},
+ refreshCollectionsView: function() {
+ var self = this;
+ window.App.arangoCollectionsStore.fetch({
+ success: function () {
+ self.collectionsView.checkLockedCollections();
+ }
+ });
+ },
+
deleteIndex: function () {
var callback = function(error) {
if (error) {
@@ -20106,13 +20145,21 @@ window.ArangoUsers = Backbone.Collection.extend({
''
);
+ this.model.set("locked", false);
+ this.refreshCollectionsView();
}
- 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 e40d940da9..39b2a382f8 100644
Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/app.js.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/app.js.gz differ
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js
index cf0b529669..c6f2c9c234 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js
+++ b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js
@@ -1,18 +1,18 @@
function JSONAdapter(a,b,c,d,e,f){"use strict";var g=this,h={},i={},j=new AbstractAdapter(b,c,this,d);h.range=e/2,h.start=e/4,h.getStart=function(){return this.start+Math.random()*this.range},i.range=f/2,i.start=f/4,i.getStart=function(){return this.start+Math.random()*this.range},g.loadNode=function(a,b){g.loadNodeFromTreeById(a,b)},g.loadInitialNode=function(b,c){var d=a+b+".json";j.cleanUp(),d3.json(d,function(a,d){void 0!==a&&null!==a&&console.log(a);var e=j.insertInitialNode(d);g.requestCentralityChildren(b,function(a){e._centrality=a}),_.each(d.children,function(a){var b=j.insertNode(a),c={_from:e._id,_to:b._id,_id:e._id+"-"+b._id};j.insertEdge(c),g.requestCentralityChildren(b._id,function(a){b._centrality=a}),delete b._data.children}),delete e._data.children,c&&c(e)})},g.loadNodeFromTreeById=function(b,c){var d=a+b+".json";d3.json(d,function(a,d){void 0!==a&&null!==a&&console.log(a);var e=j.insertNode(d);g.requestCentralityChildren(b,function(a){e._centrality=a}),_.each(d.children,function(a){var b=j.insertNode(a),c={_from:e._id,_to:b._id,_id:e._id+"-"+b._id};j.insertEdge(c),g.requestCentralityChildren(b._id,function(a){e._centrality=a}),delete b._data.children}),delete e._data.children,c&&c(e)})},g.requestCentralityChildren=function(b,c){var d=a+b+".json";d3.json(d,function(a,b){void 0!==a&&null!==a&&console.log(a),void 0!==c&&c(void 0!==b.children?b.children.length:0)})},g.loadNodeFromTreeByAttributeValue=function(a,b,c){throw"Sorry this adapter is read-only"},g.loadInitialNodeByAttributeValue=function(a,b,c){throw"Sorry this adapter is read-only"},g.createEdge=function(a,b){throw"Sorry this adapter is read-only"},g.deleteEdge=function(a,b){throw"Sorry this adapter is read-only"},g.patchEdge=function(a,b,c){throw"Sorry this adapter is read-only"},g.createNode=function(a,b){throw"Sorry this adapter is read-only"},g.deleteNode=function(a,b){throw"Sorry this adapter is read-only"},g.patchNode=function(a,b,c){throw"Sorry this adapter is read-only"},g.setNodeLimit=function(a,b){},g.setChildLimit=function(a){},g.expandCommunity=function(a,b){},g.setWidth=function(){},g.explore=j.explore}function AbstractAdapter(a,b,c,d,e){"use strict";if(void 0===a)throw"The nodes have to be given.";if(void 0===b)throw"The edges have to be given.";if(void 0===c)throw"An inheriting class has to be given.";if(void 0===d)throw"A reference to the graph viewer has to be given.";e=e||{};var f,g,h,i,j,k=this,l=!1,m={},n={},o={},p={},q=0,r={},s={},t=function(a){void 0!==a.prioList&&g.changePrioList(a.prioList||[])},u=function(a){m.range=a/2,m.start=a/4,m.getStart=function(){return this.start+Math.random()*this.range}},v=function(a){n.range=a/2,n.start=a/4,n.getStart=function(){return this.start+Math.random()*this.range}},w=function(b){var c=p[b]||b,d=$.grep(a,function(a){return a._id===c});if(0===d.length)return!1;if(1===d.length)return d[0];throw"Too many nodes with the same ID, should never happen"},x=function(a){var c=$.grep(b,function(b){return b._id===a});if(0===c.length)return!1;if(1===c.length)return c[0];throw"Too many edges with the same ID, should never happen"},y=function(b,c,d){var e={_data:b,_id:b._id},f=w(e._id);return f?f:(e.x=c||m.getStart(),e.y=d||n.getStart(),e.weight=1,a.push(e),e._outboundCounter=0,e._inboundCounter=0,e)},z=function(a){var b=y(a);return b.x=2*m.start,b.y=2*n.start,b.fixed=!0,b},A=function(){a.length=0,b.length=0,p={},o={},d.cleanUp()},B=function(a){var c,d,e,f=!0,g={_data:a,_id:a._id},i=x(g._id);if(i)return i;if(c=w(a._from),d=w(a._to),!c)throw"Unable to insert Edge, source node not existing "+a._from;if(!d)throw"Unable to insert Edge, target node not existing "+a._to;return g.source=c,g.source._isCommunity?(e=o[g.source._id],g.source=e.getNode(a._from),g.source._outboundCounter++,e.insertOutboundEdge(g),f=!1):c._outboundCounter++,g.target=d,g.target._isCommunity?(e=o[g.target._id],g.target=e.getNode(a._to),g.target._inboundCounter++,e.insertInboundEdge(g),f=!1):d._inboundCounter++,b.push(g),f&&h.call("insertEdge",c._id,d._id),g},C=function(b){var c;for(c=0;c0){var c,d=[];for(c=0;cf&&(c?c.collapse():K(b))},M=function(c){var d=c.getDissolveInfo(),e=d.nodes,g=d.edges.both,i=d.edges.inbound,j=d.edges.outbound;C(c),fi){var b=g.bucketNodes(_.values(a),i);_.each(b,function(a){if(a.nodes.length>1){var b=_.map(a.nodes,function(a){return a._id});I(b,a.reason)}})}},P=function(a,b){f=a,L(),void 0!==b&&b()},Q=function(a){i=a},R=function(a,b){a._expanded=!1;var c=b.removeOutboundEdgesFromNode(a);_.each(c,function(a){j(a),E(a,!0)})},S=function(a){a._expanded=!1,p[a._id]&&o[p[a._id]].collapseNode(a);var b=H(a),c=[];_.each(b,function(b){0===q?(r=b,s=a,c.push(b)):void 0!==a&&(a._id===r.target._id?b.target._id===s._id&&c.push(r):c.push(b),r=b,s=a),q++}),_.each(c,j),q=0},T=function(a){var b=a.getDissolveInfo();C(a),_.each(b.nodes,function(a){delete p[a._id]}),_.each(b.edges.outbound,function(a){j(a),E(a,!0)}),delete o[a._id]},U=function(a,b){a._isCommunity?k.expandCommunity(a,b):(a._expanded=!0,c.loadNode(a._id,b))},V=function(a,b){a._expanded?S(a):U(a,b)};j=function(a){var b,c=a.target;return c._isCommunity?(b=a._target,c.removeInboundEdge(a),b._inboundCounter--,0===b._inboundCounter&&(R(b,c),c.removeNode(b),delete p[b._id]),void(0===c._inboundCounter&&T(c))):(c._inboundCounter--,void(0===c._inboundCounter&&(S(c),C(c))))},i=Number.POSITIVE_INFINITY,g=e.prioList?new NodeReducer(e.prioList):new NodeReducer,h=new WebWorkerWrapper(ModularityJoiner,J),m.getStart=function(){return 0},n.getStart=function(){return 0},this.cleanUp=A,this.setWidth=u,this.setHeight=v,this.insertNode=y,this.insertInitialNode=z,this.insertEdge=B,this.removeNode=C,this.removeEdge=E,this.removeEdgesForNode=F,this.expandCommunity=N,this.setNodeLimit=P,this.setChildLimit=Q,this.checkSizeOfInserted=O,this.checkNodeLimit=L,this.explore=V,this.changeTo=t,this.getPrioList=g.getPrioList,this.dissolveCommunity=M}function ArangoAdapter(a,b,c,d){"use strict";if(void 0===a)throw"The nodes have to be given.";if(void 0===b)throw"The edges have to be given.";if(void 0===c)throw"A reference to the graph viewer has to be given.";if(void 0===d)throw"A configuration with node- and edgeCollection has to be given.";if(void 0===d.graph){if(void 0===d.nodeCollection)throw"The nodeCollection or a graphname has to be given.";if(void 0===d.edgeCollection)throw"The edgeCollection or a graphname has to be given."}var e,f,g,h,i,j=this,k={},l={},m={},n=function(a){h=a},o=function(a){f=a,l.node=l.base+"document?collection="+f},p=function(a){g=a,l.edge=l.base+"edge?collection="+g},q=function(a){$.ajax({cache:!1,type:"GET",async:!1,url:l.graph+"/"+a,contentType:"application/json",success:function(a){o(a.graph.vertices),p(a.graph.edges)}})},r=function(a){var b=a.baseUrl||"";void 0!==a.width&&e.setWidth(a.width),void 0!==a.height&&e.setHeight(a.height),i=void 0!==a.undirected&&a.undirected===!0?"any":"outbound",l.base=b+"_api/",l.cursor=l.base+"cursor",l.graph=l.base+"graph",l.collection=l.base+"collection/",l.document=l.base+"document/",l.any=l.base+"simple/any",a.graph?(q(a.graph),n(a.graph)):(o(a.nodeCollection),p(a.edgeCollection),n(void 0))},s=function(a,b,c){a!==m.getAllGraphs&&(a!==m.connectedEdges&&(b["@nodes"]=f,a!==m.childrenCentrality&&(b.dir=i)),b["@edges"]=g);var d={query:a,bindVars:b};$.ajax({type:"POST",url:l.cursor,data:JSON.stringify(d),contentType:"application/json",dataType:"json",processData:!1,success:function(a){c(a.result)},error:function(a){try{throw console.log(a.statusText),"["+a.errorNum+"] "+a.errorMessage}catch(b){throw"Undefined ERROR"}}})},t=function(a,b){var c=[],d=0,e=function(d){c.push(d.document||{}),c.length===a&&b(c)};for(d=0;a>d;d++)$.ajax({cache:!1,type:"PUT",url:l.any,data:JSON.stringify({collection:f}),contentType:"application/json",success:e})},u=function(b,c){if(0===b.length)return void(c&&c({errorCode:404}));b=b[0];var d={},f=e.insertNode(b[0].vertex),g=a.length;_.each(b,function(b){var c=e.insertNode(b.vertex),f=b.path;g=2&&$.ajax({cache:!1,type:"GET",url:l.collection,contentType:"application/json",dataType:"json",processData:!1,success:function(b){var c=b.collections,d=[],e=[];_.each(c,function(a){a.name.match(/^_/)||(3===a.type?e.push(a.name):2===a.type&&d.push(a.name))}),a(d,e)},error:function(a){throw a.statusText}})},j.getGraphs=function(a){a&&a.length>=1&&s(m.getAllGraphs,{},a)},j.getAttributeExamples=function(a){a&&a.length>=1&&t(10,function(b){var c=_.sortBy(_.uniq(_.flatten(_.map(b,function(a){return _.keys(a)}))),function(a){return a.toLowerCase()});a(c)})},j.getNodeCollection=function(){return f},j.getEdgeCollection=function(){return g},j.getDirection=function(){return i},j.getGraphName=function(){return h},j.setWidth=e.setWidth,j.changeTo=e.changeTo,j.getPrioList=e.getPrioList}function ColourMapper(){"use strict";var a,b={},c={},d=[],e=this,f=0;d.push({back:"#C8E6C9",front:"black"}),d.push({back:"#8aa249",front:"white"}),d.push({back:"#8BC34A",front:"black"}),d.push({back:"#388E3C",front:"white"}),d.push({back:"#4CAF50",front:"white"}),d.push({back:"#212121",front:"white"}),d.push({back:"#727272",front:"white"}),d.push({back:"#B6B6B6",front:"black"}),d.push({back:"#e5f0a3",front:"black"}),d.push({back:"#6c4313",front:"white"}),d.push({back:"#9d8564",front:"white"}),this.getColour=function(g){return void 0===b[g]&&(b[g]=d[f],void 0===c[d[f].back]&&(c[d[f].back]={front:d[f].front,list:[]}),c[d[f].back].list.push(g),f++,f===d.length&&(f=0)),void 0!==a&&a(e.getList()),b[g].back},this.getCommunityColour=function(){return"#333333"},this.getForegroundColour=function(g){return void 0===b[g]&&(b[g]=d[f],void 0===c[d[f].back]&&(c[d[f].back]={front:d[f].front,list:[]}),c[d[f].back].list.push(g),f++,f===d.length&&(f=0)),void 0!==a&&a(e.getList()),b[g].front},this.getForegroundCommunityColour=function(){return"white"},this.reset=function(){b={},c={},f=0,void 0!==a&&a(e.getList())},this.getList=function(){return c},this.setChangeListener=function(b){a=b},this.reset()}function CommunityNode(a,b){"use strict";if(_.isUndefined(a)||!_.isFunction(a.dissolveCommunity)||!_.isFunction(a.checkNodeLimit))throw"A parent element has to be given.";b=b||[];var c,d,e,f,g,h=this,i={},j=[],k=[],l={},m={},n={},o={},p=function(a){return h._expanded?2*a*Math.sqrt(j.length):a},q=function(a){return h._expanded?4*a*Math.sqrt(j.length):a},r=function(a){var b=h.position,c=a.x*b.z+b.x,d=a.y*b.z+b.y,e=a.z*b.z;return{x:c,y:d,z:e}},s=function(a){return h._expanded?r(a._source.position):h.position},t=function(a){return h._expanded?r(a._target.position):h.position},u=function(){var a=document.getElementById(h._id).getBBox();c.attr("transform","translate("+(a.x-5)+","+(a.y-25)+")"),d.attr("width",a.width+10).attr("height",a.height+30),e.attr("width",a.width+10)},v=function(){if(!f){var a=new DomObserverFactory;f=a.createObserver(function(a){_.any(a,function(a){return"transform"===a.attributeName})&&(u(),f.disconnect())})}return f},w=function(){g.stop(),j.length=0,_.each(i,function(a){j.push(a)}),g.start()},x=function(){g.stop(),k.length=0,_.each(l,function(a){k.push(a)}),g.start()},y=function(a){var b=[];return _.each(a,function(a){b.push(a)}),b},z=function(a){return!!i[a]},A=function(){return j},B=function(a){return i[a]},C=function(a){i[a._id]=a,w(),h._size++},D=function(a){_.each(a,function(a){i[a._id]=a,h._size++}),w()},E=function(a){var b=a._id||a;delete i[b],w(),h._size--},F=function(a){var b;return _.has(a,"_id")?b=a._id:(b=a,a=l[b]||m[b]),a.target=a._target,delete a._target,l[b]?(delete l[b],h._outboundCounter++,n[b]=a,void x()):(delete m[b],void h._inboundCounter--)},G=function(a){var b;return _.has(a,"_id")?b=a._id:(b=a,a=l[b]||n[b]),a.source=a._source,delete a._source,delete o[a.source._id][b],l[b]?(delete l[b],h._inboundCounter++,m[b]=a,void x()):(delete n[b],void h._outboundCounter--)},H=function(a){var b=a._id||a,c=[];return _.each(o[b],function(a){G(a),c.push(a)}),delete o[b],c},I=function(a){return a._target=a.target,a.target=h,n[a._id]?(delete n[a._id],h._outboundCounter--,l[a._id]=a,x(),!0):(m[a._id]=a,h._inboundCounter++,!1)},J=function(a){var b=a.source._id;return a._source=a.source,a.source=h,o[b]=o[b]||{},o[b][a._id]=a,m[a._id]?(delete m[a._id],h._inboundCounter--,l[a._id]=a,x(),!0):(h._outboundCounter++,n[a._id]=a,!1)},K=function(){return{nodes:j,edges:{both:k,inbound:y(m),outbound:y(n)}}},L=function(){this._expanded=!0},M=function(){a.dissolveCommunity(h)},N=function(){this._expanded=!1},O=function(a,b){var c=a.select("rect").attr("width"),d=a.append("text").attr("text-anchor","middle").attr("fill",b.getForegroundCommunityColour()).attr("stroke","none");c*=2,c/=3,h._reason&&h._reason.key&&(d.append("tspan").attr("x","0").attr("dy","-4").text(h._reason.key+":"),d.append("tspan").attr("x","0").attr("dy","16").text(h._reason.value)),d.append("tspan").attr("x",c).attr("y","0").attr("fill",b.getCommunityColour()).text(h._size)},P=function(b,c,d,e){var f=b.append("g").attr("stroke",e.getForegroundCommunityColour()).attr("fill",e.getCommunityColour());c(f,9),c(f,6),c(f,3),c(f),f.on("click",function(){h.expand(),a.checkNodeLimit(h),d()}),O(f,e)},Q=function(a,b){var c=a.selectAll(".node").data(j,function(a){return a._id});c.enter().append("g").attr("class","node").attr("id",function(a){return a._id}),c.exit().remove(),c.selectAll("* > *").remove(),b(c)},R=function(a,b){c=a.append("g"),d=c.append("rect").attr("rx","8").attr("ry","8").attr("fill","none").attr("stroke","black"),e=c.append("rect").attr("rx","8").attr("ry","8").attr("height","20").attr("fill","#686766").attr("stroke","none"),c.append("image").attr("id",h._id+"_dissolve").attr("xlink:href","img/icon_delete.png").attr("width","16").attr("height","16").attr("x","5").attr("y","2").attr("style","cursor:pointer").on("click",function(){h.dissolve(),b()}),c.append("image").attr("id",h._id+"_collapse").attr("xlink:href","img/gv_collapse.png").attr("width","16").attr("height","16").attr("x","25").attr("y","2").attr("style","cursor:pointer").on("click",function(){h.collapse(),b()});var f=c.append("text").attr("x","45").attr("y","15").attr("fill","white").attr("stroke","none").attr("text-anchor","left");h._reason&&f.text(h._reason.text),v().observe(document.getElementById(h._id),{subtree:!0,attributes:!0})},S=function(a){if(h._expanded){var b=a.focus(),c=[b[0]-h.position.x,b[1]-h.position.y];a.focus(c),_.each(j,function(b){b.position=a(b),b.position.x/=h.position.z,b.position.y/=h.position.z,b.position.z/=h.position.z}),a.focus(b)}},T=function(a,b,c,d,e){return a.on("click",null),h._expanded?(R(a,d),void Q(a,c,d,e)):void P(a,b,d,e)},U=function(a,b,c){if(h._expanded){var d=a.selectAll(".link"),e=d.select("line");b(e,d),c(d)}},V=function(a,b){var c,d,e=function(a){return a._id};h._expanded&&(d=a.selectAll(".link").data(k,e),d.enter().append("g").attr("class","link").attr("id",e),d.exit().remove(),d.selectAll("* > *").remove(),c=d.append("line"),b(c,d))},W=function(a){H(a)};g=new ForceLayouter({distance:100,gravity:.1,charge:-500,width:1,height:1,nodes:j,links:k}),this._id="*community_"+Math.floor(1e6*Math.random()),b.length>0?(this.x=b[0].x,this.y=b[0].y):(this.x=0,this.y=0),this._size=0,this._inboundCounter=0,this._outboundCounter=0,this._expanded=!1,this._isCommunity=!0,D(b),this.hasNode=z,this.getNodes=A,this.getNode=B,this.getDistance=p,this.getCharge=q,this.insertNode=C,this.insertInboundEdge=I,this.insertOutboundEdge=J,this.removeNode=E,this.removeInboundEdge=F,this.removeOutboundEdge=G,this.removeOutboundEdgesFromNode=H,this.collapseNode=W,this.dissolve=M,this.getDissolveInfo=K,this.collapse=N,this.expand=L,this.shapeNodes=T,this.shapeInnerEdges=V,this.updateInnerEdges=U,this.addDistortion=S,this.getSourcePosition=s,this.getTargetPosition=t}function DomObserverFactory(){"use strict";var a=window.WebKitMutationObserver||window.MutationObserver;this.createObserver=function(b){if(!a)throw"Observer not supported";return new a(b)}}function EdgeShaper(a,b,c){"use strict";var d,e,f,g=this,h=[],i={},j=new ContextMenu("gv_edge_cm"),k=function(a,b){return _.isArray(a)?b[_.find(a,function(a){return b[a]})]:b[a]},l=function(a){if(void 0===a)return[""];"string"!=typeof a&&(a=String(a));var b=a.match(/[\w\W]{1,10}(\s|$)|\S+?(\s|$)/g);return b[0]=$.trim(b[0]),b[1]=$.trim(b[1]),b[0].length>12&&(b[0]=$.trim(a.substring(0,10))+"-",b[1]=$.trim(a.substring(10)),b[1].length>12&&(b[1]=b[1].split(/\W/)[0],b[1].length>12&&(b[1]=b[1].substring(0,10)+"...")),b.length=2),b.length>2&&(b.length=2,b[1]+="..."),b},m=!0,n={},o=function(a){return a._id},p=function(a,b){},q=new ColourMapper,r=function(){q.reset()},s=p,t=p,u=p,v=p,w=function(){f={click:p,dblclick:p,mousedown:p,mouseup:p,mousemove:p,mouseout:p,mouseover:p}},x=function(a,b){return 180*Math.atan2(b.y-a.y,b.x-a.x)/Math.PI},y=function(a,b){var c,d=Math.sqrt((b.y-a.y)*(b.y-a.y)+(b.x-a.x)*(b.x-a.x));return a.x===b.x?d-=18*b.z:(c=Math.abs((b.y-a.y)/(b.x-a.x)),d-=.4>c?Math.abs(d*b.z*45/(b.x-a.x)):Math.abs(d*b.z*18/(b.y-a.y))),d},z=function(a,b){_.each(f,function(a,c){b.on(c,a)})},A=function(a,b){if("update"===a)s=b;else{if(void 0===f[a])throw"Sorry Unknown Event "+a+" cannot be bound.";f[a]=b}},B=function(a){var b,c,d,e;return d=a.source,e=a.target,d._isCommunity?(i[d._id]=d,b=d.getSourcePosition(a)):b=d.position,e._isCommunity?(i[e._id]=e,c=e.getTargetPosition(a)):c=e.position,{s:b,t:c}},C=function(a,b){i={},b.attr("transform",function(a){var b=B(a);return"translate("+b.s.x+", "+b.s.y+")rotate("+x(b.s,b.t)+")"}),a.attr("x2",function(a){var b=B(a);return y(b.s,b.t)})},D=function(a,b){t(a,b),m&&u(a,b),v(a,b),z(a,b),C(a,b)},E=function(a){void 0!==a&&(h=a);var b,c=g.parent.selectAll(".link").data(h,o);c.enter().append("g").attr("class","link").attr("id",o),c.exit().remove(),c.selectAll("* > *").remove(),b=c.append("line"),D(b,c),_.each(i,function(a){a.shapeInnerEdges(d3.select(this),D)}),j.bindMenu($(".link"))},F=function(){var a=g.parent.selectAll(".link"),b=a.select("line");C(b,a),s(a),_.each(i,function(a){a.updateInnerEdges(d3.select(this),C,s)})},G=function(a){switch($("svg defs marker#arrow").remove(),a.type){case EdgeShaper.shapes.NONE:t=p;break;case EdgeShaper.shapes.ARROW:t=function(a,b){a.attr("marker-end","url(#arrow)")},0===d.selectAll("defs")[0].length&&d.append("defs"),d.select("defs").append("marker").attr("id","arrow").attr("refX","10").attr("refY","5").attr("markerUnits","strokeWidth").attr("markerHeight","10").attr("markerWidth","10").attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z");break;default:throw"Sorry given Shape not known!"}},H=function(a){u=_.isFunction(a)?function(b,c){c.append("text").attr("text-anchor","middle").text(a)}:function(b,c){c.append("text").attr("text-anchor","middle").text(function(b){var c=l(k(a,b._data));return c[0]||""})},s=function(a){a.select("text").attr("transform",function(a){var b=B(a);return"translate("+y(b.s,b.t)/2+", -3)"})}},I=function(a){void 0!==a.reset&&a.reset&&w(),_.each(a,function(a,b){"reset"!==b&&A(b,a)})},J=function(a){switch($("svg defs #gradientEdgeColor").remove(),r(),a.type){case"single":v=function(b,c){b.attr("stroke",a.stroke)};break;case"gradient":0===d.selectAll("defs")[0].length&&d.append("defs");var b=d.select("defs").append("linearGradient").attr("id","gradientEdgeColor");b.append("stop").attr("offset","0").attr("stop-color",a.source),b.append("stop").attr("offset","0.4").attr("stop-color",a.source),b.append("stop").attr("offset","0.6").attr("stop-color",a.target),b.append("stop").attr("offset","1").attr("stop-color",a.target),v=function(a,b){a.attr("stroke","url(#gradientEdgeColor)"),a.attr("y2","0.0000000000000001")};break;case"attribute":v=function(b,c){c.attr("stroke",function(b){return q.getColour(b._data[a.key])})};break;default:throw"Sorry given colour-scheme not known"}},K=function(a){void 0!==a.shape&&G(a.shape),void 0!==a.label&&(H(a.label),g.label=a.label),void 0!==a.actions&&I(a.actions),void 0!==a.color&&J(a.color)};for(g.parent=a,w(),d=a;d[0][0]&&d[0][0].ownerSVGElement;)d=d3.select(d[0][0].ownerSVGElement);void 0===b&&(b={color:{type:"single",stroke:"#686766"}}),void 0===b.color&&(b.color={type:"single",stroke:"#686766"}),K(b),_.isFunction(c)&&(o=c),e=d.append("g"),g.changeTo=function(a){K(a),E(),F()},g.drawEdges=function(a){E(a),F()},g.updateEdges=function(){F()},g.reshapeEdges=function(){E()},g.activateLabel=function(a){m=a?!0:!1,E()},g.addAnEdgeFollowingTheCursor=function(a,b){return n=e.append("line"),n.attr("stroke","black").attr("id","connectionLine").attr("x1",a).attr("y1",b).attr("x2",a).attr("y2",b),function(a,b){n.attr("x2",a).attr("y2",b)}},g.removeCursorFollowingEdge=function(){n.remove&&(n.remove(),n={})},g.addMenuEntry=function(a,b){j.addEntry(a,b)},g.getLabel=function(){return g.label||""},g.resetColourMap=r}function EventDispatcher(a,b,c){"use strict";var d,e,f,g,h=this,i=function(b){if(void 0===b.shaper&&(b.shaper=a),d.checkNodeEditorConfig(b)){var c=new d.InsertNode(b),e=new d.PatchNode(b),f=new d.DeleteNode(b);h.events.CREATENODE=function(a,b,d,e){var f;return f=_.isFunction(a)?a():a,function(){c(f,b,d,e)}},h.events.PATCHNODE=function(a,b,c){if(!_.isFunction(b))throw"Please give a function to extract the new node data";return function(){e(a,b(),c)}},h.events.DELETENODE=function(a){return function(b){f(b,a)}}}},j=function(a){if(void 0===a.shaper&&(a.shaper=b),d.checkEdgeEditorConfig(a)){var c=new d.InsertEdge(a),e=new d.PatchEdge(a),f=new d.DeleteEdge(a),g=null,i=!1;h.events.STARTCREATEEDGE=function(a){return function(b){var c=d3.event||window.event;g=b,i=!1,void 0!==a&&a(b,c),c.stopPropagation()}},h.events.CANCELCREATEEDGE=function(a){return function(){g=null,void 0===a||i||a()}},h.events.FINISHCREATEEDGE=function(a){return function(b){null!==g&&b!==g&&(c(g,b,a),i=!0)}},h.events.PATCHEDGE=function(a,b,c){if(!_.isFunction(b))throw"Please give a function to extract the new node data";return function(){e(a,b(),c)}},h.events.DELETEEDGE=function(a){return function(b){f(b,a)}}}},k=function(){g=g||$("svg"),g.unbind(),_.each(e,function(a,b){g.bind(b,function(c){_.each(a,function(a){a(c)}),f[b]&&f[b](c)})})};if(void 0===a)throw"NodeShaper has to be given.";if(void 0===b)throw"EdgeShaper has to be given.";d=new EventLibrary,e={click:[],dblclick:[],mousedown:[],mouseup:[],mousemove:[],mouseout:[],mouseover:[]},f={},h.events={},void 0!==c&&(void 0!==c.expand&&d.checkExpandConfig(c.expand)&&(h.events.EXPAND=new d.Expand(c.expand),a.setGVStartFunction(function(){c.expand.reshapeNodes(),c.expand.startCallback()})),void 0!==c.drag&&d.checkDragConfig(c.drag)&&(h.events.DRAG=d.Drag(c.drag)),void 0!==c.nodeEditor&&i(c.nodeEditor),void 0!==c.edgeEditor&&j(c.edgeEditor)),Object.freeze(h.events),h.bind=function(c,d,e){if(void 0===e||!_.isFunction(e))throw"You have to give a function that should be bound as a third argument";var g={};switch(c){case"nodes":g[d]=e,a.changeTo({actions:g});break;case"edges":g[d]=e,b.changeTo({actions:g});break;case"svg":f[d]=e,k();break;default:if(void 0===c.bind)throw'Sorry cannot bind to object. Please give either "nodes", "edges" or a jQuery-selected DOM-Element';c.unbind(d),c.bind(d,e)}},h.rebind=function(c,d){switch(d=d||{},d.reset=!0,c){case"nodes":a.changeTo({actions:d});break;case"edges":b.changeTo({actions:d});break;case"svg":f={},_.each(d,function(a,b){"reset"!==b&&(f[b]=a)}),k();break;default:throw'Sorry cannot rebind to object. Please give either "nodes", "edges" or "svg"'}},h.fixSVG=function(a,b){if(void 0===e[a])throw"Sorry unkown event";e[a].push(b),k()},Object.freeze(h.events)}function EventLibrary(){"use strict";var a=this;this.checkExpandConfig=function(a){if(void 0===a.startCallback)throw"A callback to the Start-method has to be defined";if(void 0===a.adapter||void 0===a.adapter.explore)throw"An adapter to load data has to be defined";if(void 0===a.reshapeNodes)throw"A callback to reshape nodes has to be defined";return!0},this.Expand=function(b){a.checkExpandConfig(b);var c=b.startCallback,d=b.adapter.explore,e=b.reshapeNodes;return function(a){d(a,c),e(),c()}},this.checkDragConfig=function(a){if(void 0===a.layouter)throw"A layouter has to be defined";if(void 0===a.layouter.drag||!_.isFunction(a.layouter.drag))throw"The layouter has to offer a drag function";return!0},this.Drag=function(b){return a.checkDragConfig(b),b.layouter.drag},this.checkNodeEditorConfig=function(a){if(void 0===a.adapter)throw"An adapter has to be defined";if(void 0===a.shaper)throw"A node shaper has to be defined";return!0},this.checkEdgeEditorConfig=function(a){if(void 0===a.adapter)throw"An adapter has to be defined";if(void 0===a.shaper)throw"An edge Shaper has to be defined";return!0},this.InsertNode=function(b){a.checkNodeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e,f){var g,h;_.isFunction(a)&&!b?(g=a,h={}):(g=b,h=a),c.createNode(h,function(a){d.reshapeNodes(),g(a)},e,f)}},this.PatchNode=function(b){a.checkNodeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e){c.patchNode(a,b,function(a){d.reshapeNodes(),e(a)})}},this.DeleteNode=function(b){a.checkNodeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b){c.deleteNode(a,function(){d.reshapeNodes(),b()})}},this.SelectNodeCollection=function(b){a.checkNodeEditorConfig(b);var c=b.adapter;if(!_.isFunction(c.useNodeCollection))throw"The adapter has to support collection changes";return function(a,b){c.useNodeCollection(a),b()}},this.InsertEdge=function(b){a.checkEdgeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e){c.createEdge({source:a,target:b},function(a){d.reshapeEdges(),e(a)})}},this.PatchEdge=function(b){a.checkEdgeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e){c.patchEdge(a,b,function(a){d.reshapeEdges(),e(a)})}},this.DeleteEdge=function(b){a.checkEdgeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b){c.deleteEdge(a,function(){d.reshapeEdges(),b()})}}}function ForceLayouter(a){"use strict";var b=this,c=d3.layout.force(),d=a.charge||-600,e=a.distance||80,f=a.gravity||.01,g=function(a){
var b=0;return b+=a.source._isCommunity?a.source.getDistance(e):e,b+=a.target._isCommunity?a.target.getDistance(e):e},h=function(a){return a._isCommunity?a.getCharge(d):d},i=a.onUpdate||function(){},j=a.width||880,k=a.height||680,l=function(a){a.distance&&(e=a.distance),a.gravity&&c.gravity(a.gravity),a.charge&&(d=a.charge)};if(void 0===a.nodes)throw"No nodes defined";if(void 0===a.links)throw"No links defined";c.nodes(a.nodes),c.links(a.links),c.size([j,k]),c.linkDistance(g),c.gravity(f),c.charge(h),c.on("tick",function(){}),b.start=function(){c.start()},b.stop=function(){c.stop()},b.drag=c.drag,b.setCombinedUpdateFunction=function(a,d,e){void 0!==e?(i=function(){c.alpha()<.1&&(a.updateNodes(),d.updateEdges(),e(),c.alpha()<.05&&b.stop())},c.on("tick",i)):(i=function(){c.alpha()<.1&&(a.updateNodes(),d.updateEdges(),c.alpha()<.05&&b.stop())},c.on("tick",i))},b.changeTo=function(a){l(a)},b.changeWidth=function(a){j=a,c.size([j,k])}}function FoxxAdapter(a,b,c,d,e){"use strict";if(void 0===a)throw"The nodes have to be given.";if(void 0===b)throw"The edges have to be given.";if(void 0===c)throw"The route has to be given.";if(void 0===d)throw"A reference to the graph viewer has to be given.";e=e||{};var f,g=this,h={},i={},j=c,k={cache:!1,contentType:"application/json",dataType:"json",processData:!1,error:function(a){try{throw console.log(a.statusText),"["+a.errorNum+"] "+a.errorMessage}catch(b){throw console.log(b),"Undefined ERROR"}}},l=function(){i.query={get:function(a,b){var c=$.extend(k,{type:"GET",url:j+"/query/"+a,success:b});$.ajax(c)}},i.nodes={post:function(a,b){var c=$.extend(k,{type:"POST",url:j+"/nodes",data:JSON.stringify(a),success:b});$.ajax(c)},put:function(a,b,c){var d=$.extend(k,{type:"PUT",url:j+"/nodes/"+a,data:JSON.stringify(b),success:c});$.ajax(d)},del:function(a,b){var c=$.extend(k,{type:"DELETE",url:j+"/nodes/"+a,success:b});$.ajax(c)}},i.edges={post:function(a,b){var c=$.extend(k,{type:"POST",url:j+"/edges",data:JSON.stringify(a),success:b});$.ajax(c)},put:function(a,b,c){var d=$.extend(k,{type:"PUT",url:j+"/edges/"+a,data:JSON.stringify(b),success:c});$.ajax(d)},del:function(a,b){var c=$.extend(k,{type:"DELETE",url:j+"/edges/"+a,success:b});$.ajax(c)}},i.forNode={del:function(a,b){var c=$.extend(k,{type:"DELETE",url:j+"/edges/forNode/"+a,success:b});$.ajax(c)}}},m=function(a,b,c){i[a].get(b,c)},n=function(a,b,c){i[a].post(b,c)},o=function(a,b,c){i[a].del(b,c)},p=function(a,b,c,d){i[a].put(b,c,d)},q=function(a){void 0!==a.width&&f.setWidth(a.width),void 0!==a.height&&f.setHeight(a.height)},r=function(b,c){var d={},e=b.first,g=a.length;e=f.insertNode(e),_.each(b.nodes,function(b){b=f.insertNode(b),g=l.TOTAL_NODES?$(".infoField").hide():$(".infoField").show());var e=t(l.NODES_TO_DISPLAY,d[c]);if(e.length>0){return _.each(e,function(a){l.randomNodes.push(a)}),void l.loadInitialNode(e[0]._id,a)}}a({errorCode:404})},l.loadInitialNode=function(a,b){e.cleanUp(),l.loadNode(a,v(b))},l.getRandomNodes=function(){var a=[],b=[];l.definedNodes.length>0&&_.each(l.definedNodes,function(a){b.push(a)}),l.randomNodes.length>0&&_.each(l.randomNodes,function(a){b.push(a)});var c=0;return _.each(b,function(b){c0?_.each(d,function(a){s(o.traversal,{example:a.vertex._id},function(a){_.each(a[0][0],function(a){c[0][0].push(a)}),u(c,b)})}):s(o.traversal,{example:a},function(a){u(a,b)})})},l.loadNodeFromTreeByAttributeValue=function(a,b,c){var d={};d[a]=b,s(o.traversal,{example:d},function(a){u(a,c)})},l.getNodeExampleFromTreeByAttributeValue=function(a,b,c){var d={};d[a]=b,s(o.traversal,{example:d},function(d){if(void 0===d[0][0])throw arangoHelper.arangoError("Graph error","no nodes found"),"No suitable nodes have been found.";_.each(d[0][0],function(d){if(d.vertex[a]===b){var f={};f._key=d.vertex._key,f._id=d.vertex._id,f._rev=d.vertex._rev,e.insertNode(f),c(f)}})})},l.loadAdditionalNodeByAttributeValue=function(a,b,c){l.getNodeExampleFromTreeByAttributeValue(a,b,c)},l.loadInitialNodeByAttributeValue=function(a,b,c){e.cleanUp(),l.loadNodeFromTreeByAttributeValue(a,b,v(c))},l.requestCentralityChildren=function(a,b){s(o.childrenCentrality,{id:a},function(a){b(a[0])})},l.createEdge=function(a,b){var c={};c._from=a.source._id,c._to=a.target._id,$.ajax({cache:!1,type:"POST",url:n.edges+i,data:JSON.stringify(c),dataType:"json",contentType:"application/json",processData:!1,success:function(a){if(a.error===!1){var d,f=a.edge;f._from=c._from,f._to=c._to,d=e.insertEdge(f),b(d)}},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.deleteEdge=function(a,b){$.ajax({cache:!1,type:"DELETE",url:n.edges+a._id,contentType:"application/json",dataType:"json",processData:!1,success:function(){e.removeEdge(a),void 0!==b&&_.isFunction(b)&&b()},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.patchEdge=function(a,b,c){$.ajax({cache:!1,type:"PUT",url:n.edges+a._id,data:JSON.stringify(b),dataType:"json",contentType:"application/json",processData:!1,success:function(){a._data=$.extend(a._data,b),c()},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.createNode=function(a,b){$.ajax({cache:!1,type:"POST",url:n.vertices+g,data:JSON.stringify(a),dataType:"json",contentType:"application/json",processData:!1,success:function(c){c.error===!1&&(a._key=c.vertex._key,a._id=c.vertex._id,a._rev=c.vertex._rev,e.insertNode(a),b(a))},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.deleteNode=function(a,b){$.ajax({cache:!1,type:"DELETE",url:n.vertices+a._id,dataType:"json",contentType:"application/json",processData:!1,success:function(){e.removeEdgesForNode(a),e.removeNode(a),void 0!==b&&_.isFunction(b)&&b()},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.patchNode=function(a,b,c){$.ajax({cache:!1,type:"PUT",url:n.vertices+a._id,data:JSON.stringify(b),dataType:"json",contentType:"application/json",processData:!1,success:function(){a._data=$.extend(a._data,b),c(a)},error:function(a){throw a.statusText}})},l.changeToGraph=function(a,b){e.cleanUp(),q(a),void 0!==b&&(k=b===!0?"any":"outbound")},l.setNodeLimit=function(a,b){e.setNodeLimit(a,b)},l.setChildLimit=function(a){e.setChildLimit(a)},l.expandCommunity=function(a,b){e.expandCommunity(a),void 0!==b&&b()},l.getGraphs=function(a){a&&a.length>=1&&s(o.getAllGraphs,{},a)},l.getAttributeExamples=function(a){if(a&&a.length>=1){var b,c=[],d=_.shuffle(l.getNodeCollections());for(b=0;b0&&(c=c.concat(_.flatten(_.map(e,function(a){return _.keys(a)}))))}var c=_.sortBy(_.uniq(c),function(a){return a.toLowerCase()});a(c)}},l.getEdgeCollections=function(){return h},l.getSelectedEdgeCollection=function(){return i},l.useEdgeCollection=function(a){if(!_.contains(h,a))throw"Collection "+a+" is not available in the graph.";i=a},l.getNodeCollections=function(){return f},l.getSelectedNodeCollection=function(){return g},l.useNodeCollection=function(a){if(!_.contains(f,a))throw"Collection "+a+" is not available in the graph.";g=a},l.getDirection=function(){return k},l.getGraphName=function(){return j},l.setWidth=e.setWidth,l.changeTo=e.changeTo,l.getPrioList=e.getPrioList}function ModularityJoiner(){"use strict";var a={},b=Array.prototype.forEach,c=Object.keys,d=Array.isArray,e=Object.prototype.toString,f=Array.prototype.indexOf,g=Array.prototype.map,h=Array.prototype.some,i={isArray:d||function(a){return"[object Array]"===e.call(a)},isFunction:function(a){return"function"==typeof a},isString:function(a){return"[object String]"===e.call(a)},each:function(c,d,e){if(null!==c&&void 0!==c){var f,g,h;if(b&&c.forEach===b)c.forEach(d,e);else if(c.length===+c.length){for(f=0,g=c.length;g>f;f++)if(d.call(e,c[f],f,c)===a)return}else for(h in c)if(c.hasOwnProperty(h)&&d.call(e,c[h],h,c)===a)return}},keys:c||function(a){if("object"!=typeof a||Array.isArray(a))throw new TypeError("Invalid object");var b,c=[];for(b in a)a.hasOwnProperty(b)&&(c[c.length]=b);return c},min:function(a,b,c){if(!b&&i.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&i.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return i.each(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gc&&(c=a,b=d)}),0>c?void delete q[a]:void(q[a]=b)},t=function(a,b){s(b)},u=function(a,b){return b>a?p[a]&&p[a][b]:p[b]&&p[b][a]},v=function(a,b){return b>a?p[a][b]:p[b][a]},w=function(a,b,c){return b>a?(p[a]=p[a]||{},void(p[a][b]=c)):(p[b]=p[b]||{},void(p[b][a]=c))},x=function(a,b){if(b>a){if(!p[a])return;return delete p[a][b],void(i.isEmpty(p[a])&&delete p[a])}a!==b&&x(b,a)},y=function(a,b){var c,d;return b>a?u(a,b)?(d=v(a,b),q[a]===b?void s(a):u(a,q[a])?(c=v(a,q[a]),void(d>c&&(q[a]=b))):void s(a)):void s(a):void(a!==b&&y(b,a))},z=function(a,b){o[a]._in+=o[b]._in,o[a]._out+=o[b]._out,delete o[b]},A=function(a,b){j[a]=j[a]||{},j[a][b]=(j[a][b]||0)+1,k[b]=k[b]||{},k[b][a]=(k[b][a]||0)+1,l[a]=l[a]||{_in:0,_out:0},l[b]=l[b]||{_in:0,_out:0},l[a]._out++,l[b]._in++,m++,n=Math.pow(m,-1)},B=function(a,b){j[a]&&(j[a][b]--,0===j[a][b]&&delete j[a][b],k[b][a]--,0===k[b][a]&&delete k[b][a],l[a]._out--,l[b]._in--,m--,n=m>0?Math.pow(m,-1):0,i.isEmpty(j[a])&&delete j[a],i.isEmpty(k[b])&&delete k[b],0===l[a]._in&&0===l[a]._out&&delete l[a],0===l[b]._in&&0===l[b]._out&&delete l[b])},C=function(){return o={},i.each(l,function(a,b){o[b]={_in:a._in/m,_out:a._out/m}}),o},D=function(a,b){return o[a]._out*o[b]._in+o[a]._in*o[b]._out},E=function(a){var b=i.keys(j[a]||{}),c=i.keys(k[a]||{});return i.union(b,c)},F=function(){p={},i.each(j,function(a,b){var c=k[b]||{},d=E(b);i.each(d,function(d){var e,f=a[d]||0;f+=c[d]||0,e=f*n-D(b,d),e>0&&w(b,d,e)})})},G=function(){return q={},i.each(p,t),q},H=function(a,b,c){var d;return u(c,a)?(d=v(c,a),u(c,b)?(d+=v(c,b),w(c,a,d),x(c,b),y(c,a),void y(c,b)):(d-=D(c,b),0>d&&x(c,a),void y(c,a))):void(u(c,b)&&(d=v(c,b),d-=D(c,a),d>0&&w(c,a,d),y(c,a),x(c,b),y(c,b)))},I=function(a,b){i.each(p,function(c,d){return d===a||d===b?void i.each(c,function(c,d){return d===b?(x(a,b),void y(a,b)):void H(a,b,d)}):void H(a,b,d)})},J=function(){return j},K=function(){return q},L=function(){return p},M=function(){return o},N=function(){return r},O=function(){var a,b,c=Number.NEGATIVE_INFINITY;return i.each(q,function(d,e){c
"))}})}(),function(){"use strict";window.databaseView=Backbone.View.extend({users:null,el:"#content",template:templateEngine.createTemplate("databaseView.ejs"),dropdownVisible:!1,currentDB:"",events:{"click #createDatabase":"createDatabase","click #submitCreateDatabase":"submitCreateDatabase","click .editDatabase":"editDatabase","click .icon":"editDatabase","click #selectDatabase":"updateDatabase","click #submitDeleteDatabase":"submitDeleteDatabase","click .contentRowInactive a":"changeDatabase","keyup #databaseSearchInput":"search","click #databaseSearchSubmit":"search","click #databaseToggle":"toggleSettingsDropdown","click .css-label":"checkBoxes","click #dbSortDesc":"sorting","click .tile":"switchDatabase"},sorting:function(){$("#dbSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#databaseDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},initialize:function(){this.collection.fetch({async:!1})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},render:function(){return this.currentDatabase(),this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:"",currentDB:this.currentDB})),this.dropdownVisible===!0&&($("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").show()),arangoHelper.setCheckboxStatus("#databaseDropdown"),this.replaceSVGs(),this},toggleSettingsDropdown:function(){$("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").slideToggle(200)},selectedDatabase:function(){return $("#selectDatabases").val()},handleError:function(a,b,c){return 409===a?void arangoHelper.arangoError("DB","Database "+c+" already exists."):400===a?void arangoHelper.arangoError("DB","Invalid Parameters"):403===a?void arangoHelper.arangoError("DB","Insufficent rights. Execute this from _system database"):void 0},validateDatabaseInfo:function(a,b,c){return""===b?(arangoHelper.arangoError("DB","You have to define an owner for the new database"),!1):""===a?(arangoHelper.arangoError("DB","You have to define a name for the new database"),!1):0===a.indexOf("_")?(arangoHelper.arangoError("DB ","Databasename should not start with _"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("DB","Databasename may only contain numbers, letters, _ and -"),!1)},createDatabase:function(a){a.preventDefault(),this.createAddDatabaseModal()},switchDatabase:function(a){if(!$(a.target).parent().hasClass("iconSet")){var b=$(a.currentTarget).find("h5").text();if(""!==b){var c=this.collection.createDatabaseURL(b);window.location.replace(c)}}},submitCreateDatabase:function(){var a,b=this,c=$("#newDatabaseName").val(),d=$("#newUser").val();if(a="true"===$("#useDefaultPassword").val()?"ARANGODB_DEFAULT_ROOT_PASSWORD":$("#newPassword").val(),this.validateDatabaseInfo(c,d,a)){var e={name:c,users:[{username:d,passwd:a,active:!0}]};this.collection.create(e,{wait:!0,error:function(a,d){b.handleError(d.status,d.statusText,c)},success:function(a){b.updateDatabases(),window.modalView.hide(),window.App.naviView.dbSelectionView.render($("#dbSelect"))}})}},submitDeleteDatabase:function(a){var b=this.collection.where({name:a});b[0].destroy({wait:!0,url:"/_api/database/"+a}),this.updateDatabases(),window.App.naviView.dbSelectionView.render($("#dbSelect")),window.modalView.hide()},currentDatabase:function(){this.currentDB=this.collection.getCurrentDatabase()},changeDatabase:function(a){var b=$(a.currentTarget).attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},updateDatabases:function(){var a=this;this.collection.fetch({success:function(){a.render(),window.App.handleSelectDatabase()}})},editDatabase:function(a){var b=this.evaluateDatabaseName($(a.currentTarget).attr("id"),"_edit-database"),c=!0;b===this.currentDB&&(c=!1),this.createEditDatabaseModal(b,c)},search:function(){var a,b,c,d;a=$("#databaseSearchInput"),b=$("#databaseSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("name").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b,currentDB:this.currentDB})),this.replaceSVGs(),a=$("#databaseSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},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","tile-icon-svg").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},evaluateDatabaseName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},createEditDatabaseModal:function(a,b){var c=[],d=[];d.push(window.modalView.createReadOnlyEntry("id_name","Name",a,"")),b?c.push(window.modalView.createDeleteButton("Delete",this.submitDeleteDatabase.bind(this,a))):c.push(window.modalView.createDisabledButton("Delete")),window.modalView.show("modalTable.ejs","Delete database",c,d)},createAddDatabaseModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newDatabaseName","Name","",!1,"Database Name",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Database name must start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No database name given."}])),b.push(window.modalView.createTextEntry("newUser","Username",null!==this.users?this.users.whoAmI():"root","Please define the owner of this database. This will be the only user having initial access to this database if authentication is turned on. Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it. Specifying a username is mandatory even with authentication turned off. If there is a failure you will be informed.","Database Owner",!0,[{rule:Joi.string().required(),msg:"No username given."}])),b.push(window.modalView.createSelectEntry("useDefaultPassword","Use default password",!0,"Read the password from the environment variable ARANGODB_DEFAULT_ROOT_PASSWORD.",[{value:!1,label:"No"},{value:!0,label:"Yes"}])),b.push(window.modalView.createPasswordEntry("newPassword","Password","",!1,"",!1)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateDatabase.bind(this))),window.modalView.show("modalTable.ejs","Create Database",a,b),$("#useDefaultPassword").change(function(){"true"===$("#useDefaultPassword").val()?$("#row_newPassword").hide():$("#row_newPassword").show()}),$("#row_newPassword").hide()}})}(),function(){"use strict";window.DBSelectionView=Backbone.View.extend({template:templateEngine.createTemplate("dbSelectionView.ejs"),events:{"click .dbSelectionLink":"changeDatabase"},initialize:function(a){this.current=a.current},changeDatabase:function(a){var b=$(a.currentTarget).closest(".dbSelectionLink.tab").attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},render:function(a){return this.$el=a,this.$el.html(this.template.render({list:this.collection.getDatabasesForUser(),current:this.current.get("name")})),this.delegateEvents(),this.el}})}(),function(){"use strict";var a=function(a){var b=a.split("/");return"collection/"+encodeURIComponent(b[0])+"/"+encodeURIComponent(b[1])};window.DocumentView=Backbone.View.extend({el:"#content",colid:0,docid:0,customView:!1,template:templateEngine.createTemplate("documentView.ejs"),events:{"click #saveDocumentButton":"saveDocument","click #deleteDocumentButton":"deleteDocumentModal","click #confirmDeleteDocument":"deleteDocument","click #document-from":"navigateToDocument","click #document-to":"navigateToDocument","keydown #documentEditor .ace_editor":"keyPress","keyup .jsoneditor .search input":"checkSearchBox"},checkSearchBox:function(a){""===$(a.currentTarget).val()&&this.editor.expandAll()},keyPress:function(a){a.ctrlKey&&13===a.keyCode?(a.preventDefault(),this.saveDocument()):a.metaKey&&13===a.keyCode&&(a.preventDefault(),this.saveDocument())},editor:0,setType:function(a){var b,c;return"edge"===a?(b=this.collection.getEdge(this.colid,this.docid),c="Edge: "):"document"===a&&(b=this.collection.getDocument(this.colid,this.docid),c="Document: "),b===!0?(this.type=a,this.fillInfo(c),this.fillEditor(),!0):void 0},deleteDocumentModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("doc-delete-button","Delete","Delete this "+this.type+"?",void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createDeleteButton("Delete",this.deleteDocument.bind(this))),window.modalView.show("modalTable.ejs","Delete Document",a,b)},deleteDocument:function(){var a;if("document"===this.type){if(a=this.collection.deleteDocument(this.colid,this.docid),a===!1)return void arangoHelper.arangoError("Document error:","Could not delete")}else if("edge"===this.type&&(a=this.collection.deleteEdge(this.colid,this.docid),a===!1))return void arangoHelper.arangoError("Edge error:","Could not delete");if(a===!0)if(this.customView)this.customDeleteFunction();else{var b="collection/"+encodeURIComponent(this.colid)+"/documents/1";window.modalView.hide(),window.App.navigate(b,{trigger:!0})}},navigateToDocument:function(a){var b=$(a.target).attr("documentLink");b&&window.App.navigate(b,{trigger:!0})},fillInfo:function(b){var c=this.collection.first(),d=c.get("_id"),e=c.get("_key"),f=c.get("_rev"),g=c.get("_from"),h=c.get("_to");if($("#document-type").text(b),$("#document-id").text(d),$("#document-key").text(e),$("#document-rev").text(f),g&&h){var i=a(g),j=a(h);$("#document-from").text(g),$("#document-from").attr("documentLink",i),$("#document-to").text(h),$("#document-to").attr("documentLink",j)}else $(".edge-info-container").hide()},fillEditor:function(){var a=this.removeReadonlyKeys(this.collection.first().attributes);this.editor.set(a),$(".ace_content").attr("font-size","11pt")},jsonContentChanged:function(){this.enableSaveButton()},render:function(){$(this.el).html(this.template.render({})),this.disableSaveButton(),this.breadcrumb();var a=this,b=document.getElementById("documentEditor"),c={change:function(){a.jsonContentChanged()},search:!0,mode:"tree",modes:["tree","code"],iconlib:"fontawesome4"};return this.editor=new JSONEditor(b,c),this},removeReadonlyKeys:function(a){return _.omit(a,["_key","_id","_from","_to","_rev"])},saveDocument:function(){var a,b;if(void 0===$("#saveDocumentButton").attr("disabled")){try{a=this.editor.get()}catch(c){return this.errorConfirmation(c),void this.disableSaveButton()}if(a=JSON.stringify(a),"document"===this.type){if(b=this.collection.saveDocument(this.colid,this.docid,a),b===!1)return void arangoHelper.arangoError("Document error:","Could not save")}else if("edge"===this.type&&(b=this.collection.saveEdge(this.colid,this.docid,a),b===!1))return void arangoHelper.arangoError("Edge error:","Could not save");b===!0&&(this.successConfirmation(),this.disableSaveButton())}},successConfirmation:function(){arangoHelper.arangoNotification("Document saved."),$("#documentEditor .tree").animate({backgroundColor:"#C6FFB0"},500),$("#documentEditor .tree").animate({backgroundColor:"#FFFFF"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#C6FFB0"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFFFF"},500)},errorConfirmation:function(a){arangoHelper.arangoError("Document editor: ",a),$("#documentEditor .tree").animate({backgroundColor:"#FFB0B0"},500),$("#documentEditor .tree").animate({backgroundColor:"#FFFFF"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFB0B0"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFFFF"},500)},enableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!1),$("#saveDocumentButton").addClass("button-success"),$("#saveDocumentButton").removeClass("button-close")},disableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!0),$("#saveDocumentButton").addClass("button-close"),$("#saveDocumentButton").removeClass("button-success")},breadcrumb:function(){var a=window.location.hash.split("/");$("#transparentHeader").append('
")}})}(),function(){"use strict";window.EditListEntryView=Backbone.View.extend({template:templateEngine.createTemplate("editListEntryView.ejs"),initialize:function(a){this.key=a.key,this.value=a.value,this.render()},events:{"click .deleteAttribute":"removeRow"},render:function(){$(this.el).html(this.template.render({key:this.key,value:JSON.stringify(this.value),isReadOnly:this.isReadOnly()}))},isReadOnly:function(){return 0===this.key.indexOf("_")},getKey:function(){return $(".key").val()},getValue:function(){var val=$(".val").val();try{val=JSON.parse(val)}catch(e){try{return eval("val = "+val),val}catch(e2){return $(".val").val()}}return val},removeRow:function(){this.remove()}})}(),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";window.FoxxActiveView=Backbone.View.extend({tagName:"div",className:"tile",template:templateEngine.createTemplate("foxxActiveView.ejs"),_show:!0,events:{click:"openAppDetailView"},openAppDetailView:function(){window.App.navigate("applications/"+encodeURIComponent(this.model.get("mount")),{trigger:!0})},toggle:function(a,b){switch(a){case"devel":this.model.isDevelopment()&&(this._show=b);break;case"production":this.model.isDevelopment()||this.model.isSystem()||(this._show=b);break;case"system":this.model.isSystem()&&(this._show=b)}this._show?$(this.el).show():$(this.el).hide()},render:function(){return $(this.el).html(this.template.render({model:this.model})),$(this.el)}})}(),function(){"use strict";var a=require("internal").errors,b=templateEngine.createTemplate("applicationListView.ejs"),c=function(a){this.collection=a.collection},d=function(b){if(b.error===!1)this.collection.fetch({async:!1}),window.modalView.hide(),this.reload();else{var c=b;switch(b.hasOwnProperty("responseJSON")&&(c=b.responseJSON),c.errorNum){case a.ERROR_APPLICATION_DOWNLOAD_FAILED.code:alert("Unable to download application from the given repository.");break;default:alert("Error: "+c.errorNum+". "+c.errorMessage)}}},e=function(){window.modalView.modalBindValidation({id:"new-app-mount",validateInput:function(){return[{rule:Joi.string().regex(/^(\/(APP[^\/]+|(?!APP)[a-zA-Z0-9_\-%]+))+$/i),msg:"May not contain /APP"},{rule:Joi.string().regex(/^(\/[a-zA-Z0-9_\-%]+)+$/),msg:"Can only contain [a-zA-Z0-9_-%]"},{rule:Joi.string().regex(/^\/([^_]|_open\/)/),msg:"Mountpoints with _ are reserved for internal use"},{rule:Joi.string().regex(/[^\/]$/),msg:"May not end with /"},{rule:Joi.string().regex(/^\//),msg:"Has to start with /"},{rule:Joi.string().required().min(2),msg:"Has to be non-empty"}]}})},f=function(){window.modalView.modalBindValidation({id:"repository",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/),msg:"No valid Github account and repository."}]}})},g=function(){window.modalView.modalBindValidation({id:"new-app-author",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-name",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z\-_][a-zA-Z0-9\-_]*$/),msg:"Can only contain a to z, A to Z, 0-9, '-' and '_'."}]}}),window.modalView.modalBindValidation({id:"new-app-description",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-license",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9 \.,;\-]+$/),msg:"Has to be non empty."}]}}),window.modalView.modalTestAll()},h=function(a){window.modalView.clearValidators();var b=$("#modalButton1");switch(this._upgrade||e(),a){case"newApp":b.html("Generate"),b.prop("disabled",!1),g();break;case"appstore":b.html("Install"),b.prop("disabled",!0);break;case"github":f(),b.html("Install"),b.prop("disabled",!1);break;case"zip":b.html("Install"),b.prop("disabled",!1)}b.prop("disabled")||window.modalView.modalTestAll()||b.prop("disabled",!0)},i=function(a){var b=$(a.currentTarget).attr("href").substr(1);h.call(this,b)},j=function(a){if(h.call(this,"appstore"),window.modalView.modalTestAll()){var b,c;this._upgrade?(b=this.mount,c=$("#new-app-teardown").prop("checked")):b=window.arangoHelper.escapeHtml($("#new-app-mount").val());var e=$(a.currentTarget).attr("appId"),f=$(a.currentTarget).attr("appVersion");void 0!==c?this.collection.installFromStore({name:e,version:f},b,d.bind(this),c):this.collection.installFromStore({name:e,version:f},b,d.bind(this))}},k=function(a,b){if(void 0===b?b=this._uploadData:this._uploadData=b,b&&window.modalView.modalTestAll()){var c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),void 0!==e?this.collection.installFromZip(b.filename,c,d.bind(this),e):this.collection.installFromZip(b.filename,c,d.bind(this))}},l=function(){if(window.modalView.modalTestAll()){var a,b,c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),a=window.arangoHelper.escapeHtml($("#repository").val()),b=window.arangoHelper.escapeHtml($("#tag").val()),""===b&&(b="master");var f={url:window.arangoHelper.escapeHtml($("#repository").val()),version:window.arangoHelper.escapeHtml($("#tag").val())};try{Joi.assert(a,Joi.string().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/))}catch(g){return}void 0!==e?this.collection.installFromGithub(f,c,d.bind(this),e):this.collection.installFromGithub(f,c,d.bind(this))}},m=function(){if(window.modalView.modalTestAll()){var a,b;this._upgrade?(a=this.mount,b=$("#new-app-teardown").prop("checked")):a=window.arangoHelper.escapeHtml($("#new-app-mount").val());var c={name:window.arangoHelper.escapeHtml($("#new-app-name").val()),collectionNames:_.map($("#new-app-collections").select2("data"),function(a){return window.arangoHelper.escapeHtml(a.text)}),author:window.arangoHelper.escapeHtml($("#new-app-author").val()),license:window.arangoHelper.escapeHtml($("#new-app-license").val()),description:window.arangoHelper.escapeHtml($("#new-app-description").val())};void 0!==b?this.collection.generate(c,a,d.bind(this),b):this.collection.generate(c,a,d.bind(this))}},n=function(){var a=$(".modal-body .tab-pane.active").attr("id");switch(a){case"newApp":m.apply(this);break;case"github":l.apply(this);break;case"zip":k.apply(this)}},o=function(a,c){var d=[],e={"click #infoTab a":i.bind(a),"click .install-app":j.bind(a)};d.push(window.modalView.createSuccessButton("Generate",n.bind(a))),window.modalView.show("modalApplicationMount.ejs","Install Service",d,c,void 0,void 0,e),$("#new-app-collections").select2({tags:[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px"});var f=function(){var a=$("#modalButton1");a.prop("disabled")||window.modalView.modalTestAll()?a.prop("disabled",!1):a.prop("disabled",!0)};$(".select2-search-field input").focusout(function(){f(),window.setTimeout(function(){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||($("#s2id_new-app-collections").select2("close"),f()))},80)}),$(".select2-search-field input").focusin(function(){if($(".select2-drop").is(":visible")){var a=$("#modalButton1");a.prop("disabled",!0)}}),$("#upload-foxx-zip").uploadFile({url:"/_api/upload?multipart=true",allowedTypes:"zip",multiple:!1,onSuccess:k.bind(a)}),$.get("foxxes/fishbowl",function(a){var c=$("#appstore-content");c.html(""),_.each(_.sortBy(a,"name"),function(a){c.append(b.render(a))})}).fail(function(){var a=$("#appstore-content");a.append("
Store is not available. ArangoDB is not able to connect to github.com
")})};c.prototype.install=function(a){this.reload=a,this._upgrade=!1,this._uploadData=void 0,delete this.mount,o(this,!1),window.modalView.clearValidators(),e(),g()},c.prototype.upgrade=function(a,b){this.reload=b,this._upgrade=!0,this._uploadData=void 0,this.mount=a,o(this,!0),window.modalView.clearValidators(),g()},window.FoxxInstallView=c}(),function(){"use strict";window.GraphManagementView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("graphManagementView.ejs"),edgeDefintionTemplate:templateEngine.createTemplate("edgeDefinitionTable.ejs"),eCollList:[],removedECollList:[],dropdownVisible:!1,events:{"click #deleteGraph":"deleteGraph","click .icon_arangodb_settings2.editGraph":"editGraph","click #createGraph":"addNewGraph","keyup #graphManagementSearchInput":"search","click #graphManagementSearchSubmit":"search","click .tile-graph":"redirectToGraphViewer","click #graphManagementToggle":"toggleGraphDropdown","click .css-label":"checkBoxes","change #graphSortDesc":"sorting"},toggleTab:function(a){var b=a.currentTarget.id;b=b.replace("tab-",""),$("#tab-content-create-graph .tab-pane").removeClass("active"),$("#tab-content-create-graph #"+b).addClass("active"),"exampleGraphs"===b?$("#modal-dialog .modal-footer button").css("display","none"):$("#modal-dialog .modal-footer button").css("display","block")},redirectToGraphViewer:function(a){var b=$(a.currentTarget).attr("id");b=b.substr(0,b.length-5),window.location=window.location+"/"+encodeURIComponent(b)},loadGraphViewer:function(a){var b=this.collection.get(a).get("edgeDefinitions");if(b&&0!==b.length){var c={type:"gharial",graphName:a,baseUrl:require("internal").arango.databasePrefix("/")},d=$("#content").width()-75;$("#content").html("");var e=arangoHelper.calculateCenterDivHeight();this.ui=new GraphViewerUI($("#content")[0],c,d,e,{nodeShaper:{label:"_key",color:{type:"attribute",key:"_key"}}},!0),$(".contentDiv").height(e)}},handleResize:function(a){this.width&&this.width===a||(this.width=a,this.ui&&this.ui.changeWidth(a))},addNewGraph:function(a){a.preventDefault(),this.createEditGraphModal()},deleteGraph:function(){var a=this,b=$("#editGraphName")[0].value;if($("#dropGraphCollections").is(":checked")){var c=function(c){c?(a.collection.remove(a.collection.get(b)),a.updateGraphManagementView(),window.modalView.hide()):window.modalView.hide()};this.collection.dropAndDeleteGraph(b,c)}else this.collection.get(b).destroy({success:function(){a.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;arangoHelper.arangoError(d),window.modalView.hide()}})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},toggleGraphDropdown:function(){$("#graphSortDesc").attr("checked",this.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown2").slideToggle(200)},sorting:function(){$("#graphSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#graphManagementDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},createExampleGraphs:function(a){var b=$(a.currentTarget).attr("graph-id"),c=this;$.ajax({type:"POST",url:"/_admin/aardvark/graph-examples/create/"+encodeURIComponent(b),success:function(){window.modalView.hide(),c.updateGraphManagementView(),arangoHelper.arangoNotification("Example Graphs","Graph: "+b+" created.")},error:function(a){if(window.modalView.hide(),console.log(a),a.responseText)try{var c=JSON.parse(a.responseText);arangoHelper.arangoError("Example Graphs",c.errorMessage)}catch(d){arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}else arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}})},render:function(){return this.collection.fetch({async:!1}),this.collection.sort(),$(this.el).html(this.template.render({graphs:this.collection,searchString:""})),this.dropdownVisible===!0&&($("#graphManagementDropdown2").show(),$("#graphSortDesc").attr("checked",this.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown").show()),this.events["click .tableRow"]=this.showHideDefinition.bind(this),this.events['change tr[id*="newEdgeDefinitions"]']=this.setFromAndTo.bind(this),this.events["click .graphViewer-icon-button"]=this.addRemoveDefinition.bind(this),this.events["click #graphTab a"]=this.toggleTab.bind(this),this.events["click .createExampleGraphs"]=this.createExampleGraphs.bind(this),arangoHelper.setCheckboxStatus("#graphManagementDropdown"),this},setFromAndTo:function(a){a.stopPropagation();var b,c=this.calculateEdgeDefinitionMap();if(a.added){if(-1===this.eCollList.indexOf(a.added.id)&&-1!==this.removedECollList.indexOf(a.added.id))return b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$('input[id*="newEdgeDefinitions'+b+'"]').select2("val",null),void $('input[id*="newEdgeDefinitions'+b+'"]').attr("placeholder","The collection "+a.added.id+" is already used.");this.removedECollList.push(a.added.id),this.eCollList.splice(this.eCollList.indexOf(a.added.id),1)}else this.eCollList.push(a.removed.id),this.removedECollList.splice(this.removedECollList.indexOf(a.removed.id),1);c[a.val]?(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",c[a.val].from),$("#fromCollections"+b).attr("disabled",!0),$("#s2id_toCollections"+b).select2("val",c[a.val].to),$("#toCollections"+b).attr("disabled",!0)):(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",null),$("#fromCollections"+b).attr("disabled",!1),$("#s2id_toCollections"+b).select2("val",null),$("#toCollections"+b).attr("disabled",!1))},editGraph:function(a){a.stopPropagation(),this.collection.fetch(),this.graphToEdit=this.evaluateGraphName($(a.currentTarget).attr("id"),"_settings");var b=this.collection.findWhere({_key:this.graphToEdit});this.createEditGraphModal(b)},saveEditedGraph:function(){var a,b,c,d,e,f=$("#editGraphName")[0].value,g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i={};if(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){if(d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),0!==b.length&&0!==c.length)){var f={collection:a,from:b,to:c};h.push(f),i[a]=f}}),0===h.length)return void $("#s2id_newEdgeDefinitions0 .select2-choices").css("border-color","red");var j=this.collection.findWhere({_key:f}),k=j.get("edgeDefinitions"),l=j.get("orphanCollections"),m=[];l.forEach(function(a){-1===g.indexOf(a)&&j.deleteVertexCollection(a)}),g.forEach(function(a){-1===l.indexOf(a)&&j.addVertexCollection(a)});var n=[],o=[],p=[];k.forEach(function(a){var b=a.collection;m.push(b);var c=i[b];void 0===c?p.push(b):JSON.stringify(c)!==JSON.stringify(a)&&o.push(b)}),h.forEach(function(a){var b=a.collection;-1===m.indexOf(b)&&n.push(b)}),n.forEach(function(a){j.addEdgeDefinition(i[a])}),o.forEach(function(a){j.modifyEdgeDefinition(i[a])}),p.forEach(function(a){j.deleteEdgeDefinition(a)}),this.updateGraphManagementView(),window.modalView.hide()},evaluateGraphName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},search:function(){var a,b,c,d;a=$("#graphManagementSearchInput"),b=$("#graphManagementSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("_key").indexOf(b)}),$(this.el).html(this.template.render({graphs:d,searchString:b})),a=$("#graphManagementSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},updateGraphManagementView:function(){
-var a=this;this.collection.fetch({success:function(){a.render()}})},createNewGraph:function(){var a,b,c,d,e,f=$("#createNewGraphName").val(),g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i=this;return f?this.collection.findWhere({_key:f})?(arangoHelper.arangoError("The graph '"+f+"' already exists."),0):(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),1!==b&&1!==c&&h.push({collection:a,from:b,to:c}))}),void this.collection.create({name:f,edgeDefinitions:h,orphanCollections:g},{success:function(){i.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;d=d.replace("<",""),d=d.replace(">",""),arangoHelper.arangoError(d)}})):(arangoHelper.arangoError("A name for the graph has to be provided."),0)},createEditGraphModal:function(a){var b,c=[],d=[],e=[],f=this.options.collectionCollection.models,g=this,h="",i=[{collection:"",from:"",to:""}],j="",k=function(a,b){return a=a.toLowerCase(),b=b.toLowerCase(),b>a?-1:a>b?1:0};if(this.eCollList=[],this.removedECollList=[],f.forEach(function(a){a.get("isSystem")||("edge"===a.get("type")?g.eCollList.push(a.id):d.push(a.id))}),window.modalView.enableHotKeys=!1,this.counter=0,a?(b="Edit Graph",h=a.get("_key"),i=a.get("edgeDefinitions"),i&&0!==i.length||(i=[{collection:"",from:"",to:""}]),j=a.get("orphanCollections"),e.push(window.modalView.createReadOnlyEntry("editGraphName","Name",h,"The name to identify the graph. Has to be unique")),c.push(window.modalView.createDeleteButton("Delete",this.deleteGraph.bind(this))),c.push(window.modalView.createSuccessButton("Save",this.saveEditedGraph.bind(this)))):(b="Create Graph",e.push(window.modalView.createTextEntry("createNewGraphName","Name","","The name to identify the graph. Has to be unique.","graphName",!0)),c.push(window.modalView.createSuccessButton("Create",this.createNewGraph.bind(this)))),i.forEach(function(a){0===g.counter?(a.collection&&(g.removedECollList.push(a.collection),g.eCollList.splice(g.eCollList.indexOf(a.collection),1)),e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!0,!1,!0,1,g.eCollList.sort(k)))):e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!1,!0,!1,1,g.eCollList.sort(k))),e.push(window.modalView.createSelect2Entry("fromCollections"+g.counter,"fromCollections",a.from,"The collections that contain the start vertices of the relation.","fromCollections",!0,!1,!1,10,d.sort(k))),e.push(window.modalView.createSelect2Entry("toCollections"+g.counter,"toCollections",a.to,"The collections that contain the end vertices of the relation.","toCollections",!0,!1,!1,10,d.sort(k))),g.counter++}),e.push(window.modalView.createSelect2Entry("newVertexCollections","Vertex collections",j,"Collections that are part of a graph but not used in an edge definition","Vertex Collections",!1,!1,!1,10,d.sort(k))),window.modalView.show("modalGraphTable.ejs",b,c,e,void 0,void 0,this.events),a){$(".modal-body table").css("border-collapse","separate");var l;for($(".modal-body .spacer").remove(),l=0;l<=this.counter;l++)$("#row_fromCollections"+l).show(),$("#row_toCollections"+l).show(),$("#row_newEdgeDefinitions"+l).addClass("first"),$("#row_fromCollections"+l).addClass("middle"),$("#row_toCollections"+l).addClass("last"),$("#row_toCollections"+l).after('
The script failed with an error"+(a.statusCode?" (HTTP "+a.statusCode+")":"")+":
"+a.message+"
":c?"
Script results:
"+JSON.stringify(c,null,2)+"
":"
The script ran successfully.
",window.modalView.show("modalTable.ejs",'Result of script "'+b+'"',void 0,void 0,void 0,d)})}.bind(this))];window.modalView.show("modalTable.ejs",'Run script "'+b+'" on "'+this.model.get("mount")+'"',d,c)},showSwagger:function(a){a.preventDefault(),this.render("swagger")},showReadme:function(a){a.preventDefault(),this.render("readme")},runTests:function(a){a.preventDefault();var b="
WARNING: Running tests may result in destructive side-effects including data loss. Please make sure not to run tests on a production database.
";this.model.isDevelopment()&&(b+="
WARNING: This app is running in development mode. If any of the tests access the app's HTTP API they may become non-deterministic.
");var c=[window.modalView.createSuccessButton("Run tests",function(){window.modalView.hide(),this.model.runTests({reporter:"suite"},function(a,b){window.modalView.show("modalTestResults.ejs","Test results",void 0,void 0,void 0,a||b)})}.bind(this))];window.modalView.show("modalTable.ejs",'Run tests for app "'+this.model.get("mount")+'"',c,void 0,void 0,b)},render:function(a){var b=this;return $(this.el).html(this.template.render({app:this.model,db:arangoHelper.currentDatabase(),mode:a})),$.get(this.appUrl()).success(function(){$(".open",this.el).prop("disabled",!1)}.bind(this)),this.updateConfig(),this.updateDeps(),"swagger"===a&&$.get("./foxxes/docs/swagger.json?mount="+encodeURIComponent(this.model.get("mount")),function(a){Object.keys(a.paths).length<1&&(b.render("readme"),$("#app-show-swagger").attr("disabled","true"))}),$(this.el)},openApp:function(){window.open(this.appUrl(),this.model.get("title")).focus()},deleteApp:function(){var a=[window.modalView.createDeleteButton("Delete",function(){var a={teardown:$("#app_delete_run_teardown").is(":checked")};this.model.destroy(a,function(a,b){a||b.error!==!1||(window.modalView.hide(),window.App.navigate("applications",{trigger:!0}))})}.bind(this))],b=[window.modalView.createCheckboxEntry("app_delete_run_teardown","Run teardown?",!0,"Should this app's teardown script be executed before removing the app?",!0)];window.modalView.show("modalTable.ejs",'Delete Foxx App mounted at "'+this.model.get("mount")+'"',a,b,void 0,"
Are you sure? There is no way back...
",!0)},appUrl:function(){return window.location.origin+"/_db/"+encodeURIComponent(arangoHelper.currentDatabase())+this.model.get("mount")},applyConfig:function(){var a={};_.each(this.model.get("config"),function(b,c){var d=$("#app_config_"+c),e=d.val();if("boolean"===b.type||"bool"===b.type)return void(a[c]=d.is(":checked"));if(""===e&&b.hasOwnProperty("default"))return a[c]=b["default"],void("json"===b.type&&(a[c]=JSON.stringify(b["default"])));if("number"===b.type)a[c]=parseFloat(e);else if("integer"===b.type||"int"===b.type)a[c]=parseInt(e,10);else{if("json"!==b.type)return void(a[c]=window.arangoHelper.escapeHtml(e));a[c]=e&&JSON.stringify(JSON.parse(e))}}),this.model.setConfiguration(a,function(){window.modalView.hide(),this.updateConfig()}.bind(this))},showConfigDialog:function(){if(!_.isEmpty(this.model.get("config"))){var a=_.map(this.model.get("config"),function(a,b){var c=void 0===a["default"]?"":String(a["default"]),d=void 0===a.current?"":String(a.current),e="createTextEntry",f=!1,g=[];return"boolean"===a.type||"bool"===a.type?(e="createCheckboxEntry",a["default"]=a["default"]||!1,c=a["default"]||!1,d=a.current||!1):"json"===a.type?(e="createBlobEntry",c=void 0===a["default"]?"":JSON.stringify(a["default"]),d=void 0===a.current?"":a.current,g.push({rule:function(a){return a&&JSON.parse(a)},msg:"Must be well-formed JSON or empty."})):"integer"===a.type||"int"===a.type?g.push({rule:Joi.number().integer().optional().allow(""),msg:"Has to be an integer."}):"number"===a.type?g.push({rule:Joi.number().optional().allow(""),msg:"Has to be a number."}):("password"===a.type&&(e="createPasswordEntry"),g.push({rule:Joi.string().optional().allow(""),msg:"Has to be a string."})),void 0===a["default"]&&a.required!==!1&&(f=!0,g.unshift({rule:Joi.any().required(),msg:"This field is required."})),window.modalView[e]("app_config_"+b,b,d,a.description,c,f,g)}),b=[window.modalView.createSuccessButton("Apply",this.applyConfig.bind(this))];window.modalView.show("modalTable.ejs","Configuration",b,a)}},applyDeps:function(){var a={};_.each(this.model.get("deps"),function(b,c){var d=$("#app_deps_"+c);a[c]=window.arangoHelper.escapeHtml(d.val())}),this.model.setDependencies(a,function(){window.modalView.hide(),this.updateDeps()}.bind(this))},showDepsDialog:function(){if(!_.isEmpty(this.model.get("deps"))){var a=_.map(this.model.get("deps"),function(a,b){var c=void 0===a.current?"":String(a.current),d="",e=a.definition.name;"*"!==a.definition.version&&(e+="@"+a.definition.version);var f=[{rule:Joi.string().optional().allow(""),msg:"Has to be a string."}];return a.definition.required&&f.push({rule:Joi.string().required(),msg:"This value is required."}),window.modalView.createTextEntry("app_deps_"+b,a.title,c,e,d,a.definition.required,f)}),b=[window.modalView.createSuccessButton("Apply",this.applyDeps.bind(this))];window.modalView.show("modalTable.ejs","Dependencies",b,a)}},showDropdown:function(){_.isEmpty(this.model.get("scripts"))||$("#scripts_dropdown").show(200)},hideDropdown:function(){$("#scripts_dropdown").hide()}})}(),function(){"use strict";window.ApplicationsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("applicationsView.ejs"),events:{"click #addApp":"createInstallModal","click #foxxToggle":"slideToggle","click #checkDevel":"toggleDevel","click #checkProduction":"toggleProduction","click #checkSystem":"toggleSystem"},fixCheckboxes:function(){this._showDevel?$("#checkDevel").attr("checked","checked"):$("#checkDevel").removeAttr("checked"),this._showSystem?$("#checkSystem").attr("checked","checked"):$("#checkSystem").removeAttr("checked"),this._showProd?$("#checkProduction").attr("checked","checked"):$("#checkProduction").removeAttr("checked"),$("#checkDevel").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),$("#checkSystem").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),$("#checkProduction").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),arangoHelper.setCheckboxStatus("#foxxDropdown")},toggleDevel:function(){var a=this;this._showDevel=!this._showDevel,_.each(this._installedSubViews,function(b){b.toggle("devel",a._showDevel)}),this.fixCheckboxes()},toggleProduction:function(){var a=this;this._showProd=!this._showProd,_.each(this._installedSubViews,function(b){b.toggle("production",a._showProd)}),this.fixCheckboxes()},toggleSystem:function(){this._showSystem=!this._showSystem;var a=this;_.each(this._installedSubViews,function(b){b.toggle("system",a._showSystem)}),this.fixCheckboxes()},reload:function(){var a=this;_.each(this._installedSubViews,function(a){a.undelegateEvents()}),this.collection.fetch({success:function(){a.createSubViews(),a.render()}})},createSubViews:function(){var a=this;this._installedSubViews={},a.collection.each(function(b){var c=new window.FoxxActiveView({model:b,appsView:a});a._installedSubViews[b.get("mount")]=c})},initialize:function(){this._installedSubViews={},this._showDevel=!0,this._showProd=!0,this._showSystem=!1,this.reload()},slideToggle:function(){$("#foxxToggle").toggleClass("activated"),$("#foxxDropdownOut").slideToggle(200)},createInstallModal:function(a){a.preventDefault(),window.foxxInstallView.install(this.reload.bind(this))},render:function(){this.collection.sort(),$(this.el).html(this.template.render({})),_.each(this._installedSubViews,function(a){$("#installedList").append(a.render())}),this.delegateEvents(),$("#checkDevel").attr("checked",this._showDevel),$("#checkProduction").attr("checked",this._showProd),$("#checkSystem").attr("checked",this._showSystem),arangoHelper.setCheckboxStatus("#foxxDropdown");var a=this;return _.each(this._installedSubViews,function(b){b.toggle("devel",a._showDevel),b.toggle("system",a._showSystem)}),arangoHelper.fixTooltips("icon_arangodb","left"),this}})}(),function(){"use strict";window.CollectionListItemView=Backbone.View.extend({tagName:"div",className:"tile",template:templateEngine.createTemplate("collectionsItemView.ejs"),initialize:function(){this.collectionsView=this.options.collectionsView},events:{"click .iconSet.icon_arangodb_settings2":"createEditPropertiesModal","click .pull-left":"noop","click .icon_arangodb_settings2":"editProperties","click .spanInfo":"showProperties",click:"selectCollection"},render:function(){return this.model.get("locked")&&$(this.el).addClass("locked"),$(this.el).html(this.template.render({model:this.model})),$(this.el).attr("id","collection_"+this.model.get("name")),this},editProperties:function(a){return this.model.get("locked")?0:(a.stopPropagation(),void this.createEditPropertiesModal())},showProperties:function(a){return this.model.get("locked")?0:(a.stopPropagation(),void this.createInfoModal())},selectCollection:function(a){return $(a.target).hasClass("disabled")?0:this.model.get("locked")?0:void window.App.navigate("collection/"+encodeURIComponent(this.model.get("name"))+"/documents/1",{trigger:!0})},noop:function(a){a.stopPropagation()},unloadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be unloaded."):void 0===a?(this.model.set("status","unloading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","unloaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" unloaded.")}.bind(this);this.model.unloadCollection(a),window.modalView.hide()},loadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be loaded."):void 0===a?(this.model.set("status","loading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","loaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" loaded.")}.bind(this);this.model.loadCollection(a),window.modalView.hide()},truncateCollection:function(){this.model.truncateCollection(),this.render(),window.modalView.hide()},deleteCollection:function(){this.model.destroy({error:function(){arangoHelper.arangoError("Could not delete collection.")},success:function(){window.modalView.hide()}}),this.collectionsView.render()},saveModifiedCollection:function(){var a;a=window.isCoordinator()?this.model.get("name"):$("#change-collection-name").val();var b=this.model.get("status");if("loaded"===b){var c;try{c=JSON.parse(1024*$("#change-collection-size").val()*1024)}catch(d){return arangoHelper.arangoError("Please enter a valid number"),0}var e;try{if(e=JSON.parse($("#change-index-buckets").val()),1>e||parseInt(e)!==Math.pow(2,Math.log2(e)))throw"invalid indexBuckets value"}catch(d){return arangoHelper.arangoError("Please enter a valid number of index buckets"),0}var f;if(this.model.get("name")!==a&&(f=this.model.renameCollection(a)),f!==!0&&void 0!==f)return arangoHelper.arangoError("Collection error: "+f),0;var g=$("#change-collection-sync").val(),h=this.model.changeCollection(g,c,e);if(h!==!0)return arangoHelper.arangoNotification("Collection error",h),0;this.collectionsView.render(),window.modalView.hide()}else if("unloaded"===b)if(this.model.get("name")!==a){var i=this.model.renameCollection(a);i===!0?(this.collectionsView.render(),window.modalView.hide()):arangoHelper.arangoError("Collection error: "+i)}else window.modalView.hide()},createEditPropertiesModal:function(){var a=!1;"loaded"===this.model.get("status")&&(a=!0);var b=[],c=[];if(window.isCoordinator()||c.push(window.modalView.createTextEntry("change-collection-name","Name",this.model.get("name"),!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}])),a){var d=this.model.getProperties().journalSize;d/=1048576,c.push(window.modalView.createTextEntry("change-collection-size","Journal size",d,"The maximal size of a journal or datafile (in MB). Must be at least 1.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}]));var e=this.model.getProperties().indexBuckets;c.push(window.modalView.createTextEntry("change-index-buckets","Index buckets",e,"The number of index buckets for this collection. Must be at least 1 and a power of 2.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[1-9][0-9]*$/),msg:"Must be a number greater than 1 and a power of 2."}]));var f=this.model.getProperties().waitForSync;c.push(window.modalView.createSelectEntry("change-collection-sync","Wait for sync",f,"Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}]))}c.push(window.modalView.createReadOnlyEntry("change-collection-id","ID",this.model.get("id"),"")),c.push(window.modalView.createReadOnlyEntry("change-collection-type","Type",this.model.get("type"),"")),c.push(window.modalView.createReadOnlyEntry("change-collection-status","Status",this.model.get("status"),"")),b.push(window.modalView.createDeleteButton("Delete",this.deleteCollection.bind(this))),b.push(window.modalView.createDeleteButton("Truncate",this.truncateCollection.bind(this))),a?b.push(window.modalView.createNotificationButton("Unload",this.unloadCollection.bind(this))):b.push(window.modalView.createNotificationButton("Load",this.loadCollection.bind(this))),b.push(window.modalView.createSuccessButton("Save",this.saveModifiedCollection.bind(this)));var g=["General","Indices"],h=["modalTable.ejs","indicesView.ejs"];window.modalView.show(h,"Modify Collection",b,c,null,null,this.events,null,g),"loaded"===this.model.get("status")?this.getIndex():$($("#infoTab").children()[1]).remove(),this.bindIndexEvents()},bindIndexEvents:function(){this.unbindIndexEvents();var a=this;$("#indexEditView #addIndex").bind("click",function(){a.toggleNewIndexView(),$("#cancelIndex").unbind("click"),$("#cancelIndex").bind("click",function(){a.toggleNewIndexView()}),$("#createIndex").unbind("click"),$("#createIndex").bind("click",function(){a.createIndex()})}),$("#newIndexType").bind("change",function(){a.selectIndexType()}),$(".deleteIndex").bind("click",function(b){a.prepDeleteIndex(b)}),$("#infoTab a").bind("click",function(a){if($("#indexDeleteModal").remove(),"Indices"!==$(a.currentTarget).html()||$(a.currentTarget).parent().hasClass("active")||($("#newIndexView").hide(),$("#indexEditView").show(),$("#modal-dialog .modal-footer .button-danger").hide(),$("#modal-dialog .modal-footer .button-success").hide(),$("#modal-dialog .modal-footer .button-notification").hide(),$("#addIndex").detach().appendTo("#modal-dialog .modal-footer")),"General"===$(a.currentTarget).html()&&!$(a.currentTarget).parent().hasClass("active")){$("#modal-dialog .modal-footer .button-danger").show(),$("#modal-dialog .modal-footer .button-success").show(),$("#modal-dialog .modal-footer .button-notification").show();var b=$(".index-button-bar")[0],c=$(".index-button-bar2")[0];$("#addIndex").detach().appendTo(b),$("#cancelIndex").is(":visible")&&($("#cancelIndex").detach().appendTo(c),$("#createIndex").detach().appendTo(c))}})},unbindIndexEvents:function(){$("#indexEditView #addIndex").unbind("click"),$("#newIndexType").unbind("change"),$("#infoTab a").unbind("click"),$(".deleteIndex").unbind("click")},createInfoModal:function(){var a=[],b=this.model;window.modalView.show("modalCollectionInfo.ejs","Collection: "+this.model.get("name"),a,b)},resetIndexForms:function(){$("#indexHeader input").val("").prop("checked",!1),$("#newIndexType").val("Cap").prop("selected",!0),this.selectIndexType()},createIndex:function(){var a,b,c,d=this,e=$("#newIndexType").val(),f={};switch(e){case"Cap":var g=parseInt($("#newCapSize").val(),10)||0,h=parseInt($("#newCapByteSize").val(),10)||0;f={type:"cap",size:g,byteSize:h};break;case"Geo":a=$("#newGeoFields").val();var i=d.checkboxToValue("#newGeoJson"),j=d.checkboxToValue("#newGeoConstraint"),k=d.checkboxToValue("#newGeoIgnoreNull");f={type:"geo",fields:d.stringToArray(a),geoJson:i,constraint:j,ignoreNull:k};break;case"Hash":a=$("#newHashFields").val(),b=d.checkboxToValue("#newHashUnique"),c=d.checkboxToValue("#newHashSparse"),f={type:"hash",fields:d.stringToArray(a),unique:b,sparse:c};break;case"Fulltext":a=$("#newFulltextFields").val();var l=parseInt($("#newFulltextMinLength").val(),10)||0;f={type:"fulltext",fields:d.stringToArray(a),minLength:l};break;case"Skiplist":a=$("#newSkiplistFields").val(),b=d.checkboxToValue("#newSkiplistUnique"),c=d.checkboxToValue("#newSkiplistSparse"),f={type:"skiplist",fields:d.stringToArray(a),unique:b,sparse:c}}var m=function(a,b){if(a)if(b){var c=JSON.parse(b.responseText);arangoHelper.arangoError("Document error",c.errorMessage)}else arangoHelper.arangoError("Document error","Could not create index.")};window.modalView.hide(),d.model.createIndex(f,m),window.App.arangoCollectionsStore.fetch({success:function(){d.collectionsView.render()}})},lastTarget:null,prepDeleteIndex:function(a){var b=this;this.lastTarget=a,this.lastId=$(this.lastTarget.currentTarget).parent().parent().first().children().first().text(),$("#modal-dialog .modal-footer").after('
")})}},toggleNewIndexView:function(){var a=$(".index-button-bar2")[0],b=$(".index-button-bar")[0];$("#indexEditView").is(":visible")?($("#indexEditView").hide(),$("#newIndexView").show(),$("#addIndex").detach().appendTo(b),$("#cancelIndex").detach().appendTo("#modal-dialog .modal-footer"),$("#createIndex").detach().appendTo("#modal-dialog .modal-footer")):($("#indexEditView").show(),$("#newIndexView").hide(),$("#addIndex").detach().appendTo("#modal-dialog .modal-footer"),$("#cancelIndex").detach().appendTo(a),$("#createIndex").detach().appendTo(a)),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","right"),this.resetIndexForms()},stringToArray:function(a){var b=[];return a.split(",").forEach(function(a){a=a.replace(/(^\s+|\s+$)/g,""),""!==a&&b.push(a)}),b},checkboxToValue:function(a){return $(a).prop("checked")}})}(),function(){"use strict";window.CollectionsView=Backbone.View.extend({el:"#content",el2:"#collectionsThumbnailsIn",searchTimeout:null,refreshRate:2e3,template:templateEngine.createTemplate("collectionsView.ejs"),checkLockedCollections:function(){var a=this,b=window.arangoHelper.syncAndReturnUninishedAardvarkJobs("index");this.collection.each(function(a){a.set("locked",!1)}),_.each(b,function(b){var c=a.collection.findWhere({id:b.collection});c.set("locked",!0),c.set("lockType",b.type)}),this.collection.each(function(a){a.get("locked")?$("#collection_"+a.get("name")).addClass("locked"):$("#collection_"+a.get("name")).removeClass("locked")})},initialize:function(){var a=this;window.setInterval(function(){a.checkLockedCollections()},a.refreshRate)},render:function(){this.checkLockedCollections();var a=!1;$("#collectionsDropdown").is(":visible")&&(a=!0),$(this.el).html(this.template.render({})),this.setFilterValues(),a===!0&&$("#collectionsDropdown2").show();var b=this.collection.searchOptions;this.collection.getFiltered(b).forEach(function(a){$("#collectionsThumbnailsIn",this.el).append(new window.CollectionListItemView({model:a,collectionsView:this}).render().el)},this),"none"===$("#collectionsDropdown2").css("display")?$("#collectionsToggle").removeClass("activated"):$("#collectionsToggle").addClass("activated");var c;arangoHelper.setCheckboxStatus("#collectionsDropdown");try{c=b.searchPhrase.length}catch(d){}return $("#searchInput").val(b.searchPhrase),$("#searchInput").focus(),$("#searchInput")[0].setSelectionRange(c,c),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","left"),this},events:{"click #createCollection":"createCollection","keydown #searchInput":"restrictToSearchPhraseKey","change #searchInput":"restrictToSearchPhrase","click #searchSubmit":"restrictToSearchPhrase","click .checkSystemCollections":"checkSystem","click #checkLoaded":"checkLoaded","click #checkUnloaded":"checkUnloaded","click #checkDocument":"checkDocument","click #checkEdge":"checkEdge","click #sortName":"sortName","click #sortType":"sortType","click #sortOrder":"sortOrder","click #collectionsToggle":"toggleView",
+"click .css-label":"checkBoxes"},updateCollectionsView:function(){var a=this;this.collection.fetch({success:function(){a.render()}})},toggleView:function(){$("#collectionsToggle").toggleClass("activated"),$("#collectionsDropdown2").slideToggle(200)},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},checkSystem:function(){var a=this.collection.searchOptions,b=a.includeSystem;a.includeSystem=$(".checkSystemCollections").is(":checked")===!0,b!==a.includeSystem&&this.render()},checkEdge:function(){var a=this.collection.searchOptions,b=a.includeEdge;a.includeEdge=$("#checkEdge").is(":checked")===!0,b!==a.includeEdge&&this.render()},checkDocument:function(){var a=this.collection.searchOptions,b=a.includeDocument;a.includeDocument=$("#checkDocument").is(":checked")===!0,b!==a.includeDocument&&this.render()},checkLoaded:function(){var a=this.collection.searchOptions,b=a.includeLoaded;a.includeLoaded=$("#checkLoaded").is(":checked")===!0,b!==a.includeLoaded&&this.render()},checkUnloaded:function(){var a=this.collection.searchOptions,b=a.includeUnloaded;a.includeUnloaded=$("#checkUnloaded").is(":checked")===!0,b!==a.includeUnloaded&&this.render()},sortName:function(){var a=this.collection.searchOptions,b=a.sortBy;a.sortBy=$("#sortName").is(":checked")===!0?"name":"type",b!==a.sortBy&&this.render()},sortType:function(){var a=this.collection.searchOptions,b=a.sortBy;a.sortBy=$("#sortType").is(":checked")===!0?"type":"name",b!==a.sortBy&&this.render()},sortOrder:function(){var a=this.collection.searchOptions,b=a.sortOrder;a.sortOrder=$("#sortOrder").is(":checked")===!0?-1:1,b!==a.sortOrder&&this.render()},setFilterValues:function(){var a=this.collection.searchOptions;$("#checkLoaded").attr("checked",a.includeLoaded),$("#checkUnloaded").attr("checked",a.includeUnloaded),$(".checkSystemCollections").attr("checked",a.includeSystem),$("#checkEdge").attr("checked",a.includeEdge),$("#checkDocument").attr("checked",a.includeDocument),$("#sortName").attr("checked","type"!==a.sortBy),$("#sortType").attr("checked","type"===a.sortBy),$("#sortOrder").attr("checked",1!==a.sortOrder)},search:function(){var a=this.collection.searchOptions,b=$("#searchInput").val();b!==a.searchPhrase&&(a.searchPhrase=b,this.render())},resetSearch:function(){this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null);var a=this.collection.searchOptions;a.searchPhrase=null},restrictToSearchPhraseKey:function(){var a=this;this.resetSearch(),a.searchTimeout=setTimeout(function(){a.search()},200)},restrictToSearchPhrase:function(){this.resetSearch(),this.search()},createCollection:function(a){a.preventDefault(),this.createNewCollectionModal()},submitCreateCollection:function(){var a=$("#new-collection-name").val(),b=$("#new-collection-size").val(),c=$("#new-collection-type").val(),d=$("#new-collection-sync").val(),e=1,f=[];if(window.isCoordinator()){if(e=$("#new-collection-shards").val(),""===e&&(e=1),e=parseInt(e,10),1>e)return arangoHelper.arangoError("Number of shards has to be an integer value greater or equal 1"),0;f=_.pluck($("#new-collection-shardBy").select2("data"),"text"),0===f.length&&f.push("_key")}if("_"===a.substr(0,1))return arangoHelper.arangoError('No "_" allowed as first character!'),0;var g=!1,h="true"===d;if(b>0)try{b=1024*JSON.parse(b)*1024}catch(i){return arangoHelper.arangoError("Please enter a valid number"),0}if(""===a)return arangoHelper.arangoError("No collection name entered!"),0;var j=this.collection.newCollection(a,h,g,b,c,e,f);j.status!==!0&&arangoHelper.arangoError("Collection error",j.errorMessage),this.updateCollectionsView(),window.modalView.hide()},createNewCollectionModal:function(){var a=[],b=[],c={},d=[];b.push(window.modalView.createTextEntry("new-collection-name","Name","",!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only symbols, "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}])),b.push(window.modalView.createSelectEntry("new-collection-type","Type","","The type of the collection to create.",[{value:2,label:"Document"},{value:3,label:"Edge"}])),window.isCoordinator()&&(b.push(window.modalView.createTextEntry("new-collection-shards","Shards","","The number of shards to create. You cannot change this afterwards. Recommended: DBServers squared","",!0)),b.push(window.modalView.createSelect2Entry("new-collection-shardBy","shardBy","","The keys used to distribute documents on shards. Type the key and press return to add it.","_key",!1))),a.push(window.modalView.createSuccessButton("Save",this.submitCreateCollection.bind(this))),d.push(window.modalView.createTextEntry("new-collection-size","Journal size","","The maximal size of a journal or datafile (in MB). Must be at least 1.","",!1,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),d.push(window.modalView.createSelectEntry("new-collection-sync","Sync","","Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}])),c.header="Advanced",c.content=d,window.modalView.show("modalTable.ejs","New Collection",a,b,c)}})}(),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('
"))}})}(),function(){"use strict";window.databaseView=Backbone.View.extend({users:null,el:"#content",template:templateEngine.createTemplate("databaseView.ejs"),dropdownVisible:!1,currentDB:"",events:{"click #createDatabase":"createDatabase","click #submitCreateDatabase":"submitCreateDatabase","click .editDatabase":"editDatabase","click .icon":"editDatabase","click #selectDatabase":"updateDatabase","click #submitDeleteDatabase":"submitDeleteDatabase","click .contentRowInactive a":"changeDatabase","keyup #databaseSearchInput":"search","click #databaseSearchSubmit":"search","click #databaseToggle":"toggleSettingsDropdown","click .css-label":"checkBoxes","click #dbSortDesc":"sorting","click .tile":"switchDatabase"},sorting:function(){$("#dbSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#databaseDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},initialize:function(){this.collection.fetch({async:!1})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},render:function(){return this.currentDatabase(),this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:"",currentDB:this.currentDB})),this.dropdownVisible===!0&&($("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").show()),arangoHelper.setCheckboxStatus("#databaseDropdown"),this.replaceSVGs(),this},toggleSettingsDropdown:function(){$("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").slideToggle(200)},selectedDatabase:function(){return $("#selectDatabases").val()},handleError:function(a,b,c){return 409===a?void arangoHelper.arangoError("DB","Database "+c+" already exists."):400===a?void arangoHelper.arangoError("DB","Invalid Parameters"):403===a?void arangoHelper.arangoError("DB","Insufficent rights. Execute this from _system database"):void 0},validateDatabaseInfo:function(a,b,c){return""===b?(arangoHelper.arangoError("DB","You have to define an owner for the new database"),!1):""===a?(arangoHelper.arangoError("DB","You have to define a name for the new database"),!1):0===a.indexOf("_")?(arangoHelper.arangoError("DB ","Databasename should not start with _"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("DB","Databasename may only contain numbers, letters, _ and -"),!1)},createDatabase:function(a){a.preventDefault(),this.createAddDatabaseModal()},switchDatabase:function(a){if(!$(a.target).parent().hasClass("iconSet")){var b=$(a.currentTarget).find("h5").text();if(""!==b){var c=this.collection.createDatabaseURL(b);window.location.replace(c)}}},submitCreateDatabase:function(){var a,b=this,c=$("#newDatabaseName").val(),d=$("#newUser").val();if(a="true"===$("#useDefaultPassword").val()?"ARANGODB_DEFAULT_ROOT_PASSWORD":$("#newPassword").val(),this.validateDatabaseInfo(c,d,a)){var e={name:c,users:[{username:d,passwd:a,active:!0}]};this.collection.create(e,{wait:!0,error:function(a,d){b.handleError(d.status,d.statusText,c)},success:function(a){b.updateDatabases(),window.modalView.hide(),window.App.naviView.dbSelectionView.render($("#dbSelect"))}})}},submitDeleteDatabase:function(a){var b=this.collection.where({name:a});b[0].destroy({wait:!0,url:"/_api/database/"+a}),this.updateDatabases(),window.App.naviView.dbSelectionView.render($("#dbSelect")),window.modalView.hide()},currentDatabase:function(){this.currentDB=this.collection.getCurrentDatabase()},changeDatabase:function(a){var b=$(a.currentTarget).attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},updateDatabases:function(){var a=this;this.collection.fetch({success:function(){a.render(),window.App.handleSelectDatabase()}})},editDatabase:function(a){var b=this.evaluateDatabaseName($(a.currentTarget).attr("id"),"_edit-database"),c=!0;b===this.currentDB&&(c=!1),this.createEditDatabaseModal(b,c)},search:function(){var a,b,c,d;a=$("#databaseSearchInput"),b=$("#databaseSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("name").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b,currentDB:this.currentDB})),this.replaceSVGs(),a=$("#databaseSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},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","tile-icon-svg").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},evaluateDatabaseName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},createEditDatabaseModal:function(a,b){var c=[],d=[];d.push(window.modalView.createReadOnlyEntry("id_name","Name",a,"")),b?c.push(window.modalView.createDeleteButton("Delete",this.submitDeleteDatabase.bind(this,a))):c.push(window.modalView.createDisabledButton("Delete")),window.modalView.show("modalTable.ejs","Delete database",c,d)},createAddDatabaseModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newDatabaseName","Name","",!1,"Database Name",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Database name must start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No database name given."}])),b.push(window.modalView.createTextEntry("newUser","Username",null!==this.users?this.users.whoAmI():"root","Please define the owner of this database. This will be the only user having initial access to this database if authentication is turned on. Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it. Specifying a username is mandatory even with authentication turned off. If there is a failure you will be informed.","Database Owner",!0,[{rule:Joi.string().required(),msg:"No username given."}])),b.push(window.modalView.createSelectEntry("useDefaultPassword","Use default password",!0,"Read the password from the environment variable ARANGODB_DEFAULT_ROOT_PASSWORD.",[{value:!1,label:"No"},{value:!0,label:"Yes"}])),b.push(window.modalView.createPasswordEntry("newPassword","Password","",!1,"",!1)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateDatabase.bind(this))),window.modalView.show("modalTable.ejs","Create Database",a,b),$("#useDefaultPassword").change(function(){"true"===$("#useDefaultPassword").val()?$("#row_newPassword").hide():$("#row_newPassword").show()}),$("#row_newPassword").hide()}})}(),function(){"use strict";window.DBSelectionView=Backbone.View.extend({template:templateEngine.createTemplate("dbSelectionView.ejs"),events:{"click .dbSelectionLink":"changeDatabase"},initialize:function(a){this.current=a.current},changeDatabase:function(a){var b=$(a.currentTarget).closest(".dbSelectionLink.tab").attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},render:function(a){return this.$el=a,this.$el.html(this.template.render({list:this.collection.getDatabasesForUser(),current:this.current.get("name")})),this.delegateEvents(),this.el}})}(),function(){"use strict";var a=function(a){var b=a.split("/");return"collection/"+encodeURIComponent(b[0])+"/"+encodeURIComponent(b[1])};window.DocumentView=Backbone.View.extend({el:"#content",colid:0,docid:0,customView:!1,template:templateEngine.createTemplate("documentView.ejs"),events:{"click #saveDocumentButton":"saveDocument","click #deleteDocumentButton":"deleteDocumentModal","click #confirmDeleteDocument":"deleteDocument","click #document-from":"navigateToDocument","click #document-to":"navigateToDocument","keydown #documentEditor .ace_editor":"keyPress","keyup .jsoneditor .search input":"checkSearchBox"},checkSearchBox:function(a){""===$(a.currentTarget).val()&&this.editor.expandAll()},keyPress:function(a){a.ctrlKey&&13===a.keyCode?(a.preventDefault(),this.saveDocument()):a.metaKey&&13===a.keyCode&&(a.preventDefault(),this.saveDocument())},editor:0,setType:function(a){var b,c;return"edge"===a?(b=this.collection.getEdge(this.colid,this.docid),c="Edge: "):"document"===a&&(b=this.collection.getDocument(this.colid,this.docid),c="Document: "),b===!0?(this.type=a,this.fillInfo(c),this.fillEditor(),!0):void 0},deleteDocumentModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("doc-delete-button","Delete","Delete this "+this.type+"?",void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createDeleteButton("Delete",this.deleteDocument.bind(this))),window.modalView.show("modalTable.ejs","Delete Document",a,b)},deleteDocument:function(){var a;if("document"===this.type){if(a=this.collection.deleteDocument(this.colid,this.docid),a===!1)return void arangoHelper.arangoError("Document error:","Could not delete")}else if("edge"===this.type&&(a=this.collection.deleteEdge(this.colid,this.docid),a===!1))return void arangoHelper.arangoError("Edge error:","Could not delete");if(a===!0)if(this.customView)this.customDeleteFunction();else{var b="collection/"+encodeURIComponent(this.colid)+"/documents/1";window.modalView.hide(),window.App.navigate(b,{trigger:!0})}},navigateToDocument:function(a){var b=$(a.target).attr("documentLink");b&&window.App.navigate(b,{trigger:!0})},fillInfo:function(b){var c=this.collection.first(),d=c.get("_id"),e=c.get("_key"),f=c.get("_rev"),g=c.get("_from"),h=c.get("_to");if($("#document-type").text(b),$("#document-id").text(d),$("#document-key").text(e),$("#document-rev").text(f),g&&h){var i=a(g),j=a(h);$("#document-from").text(g),$("#document-from").attr("documentLink",i),$("#document-to").text(h),$("#document-to").attr("documentLink",j)}else $(".edge-info-container").hide()},fillEditor:function(){var a=this.removeReadonlyKeys(this.collection.first().attributes);this.editor.set(a),$(".ace_content").attr("font-size","11pt")},jsonContentChanged:function(){this.enableSaveButton()},render:function(){$(this.el).html(this.template.render({})),this.disableSaveButton(),this.breadcrumb();var a=this,b=document.getElementById("documentEditor"),c={change:function(){a.jsonContentChanged()},search:!0,mode:"tree",modes:["tree","code"],iconlib:"fontawesome4"};return this.editor=new JSONEditor(b,c),this},removeReadonlyKeys:function(a){return _.omit(a,["_key","_id","_from","_to","_rev"])},saveDocument:function(){var a,b;if(void 0===$("#saveDocumentButton").attr("disabled")){try{a=this.editor.get()}catch(c){return this.errorConfirmation(c),void this.disableSaveButton()}if(a=JSON.stringify(a),"document"===this.type){if(b=this.collection.saveDocument(this.colid,this.docid,a),b===!1)return void arangoHelper.arangoError("Document error:","Could not save")}else if("edge"===this.type&&(b=this.collection.saveEdge(this.colid,this.docid,a),b===!1))return void arangoHelper.arangoError("Edge error:","Could not save");b===!0&&(this.successConfirmation(),this.disableSaveButton())}},successConfirmation:function(){arangoHelper.arangoNotification("Document saved."),$("#documentEditor .tree").animate({backgroundColor:"#C6FFB0"},500),$("#documentEditor .tree").animate({backgroundColor:"#FFFFF"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#C6FFB0"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFFFF"},500)},errorConfirmation:function(a){arangoHelper.arangoError("Document editor: ",a),$("#documentEditor .tree").animate({backgroundColor:"#FFB0B0"},500),$("#documentEditor .tree").animate({backgroundColor:"#FFFFF"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFB0B0"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFFFF"},500)},enableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!1),$("#saveDocumentButton").addClass("button-success"),$("#saveDocumentButton").removeClass("button-close")},disableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!0),$("#saveDocumentButton").addClass("button-close"),$("#saveDocumentButton").removeClass("button-success")},breadcrumb:function(){var a=window.location.hash.split("/");$("#transparentHeader").append('
")}})}(),function(){"use strict";window.EditListEntryView=Backbone.View.extend({template:templateEngine.createTemplate("editListEntryView.ejs"),initialize:function(a){this.key=a.key,this.value=a.value,this.render()},events:{"click .deleteAttribute":"removeRow"},render:function(){$(this.el).html(this.template.render({key:this.key,value:JSON.stringify(this.value),isReadOnly:this.isReadOnly()}))},isReadOnly:function(){return 0===this.key.indexOf("_")},getKey:function(){return $(".key").val()},getValue:function(){var val=$(".val").val();try{val=JSON.parse(val)}catch(e){try{return eval("val = "+val),val}catch(e2){return $(".val").val()}}return val},removeRow:function(){this.remove()}})}(),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";window.FoxxActiveView=Backbone.View.extend({tagName:"div",className:"tile",template:templateEngine.createTemplate("foxxActiveView.ejs"),_show:!0,events:{click:"openAppDetailView"},openAppDetailView:function(){window.App.navigate("applications/"+encodeURIComponent(this.model.get("mount")),{trigger:!0})},toggle:function(a,b){switch(a){case"devel":this.model.isDevelopment()&&(this._show=b);break;case"production":this.model.isDevelopment()||this.model.isSystem()||(this._show=b);break;case"system":this.model.isSystem()&&(this._show=b)}this._show?$(this.el).show():$(this.el).hide()},render:function(){return $(this.el).html(this.template.render({model:this.model})),$(this.el)}})}(),function(){"use strict";var a=require("internal").errors,b=templateEngine.createTemplate("applicationListView.ejs"),c=function(a){this.collection=a.collection},d=function(b){if(b.error===!1)this.collection.fetch({async:!1}),window.modalView.hide(),this.reload();else{var c=b;switch(b.hasOwnProperty("responseJSON")&&(c=b.responseJSON),c.errorNum){case a.ERROR_APPLICATION_DOWNLOAD_FAILED.code:alert("Unable to download application from the given repository.");break;default:alert("Error: "+c.errorNum+". "+c.errorMessage)}}},e=function(){window.modalView.modalBindValidation({id:"new-app-mount",validateInput:function(){return[{rule:Joi.string().regex(/^(\/(APP[^\/]+|(?!APP)[a-zA-Z0-9_\-%]+))+$/i),msg:"May not contain /APP"},{rule:Joi.string().regex(/^(\/[a-zA-Z0-9_\-%]+)+$/),msg:"Can only contain [a-zA-Z0-9_-%]"},{rule:Joi.string().regex(/^\/([^_]|_open\/)/),msg:"Mountpoints with _ are reserved for internal use"},{rule:Joi.string().regex(/[^\/]$/),msg:"May not end with /"},{rule:Joi.string().regex(/^\//),msg:"Has to start with /"},{rule:Joi.string().required().min(2),msg:"Has to be non-empty"}]}})},f=function(){window.modalView.modalBindValidation({id:"repository",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/),msg:"No valid Github account and repository."}]}})},g=function(){window.modalView.modalBindValidation({id:"new-app-author",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-name",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z\-_][a-zA-Z0-9\-_]*$/),msg:"Can only contain a to z, A to Z, 0-9, '-' and '_'."}]}}),window.modalView.modalBindValidation({id:"new-app-description",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-license",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9 \.,;\-]+$/),msg:"Has to be non empty."}]}}),window.modalView.modalTestAll()},h=function(a){window.modalView.clearValidators();var b=$("#modalButton1");switch(this._upgrade||e(),a){case"newApp":b.html("Generate"),b.prop("disabled",!1),g();break;case"appstore":b.html("Install"),b.prop("disabled",!0);break;case"github":f(),b.html("Install"),b.prop("disabled",!1);break;case"zip":b.html("Install"),b.prop("disabled",!1)}b.prop("disabled")||window.modalView.modalTestAll()||b.prop("disabled",!0)},i=function(a){var b=$(a.currentTarget).attr("href").substr(1);h.call(this,b)},j=function(a){if(h.call(this,"appstore"),window.modalView.modalTestAll()){var b,c;this._upgrade?(b=this.mount,c=$("#new-app-teardown").prop("checked")):b=window.arangoHelper.escapeHtml($("#new-app-mount").val());var e=$(a.currentTarget).attr("appId"),f=$(a.currentTarget).attr("appVersion");void 0!==c?this.collection.installFromStore({name:e,version:f},b,d.bind(this),c):this.collection.installFromStore({name:e,version:f},b,d.bind(this))}},k=function(a,b){if(void 0===b?b=this._uploadData:this._uploadData=b,b&&window.modalView.modalTestAll()){var c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),void 0!==e?this.collection.installFromZip(b.filename,c,d.bind(this),e):this.collection.installFromZip(b.filename,c,d.bind(this))}},l=function(){if(window.modalView.modalTestAll()){var a,b,c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),a=window.arangoHelper.escapeHtml($("#repository").val()),b=window.arangoHelper.escapeHtml($("#tag").val()),""===b&&(b="master");var f={url:window.arangoHelper.escapeHtml($("#repository").val()),version:window.arangoHelper.escapeHtml($("#tag").val())};try{Joi.assert(a,Joi.string().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/))}catch(g){return}void 0!==e?this.collection.installFromGithub(f,c,d.bind(this),e):this.collection.installFromGithub(f,c,d.bind(this))}},m=function(){if(window.modalView.modalTestAll()){var a,b;this._upgrade?(a=this.mount,b=$("#new-app-teardown").prop("checked")):a=window.arangoHelper.escapeHtml($("#new-app-mount").val());var c={name:window.arangoHelper.escapeHtml($("#new-app-name").val()),collectionNames:_.map($("#new-app-collections").select2("data"),function(a){return window.arangoHelper.escapeHtml(a.text)}),author:window.arangoHelper.escapeHtml($("#new-app-author").val()),license:window.arangoHelper.escapeHtml($("#new-app-license").val()),description:window.arangoHelper.escapeHtml($("#new-app-description").val())};void 0!==b?this.collection.generate(c,a,d.bind(this),b):this.collection.generate(c,a,d.bind(this))}},n=function(){var a=$(".modal-body .tab-pane.active").attr("id");switch(a){case"newApp":m.apply(this);break;case"github":l.apply(this);break;case"zip":k.apply(this)}},o=function(a,c){var d=[],e={"click #infoTab a":i.bind(a),"click .install-app":j.bind(a)};d.push(window.modalView.createSuccessButton("Generate",n.bind(a))),window.modalView.show("modalApplicationMount.ejs","Install Service",d,c,void 0,void 0,e),$("#new-app-collections").select2({tags:[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px"});var f=function(){var a=$("#modalButton1");a.prop("disabled")||window.modalView.modalTestAll()?a.prop("disabled",!1):a.prop("disabled",!0)};$(".select2-search-field input").focusout(function(){f(),window.setTimeout(function(){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||($("#s2id_new-app-collections").select2("close"),f()))},80)}),$(".select2-search-field input").focusin(function(){if($(".select2-drop").is(":visible")){var a=$("#modalButton1");a.prop("disabled",!0)}}),$("#upload-foxx-zip").uploadFile({url:"/_api/upload?multipart=true",allowedTypes:"zip",multiple:!1,onSuccess:k.bind(a)}),$.get("foxxes/fishbowl",function(a){var c=$("#appstore-content");c.html(""),_.each(_.sortBy(a,"name"),function(a){c.append(b.render(a))})}).fail(function(){var a=$("#appstore-content");a.append("
Store is not available. ArangoDB is not able to connect to github.com
")})};c.prototype.install=function(a){this.reload=a,this._upgrade=!1,this._uploadData=void 0,delete this.mount,o(this,!1),window.modalView.clearValidators(),e(),g()},c.prototype.upgrade=function(a,b){this.reload=b,this._upgrade=!0,this._uploadData=void 0,this.mount=a,o(this,!0),window.modalView.clearValidators(),g()},window.FoxxInstallView=c}(),function(){"use strict";window.GraphManagementView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("graphManagementView.ejs"),edgeDefintionTemplate:templateEngine.createTemplate("edgeDefinitionTable.ejs"),eCollList:[],removedECollList:[],dropdownVisible:!1,events:{"click #deleteGraph":"deleteGraph","click .icon_arangodb_settings2.editGraph":"editGraph","click #createGraph":"addNewGraph","keyup #graphManagementSearchInput":"search","click #graphManagementSearchSubmit":"search","click .tile-graph":"redirectToGraphViewer","click #graphManagementToggle":"toggleGraphDropdown","click .css-label":"checkBoxes","change #graphSortDesc":"sorting"},toggleTab:function(a){var b=a.currentTarget.id;b=b.replace("tab-",""),$("#tab-content-create-graph .tab-pane").removeClass("active"),$("#tab-content-create-graph #"+b).addClass("active"),"exampleGraphs"===b?$("#modal-dialog .modal-footer button").css("display","none"):$("#modal-dialog .modal-footer button").css("display","block")},redirectToGraphViewer:function(a){var b=$(a.currentTarget).attr("id");b=b.substr(0,b.length-5),window.location=window.location+"/"+encodeURIComponent(b)},loadGraphViewer:function(a){var b=this.collection.get(a).get("edgeDefinitions");if(b&&0!==b.length){var c={type:"gharial",graphName:a,baseUrl:require("internal").arango.databasePrefix("/")},d=$("#content").width()-75;$("#content").html("");var e=arangoHelper.calculateCenterDivHeight();this.ui=new GraphViewerUI($("#content")[0],c,d,e,{nodeShaper:{label:"_key",color:{type:"attribute",key:"_key"}}},!0),$(".contentDiv").height(e)}},handleResize:function(a){this.width&&this.width===a||(this.width=a,this.ui&&this.ui.changeWidth(a))},addNewGraph:function(a){a.preventDefault(),this.createEditGraphModal()},deleteGraph:function(){var a=this,b=$("#editGraphName")[0].value;if($("#dropGraphCollections").is(":checked")){var c=function(c){c?(a.collection.remove(a.collection.get(b)),a.updateGraphManagementView(),window.modalView.hide()):window.modalView.hide()};this.collection.dropAndDeleteGraph(b,c)}else this.collection.get(b).destroy({success:function(){a.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;arangoHelper.arangoError(d),window.modalView.hide()}})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},toggleGraphDropdown:function(){$("#graphSortDesc").attr("checked",this.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown2").slideToggle(200)},sorting:function(){$("#graphSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#graphManagementDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},createExampleGraphs:function(a){var b=$(a.currentTarget).attr("graph-id"),c=this;$.ajax({type:"POST",url:"/_admin/aardvark/graph-examples/create/"+encodeURIComponent(b),success:function(){window.modalView.hide(),c.updateGraphManagementView(),arangoHelper.arangoNotification("Example Graphs","Graph: "+b+" created.")},error:function(a){if(window.modalView.hide(),console.log(a),a.responseText)try{var c=JSON.parse(a.responseText);arangoHelper.arangoError("Example Graphs",c.errorMessage)}catch(d){arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}else arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}})},render:function(){return this.collection.fetch({async:!1}),this.collection.sort(),$(this.el).html(this.template.render({graphs:this.collection,searchString:""})),this.dropdownVisible===!0&&($("#graphManagementDropdown2").show(),$("#graphSortDesc").attr("checked",this.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown").show()),this.events["click .tableRow"]=this.showHideDefinition.bind(this),this.events['change tr[id*="newEdgeDefinitions"]']=this.setFromAndTo.bind(this),this.events["click .graphViewer-icon-button"]=this.addRemoveDefinition.bind(this),this.events["click #graphTab a"]=this.toggleTab.bind(this),this.events["click .createExampleGraphs"]=this.createExampleGraphs.bind(this),arangoHelper.setCheckboxStatus("#graphManagementDropdown"),this},setFromAndTo:function(a){a.stopPropagation();var b,c=this.calculateEdgeDefinitionMap();if(a.added){if(-1===this.eCollList.indexOf(a.added.id)&&-1!==this.removedECollList.indexOf(a.added.id))return b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$('input[id*="newEdgeDefinitions'+b+'"]').select2("val",null),void $('input[id*="newEdgeDefinitions'+b+'"]').attr("placeholder","The collection "+a.added.id+" is already used.");this.removedECollList.push(a.added.id),this.eCollList.splice(this.eCollList.indexOf(a.added.id),1)}else this.eCollList.push(a.removed.id),this.removedECollList.splice(this.removedECollList.indexOf(a.removed.id),1);c[a.val]?(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",c[a.val].from),$("#fromCollections"+b).attr("disabled",!0),$("#s2id_toCollections"+b).select2("val",c[a.val].to),
+$("#toCollections"+b).attr("disabled",!0)):(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",null),$("#fromCollections"+b).attr("disabled",!1),$("#s2id_toCollections"+b).select2("val",null),$("#toCollections"+b).attr("disabled",!1))},editGraph:function(a){a.stopPropagation(),this.collection.fetch(),this.graphToEdit=this.evaluateGraphName($(a.currentTarget).attr("id"),"_settings");var b=this.collection.findWhere({_key:this.graphToEdit});this.createEditGraphModal(b)},saveEditedGraph:function(){var a,b,c,d,e,f=$("#editGraphName")[0].value,g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i={};if(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){if(d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),0!==b.length&&0!==c.length)){var f={collection:a,from:b,to:c};h.push(f),i[a]=f}}),0===h.length)return void $("#s2id_newEdgeDefinitions0 .select2-choices").css("border-color","red");var j=this.collection.findWhere({_key:f}),k=j.get("edgeDefinitions"),l=j.get("orphanCollections"),m=[];l.forEach(function(a){-1===g.indexOf(a)&&j.deleteVertexCollection(a)}),g.forEach(function(a){-1===l.indexOf(a)&&j.addVertexCollection(a)});var n=[],o=[],p=[];k.forEach(function(a){var b=a.collection;m.push(b);var c=i[b];void 0===c?p.push(b):JSON.stringify(c)!==JSON.stringify(a)&&o.push(b)}),h.forEach(function(a){var b=a.collection;-1===m.indexOf(b)&&n.push(b)}),n.forEach(function(a){j.addEdgeDefinition(i[a])}),o.forEach(function(a){j.modifyEdgeDefinition(i[a])}),p.forEach(function(a){j.deleteEdgeDefinition(a)}),this.updateGraphManagementView(),window.modalView.hide()},evaluateGraphName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},search:function(){var a,b,c,d;a=$("#graphManagementSearchInput"),b=$("#graphManagementSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("_key").indexOf(b)}),$(this.el).html(this.template.render({graphs:d,searchString:b})),a=$("#graphManagementSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},updateGraphManagementView:function(){var a=this;this.collection.fetch({success:function(){a.render()}})},createNewGraph:function(){var a,b,c,d,e,f=$("#createNewGraphName").val(),g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i=this;return f?this.collection.findWhere({_key:f})?(arangoHelper.arangoError("The graph '"+f+"' already exists."),0):(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),1!==b&&1!==c&&h.push({collection:a,from:b,to:c}))}),void this.collection.create({name:f,edgeDefinitions:h,orphanCollections:g},{success:function(){i.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;d=d.replace("<",""),d=d.replace(">",""),arangoHelper.arangoError(d)}})):(arangoHelper.arangoError("A name for the graph has to be provided."),0)},createEditGraphModal:function(a){var b,c=[],d=[],e=[],f=this.options.collectionCollection.models,g=this,h="",i=[{collection:"",from:"",to:""}],j="",k=function(a,b){return a=a.toLowerCase(),b=b.toLowerCase(),b>a?-1:a>b?1:0};if(this.eCollList=[],this.removedECollList=[],f.forEach(function(a){a.get("isSystem")||("edge"===a.get("type")?g.eCollList.push(a.id):d.push(a.id))}),window.modalView.enableHotKeys=!1,this.counter=0,a?(b="Edit Graph",h=a.get("_key"),i=a.get("edgeDefinitions"),i&&0!==i.length||(i=[{collection:"",from:"",to:""}]),j=a.get("orphanCollections"),e.push(window.modalView.createReadOnlyEntry("editGraphName","Name",h,"The name to identify the graph. Has to be unique")),c.push(window.modalView.createDeleteButton("Delete",this.deleteGraph.bind(this))),c.push(window.modalView.createSuccessButton("Save",this.saveEditedGraph.bind(this)))):(b="Create Graph",e.push(window.modalView.createTextEntry("createNewGraphName","Name","","The name to identify the graph. Has to be unique.","graphName",!0)),c.push(window.modalView.createSuccessButton("Create",this.createNewGraph.bind(this)))),i.forEach(function(a){0===g.counter?(a.collection&&(g.removedECollList.push(a.collection),g.eCollList.splice(g.eCollList.indexOf(a.collection),1)),e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!0,!1,!0,1,g.eCollList.sort(k)))):e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!1,!0,!1,1,g.eCollList.sort(k))),e.push(window.modalView.createSelect2Entry("fromCollections"+g.counter,"fromCollections",a.from,"The collections that contain the start vertices of the relation.","fromCollections",!0,!1,!1,10,d.sort(k))),e.push(window.modalView.createSelect2Entry("toCollections"+g.counter,"toCollections",a.to,"The collections that contain the end vertices of the relation.","toCollections",!0,!1,!1,10,d.sort(k))),g.counter++}),e.push(window.modalView.createSelect2Entry("newVertexCollections","Vertex collections",j,"Collections that are part of a graph but not used in an edge definition","Vertex Collections",!1,!1,!1,10,d.sort(k))),window.modalView.show("modalGraphTable.ejs",b,c,e,void 0,void 0,this.events),a){$(".modal-body table").css("border-collapse","separate");var l;for($(".modal-body .spacer").remove(),l=0;l<=this.counter;l++)$("#row_fromCollections"+l).show(),$("#row_toCollections"+l).show(),$("#row_newEdgeDefinitions"+l).addClass("first"),$("#row_fromCollections"+l).addClass("middle"),$("#row_toCollections"+l).addClass("last"),$("#row_toCollections"+l).after('
',maxVisible:1,closeWith:["click"],type:d.get("type"),layout:"bottom",timeout:f,animation:{open:{height:"show"},close:{height:"hide"},easing:"swing",speed:200}}),"success"===d.get("type"))return void d.destroy()}$("#stat_hd_counter").text(this.collection.length),0===this.collection.length?($("#stat_hd").removeClass("fullNotification"),$("#notification_menu").hide()):$("#stat_hd").addClass("fullNotification"),$(".innerDropdownInnerUL").html(this.notificationItem.render({notifications:this.collection})),$(".notificationInfoIcon").tooltip({position:{my:"left top",at:"right+55 top-1"}})},render:function(){return $(this.el).html(this.template.render({notifications:this.collection})),this.renderNotifications(),this.delegateEvents(),this.el}})}(),function(){"use strict";window.ProgressView=Backbone.View.extend({template:templateEngine.createTemplate("progressBase.ejs"),el:"#progressPlaceholder",el2:"#progressPlaceholderIcon",toShow:!1,lastDelay:0,action:function(){},events:{"click .progress-action button":"performAction"},performAction:function(){this.action(),window.progressView.hide()},initialize:function(){},showWithDelay:function(a,b,c,d){var e=this;e.toShow=!0,e.lastDelay=a,setTimeout(function(){e.toShow===!0&&e.show(b,c,d)},e.lastDelay)},show:function(a,b,c){$(this.el).html(this.template.render({})),$(".progress-text").text(a),c?$(".progress-action").html('"):$(".progress-action").html(''),b?this.action=b:this.action=this.hide(),$(this.el).show()},hide:function(){var a=this;a.toShow=!1,$(this.el).hide(),this.action=function(){}}})}(),function(){"use strict";window.queryManagementView=Backbone.View.extend({el:"#content",id:"#queryManagementContent",templateActive:templateEngine.createTemplate("queryManagementViewActive.ejs"),templateSlow:templateEngine.createTemplate("queryManagementViewSlow.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),tabbar:templateEngine.createTemplate("arangoTabbar.ejs"),initialize:function(){this.activeCollection=new window.QueryManagementActive,this.slowCollection=new window.QueryManagementSlow,this.convertModelToJSON(!0)},events:{"click #arangoQueryManagementTabbar button":"switchTab","click #deleteSlowQueryHistory":"deleteSlowQueryHistoryModal","click #arangoQueryManagementTable .fa-minus-circle":"deleteRunningQueryModal"},tabbarElements:{id:"arangoQueryManagementTabbar",titles:[["Active","activequeries"],["Slow","slowqueries"]]},tableDescription:{id:"arangoQueryManagementTable",titles:["ID","Query String","Runtime","Started",""],rows:[],unescaped:[!1,!1,!1,!1,!0]},switchTab:function(a){"activequeries"===a.currentTarget.id?this.convertModelToJSON(!0):"slowqueries"===a.currentTarget.id&&this.convertModelToJSON(!1)},deleteRunningQueryModal:function(a){this.killQueryId=$(a.currentTarget).attr("data-id");var b=[],c=[];c.push(window.modalView.createReadOnlyEntry(void 0,"Running Query","Do you want to kill the running query?",void 0,void 0,!1,void 0)),b.push(window.modalView.createDeleteButton("Kill",this.killRunningQuery.bind(this))),window.modalView.show("modalTable.ejs","Kill Running Query",b,c),$(".modal-delete-confirmation strong").html("Really kill?")},killRunningQuery:function(){this.collection.killRunningQuery(this.killQueryId,this.killRunningQueryCallback.bind(this)),window.modalView.hide()},killRunningQueryCallback:function(){this.convertModelToJSON(!0),this.renderActive()},deleteSlowQueryHistoryModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry(void 0,"Slow Query Log","Do you want to delete the slow query log entries?",void 0,void 0,!1,void 0)),a.push(window.modalView.createDeleteButton("Delete",this.deleteSlowQueryHistory.bind(this))),window.modalView.show("modalTable.ejs","Delete Slow Query Log",a,b)},deleteSlowQueryHistory:function(){this.collection.deleteSlowQueryHistory(this.slowQueryCallback.bind(this)),window.modalView.hide()},slowQueryCallback:function(){this.convertModelToJSON(!1),this.renderSlow()},render:function(){this.convertModelToJSON(!0)},renderActive:function(){this.$el.html(this.templateActive.render({})),$(this.id).html(this.tabbar.render({content:this.tabbarElements})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#activequeries").addClass("arango-active-tab")},renderSlow:function(){this.$el.html(this.templateSlow.render({})),$(this.id).html(this.tabbar.render({content:this.tabbarElements})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#slowqueries").addClass("arango-active-tab")},convertModelToJSON:function(a){var b=this,c=[];a===!0?this.collection=this.activeCollection:this.collection=this.slowCollection,this.collection.fetch({success:function(){b.collection.each(function(b){var d="";a&&(d=''),c.push([b.get("id"),b.get("query"),b.get("runTime").toFixed(2)+" s",b.get("started"),d])});var d="No running queries.";a||(d="No slow queries."),0===c.length&&c.push([d,"","",""]),b.tableDescription.rows=c,a?b.renderActive():b.renderSlow()}})}})}(),function(){"use strict";window.queryView=Backbone.View.extend({el:"#content",id:"#customsDiv",warningTemplate:templateEngine.createTemplate("warningList.ejs"),tabArray:[],execPending:!1,initialize:function(){this.refreshAQL(),this.tableDescription.rows=this.customQueries},events:{"click #result-switch":"switchTab","click #query-switch":"switchTab","click #customs-switch":"switchTab","click #submitQueryButton":"submitQuery","click #explainQueryButton":"explainQuery","click #commentText":"commentText","click #uncommentText":"uncommentText","click #undoText":"undoText","click #redoText":"redoText","click #smallOutput":"smallOutput","click #bigOutput":"bigOutput","click #clearOutput":"clearOutput","click #clearInput":"clearInput","click #clearQueryButton":"clearInput","click #addAQL":"addAQL","mouseover #querySelect":function(){this.refreshAQL(!0)},"change #querySelect":"importSelected","keypress #aqlEditor":"aqlShortcuts","click #arangoQueryTable .table-cell0":"editCustomQuery","click #arangoQueryTable .table-cell1":"editCustomQuery","click #arangoQueryTable .table-cell2 a":"deleteAQL","click #confirmQueryImport":"importCustomQueries","click #confirmQueryExport":"exportCustomQueries","click #export-query":"exportCustomQueries","click #import-query":"openExportDialog","click #closeQueryModal":"closeExportDialog","click #downloadQueryResult":"downloadQueryResult"},openExportDialog:function(){$("#queryImportDialog").modal("show")},closeExportDialog:function(){$("#queryImportDialog").modal("hide")},createCustomQueryModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("new-query-name","Name","",void 0,void 0,!1,[{rule:Joi.string().required(),msg:"No query name given."}])),a.push(window.modalView.createSuccessButton("Save",this.saveAQL.bind(this))),window.modalView.show("modalTable.ejs","Save Query",a,b,void 0,void 0,{"keyup #new-query-name":this.listenKey.bind(this)})},updateTable:function(){this.tableDescription.rows=this.customQueries,_.each(this.tableDescription.rows,function(a){a.thirdRow='',a.hasOwnProperty("parameter")&&delete a.parameter}),this.tableDescription.unescaped=[!1,!1,!0],this.$(this.id).html(this.table.render({content:this.tableDescription}))},editCustomQuery:function(a){var b=$(a.target).parent().children().first().text(),c=ace.edit("aqlEditor"),d=ace.edit("varsEditor");c.setValue(this.getCustomQueryValueByName(b)),d.setValue(JSON.stringify(this.getCustomQueryParameterByName(b))),this.deselect(d),this.deselect(c),$("#querySelect").val(b),this.switchTab("query-switch")},initTabArray:function(){var a=this;$(".arango-tab").children().each(function(){a.tabArray.push($(this).children().first().attr("id"))})},listenKey:function(a){13===a.keyCode&&this.saveAQL(a),this.checkSaveName()},checkSaveName:function(){var a=$("#new-query-name").val();if("Insert Query"===a)return void $("#new-query-name").val("");var b=this.customQueries.some(function(b){return b.name===a});b?($("#modalButton1").removeClass("button-success"),$("#modalButton1").addClass("button-warning"),$("#modalButton1").text("Update")):($("#modalButton1").removeClass("button-warning"),$("#modalButton1").addClass("button-success"),$("#modalButton1").text("Save"))},clearOutput:function(){var a=ace.edit("queryOutput");a.setValue("")},clearInput:function(){var a=ace.edit("aqlEditor"),b=ace.edit("varsEditor");this.setCachedQuery(a.getValue(),b.getValue()),a.setValue(""),b.setValue("")},smallOutput:function(){var a=ace.edit("queryOutput");a.getSession().foldAll()},bigOutput:function(){var a=ace.edit("queryOutput");a.getSession().unfold()},aqlShortcuts:function(a){a.ctrlKey&&13===a.keyCode?this.submitQuery():a.metaKey&&!a.ctrlKey&&13===a.keyCode&&this.submitQuery()},queries:[],customQueries:[],tableDescription:{id:"arangoQueryTable",titles:["Name","Content",""],rows:[]},template:templateEngine.createTemplate("queryView.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),render:function(){var a=this;this.$el.html(this.template.render({})),this.$(this.id).html(this.table.render({content:this.tableDescription}));var b=1e3,c=$("#querySize");c.empty(),[100,250,500,1e3,2500,5e3,1e4,"all"].forEach(function(a){c.append('")});var d=ace.edit("queryOutput");d.setReadOnly(!0),d.setHighlightActiveLine(!1),d.getSession().setMode("ace/mode/json"),d.setFontSize("13px"),d.setValue("");var e=ace.edit("aqlEditor");e.getSession().setMode("ace/mode/aql"),e.setFontSize("13px"),e.commands.addCommand({name:"togglecomment",bindKey:{win:"Ctrl-Shift-C",linux:"Ctrl-Shift-C",
+mac:"Command-Shift-C"},exec:function(a){a.toggleCommentLines()},multiSelectAction:"forEach"});var f=ace.edit("varsEditor");f.getSession().setMode("ace/mode/aql"),f.setFontSize("13px"),f.commands.addCommand({name:"togglecomment",bindKey:{win:"Ctrl-Shift-C",linux:"Ctrl-Shift-C",mac:"Command-Shift-C"},exec:function(a){a.toggleCommentLines()},multiSelectAction:"forEach"});var g=this.getCachedQuery();null!==g&&void 0!==g&&""!==g&&(e.setValue(g.query),""===g.parameter||void 0===g?f.setValue("{}"):f.setValue(g.parameter));var h=function(){var b=e.getSession(),c=e.getCursorPosition(),d=b.getTokenAt(c.row,c.column);d&&("comment"===d.type?$("#commentText i").removeClass("fa-comment").addClass("fa-comment-o").attr("data-original-title","Uncomment"):$("#commentText i").removeClass("fa-comment-o").addClass("fa-comment").attr("data-original-title","Comment"));var g=e.getValue(),h=f.getValue();1===g.length&&(g=""),1===h.length&&(h=""),a.setCachedQuery(g,h)};e.getSession().selection.on("changeCursor",function(){h()}),f.getSession().selection.on("changeCursor",function(){h()}),$("#queryOutput").resizable({handles:"s",ghost:!0,stop:function(){setTimeout(function(){var a=ace.edit("queryOutput");a.resize()},200)}}),arangoHelper.fixTooltips(".vars-editor-header i, .queryTooltips, .icon_arangodb","top"),$("#aqlEditor .ace_text-input").focus();var i=$(window).height()-295;return $("#aqlEditor").height(i-100-29),$("#varsEditor").height(100),$("#queryOutput").height(i),e.resize(),d.resize(),this.initTabArray(),this.renderSelectboxes(),this.deselect(f),this.deselect(d),this.deselect(e),$("#queryDiv").show(),$("#customsDiv").show(),this.initQueryImport(),this.switchTab("query-switch"),this},getCachedQuery:function(){if("undefined"!==Storage){var a=localStorage.getItem("cachedQuery");if(void 0!==a){var b=JSON.parse(a);return b}}},setCachedQuery:function(a,b){if("undefined"!==Storage){var c={query:a,parameter:b};localStorage.setItem("cachedQuery",JSON.stringify(c))}},initQueryImport:function(){var a=this;a.allowUpload=!1,$("#importQueries").change(function(b){a.files=b.target.files||b.dataTransfer.files,a.file=a.files[0],a.allowUpload=!0,$("#confirmQueryImport").removeClass("disabled")})},importCustomQueries:function(){var a=this;if(this.allowUpload===!0){var b=function(){this.collection.fetch({async:!1}),this.updateLocalQueries(),this.renderSelectboxes(),this.updateTable(),a.allowUpload=!1,$("#customs-switch").click()};a.collection.saveImportQueries(a.file,b.bind(this)),$("#confirmQueryImport").addClass("disabled"),$("#queryImportDialog").modal("hide")}},downloadQueryResult:function(){var a=ace.edit("aqlEditor"),b=a.getValue();""!==b||void 0!==b||null!==b?window.open("query/result/download/"+encodeURIComponent(btoa(JSON.stringify({query:b})))):arangoHelper.arangoError("Query error","could not query result.")},exportCustomQueries:function(){var a,b={},c=[];_.each(this.customQueries,function(a){c.push({name:a.name,value:a.value,parameter:a.parameter})}),b={extra:{queries:c}},$.ajax("whoAmI?_="+Date.now(),{async:!1}).done(function(b){a=b.user,(null===a||a===!1)&&(a="root")}),window.open("query/download/"+encodeURIComponent(a))},deselect:function(a){var b=a.getSelection(),c=b.lead.row,d=b.lead.column;b.setSelectionRange({start:{row:c,column:d},end:{row:c,column:d}}),a.focus()},addAQL:function(){this.refreshAQL(!0),this.createCustomQueryModal(),$("#new-query-name").val($("#querySelect").val()),setTimeout(function(){$("#new-query-name").focus()},500),this.checkSaveName()},getAQL:function(){var a,b=this;this.collection.fetch({async:!1});var c=localStorage.getItem("customQueries");if(c){var d=JSON.parse(c);_.each(d,function(a){b.collection.add({value:a.value,name:a.name})}),a=b.collection.saveCollectionQueries(),a===!0&&localStorage.removeItem("customQueries")}this.updateLocalQueries()},deleteAQL:function(a){var b=$(a.target).parent().parent().parent().children().first().text(),c=this.collection.findWhere({name:b});this.collection.remove(c),this.collection.saveCollectionQueries(),this.updateLocalQueries(),this.renderSelectboxes(),this.updateTable()},updateLocalQueries:function(){var a=this;this.customQueries=[],this.collection.each(function(b){a.customQueries.push({name:b.get("name"),value:b.get("value"),parameter:b.get("parameter")})})},saveAQL:function(a){a.stopPropagation(),this.refreshAQL();var b=ace.edit("aqlEditor"),c=ace.edit("varsEditor"),d=$("#new-query-name").val(),e=c.getValue();if(!$("#new-query-name").hasClass("invalid-input")&&""!==d.trim()){var f=b.getValue(),g=!1;if($.each(this.customQueries,function(a,b){return b.name===d?(b.value=f,void(g=!0)):void 0}),g===!0)this.collection.findWhere({name:d}).set("value",f);else{if((""===e||void 0===e)&&(e="{}"),"string"==typeof e)try{e=JSON.parse(e)}catch(h){console.log("could not parse bind parameter")}this.collection.add({name:d,parameter:e,value:f})}this.collection.saveCollectionQueries(),window.modalView.hide(),this.updateLocalQueries(),this.renderSelectboxes(),$("#querySelect").val(d)}},getSystemQueries:function(){var a=this;$.ajax({type:"GET",cache:!1,url:"js/arango/aqltemplates.json",contentType:"application/json",processData:!1,async:!1,success:function(b){a.queries=b},error:function(){arangoHelper.arangoNotification("Query","Error while loading system templates")}})},getCustomQueryValueByName:function(a){return this.collection.findWhere({name:a}).get("value")},getCustomQueryParameterByName:function(a){return this.collection.findWhere({name:a}).get("parameter")},refreshAQL:function(a){if(this.getAQL(),this.getSystemQueries(),this.updateLocalQueries(),a){var b=$("#querySelect").val();this.renderSelectboxes(),$("#querySelect").val(b)}},importSelected:function(a){var b=ace.edit("aqlEditor"),c=ace.edit("varsEditor");$.each(this.queries,function(d,e){$("#"+a.currentTarget.id).val()===e.name&&(b.setValue(e.value),e.hasOwnProperty("parameter")?((""===e.parameter||void 0===e.parameter)&&(e.parameter="{}"),"object"==typeof e.parameter?c.setValue(JSON.stringify(e.parameter)):c.setValue(e.parameter)):c.setValue("{}"))}),$.each(this.customQueries,function(d,e){$("#"+a.currentTarget.id).val()===e.name&&(b.setValue(e.value),e.hasOwnProperty("parameter")?((""===e.parameter||void 0===e.parameter)&&(e.parameter="{}"),c.setValue(e.parameter)):c.setValue("{}"))}),this.deselect(ace.edit("varsEditor")),this.deselect(ace.edit("aqlEditor"))},renderSelectboxes:function(){this.sortQueries();var a="";a="#querySelect",$(a).empty(),$(a).append(''),$(a).append('"),this.customQueries.length>0&&($(a).append('"))},undoText:function(){var a=ace.edit("aqlEditor");a.undo()},redoText:function(){var a=ace.edit("aqlEditor");a.redo()},commentText:function(){var a=ace.edit("aqlEditor");a.toggleCommentLines()},sortQueries:function(){this.queries=_.sortBy(this.queries,"name"),this.customQueries=_.sortBy(this.customQueries,"name")},readQueryData:function(){var a=ace.edit("aqlEditor"),b=ace.edit("varsEditor"),c=a.session.getTextRange(a.getSelectionRange()),d=$("#querySize"),e={query:c||a.getValue(),id:"currentFrontendQuery"};"all"!==d.val()&&(e.batchSize=parseInt(d.val(),10));var f=b.getValue();if(f.length>0)try{var g=JSON.parse(f);0!==Object.keys(g).length&&(e.bindVars=g)}catch(h){return arangoHelper.arangoError("Query error","Could not parse bind parameters."),!1}return JSON.stringify(e)},heatmapColors:["#313695","#4575b4","#74add1","#abd9e9","#e0f3f8","#ffffbf","#fee090","#fdae61","#f46d43","#d73027","#a50026"],heatmap:function(a){return this.heatmapColors[Math.floor(10*a)]},followQueryPath:function(a,b){var c={},d=0;c[b[0].id]=a;var e,f,g,h;for(e=1;e0&&(b+="Warnings:\r\n\r\n",a.extra.warnings.forEach(function(a){b+="["+a.code+"], '"+a.message+"'\r\n"})),""!==b&&(b+="\r\nResult:\r\n\r\n"),d.setValue(b+JSON.stringify(a.result,void 0,2))},g=function(a){f(a),c.switchTab("result-switch"),window.progressView.hide();var e="Execution time: "+c.timer.getTimeAndReset()/1e3+" s";$(".queryExecutionTime").text(e),c.deselect(d),$("#downloadQueryResult").show(),"function"==typeof b&&b()},h=function(){$.ajax({type:"PUT",url:"/_api/job/"+encodeURIComponent(a),contentType:"application/json",processData:!1,success:function(a,b,d){201===d.status?g(a):204===d.status&&(c.checkQueryTimer=window.setTimeout(function(){h()},500))},error:function(a){try{var b=JSON.parse(a.responseText);b.errorMessage&&arangoHelper.arangoError("Query",b.errorMessage)}catch(c){arangoHelper.arangoError("Query","Something went wrong.")}window.progressView.hide()}})};h()},fillResult:function(a){var b=this,c=ace.edit("queryOutput");c.setValue("");var d=this.readQueryData();d&&$.ajax({type:"POST",url:"/_api/cursor",headers:{"x-arango-async":"store"},data:d,contentType:"application/json",processData:!1,success:function(c,d,e){e.getResponseHeader("x-arango-async-id")&&b.queryCallbackFunction(e.getResponseHeader("x-arango-async-id"),a),$.noty.clearQueue(),$.noty.closeAll()},error:function(d){b.switchTab("result-switch"),$("#downloadQueryResult").hide();try{var e=JSON.parse(d.responseText);c.setValue("["+e.errorNum+"] "+e.errorMessage)}catch(f){c.setValue("ERROR"),arangoHelper.arangoError("Query error","ERROR")}window.progressView.hide(),"function"==typeof a&&a()}})},submitQuery:function(){var a=ace.edit("queryOutput");this.fillResult(this.switchTab.bind(this,"result-switch")),a.resize();var b=ace.edit("aqlEditor");this.deselect(b),$("#downloadQueryResult").show()},explainQuery:function(){this.fillExplain()},switchTab:function(a){var b;b="string"==typeof a?a:a.target.id;var c=this,d=function(a){var d="#"+a.replace("-switch",""),e="#tabContent"+d.charAt(1).toUpperCase()+d.substr(2);a===b?($("#"+a).parent().addClass("active"),$(d).addClass("active"),$(e).show(),"query-switch"===b?$("#aqlEditor .ace_text-input").focus():"result-switch"===b&&c.execPending&&c.fillResult()):($("#"+a).parent().removeClass("active"),$(d).removeClass("active"),$(e).hide())};this.tabArray.forEach(d),this.updateTable()}})}(),function(){"use strict";window.shellView=Backbone.View.extend({resizing:!1,el:"#content",template:templateEngine.createTemplate("shellView.ejs"),render:function(){$(this.el).html(this.template.render({})),this.replShell(),$("#shell_workspace").trigger("resize",[150]),this.resize();var a=this;return $(window).resize(function(){a.resize()}),this.executeJs("start_pretty_print(); try { db._collections(); } catch (err) { } undefined;"),this},resize:function(){if(!this.resizing){this.resizing=!0;var a=$(window).height()-250;$("#shell_workspace").height(a),this.resizing=!1}},executeJs:function(a){var b=require("internal");try{var c=window.eval(a);void 0!==c&&(b.browserOutputBuffer="",b.printShell(c),jqconsole.Write("==> "+b.browserOutputBuffer+"\n","jssuccess")),b.browserOutputBuffer=""}catch(d){d instanceof b.ArangoError?d.hasOwnProperty("errorMessage")?jqconsole.Write(d.errorMessage+"\n","jserror"):jqconsole.Write(d.message+"\n","jserror"):jqconsole.Write(d.name+": "+d.message+"\n","jserror")}},replShellPromptHelper:function(a){try{new Function(a)}catch(b){return/[\[\{\(]$/.test(a)?1:0}return!1},replShellHandlerHelper:function(a){},replShell:function(){var a=this,b=require("internal"),c=require("@arangodb/arangosh"),d="Welcome to arangosh. Copyright (c) ArangoDB GmbH\n";window.jqconsole=$("#replShell").jqconsole(d,"JSH> ","...>"),this.executeJs(b.print(c.HELP)),jqconsole.RegisterShortcut("Z",function(){jqconsole.AbortPrompt(),e()}),jqconsole.RegisterShortcut("E",function(){jqconsole.MoveToEnd(),e()}),jqconsole.RegisterMatching("{","}","brace"),jqconsole.RegisterMatching("(",")","paren"),jqconsole.RegisterMatching("[","]","bracket");var e=function(b){"help"===b&&(b=help()),"exit"===b&&location.reload(),a.executeJs(b),jqconsole.Prompt(!0,e,a.replShellPromptHelper(b))};e()}})}(),function(){"use strict";window.StatisticBarView=Backbone.View.extend({el:"#statisticBar",events:{"change #arangoCollectionSelect":"navigateBySelect","click .tab":"navigateByTab"},template:templateEngine.createTemplate("statisticBarView.ejs"),initialize:function(){this.currentDB=this.options.currentDB},replaceSVG:function(a){var b=a.attr("id"),c=a.attr("class"),d=a.attr("src");$.get(d,function(d){var e=$(d).find("svg");void 0===b&&(e=e.attr("id",b)),void 0===c&&(e=e.attr("class",c+" replaced-svg")),e=e.removeAttr("xmlns:a"),a.replaceWith(e)},"xml")},render:function(){var a=this;return $(this.el).html(this.template.render({isSystem:this.currentDB.get("isSystem")})),$("img.svg").each(function(){a.replaceSVG($(this))}),this},navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},navigateByTab:function(a){var b=a.target||a.srcElement,c=b.id;return"links"===c?($("#link_dropdown").slideToggle(200),void a.preventDefault()):"tools"===c?($("#tools_dropdown").slideToggle(200),void a.preventDefault()):(window.App.navigate(c,{trigger:!0}),void a.preventDefault())},handleSelectNavigation:function(){$("#arangoCollectionSelect").change(function(){var a=$(this).find("option:selected").val();window.App.navigate(a,{trigger:!0})})},selectMenuItem:function(a){$(".navlist li").removeClass("active"),a&&$("."+a).addClass("active")}})}(),function(){"use strict";window.TableView=Backbone.View.extend({template:templateEngine.createTemplate("tableView.ejs"),loading:templateEngine.createTemplate("loadingTableView.ejs"),initialize:function(){this.rowClickCallback=this.options.rowClick},events:{"click tbody tr":"rowClick","click .deleteButton":"removeClick"},rowClick:function(a){this.hasOwnProperty("rowClickCallback")&&this.rowClickCallback(a)},removeClick:function(a){this.hasOwnProperty("removeClickCallback")&&(this.removeClickCallback(a),a.stopPropagation())},setRowClick:function(a){this.rowClickCallback=a},setRemoveClick:function(a){this.removeClickCallback=a},render:function(){$(this.el).html(this.template.render({docs:this.collection}))},drawLoading:function(){$(this.el).html(this.loading.render({}))}})}(),function(){"use strict";window.testView=Backbone.View.extend({el:"#content",graph:{edges:[],nodes:[]},events:{},initialize:function(){console.log(void 0)},template:templateEngine.createTemplate("testView.ejs"),render:function(){return $(this.el).html(this.template.render({})),this.renderGraph(),this},renderGraph:function(){this.convertData(),console.log(this.graph),this.s=new sigma({graph:this.graph,container:"graph-container",verbose:!0,renderers:[{container:document.getElementById("graph-container"),type:"webgl"}]})},convertData:function(){var a=this;return _.each(this.dump,function(b){_.each(b.p,function(c){a.graph.nodes.push({id:c.verticesvalue.v._id,label:b.v._key,x:Math.random(),y:Math.random(),size:Math.random()}),a.graph.edges.push({id:b.e._id,source:b.e._from,target:b.e._to})})}),null},dump:[{v:{label:"7",_id:"circles/G",_rev:"1841663870851",_key:"G"},e:{theFalse:!1,theTruth:!0,label:"right_foo",_id:"edges/1841666099075",_rev:"1841666099075",_key:"1841666099075",_from:"circles/A",_to:"circles/G"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"7",_id:"circles/G",_rev:"1841663870851",_key:"G"}],edges:[{theFalse:!1,theTruth:!0,label:"right_foo",_id:"edges/1841666099075",_rev:"1841666099075",_key:"1841666099075",_from:"circles/A",_to:"circles/G"}]}},{v:{label:"8",_id:"circles/H",_rev:"1841664067459",_key:"H"},e:{theFalse:!1,theTruth:!0,label:"right_blob",_id:"edges/1841666295683",_rev:"1841666295683",_key:"1841666295683",_from:"circles/G",_to:"circles/H"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"7",_id:"circles/G",_rev:"1841663870851",_key:"G"},{label:"8",_id:"circles/H",_rev:"1841664067459",_key:"H"}],edges:[{theFalse:!1,theTruth:!0,label:"right_foo",_id:"edges/1841666099075",_rev:"1841666099075",_key:"1841666099075",_from:"circles/A",_to:"circles/G"},{theFalse:!1,theTruth:!0,label:"right_blob",_id:"edges/1841666295683",_rev:"1841666295683",_key:"1841666295683",_from:"circles/G",_to:"circles/H"}]}},{v:{label:"9",_id:"circles/I",_rev:"1841664264067",_key:"I"},e:{theFalse:!1,theTruth:!0,label:"right_blub",_id:"edges/1841666492291",_rev:"1841666492291",_key:"1841666492291",_from:"circles/H",_to:"circles/I"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"7",_id:"circles/G",_rev:"1841663870851",_key:"G"},{label:"8",_id:"circles/H",_rev:"1841664067459",_key:"H"},{label:"9",_id:"circles/I",_rev:"1841664264067",_key:"I"}],edges:[{theFalse:!1,theTruth:!0,label:"right_foo",_id:"edges/1841666099075",_rev:"1841666099075",_key:"1841666099075",_from:"circles/A",_to:"circles/G"},{theFalse:!1,theTruth:!0,label:"right_blob",_id:"edges/1841666295683",_rev:"1841666295683",_key:"1841666295683",_from:"circles/G",_to:"circles/H"},{theFalse:!1,theTruth:!0,label:"right_blub",_id:"edges/1841666492291",_rev:"1841666492291",_key:"1841666492291",_from:"circles/H",_to:"circles/I"}]}},{v:{label:"10",_id:"circles/J",_rev:"1841664460675",_key:"J"},e:{theFalse:!1,theTruth:!0,label:"right_zip",_id:"edges/1841666688899",_rev:"1841666688899",_key:"1841666688899",_from:"circles/G",_to:"circles/J"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"7",_id:"circles/G",_rev:"1841663870851",_key:"G"},{label:"10",_id:"circles/J",_rev:"1841664460675",_key:"J"}],edges:[{theFalse:!1,theTruth:!0,label:"right_foo",_id:"edges/1841666099075",_rev:"1841666099075",_key:"1841666099075",_from:"circles/A",_to:"circles/G"},{theFalse:!1,theTruth:!0,label:"right_zip",_id:"edges/1841666688899",_rev:"1841666688899",_key:"1841666688899",_from:"circles/G",_to:"circles/J"}]}},{v:{label:"11",_id:"circles/K",_rev:"1841664657283",_key:"K"},e:{theFalse:!1,theTruth:!0,label:"right_zup",_id:"edges/1841666885507",_rev:"1841666885507",_key:"1841666885507",_from:"circles/J",_to:"circles/K"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"7",_id:"circles/G",_rev:"1841663870851",_key:"G"},{label:"10",_id:"circles/J",_rev:"1841664460675",_key:"J"},{label:"11",_id:"circles/K",_rev:"1841664657283",_key:"K"}],edges:[{theFalse:!1,theTruth:!0,label:"right_foo",_id:"edges/1841666099075",_rev:"1841666099075",_key:"1841666099075",_from:"circles/A",_to:"circles/G"},{theFalse:!1,theTruth:!0,label:"right_zip",_id:"edges/1841666688899",_rev:"1841666688899",_key:"1841666688899",_from:"circles/G",_to:"circles/J"},{theFalse:!1,theTruth:!0,label:"right_zup",_id:"edges/1841666885507",_rev:"1841666885507",_key:"1841666885507",_from:"circles/J",_to:"circles/K"}]}},{v:{label:"2",_id:"circles/B",_rev:"1841662887811",_key:"B"},e:{theFalse:!1,theTruth:!0,label:"left_bar",_id:"edges/1841665116035",_rev:"1841665116035",_key:"1841665116035",_from:"circles/A",_to:"circles/B"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"2",_id:"circles/B",_rev:"1841662887811",_key:"B"}],edges:[{theFalse:!1,theTruth:!0,label:"left_bar",_id:"edges/1841665116035",_rev:"1841665116035",_key:"1841665116035",_from:"circles/A",_to:"circles/B"}]}},{v:{label:"5",_id:"circles/E",_rev:"1841663477635",_key:"E"},e:{theFalse:!1,theTruth:!0,label:"left_blub",_id:"edges/1841665705859",_rev:"1841665705859",_key:"1841665705859",_from:"circles/B",_to:"circles/E"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"2",_id:"circles/B",_rev:"1841662887811",_key:"B"},{label:"5",_id:"circles/E",_rev:"1841663477635",_key:"E"}],edges:[{theFalse:!1,theTruth:!0,label:"left_bar",_id:"edges/1841665116035",_rev:"1841665116035",_key:"1841665116035",_from:"circles/A",_to:"circles/B"},{theFalse:!1,theTruth:!0,label:"left_blub",_id:"edges/1841665705859",_rev:"1841665705859",_key:"1841665705859",_from:"circles/B",_to:"circles/E"}]}},{v:{label:"6",_id:"circles/F",_rev:"1841663674243",_key:"F"},e:{theFalse:!1,theTruth:!0,label:"left_schubi",_id:"edges/1841665902467",_rev:"1841665902467",_key:"1841665902467",_from:"circles/E",_to:"circles/F"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"2",_id:"circles/B",_rev:"1841662887811",_key:"B"},{label:"5",_id:"circles/E",_rev:"1841663477635",_key:"E"},{label:"6",_id:"circles/F",_rev:"1841663674243",_key:"F"}],edges:[{theFalse:!1,theTruth:!0,label:"left_bar",_id:"edges/1841665116035",_rev:"1841665116035",_key:"1841665116035",_from:"circles/A",_to:"circles/B"},{theFalse:!1,theTruth:!0,label:"left_blub",_id:"edges/1841665705859",_rev:"1841665705859",_key:"1841665705859",_from:"circles/B",_to:"circles/E"},{theFalse:!1,theTruth:!0,label:"left_schubi",_id:"edges/1841665902467",_rev:"1841665902467",_key:"1841665902467",_from:"circles/E",_to:"circles/F"}]}},{v:{label:"3",_id:"circles/C",_rev:"1841663084419",_key:"C"},e:{theFalse:!1,theTruth:!0,label:"left_blarg",_id:"edges/1841665312643",_rev:"1841665312643",_key:"1841665312643",_from:"circles/B",_to:"circles/C"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"2",_id:"circles/B",_rev:"1841662887811",_key:"B"},{label:"3",_id:"circles/C",_rev:"1841663084419",_key:"C"}],edges:[{theFalse:!1,theTruth:!0,label:"left_bar",_id:"edges/1841665116035",_rev:"1841665116035",_key:"1841665116035",_from:"circles/A",_to:"circles/B"},{theFalse:!1,theTruth:!0,label:"left_blarg",_id:"edges/1841665312643",_rev:"1841665312643",_key:"1841665312643",_from:"circles/B",_to:"circles/C"}]}},{v:{label:"4",_id:"circles/D",_rev:"1841663281027",_key:"D"},e:{theFalse:!1,theTruth:!0,label:"left_blorg",_id:"edges/1841665509251",_rev:"1841665509251",_key:"1841665509251",_from:"circles/C",_to:"circles/D"},p:{vertices:[{label:"1",_id:"circles/A",_rev:"1841662691203",_key:"A"},{label:"2",_id:"circles/B",_rev:"1841662887811",_key:"B"},{label:"3",_id:"circles/C",_rev:"1841663084419",_key:"C"},{label:"4",_id:"circles/D",_rev:"1841663281027",_key:"D"}],edges:[{theFalse:!1,theTruth:!0,label:"left_bar",_id:"edges/1841665116035",_rev:"1841665116035",_key:"1841665116035",_from:"circles/A",_to:"circles/B"},{theFalse:!1,theTruth:!0,label:"left_blarg",_id:"edges/1841665312643",_rev:"1841665312643",_key:"1841665312643",_from:"circles/B",_to:"circles/C"},{theFalse:!1,theTruth:!0,label:"left_blorg",_id:"edges/1841665509251",_rev:"1841665509251",_key:"1841665509251",_from:"circles/C",_to:"circles/D"}]}}]})}(),function(){"use strict";window.UserBarView=Backbone.View.extend({events:{"change #userBarSelect":"navigateBySelect","click .tab":"navigateByTab","mouseenter .dropdown":"showDropdown","mouseleave .dropdown":"hideDropdown","click #userLogout":"userLogout"},initialize:function(){this.userCollection=this.options.userCollection,this.userCollection.fetch({async:!1}),this.userCollection.bind("change:extra",this.render.bind(this))},template:templateEngine.createTemplate("userBarView.ejs"),navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},navigateByTab:function(a){var b=a.target||a.srcElement;b=$(b).closest("a");var c=b.attr("id");return"user"===c?($("#user_dropdown").slideToggle(200),void a.preventDefault()):(window.App.navigate(c,{trigger:!0}),void a.preventDefault())},showDropdown:function(){$("#user_dropdown").fadeIn(1)},hideDropdown:function(){$("#user_dropdown").fadeOut(1)},render:function(){var a=this.userCollection.whoAmI(),b=null,c=null,d=!1,e=null;return a&&(e=this.userCollection.findWhere({user:a}),e.set({loggedIn:!0}),c=e.get("extra").name,b=e.get("extra").img,d=e.get("active")),b=b?"https://s.gravatar.com/avatar/"+b+"?s=24":"img/default_user.png",c||(c=""),this.$el=$("#userBar"),this.$el.html(this.template.render({img:b,name:c,username:a,active:d})),this.delegateEvents(),this.$el},userLogout:function(){this.userCollection.whoAmI(),this.userCollection.logout()}})}(),function(){"use strict";window.userManagementView=Backbone.View.extend({el:"#content",el2:"#userManagementThumbnailsIn",template:templateEngine.createTemplate("userManagementView.ejs"),events:{"click #createUser":"createUser","click #submitCreateUser":"submitCreateUser","click #userManagementThumbnailsIn .tile":"editUser","click #submitEditUser":"submitEditUser","click #userManagementToggle":"toggleView","keyup #userManagementSearchInput":"search","click #userManagementSearchSubmit":"search","click #callEditUserPassword":"editUserPassword","click #submitEditUserPassword":"submitEditUserPassword","click #submitEditCurrentUserProfile":"submitEditCurrentUserProfile","click .css-label":"checkBoxes","change #userSortDesc":"sorting"},dropdownVisible:!1,initialize:function(){this.collection.fetch({async:!1}),this.currentUser=this.collection.findWhere({user:this.collection.whoAmI()})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},sorting:function(){$("#userSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#userManagementDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},render:function(a){var b=!1;return $("#userManagementDropdown").is(":visible")&&(b=!0),this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:""})),b===!0&&($("#userManagementDropdown2").show(),$("#userSortDesc").attr("checked",this.collection.sortOptions.desc),$("#userManagementToggle").toggleClass("activated"),$("#userManagementDropdown").show()),a&&this.editCurrentUser(),arangoHelper.setCheckboxStatus("#userManagementDropdown"),this},search:function(){var a,b,c,d;a=$("#userManagementSearchInput"),b=$("#userManagementSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("user").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b})),a=$("#userManagementSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},createUser:function(a){a.preventDefault(),this.createCreateUserModal()},submitCreateUser:function(){var a=this,b=$("#newUsername").val(),c=$("#newName").val(),d=$("#newPassword").val(),e=$("#newStatus").is(":checked");if(this.validateUserInfo(c,b,d,e)){var f={user:b,passwd:d,active:e,extra:{name:c}};this.collection.create(f,{wait:!0,error:function(a,b){},success:function(b){a.updateUserManagement(),window.modalView.hide()}})}},validateUserInfo:function(a,b,c,d){return""===b?(arangoHelper.arangoError("You have to define an username"),$("#newUsername").closest("th").css("backgroundColor","red"),!1):!0},updateUserManagement:function(){var a=this;this.collection.fetch({success:function(){a.render()}})},submitDeleteUser:function(a){var b=this.collection.findWhere({user:a});b.destroy({wait:!0}),window.modalView.hide(),this.updateUserManagement()},editUser:function(a){$(a.currentTarget).hasClass("tile")&&(a.currentTarget=$(a.currentTarget).find("img")),this.collection.fetch();var b=this.evaluateUserName($(a.currentTarget).attr("id"),"_edit-user");""===b&&(b=$(a.currentTarget).attr("id"));var c=this.collection.findWhere({user:b});c.get("loggedIn")?this.editCurrentUser():this.createEditUserModal(c.get("user"),c.get("extra").name,c.get("active"))},editCurrentUser:function(){this.createEditCurrentUserModal(this.currentUser.get("user"),this.currentUser.get("extra").name,this.currentUser.get("extra").img)},submitEditUser:function(a){var b=$("#editName").val(),c=$("#editStatus").is(":checked");if(!this.validateStatus(c))return void $("#editStatus").closest("th").css("backgroundColor","red");if(!this.validateName(b))return void $("#editName").closest("th").css("backgroundColor","red");var d=this.collection.findWhere({user:a});d.save({extra:{name:b},active:c},{type:"PATCH"}),window.modalView.hide(),this.updateUserManagement()},validateUsername:function(a){return""===a?(arangoHelper.arangoError("You have to define an username"),$("#newUsername").closest("th").css("backgroundColor","red"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("Wrong Username","Username may only contain numbers, letters, _ and -"),!1)},validatePassword:function(a){return!0},validateName:function(a){return""===a?!0:a.match(/^[a-zA-Z][a-zA-Z0-9_\-\ ]*$/)?!0:(arangoHelper.arangoError("Wrong Username","Username may only contain numbers, letters, _ and -"),!1)},validateStatus:function(a){return""===a?!1:!0},toggleView:function(){$("#userSortDesc").attr("checked",this.collection.sortOptions.desc),$("#userManagementToggle").toggleClass("activated"),$("#userManagementDropdown2").slideToggle(200)},setFilterValues:function(){},evaluateUserName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},editUserPassword:function(){window.modalView.hide(),this.createEditUserPasswordModal()},submitEditUserPassword:function(){var a=$("#oldCurrentPassword").val(),b=$("#newCurrentPassword").val(),c=$("#confirmCurrentPassword").val();$("#oldCurrentPassword").val(""),$("#newCurrentPassword").val(""),$("#confirmCurrentPassword").val(""),$("#oldCurrentPassword").closest("th").css("backgroundColor","white"),$("#newCurrentPassword").closest("th").css("backgroundColor","white"),$("#confirmCurrentPassword").closest("th").css("backgroundColor","white");var d=!1;this.validateCurrentPassword(a)||($("#oldCurrentPassword").closest("th").css("backgroundColor","red"),d=!0),b!==c&&($("#confirmCurrentPassword").closest("th").css("backgroundColor","red"),d=!0),this.validatePassword(b)||($("#newCurrentPassword").closest("th").css("backgroundColor","red"),d=!0),d||(this.currentUser.setPassword(b),window.modalView.hide())},validateCurrentPassword:function(a){return this.currentUser.checkPassword(a)},submitEditCurrentUserProfile:function(){var a=$("#editCurrentName").val(),b=$("#editCurrentUserProfileImg").val();b=this.parseImgString(b),this.currentUser.setExtras(a,b),this.updateUserProfile(),
+window.modalView.hide()},updateUserProfile:function(){var a=this;this.collection.fetch({success:function(){a.render()}})},parseImgString:function(a){return-1===a.indexOf("@")?a:CryptoJS.MD5(a).toString()},createEditUserModal:function(a,b,c){var d,e;e=[{type:window.modalView.tables.READONLY,label:"Username",value:_.escape(a)},{type:window.modalView.tables.TEXT,label:"Name",value:b,id:"editName",placeholder:"Name"},{type:window.modalView.tables.CHECKBOX,label:"Active",value:"active",checked:c,id:"editStatus"}],d=[{title:"Delete",type:window.modalView.buttons.DELETE,callback:this.submitDeleteUser.bind(this,a)},{title:"Save",type:window.modalView.buttons.SUCCESS,callback:this.submitEditUser.bind(this,a)}],window.modalView.show("modalTable.ejs","Edit User",d,e)},createCreateUserModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newUsername","Username","",!1,"Username",!0,[{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only symbols, "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No username given."}])),b.push(window.modalView.createTextEntry("newName","Name","",!1,"Name",!1)),b.push(window.modalView.createPasswordEntry("newPassword","Password","",!1,"",!1)),b.push(window.modalView.createCheckboxEntry("newStatus","Active","active",!1,!0)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateUser.bind(this))),window.modalView.show("modalTable.ejs","Create New User",a,b)},createEditCurrentUserModal:function(a,b,c){var d=[],e=[];e.push(window.modalView.createReadOnlyEntry("id_username","Username",a)),e.push(window.modalView.createTextEntry("editCurrentName","Name",b,!1,"Name",!1)),e.push(window.modalView.createTextEntry("editCurrentUserProfileImg","Gravatar account (Mail)",c,"Mailaddress or its md5 representation of your gravatar account. The address will be converted into a md5 string. Only the md5 string will be stored, not the mailaddress.","myAccount(at)gravatar.com")),d.push(window.modalView.createNotificationButton("Change Password",this.editUserPassword.bind(this))),d.push(window.modalView.createSuccessButton("Save",this.submitEditCurrentUserProfile.bind(this))),window.modalView.show("modalTable.ejs","Edit User Profile",d,e)},createEditUserPasswordModal:function(){var a=[],b=[];b.push(window.modalView.createPasswordEntry("oldCurrentPassword","Old Password","",!1,"old password",!1)),b.push(window.modalView.createPasswordEntry("newCurrentPassword","New Password","",!1,"new password",!1)),b.push(window.modalView.createPasswordEntry("confirmCurrentPassword","Confirm New Password","",!1,"confirm new password",!1)),a.push(window.modalView.createSuccessButton("Save",this.submitEditUserPassword.bind(this))),window.modalView.show("modalTable.ejs","Edit User Password",a,b)}})}(),function(){"use strict";window.workMonitorView=Backbone.View.extend({el:"#content",id:"#workMonitorContent",template:templateEngine.createTemplate("workMonitorView.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),initialize:function(){},events:{},tableDescription:{id:"workMonitorTable",titles:["Type","Database","Task ID","Started","Url","User","Description","Method"],rows:[],unescaped:[!1,!1,!1,!1,!1,!1,!1,!1]},render:function(){var a=this;this.$el.html(this.template.render({})),this.collection.fetch({success:function(){a.parseTableData(),$(a.id).append(a.table.render({content:a.tableDescription}))}})},parseTableData:function(){var a=this;this.collection.each(function(b){if("AQL query"===b.get("type")){var c=b.get("parent");if(c)try{a.tableDescription.rows.push([b.get("type"),"(p) "+c.database,"(p) "+c.taskId,"(p) "+c.startTime,"(p) "+c.url,"(p) "+c.user,b.get("description"),"(p) "+c.method])}catch(d){console.log("some parse error")}}else"thread"!==b.get("type")&&a.tableDescription.rows.push([b.get("type"),b.get("database"),b.get("taskId"),b.get("startTime"),b.get("url"),b.get("user"),b.get("description"),b.get("method")])})}})}(),function(){"use strict";window.Router=Backbone.Router.extend({routes:{"":"dashboard",dashboard:"dashboard",collections:"collections","new":"newCollection",login:"login","collection/:colid/documents/:pageid":"documents","collection/:colid/:docid":"document",shell:"shell",query:"query",queryManagement:"queryManagement",workMonitor:"workMonitor",databases:"databases",applications:"applications","applications/:mount":"applicationDetail",graph:"graphManagement","graph/:name":"showGraph",userManagement:"userManagement",userProfile:"userProfile",logs:"logs",test:"test"},initialize:function(){window.modalView=new window.ModalView,this.foxxList=new window.FoxxCollection,window.foxxInstallView=new window.FoxxInstallView({collection:this.foxxList}),window.progressView=new window.ProgressView;var a=this;this.userCollection=new window.ArangoUsers,this.initOnce=function(){this.initOnce=function(){},this.arangoDatabase=new window.ArangoDatabase,this.currentDB=new window.CurrentDatabase,this.currentDB.fetch({async:!1}),this.arangoCollectionsStore=new window.arangoCollections,this.arangoDocumentStore=new window.arangoDocument,arangoHelper.setDocumentStore(this.arangoDocumentStore),this.arangoCollectionsStore.fetch({async:!1}),this.footerView=new window.FooterView,this.notificationList=new window.NotificationCollection,this.naviView=new window.NavigationView({database:this.arangoDatabase,currentDB:this.currentDB,notificationCollection:a.notificationList,userCollection:this.userCollection}),this.queryCollection=new window.ArangoQueries,this.footerView.render(),this.naviView.render(),window.checkVersion()}.bind(this),$(window).resize(function(){a.handleResize()})},checkUser:function(){return null===this.userCollection.whoAmI()?(this.navigate("login",{trigger:!0}),!1):(this.initOnce(),!0)},logs:function(){if(this.checkUser()){if(!this.logsView){var a=new window.ArangoLogs({upto:!0,loglevel:4}),b=new window.ArangoLogs({loglevel:4}),c=new window.ArangoLogs({loglevel:3}),d=new window.ArangoLogs({loglevel:2}),e=new window.ArangoLogs({loglevel:1});this.logsView=new window.LogsView({logall:a,logdebug:b,loginfo:c,logwarning:d,logerror:e})}this.logsView.render(),this.naviView.selectMenuItem("tools-menu")}},applicationDetail:function(a){this.checkUser()&&(this.naviView.selectMenuItem("applications-menu"),0===this.foxxList.length&&this.foxxList.fetch({async:!1}),this.hasOwnProperty("applicationDetailView")||(this.applicationDetailView=new window.ApplicationDetailView({model:this.foxxList.get(decodeURIComponent(a))})),this.applicationDetailView.model=this.foxxList.get(decodeURIComponent(a)),this.applicationDetailView.render("swagger"))},login:function(){return null!==this.userCollection.whoAmI()?(this.navigate("",{trigger:!0}),!1):(this.loginView||(this.loginView=new window.loginView({collection:this.userCollection})),void this.loginView.render())},collections:function(){if(this.checkUser()){var a=this.naviView,b=this;this.collectionsView||(this.collectionsView=new window.CollectionsView({collection:this.arangoCollectionsStore})),this.arangoCollectionsStore.fetch({success:function(){b.collectionsView.render(),a.selectMenuItem("collections-menu")}})}},documents:function(a,b){this.checkUser()&&(this.documentsView||(this.documentsView=new window.DocumentsView({collection:new window.arangoDocuments,documentStore:this.arangoDocumentStore,collectionsStore:this.arangoCollectionsStore})),this.documentsView.setCollectionId(a,b),this.documentsView.render())},document:function(a,b){if(this.checkUser()){this.documentView||(this.documentView=new window.DocumentView({collection:this.arangoDocumentStore})),this.documentView.colid=a,this.documentView.docid=b,this.documentView.render();var c=arangoHelper.collectionApiType(a);this.documentView.setType(c)}},shell:function(){this.checkUser()&&(this.shellView||(this.shellView=new window.shellView),this.shellView.render(),this.naviView.selectMenuItem("tools-menu"))},query:function(){this.checkUser()&&(this.queryView||(this.queryView=new window.queryView({collection:this.queryCollection})),this.queryView.render(),this.naviView.selectMenuItem("query-menu"))},test:function(){this.checkUser()&&(this.testView||(this.testView=new window.testView({})),this.testView.render())},workMonitor:function(){this.checkUser()&&(this.workMonitorCollection||(this.workMonitorCollection=new window.WorkMonitorCollection),this.workMonitorView||(this.workMonitorView=new window.workMonitorView({collection:this.workMonitorCollection})),this.workMonitorView.render(),this.naviView.selectMenuItem("tools-menu"))},queryManagement:function(){this.checkUser()&&(this.queryManagementView||(this.queryManagementView=new window.queryManagementView({collection:void 0})),this.queryManagementView.render(),this.naviView.selectMenuItem("tools-menu"))},databases:function(){this.checkUser()&&(arangoHelper.databaseAllowed()===!0?(this.databaseView||(this.databaseView=new window.databaseView({users:this.userCollection,collection:this.arangoDatabase})),this.databaseView.render(),this.naviView.selectMenuItem("databases-menu")):(this.navigate("#",{trigger:!0}),this.naviView.selectMenuItem("dashboard-menu"),$("#databaseNavi").css("display","none"),$("#databaseNaviSelect").css("display","none")))},dashboard:function(){this.checkUser()&&(this.naviView.selectMenuItem("dashboard-menu"),void 0===this.dashboardView&&(this.dashboardView=new window.DashboardView({dygraphConfig:window.dygraphConfig,database:this.arangoDatabase})),this.dashboardView.render())},graphManagement:function(){this.checkUser()&&(this.graphManagementView||(this.graphManagementView=new window.GraphManagementView({collection:new window.GraphCollection,collectionCollection:this.arangoCollectionsStore})),this.graphManagementView.render(),this.naviView.selectMenuItem("graphviewer-menu"))},showGraph:function(a){this.checkUser()&&(this.graphManagementView||(this.graphManagementView=new window.GraphManagementView({collection:new window.GraphCollection,collectionCollection:this.arangoCollectionsStore})),this.graphManagementView.render(),this.graphManagementView.loadGraphViewer(a),this.naviView.selectMenuItem("graphviewer-menu"))},applications:function(){this.checkUser()&&(void 0===this.applicationsView&&(this.applicationsView=new window.ApplicationsView({collection:this.foxxList})),this.applicationsView.reload(),this.naviView.selectMenuItem("applications-menu"))},handleSelectDatabase:function(){this.checkUser()&&this.naviView.handleSelectDatabase()},handleResize:function(){this.dashboardView&&this.dashboardView.resize(),this.graphManagementView&&this.graphManagementView.handleResize($("#content").width()),this.queryView&&this.queryView.resize()},userManagement:function(){this.checkUser()&&(this.userManagementView||(this.userManagementView=new window.userManagementView({collection:this.userCollection})),this.userManagementView.render(),this.naviView.selectMenuItem("tools-menu"))},userProfile:function(){this.checkUser()&&(this.userManagementView||(this.userManagementView=new window.userManagementView({collection:this.userCollection})),this.userManagementView.render(!0),this.naviView.selectMenuItem("tools-menu"))}})}(),function(){"use strict";var a=function(){$.ajax({type:"POST",url:"/_admin/aardvark/disableVersionCheck"})},b=function(a){$.ajax({type:"GET",url:"/_admin/aardvark/shouldCheckVersion",success:function(b){b===!0&&a()}})},c=function(b,c){var d=[];d.push(window.modalView.createNotificationButton("Don't ask again",function(){a(),window.modalView.hide()})),d.push(window.modalView.createSuccessButton("Download Page",function(){window.open("https://www.arangodb.com/download","_blank"),window.modalView.hide()}));var e=[],f=window.modalView.createReadOnlyEntry.bind(window.modalView);e.push(f("current","Current",b.toString())),c.major&&e.push(f("major","Major",c.major.version)),c.minor&&e.push(f("minor","Minor",c.minor.version)),c.bugfix&&e.push(f("bugfix","Bugfix",c.bugfix.version)),window.modalView.show("modalTable.ejs","New Version Available",d,e)};window.checkVersion=function(){$.ajax({type:"GET",cache:!1,url:"/_api/version",contentType:"application/json",processData:!1,async:!0,success:function(a){var d=window.versionHelper.fromString(a.version);window.parseVersions=function(e){_.isEmpty(e)||/-devel$/.test(a.version)||b(c.bind(window,d,e))},$.ajax({type:"GET",async:!0,crossDomain:!0,timeout:3e3,dataType:"jsonp",url:"https://www.arangodb.com/repositories/versions.php?jsonp=parseVersions&version="+encodeURIComponent(d.toString())})}})}}(),function(){"use strict";window.hasOwnProperty("TEST_BUILD")||$(document).ready(function(){window.App=new window.Router,Backbone.history.start(),window.App.handleResize()})}();
\ No newline at end of file
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz
index 980086dad8..fdc87bff33 100644
Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz differ
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes5.js b/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes5.js
index 486ac5cf9a..034529048c 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes5.js
+++ b/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes5.js
@@ -27,7 +27,7 @@
////////////////////////////////////////////////////////////////////////////////
/// @brief ArangoError
////////////////////////////////////////////////////////////////////////////////
-if(global.ArangoError){exports.ArangoError = global.ArangoError;delete global.ArangoError;}else {exports.ArangoError = function(error){if(error !== undefined){this.error = error.error;this.code = error.code;this.errorNum = error.errorNum;this.errorMessage = error.errorMessage;}this.message = this.toString();};exports.ArangoError.prototype = new Error();}exports.ArangoError.prototype._PRINT = function(context){context.output += this.toString();};exports.ArangoError.prototype.toString = function(){var errorNum=this.errorNum;var errorMessage=this.errorMessage || this.message;return '[ArangoError ' + errorNum + ': ' + errorMessage + ']';}; ////////////////////////////////////////////////////////////////////////////////
+if(global.ArangoError){exports.ArangoError = global.ArangoError;delete global.ArangoError;}else {exports.ArangoError = function(error){if(error !== undefined){this.error = error.error;this.code = error.code;this.errorNum = error.errorNum;this.errorMessage = error.errorMessage;}};exports.ArangoError.prototype = new Error();}Object.defineProperty(exports.ArangoError.prototype,'message',{configurable:true,enumerable:true,get:function get(){return this.errorMessage;}});exports.ArangoError.prototype.name = 'ArangoError';exports.ArangoError.prototype._PRINT = function(context){context.output += '[' + this.toString() + ']';};exports.ArangoError.prototype.toString = function(){return this.name + ' ' + this.errorNum + ': ' + this.message;}; ////////////////////////////////////////////////////////////////////////////////
/// @brief threadNumber
////////////////////////////////////////////////////////////////////////////////
exports.threadNumber = 0;if(global.THREAD_NUMBER){exports.threadNumber = global.THREAD_NUMBER;delete global.THREAD_NUMBER;} ////////////////////////////////////////////////////////////////////////////////
@@ -369,7 +369,7 @@ global.start_color_print = function start_color_print(color){require('internal')
global.stop_color_print = function stop_color_print(){require('internal').stopColorPrint();};if(global.EXPORTS_SLOW_BUFFER){Object.keys(global.EXPORTS_SLOW_BUFFER).forEach(function(key){exports[key] = global.EXPORTS_SLOW_BUFFER[key];});delete global.EXPORTS_SLOW_BUFFER;}if(global.APP_PATH){exports.appPath = global.APP_PATH;delete global.APP_PATH;}return exports;})()); /*jshint maxlen: 240 */ /*global require */ ////////////////////////////////////////////////////////////////////////////////
/// @brief auto-generated file generated from errors.dat
////////////////////////////////////////////////////////////////////////////////
-(function(){"use strict";var internal=require("internal");internal.errors = {"ERROR_NO_ERROR":{"code":0,"message":"no error"},"ERROR_FAILED":{"code":1,"message":"failed"},"ERROR_SYS_ERROR":{"code":2,"message":"system error"},"ERROR_OUT_OF_MEMORY":{"code":3,"message":"out of memory"},"ERROR_INTERNAL":{"code":4,"message":"internal error"},"ERROR_ILLEGAL_NUMBER":{"code":5,"message":"illegal number"},"ERROR_NUMERIC_OVERFLOW":{"code":6,"message":"numeric overflow"},"ERROR_ILLEGAL_OPTION":{"code":7,"message":"illegal option"},"ERROR_DEAD_PID":{"code":8,"message":"dead process identifier"},"ERROR_NOT_IMPLEMENTED":{"code":9,"message":"not implemented"},"ERROR_BAD_PARAMETER":{"code":10,"message":"bad parameter"},"ERROR_FORBIDDEN":{"code":11,"message":"forbidden"},"ERROR_OUT_OF_MEMORY_MMAP":{"code":12,"message":"out of memory in mmap"},"ERROR_CORRUPTED_CSV":{"code":13,"message":"csv is corrupt"},"ERROR_FILE_NOT_FOUND":{"code":14,"message":"file not found"},"ERROR_CANNOT_WRITE_FILE":{"code":15,"message":"cannot write file"},"ERROR_CANNOT_OVERWRITE_FILE":{"code":16,"message":"cannot overwrite file"},"ERROR_TYPE_ERROR":{"code":17,"message":"type error"},"ERROR_LOCK_TIMEOUT":{"code":18,"message":"lock timeout"},"ERROR_CANNOT_CREATE_DIRECTORY":{"code":19,"message":"cannot create directory"},"ERROR_CANNOT_CREATE_TEMP_FILE":{"code":20,"message":"cannot create temporary file"},"ERROR_REQUEST_CANCELED":{"code":21,"message":"canceled request"},"ERROR_DEBUG":{"code":22,"message":"intentional debug error"},"ERROR_AID_NOT_FOUND":{"code":23,"message":"internal error with attribute ID in shaper"},"ERROR_LEGEND_INCOMPLETE":{"code":24,"message":"internal error if a legend could not be created"},"ERROR_IP_ADDRESS_INVALID":{"code":25,"message":"IP address is invalid"},"ERROR_LEGEND_NOT_IN_WAL_FILE":{"code":26,"message":"internal error if a legend for a marker does not yet exist in the same WAL file"},"ERROR_FILE_EXISTS":{"code":27,"message":"file exists"},"ERROR_LOCKED":{"code":28,"message":"locked"},"ERROR_DEADLOCK":{"code":29,"message":"deadlock detected"},"ERROR_HTTP_BAD_PARAMETER":{"code":400,"message":"bad parameter"},"ERROR_HTTP_UNAUTHORIZED":{"code":401,"message":"unauthorized"},"ERROR_HTTP_FORBIDDEN":{"code":403,"message":"forbidden"},"ERROR_HTTP_NOT_FOUND":{"code":404,"message":"not found"},"ERROR_HTTP_METHOD_NOT_ALLOWED":{"code":405,"message":"method not supported"},"ERROR_HTTP_PRECONDITION_FAILED":{"code":412,"message":"precondition failed"},"ERROR_HTTP_SERVER_ERROR":{"code":500,"message":"internal server error"},"ERROR_HTTP_CORRUPTED_JSON":{"code":600,"message":"invalid JSON object"},"ERROR_HTTP_SUPERFLUOUS_SUFFICES":{"code":601,"message":"superfluous URL suffices"},"ERROR_ARANGO_ILLEGAL_STATE":{"code":1000,"message":"illegal state"},"ERROR_ARANGO_SHAPER_FAILED":{"code":1001,"message":"could not shape document"},"ERROR_ARANGO_DATAFILE_SEALED":{"code":1002,"message":"datafile sealed"},"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE":{"code":1003,"message":"unknown type"},"ERROR_ARANGO_READ_ONLY":{"code":1004,"message":"read only"},"ERROR_ARANGO_DUPLICATE_IDENTIFIER":{"code":1005,"message":"duplicate identifier"},"ERROR_ARANGO_DATAFILE_UNREADABLE":{"code":1006,"message":"datafile unreadable"},"ERROR_ARANGO_DATAFILE_EMPTY":{"code":1007,"message":"datafile empty"},"ERROR_ARANGO_RECOVERY":{"code":1008,"message":"logfile recovery error"},"ERROR_ARANGO_CORRUPTED_DATAFILE":{"code":1100,"message":"corrupted datafile"},"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE":{"code":1101,"message":"illegal or unreadable parameter file"},"ERROR_ARANGO_CORRUPTED_COLLECTION":{"code":1102,"message":"corrupted collection"},"ERROR_ARANGO_MMAP_FAILED":{"code":1103,"message":"mmap failed"},"ERROR_ARANGO_FILESYSTEM_FULL":{"code":1104,"message":"filesystem full"},"ERROR_ARANGO_NO_JOURNAL":{"code":1105,"message":"no journal"},"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS":{"code":1106,"message":"cannot create/rename datafile because it already exists"},"ERROR_ARANGO_DATADIR_LOCKED":{"code":1107,"message":"database directory is locked"},"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS":{"code":1108,"message":"cannot create/rename collection because directory already exists"},"ERROR_ARANGO_MSYNC_FAILED":{"code":1109,"message":"msync failed"},"ERROR_ARANGO_DATADIR_UNLOCKABLE":{"code":1110,"message":"cannot lock database directory"},"ERROR_ARANGO_SYNC_TIMEOUT":{"code":1111,"message":"sync timeout"},"ERROR_ARANGO_CONFLICT":{"code":1200,"message":"conflict"},"ERROR_ARANGO_DATADIR_INVALID":{"code":1201,"message":"invalid database directory"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND":{"code":1202,"message":"document not found"},"ERROR_ARANGO_COLLECTION_NOT_FOUND":{"code":1203,"message":"collection not found"},"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING":{"code":1204,"message":"parameter 'collection' not found"},"ERROR_ARANGO_DOCUMENT_HANDLE_BAD":{"code":1205,"message":"illegal document handle"},"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL":{"code":1206,"message":"maximal size of journal too small"},"ERROR_ARANGO_DUPLICATE_NAME":{"code":1207,"message":"duplicate name"},"ERROR_ARANGO_ILLEGAL_NAME":{"code":1208,"message":"illegal name"},"ERROR_ARANGO_NO_INDEX":{"code":1209,"message":"no suitable index known"},"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED":{"code":1210,"message":"unique constraint violated"},"ERROR_ARANGO_INDEX_NOT_FOUND":{"code":1212,"message":"index not found"},"ERROR_ARANGO_CROSS_COLLECTION_REQUEST":{"code":1213,"message":"cross collection request not allowed"},"ERROR_ARANGO_INDEX_HANDLE_BAD":{"code":1214,"message":"illegal index handle"},"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED":{"code":1215,"message":"cap constraint already defined"},"ERROR_ARANGO_DOCUMENT_TOO_LARGE":{"code":1216,"message":"document too large"},"ERROR_ARANGO_COLLECTION_NOT_UNLOADED":{"code":1217,"message":"collection must be unloaded"},"ERROR_ARANGO_COLLECTION_TYPE_INVALID":{"code":1218,"message":"collection type invalid"},"ERROR_ARANGO_VALIDATION_FAILED":{"code":1219,"message":"validator failed"},"ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED":{"code":1220,"message":"parsing attribute name definition failed"},"ERROR_ARANGO_DOCUMENT_KEY_BAD":{"code":1221,"message":"illegal document key"},"ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED":{"code":1222,"message":"unexpected document key"},"ERROR_ARANGO_DATADIR_NOT_WRITABLE":{"code":1224,"message":"server database directory not writable"},"ERROR_ARANGO_OUT_OF_KEYS":{"code":1225,"message":"out of keys"},"ERROR_ARANGO_DOCUMENT_KEY_MISSING":{"code":1226,"message":"missing document key"},"ERROR_ARANGO_DOCUMENT_TYPE_INVALID":{"code":1227,"message":"invalid document type"},"ERROR_ARANGO_DATABASE_NOT_FOUND":{"code":1228,"message":"database not found"},"ERROR_ARANGO_DATABASE_NAME_INVALID":{"code":1229,"message":"database name invalid"},"ERROR_ARANGO_USE_SYSTEM_DATABASE":{"code":1230,"message":"operation only allowed in system database"},"ERROR_ARANGO_ENDPOINT_NOT_FOUND":{"code":1231,"message":"endpoint not found"},"ERROR_ARANGO_INVALID_KEY_GENERATOR":{"code":1232,"message":"invalid key generator"},"ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE":{"code":1233,"message":"edge attribute missing"},"ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING":{"code":1234,"message":"index insertion warning - attribute missing in document"},"ERROR_ARANGO_INDEX_CREATION_FAILED":{"code":1235,"message":"index creation failed"},"ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT":{"code":1236,"message":"write-throttling timeout"},"ERROR_ARANGO_COLLECTION_TYPE_MISMATCH":{"code":1237,"message":"collection type mismatch"},"ERROR_ARANGO_COLLECTION_NOT_LOADED":{"code":1238,"message":"collection not loaded"},"ERROR_ARANGO_DATAFILE_FULL":{"code":1300,"message":"datafile full"},"ERROR_ARANGO_EMPTY_DATADIR":{"code":1301,"message":"server database directory is empty"},"ERROR_REPLICATION_NO_RESPONSE":{"code":1400,"message":"no response"},"ERROR_REPLICATION_INVALID_RESPONSE":{"code":1401,"message":"invalid response"},"ERROR_REPLICATION_MASTER_ERROR":{"code":1402,"message":"master error"},"ERROR_REPLICATION_MASTER_INCOMPATIBLE":{"code":1403,"message":"master incompatible"},"ERROR_REPLICATION_MASTER_CHANGE":{"code":1404,"message":"master change"},"ERROR_REPLICATION_LOOP":{"code":1405,"message":"loop detected"},"ERROR_REPLICATION_UNEXPECTED_MARKER":{"code":1406,"message":"unexpected marker"},"ERROR_REPLICATION_INVALID_APPLIER_STATE":{"code":1407,"message":"invalid applier state"},"ERROR_REPLICATION_UNEXPECTED_TRANSACTION":{"code":1408,"message":"invalid transaction"},"ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION":{"code":1410,"message":"invalid replication applier configuration"},"ERROR_REPLICATION_RUNNING":{"code":1411,"message":"cannot perform operation while applier is running"},"ERROR_REPLICATION_APPLIER_STOPPED":{"code":1412,"message":"replication stopped"},"ERROR_REPLICATION_NO_START_TICK":{"code":1413,"message":"no start tick"},"ERROR_REPLICATION_START_TICK_NOT_PRESENT":{"code":1414,"message":"start tick not present"},"ERROR_CLUSTER_NO_AGENCY":{"code":1450,"message":"could not connect to agency"},"ERROR_CLUSTER_NO_COORDINATOR_HEADER":{"code":1451,"message":"missing coordinator header"},"ERROR_CLUSTER_COULD_NOT_LOCK_PLAN":{"code":1452,"message":"could not lock plan in agency"},"ERROR_CLUSTER_COLLECTION_ID_EXISTS":{"code":1453,"message":"collection ID already exists"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN":{"code":1454,"message":"could not create collection in plan"},"ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION":{"code":1455,"message":"could not read version in current in agency"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION":{"code":1456,"message":"could not create collection"},"ERROR_CLUSTER_TIMEOUT":{"code":1457,"message":"timeout in cluster operation"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN":{"code":1458,"message":"could not remove collection from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT":{"code":1459,"message":"could not remove collection from current"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN":{"code":1460,"message":"could not create database in plan"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE":{"code":1461,"message":"could not create database"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN":{"code":1462,"message":"could not remove database from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT":{"code":1463,"message":"could not remove database from current"},"ERROR_CLUSTER_SHARD_GONE":{"code":1464,"message":"no responsible shard found"},"ERROR_CLUSTER_CONNECTION_LOST":{"code":1465,"message":"cluster internal HTTP connection broken"},"ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY":{"code":1466,"message":"must not specify _key for this collection"},"ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS":{"code":1467,"message":"got contradicting answers from different shards"},"ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN":{"code":1468,"message":"not all sharding attributes given"},"ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES":{"code":1469,"message":"must not change the value of a shard key attribute"},"ERROR_CLUSTER_UNSUPPORTED":{"code":1470,"message":"unsupported operation or parameter"},"ERROR_CLUSTER_ONLY_ON_COORDINATOR":{"code":1471,"message":"this operation is only valid on a coordinator in a cluster"},"ERROR_CLUSTER_READING_PLAN_AGENCY":{"code":1472,"message":"error reading Plan in agency"},"ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION":{"code":1473,"message":"could not truncate collection"},"ERROR_CLUSTER_AQL_COMMUNICATION":{"code":1474,"message":"error in cluster internal communication for AQL"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED":{"code":1475,"message":"document not found or sharding attributes changed"},"ERROR_CLUSTER_COULD_NOT_DETERMINE_ID":{"code":1476,"message":"could not determine my ID from my local info"},"ERROR_CLUSTER_ONLY_ON_DBSERVER":{"code":1477,"message":"this operation is only valid on a DBserver in a cluster"},"ERROR_QUERY_KILLED":{"code":1500,"message":"query killed"},"ERROR_QUERY_PARSE":{"code":1501,"message":"%s"},"ERROR_QUERY_EMPTY":{"code":1502,"message":"query is empty"},"ERROR_QUERY_SCRIPT":{"code":1503,"message":"runtime error '%s'"},"ERROR_QUERY_NUMBER_OUT_OF_RANGE":{"code":1504,"message":"number out of range"},"ERROR_QUERY_VARIABLE_NAME_INVALID":{"code":1510,"message":"variable name '%s' has an invalid format"},"ERROR_QUERY_VARIABLE_REDECLARED":{"code":1511,"message":"variable '%s' is assigned multiple times"},"ERROR_QUERY_VARIABLE_NAME_UNKNOWN":{"code":1512,"message":"unknown variable '%s'"},"ERROR_QUERY_COLLECTION_LOCK_FAILED":{"code":1521,"message":"unable to read-lock collection %s"},"ERROR_QUERY_TOO_MANY_COLLECTIONS":{"code":1522,"message":"too many collections"},"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED":{"code":1530,"message":"document attribute '%s' is assigned multiple times"},"ERROR_QUERY_FUNCTION_NAME_UNKNOWN":{"code":1540,"message":"usage of unknown function '%s()'"},"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH":{"code":1541,"message":"invalid number of arguments for function '%s()', expected number of arguments: minimum: %d, maximum: %d"},"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH":{"code":1542,"message":"invalid argument type in call to function '%s()'"},"ERROR_QUERY_INVALID_REGEX":{"code":1543,"message":"invalid regex value"},"ERROR_QUERY_BIND_PARAMETERS_INVALID":{"code":1550,"message":"invalid structure of bind parameters"},"ERROR_QUERY_BIND_PARAMETER_MISSING":{"code":1551,"message":"no value specified for declared bind parameter '%s'"},"ERROR_QUERY_BIND_PARAMETER_UNDECLARED":{"code":1552,"message":"bind parameter '%s' was not declared in the query"},"ERROR_QUERY_BIND_PARAMETER_TYPE":{"code":1553,"message":"bind parameter '%s' has an invalid value or type"},"ERROR_QUERY_INVALID_LOGICAL_VALUE":{"code":1560,"message":"invalid logical value"},"ERROR_QUERY_INVALID_ARITHMETIC_VALUE":{"code":1561,"message":"invalid arithmetic value"},"ERROR_QUERY_DIVISION_BY_ZERO":{"code":1562,"message":"division by zero"},"ERROR_QUERY_ARRAY_EXPECTED":{"code":1563,"message":"array expected"},"ERROR_QUERY_FAIL_CALLED":{"code":1569,"message":"FAIL(%s) called"},"ERROR_QUERY_GEO_INDEX_MISSING":{"code":1570,"message":"no suitable geo index found for geo restriction on '%s'"},"ERROR_QUERY_FULLTEXT_INDEX_MISSING":{"code":1571,"message":"no suitable fulltext index found for fulltext query on '%s'"},"ERROR_QUERY_INVALID_DATE_VALUE":{"code":1572,"message":"invalid date value"},"ERROR_QUERY_MULTI_MODIFY":{"code":1573,"message":"multi-modify query"},"ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION":{"code":1574,"message":"invalid aggregate expression"},"ERROR_QUERY_COMPILE_TIME_OPTIONS":{"code":1575,"message":"query options must be readable at query compile time"},"ERROR_QUERY_EXCEPTION_OPTIONS":{"code":1576,"message":"query options expected"},"ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION":{"code":1577,"message":"collection '%s' used as expression operand"},"ERROR_QUERY_DISALLOWED_DYNAMIC_CALL":{"code":1578,"message":"disallowed dynamic call to '%s'"},"ERROR_QUERY_ACCESS_AFTER_MODIFICATION":{"code":1579,"message":"access after data-modification"},"ERROR_QUERY_FUNCTION_INVALID_NAME":{"code":1580,"message":"invalid user function name"},"ERROR_QUERY_FUNCTION_INVALID_CODE":{"code":1581,"message":"invalid user function code"},"ERROR_QUERY_FUNCTION_NOT_FOUND":{"code":1582,"message":"user function '%s()' not found"},"ERROR_QUERY_FUNCTION_RUNTIME_ERROR":{"code":1583,"message":"user function runtime error: %s"},"ERROR_QUERY_BAD_JSON_PLAN":{"code":1590,"message":"bad execution plan JSON"},"ERROR_QUERY_NOT_FOUND":{"code":1591,"message":"query ID not found"},"ERROR_QUERY_IN_USE":{"code":1592,"message":"query with this ID is in use"},"ERROR_CURSOR_NOT_FOUND":{"code":1600,"message":"cursor not found"},"ERROR_CURSOR_BUSY":{"code":1601,"message":"cursor is busy"},"ERROR_TRANSACTION_INTERNAL":{"code":1650,"message":"internal transaction error"},"ERROR_TRANSACTION_NESTED":{"code":1651,"message":"nested transactions detected"},"ERROR_TRANSACTION_UNREGISTERED_COLLECTION":{"code":1652,"message":"unregistered collection used in transaction"},"ERROR_TRANSACTION_DISALLOWED_OPERATION":{"code":1653,"message":"disallowed operation inside transaction"},"ERROR_TRANSACTION_ABORTED":{"code":1654,"message":"transaction aborted"},"ERROR_USER_INVALID_NAME":{"code":1700,"message":"invalid user name"},"ERROR_USER_INVALID_PASSWORD":{"code":1701,"message":"invalid password"},"ERROR_USER_DUPLICATE":{"code":1702,"message":"duplicate user"},"ERROR_USER_NOT_FOUND":{"code":1703,"message":"user not found"},"ERROR_USER_CHANGE_PASSWORD":{"code":1704,"message":"user must change his password"},"ERROR_APPLICATION_INVALID_NAME":{"code":1750,"message":"invalid application name"},"ERROR_APPLICATION_INVALID_MOUNT":{"code":1751,"message":"invalid mount"},"ERROR_APPLICATION_DOWNLOAD_FAILED":{"code":1752,"message":"application download failed"},"ERROR_APPLICATION_UPLOAD_FAILED":{"code":1753,"message":"application upload failed"},"ERROR_KEYVALUE_INVALID_KEY":{"code":1800,"message":"invalid key declaration"},"ERROR_KEYVALUE_KEY_EXISTS":{"code":1801,"message":"key already exists"},"ERROR_KEYVALUE_KEY_NOT_FOUND":{"code":1802,"message":"key not found"},"ERROR_KEYVALUE_KEY_NOT_UNIQUE":{"code":1803,"message":"key is not unique"},"ERROR_KEYVALUE_KEY_NOT_CHANGED":{"code":1804,"message":"key value not changed"},"ERROR_KEYVALUE_KEY_NOT_REMOVED":{"code":1805,"message":"key value not removed"},"ERROR_KEYVALUE_NO_VALUE":{"code":1806,"message":"missing value"},"ERROR_TASK_INVALID_ID":{"code":1850,"message":"invalid task id"},"ERROR_TASK_DUPLICATE_ID":{"code":1851,"message":"duplicate task id"},"ERROR_TASK_NOT_FOUND":{"code":1852,"message":"task not found"},"ERROR_GRAPH_INVALID_GRAPH":{"code":1901,"message":"invalid graph"},"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH":{"code":1902,"message":"could not create graph"},"ERROR_GRAPH_INVALID_VERTEX":{"code":1903,"message":"invalid vertex"},"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX":{"code":1904,"message":"could not create vertex"},"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX":{"code":1905,"message":"could not change vertex"},"ERROR_GRAPH_INVALID_EDGE":{"code":1906,"message":"invalid edge"},"ERROR_GRAPH_COULD_NOT_CREATE_EDGE":{"code":1907,"message":"could not create edge"},"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE":{"code":1908,"message":"could not change edge"},"ERROR_GRAPH_TOO_MANY_ITERATIONS":{"code":1909,"message":"too many iterations - try increasing the value of 'maxIterations'"},"ERROR_GRAPH_INVALID_FILTER_RESULT":{"code":1910,"message":"invalid filter result"},"ERROR_GRAPH_COLLECTION_MULTI_USE":{"code":1920,"message":"multi use of edge collection in edge def"},"ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS":{"code":1921,"message":"edge collection already used in edge def"},"ERROR_GRAPH_CREATE_MISSING_NAME":{"code":1922,"message":"missing graph name"},"ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION":{"code":1923,"message":"malformed edge definition"},"ERROR_GRAPH_NOT_FOUND":{"code":1924,"message":"graph not found"},"ERROR_GRAPH_DUPLICATE":{"code":1925,"message":"graph already exists"},"ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST":{"code":1926,"message":"vertex collection does not exist or is not part of the graph"},"ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX":{"code":1927,"message":"not a vertex collection"},"ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION":{"code":1928,"message":"not in orphan collection"},"ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF":{"code":1929,"message":"collection already used in edge def"},"ERROR_GRAPH_EDGE_COLLECTION_NOT_USED":{"code":1930,"message":"edge collection not used in graph"},"ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION":{"code":1931,"message":" is not an ArangoCollection"},"ERROR_GRAPH_NO_GRAPH_COLLECTION":{"code":1932,"message":"collection _graphs does not exist"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING":{"code":1933,"message":"Invalid example type. Has to be String, Array or Object"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT":{"code":1934,"message":"Invalid example type. Has to be Array or Object"},"ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS":{"code":1935,"message":"Invalid number of arguments. Expected: "},"ERROR_GRAPH_INVALID_PARAMETER":{"code":1936,"message":"Invalid parameter type."},"ERROR_GRAPH_INVALID_ID":{"code":1937,"message":"Invalid id"},"ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS":{"code":1938,"message":"collection used in orphans"},"ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST":{"code":1939,"message":"edge collection does not exist or is not part of the graph"},"ERROR_GRAPH_EMPTY":{"code":1940,"message":"empty graph"},"ERROR_SESSION_UNKNOWN":{"code":1950,"message":"unknown session"},"ERROR_SESSION_EXPIRED":{"code":1951,"message":"session expired"},"SIMPLE_CLIENT_UNKNOWN_ERROR":{"code":2000,"message":"unknown client error"},"SIMPLE_CLIENT_COULD_NOT_CONNECT":{"code":2001,"message":"could not connect to server"},"SIMPLE_CLIENT_COULD_NOT_WRITE":{"code":2002,"message":"could not write to server"},"SIMPLE_CLIENT_COULD_NOT_READ":{"code":2003,"message":"could not read from server"},"ERROR_MALFORMED_MANIFEST_FILE":{"code":3000,"message":"malformed manifest file"},"ERROR_INVALID_APPLICATION_MANIFEST":{"code":3001,"message":"manifest file is invalid"},"ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING":{"code":3002,"message":"missing manifest attribute"},"ERROR_CANNOT_EXTRACT_APPLICATION_ROOT":{"code":3003,"message":"unable to extract app root path"},"ERROR_INVALID_FOXX_OPTIONS":{"code":3004,"message":"invalid foxx options"},"ERROR_FAILED_TO_EXECUTE_SCRIPT":{"code":3005,"message":"failed to execute script"},"ERROR_SYNTAX_ERROR_IN_SCRIPT":{"code":3006,"message":"syntax error in script"},"ERROR_INVALID_MOUNTPOINT":{"code":3007,"message":"mountpoint is invalid"},"ERROR_NO_FOXX_FOUND":{"code":3008,"message":"No foxx found at this location"},"ERROR_APP_NOT_FOUND":{"code":3009,"message":"App not found"},"ERROR_APP_NEEDS_CONFIGURATION":{"code":3010,"message":"App not configured"},"ERROR_MODULE_NOT_FOUND":{"code":3100,"message":"cannot locate module"},"ERROR_MODULE_SYNTAX_ERROR":{"code":3101,"message":"syntax error in module"},"ERROR_MODULE_BAD_WRAPPER":{"code":3102,"message":"failed to wrap module"},"ERROR_MODULE_FAILURE":{"code":3103,"message":"failed to invoke module"},"ERROR_MODULE_UNKNOWN_FILE_TYPE":{"code":3110,"message":"unknown file type"},"ERROR_MODULE_PATH_MUST_BE_ABSOLUTE":{"code":3111,"message":"path must be absolute"},"ERROR_MODULE_CAN_NOT_ESCAPE":{"code":3112,"message":"cannot use '..' to escape top-level-directory"},"ERROR_MODULE_DRIVE_LETTER":{"code":3113,"message":"drive local path is not supported"},"ERROR_MODULE_BAD_MODULE_ORIGIN":{"code":3120,"message":"corrupted module origin"},"ERROR_MODULE_BAD_PACKAGE_ORIGIN":{"code":3121,"message":"corrupted package origin"},"ERROR_MODULE_DOCUMENT_IS_EMPTY":{"code":3125,"message":"no content"},"ERROR_MODULE_MAIN_NOT_READABLE":{"code":3130,"message":"cannot read main file"},"ERROR_MODULE_MAIN_NOT_JS":{"code":3131,"message":"main file is not of type 'js'"},"RESULT_ELEMENT_EXISTS":{"code":10000,"message":"element not inserted into structure, because it already exists"},"RESULT_ELEMENT_NOT_FOUND":{"code":10001,"message":"element not found in structure"},"ERROR_APP_ALREADY_EXISTS":{"code":20000,"message":"newest version of app already installed"},"ERROR_QUEUE_ALREADY_EXISTS":{"code":21000,"message":"named queue already exists"},"ERROR_DISPATCHER_IS_STOPPING":{"code":21001,"message":"dispatcher stopped"},"ERROR_QUEUE_UNKNOWN":{"code":21002,"message":"named queue does not exist"},"ERROR_QUEUE_FULL":{"code":21003,"message":"named queue is full"}};})(); /*jshint -W051:true */ /*global jqconsole, Symbol */ /*eslint-disable */global.DEFINE_MODULE('console',(function(){'use strict'; /*eslint-enable */ ////////////////////////////////////////////////////////////////////////////////
+(function(){"use strict";var internal=require("internal");internal.errors = {"ERROR_NO_ERROR":{"code":0,"message":"no error"},"ERROR_FAILED":{"code":1,"message":"failed"},"ERROR_SYS_ERROR":{"code":2,"message":"system error"},"ERROR_OUT_OF_MEMORY":{"code":3,"message":"out of memory"},"ERROR_INTERNAL":{"code":4,"message":"internal error"},"ERROR_ILLEGAL_NUMBER":{"code":5,"message":"illegal number"},"ERROR_NUMERIC_OVERFLOW":{"code":6,"message":"numeric overflow"},"ERROR_ILLEGAL_OPTION":{"code":7,"message":"illegal option"},"ERROR_DEAD_PID":{"code":8,"message":"dead process identifier"},"ERROR_NOT_IMPLEMENTED":{"code":9,"message":"not implemented"},"ERROR_BAD_PARAMETER":{"code":10,"message":"bad parameter"},"ERROR_FORBIDDEN":{"code":11,"message":"forbidden"},"ERROR_OUT_OF_MEMORY_MMAP":{"code":12,"message":"out of memory in mmap"},"ERROR_CORRUPTED_CSV":{"code":13,"message":"csv is corrupt"},"ERROR_FILE_NOT_FOUND":{"code":14,"message":"file not found"},"ERROR_CANNOT_WRITE_FILE":{"code":15,"message":"cannot write file"},"ERROR_CANNOT_OVERWRITE_FILE":{"code":16,"message":"cannot overwrite file"},"ERROR_TYPE_ERROR":{"code":17,"message":"type error"},"ERROR_LOCK_TIMEOUT":{"code":18,"message":"lock timeout"},"ERROR_CANNOT_CREATE_DIRECTORY":{"code":19,"message":"cannot create directory"},"ERROR_CANNOT_CREATE_TEMP_FILE":{"code":20,"message":"cannot create temporary file"},"ERROR_REQUEST_CANCELED":{"code":21,"message":"canceled request"},"ERROR_DEBUG":{"code":22,"message":"intentional debug error"},"ERROR_AID_NOT_FOUND":{"code":23,"message":"internal error with attribute ID in shaper"},"ERROR_LEGEND_INCOMPLETE":{"code":24,"message":"internal error if a legend could not be created"},"ERROR_IP_ADDRESS_INVALID":{"code":25,"message":"IP address is invalid"},"ERROR_LEGEND_NOT_IN_WAL_FILE":{"code":26,"message":"internal error if a legend for a marker does not yet exist in the same WAL file"},"ERROR_FILE_EXISTS":{"code":27,"message":"file exists"},"ERROR_LOCKED":{"code":28,"message":"locked"},"ERROR_DEADLOCK":{"code":29,"message":"deadlock detected"},"ERROR_HTTP_BAD_PARAMETER":{"code":400,"message":"bad parameter"},"ERROR_HTTP_UNAUTHORIZED":{"code":401,"message":"unauthorized"},"ERROR_HTTP_FORBIDDEN":{"code":403,"message":"forbidden"},"ERROR_HTTP_NOT_FOUND":{"code":404,"message":"not found"},"ERROR_HTTP_METHOD_NOT_ALLOWED":{"code":405,"message":"method not supported"},"ERROR_HTTP_PRECONDITION_FAILED":{"code":412,"message":"precondition failed"},"ERROR_HTTP_SERVER_ERROR":{"code":500,"message":"internal server error"},"ERROR_HTTP_CORRUPTED_JSON":{"code":600,"message":"invalid JSON object"},"ERROR_HTTP_SUPERFLUOUS_SUFFICES":{"code":601,"message":"superfluous URL suffices"},"ERROR_ARANGO_ILLEGAL_STATE":{"code":1000,"message":"illegal state"},"ERROR_ARANGO_SHAPER_FAILED":{"code":1001,"message":"could not shape document"},"ERROR_ARANGO_DATAFILE_SEALED":{"code":1002,"message":"datafile sealed"},"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE":{"code":1003,"message":"unknown type"},"ERROR_ARANGO_READ_ONLY":{"code":1004,"message":"read only"},"ERROR_ARANGO_DUPLICATE_IDENTIFIER":{"code":1005,"message":"duplicate identifier"},"ERROR_ARANGO_DATAFILE_UNREADABLE":{"code":1006,"message":"datafile unreadable"},"ERROR_ARANGO_DATAFILE_EMPTY":{"code":1007,"message":"datafile empty"},"ERROR_ARANGO_RECOVERY":{"code":1008,"message":"logfile recovery error"},"ERROR_ARANGO_CORRUPTED_DATAFILE":{"code":1100,"message":"corrupted datafile"},"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE":{"code":1101,"message":"illegal or unreadable parameter file"},"ERROR_ARANGO_CORRUPTED_COLLECTION":{"code":1102,"message":"corrupted collection"},"ERROR_ARANGO_MMAP_FAILED":{"code":1103,"message":"mmap failed"},"ERROR_ARANGO_FILESYSTEM_FULL":{"code":1104,"message":"filesystem full"},"ERROR_ARANGO_NO_JOURNAL":{"code":1105,"message":"no journal"},"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS":{"code":1106,"message":"cannot create/rename datafile because it already exists"},"ERROR_ARANGO_DATADIR_LOCKED":{"code":1107,"message":"database directory is locked"},"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS":{"code":1108,"message":"cannot create/rename collection because directory already exists"},"ERROR_ARANGO_MSYNC_FAILED":{"code":1109,"message":"msync failed"},"ERROR_ARANGO_DATADIR_UNLOCKABLE":{"code":1110,"message":"cannot lock database directory"},"ERROR_ARANGO_SYNC_TIMEOUT":{"code":1111,"message":"sync timeout"},"ERROR_ARANGO_CONFLICT":{"code":1200,"message":"conflict"},"ERROR_ARANGO_DATADIR_INVALID":{"code":1201,"message":"invalid database directory"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND":{"code":1202,"message":"document not found"},"ERROR_ARANGO_COLLECTION_NOT_FOUND":{"code":1203,"message":"collection not found"},"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING":{"code":1204,"message":"parameter 'collection' not found"},"ERROR_ARANGO_DOCUMENT_HANDLE_BAD":{"code":1205,"message":"illegal document handle"},"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL":{"code":1206,"message":"maximal size of journal too small"},"ERROR_ARANGO_DUPLICATE_NAME":{"code":1207,"message":"duplicate name"},"ERROR_ARANGO_ILLEGAL_NAME":{"code":1208,"message":"illegal name"},"ERROR_ARANGO_NO_INDEX":{"code":1209,"message":"no suitable index known"},"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED":{"code":1210,"message":"unique constraint violated"},"ERROR_ARANGO_INDEX_NOT_FOUND":{"code":1212,"message":"index not found"},"ERROR_ARANGO_CROSS_COLLECTION_REQUEST":{"code":1213,"message":"cross collection request not allowed"},"ERROR_ARANGO_INDEX_HANDLE_BAD":{"code":1214,"message":"illegal index handle"},"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED":{"code":1215,"message":"cap constraint already defined"},"ERROR_ARANGO_DOCUMENT_TOO_LARGE":{"code":1216,"message":"document too large"},"ERROR_ARANGO_COLLECTION_NOT_UNLOADED":{"code":1217,"message":"collection must be unloaded"},"ERROR_ARANGO_COLLECTION_TYPE_INVALID":{"code":1218,"message":"collection type invalid"},"ERROR_ARANGO_VALIDATION_FAILED":{"code":1219,"message":"validator failed"},"ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED":{"code":1220,"message":"parsing attribute name definition failed"},"ERROR_ARANGO_DOCUMENT_KEY_BAD":{"code":1221,"message":"illegal document key"},"ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED":{"code":1222,"message":"unexpected document key"},"ERROR_ARANGO_DATADIR_NOT_WRITABLE":{"code":1224,"message":"server database directory not writable"},"ERROR_ARANGO_OUT_OF_KEYS":{"code":1225,"message":"out of keys"},"ERROR_ARANGO_DOCUMENT_KEY_MISSING":{"code":1226,"message":"missing document key"},"ERROR_ARANGO_DOCUMENT_TYPE_INVALID":{"code":1227,"message":"invalid document type"},"ERROR_ARANGO_DATABASE_NOT_FOUND":{"code":1228,"message":"database not found"},"ERROR_ARANGO_DATABASE_NAME_INVALID":{"code":1229,"message":"database name invalid"},"ERROR_ARANGO_USE_SYSTEM_DATABASE":{"code":1230,"message":"operation only allowed in system database"},"ERROR_ARANGO_ENDPOINT_NOT_FOUND":{"code":1231,"message":"endpoint not found"},"ERROR_ARANGO_INVALID_KEY_GENERATOR":{"code":1232,"message":"invalid key generator"},"ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE":{"code":1233,"message":"edge attribute missing"},"ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING":{"code":1234,"message":"index insertion warning - attribute missing in document"},"ERROR_ARANGO_INDEX_CREATION_FAILED":{"code":1235,"message":"index creation failed"},"ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT":{"code":1236,"message":"write-throttling timeout"},"ERROR_ARANGO_COLLECTION_TYPE_MISMATCH":{"code":1237,"message":"collection type mismatch"},"ERROR_ARANGO_COLLECTION_NOT_LOADED":{"code":1238,"message":"collection not loaded"},"ERROR_ARANGO_DATAFILE_FULL":{"code":1300,"message":"datafile full"},"ERROR_ARANGO_EMPTY_DATADIR":{"code":1301,"message":"server database directory is empty"},"ERROR_REPLICATION_NO_RESPONSE":{"code":1400,"message":"no response"},"ERROR_REPLICATION_INVALID_RESPONSE":{"code":1401,"message":"invalid response"},"ERROR_REPLICATION_MASTER_ERROR":{"code":1402,"message":"master error"},"ERROR_REPLICATION_MASTER_INCOMPATIBLE":{"code":1403,"message":"master incompatible"},"ERROR_REPLICATION_MASTER_CHANGE":{"code":1404,"message":"master change"},"ERROR_REPLICATION_LOOP":{"code":1405,"message":"loop detected"},"ERROR_REPLICATION_UNEXPECTED_MARKER":{"code":1406,"message":"unexpected marker"},"ERROR_REPLICATION_INVALID_APPLIER_STATE":{"code":1407,"message":"invalid applier state"},"ERROR_REPLICATION_UNEXPECTED_TRANSACTION":{"code":1408,"message":"invalid transaction"},"ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION":{"code":1410,"message":"invalid replication applier configuration"},"ERROR_REPLICATION_RUNNING":{"code":1411,"message":"cannot perform operation while applier is running"},"ERROR_REPLICATION_APPLIER_STOPPED":{"code":1412,"message":"replication stopped"},"ERROR_REPLICATION_NO_START_TICK":{"code":1413,"message":"no start tick"},"ERROR_REPLICATION_START_TICK_NOT_PRESENT":{"code":1414,"message":"start tick not present"},"ERROR_CLUSTER_NO_AGENCY":{"code":1450,"message":"could not connect to agency"},"ERROR_CLUSTER_NO_COORDINATOR_HEADER":{"code":1451,"message":"missing coordinator header"},"ERROR_CLUSTER_COULD_NOT_LOCK_PLAN":{"code":1452,"message":"could not lock plan in agency"},"ERROR_CLUSTER_COLLECTION_ID_EXISTS":{"code":1453,"message":"collection ID already exists"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN":{"code":1454,"message":"could not create collection in plan"},"ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION":{"code":1455,"message":"could not read version in current in agency"},"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION":{"code":1456,"message":"could not create collection"},"ERROR_CLUSTER_TIMEOUT":{"code":1457,"message":"timeout in cluster operation"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN":{"code":1458,"message":"could not remove collection from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT":{"code":1459,"message":"could not remove collection from current"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN":{"code":1460,"message":"could not create database in plan"},"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE":{"code":1461,"message":"could not create database"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN":{"code":1462,"message":"could not remove database from plan"},"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT":{"code":1463,"message":"could not remove database from current"},"ERROR_CLUSTER_SHARD_GONE":{"code":1464,"message":"no responsible shard found"},"ERROR_CLUSTER_CONNECTION_LOST":{"code":1465,"message":"cluster internal HTTP connection broken"},"ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY":{"code":1466,"message":"must not specify _key for this collection"},"ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS":{"code":1467,"message":"got contradicting answers from different shards"},"ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN":{"code":1468,"message":"not all sharding attributes given"},"ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES":{"code":1469,"message":"must not change the value of a shard key attribute"},"ERROR_CLUSTER_UNSUPPORTED":{"code":1470,"message":"unsupported operation or parameter"},"ERROR_CLUSTER_ONLY_ON_COORDINATOR":{"code":1471,"message":"this operation is only valid on a coordinator in a cluster"},"ERROR_CLUSTER_READING_PLAN_AGENCY":{"code":1472,"message":"error reading Plan in agency"},"ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION":{"code":1473,"message":"could not truncate collection"},"ERROR_CLUSTER_AQL_COMMUNICATION":{"code":1474,"message":"error in cluster internal communication for AQL"},"ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED":{"code":1475,"message":"document not found or sharding attributes changed"},"ERROR_CLUSTER_COULD_NOT_DETERMINE_ID":{"code":1476,"message":"could not determine my ID from my local info"},"ERROR_CLUSTER_ONLY_ON_DBSERVER":{"code":1477,"message":"this operation is only valid on a DBserver in a cluster"},"ERROR_QUERY_KILLED":{"code":1500,"message":"query killed"},"ERROR_QUERY_PARSE":{"code":1501,"message":"%s"},"ERROR_QUERY_EMPTY":{"code":1502,"message":"query is empty"},"ERROR_QUERY_SCRIPT":{"code":1503,"message":"runtime error '%s'"},"ERROR_QUERY_NUMBER_OUT_OF_RANGE":{"code":1504,"message":"number out of range"},"ERROR_QUERY_VARIABLE_NAME_INVALID":{"code":1510,"message":"variable name '%s' has an invalid format"},"ERROR_QUERY_VARIABLE_REDECLARED":{"code":1511,"message":"variable '%s' is assigned multiple times"},"ERROR_QUERY_VARIABLE_NAME_UNKNOWN":{"code":1512,"message":"unknown variable '%s'"},"ERROR_QUERY_COLLECTION_LOCK_FAILED":{"code":1521,"message":"unable to read-lock collection %s"},"ERROR_QUERY_TOO_MANY_COLLECTIONS":{"code":1522,"message":"too many collections"},"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED":{"code":1530,"message":"document attribute '%s' is assigned multiple times"},"ERROR_QUERY_FUNCTION_NAME_UNKNOWN":{"code":1540,"message":"usage of unknown function '%s()'"},"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH":{"code":1541,"message":"invalid number of arguments for function '%s()', expected number of arguments: minimum: %d, maximum: %d"},"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH":{"code":1542,"message":"invalid argument type in call to function '%s()'"},"ERROR_QUERY_INVALID_REGEX":{"code":1543,"message":"invalid regex value"},"ERROR_QUERY_BIND_PARAMETERS_INVALID":{"code":1550,"message":"invalid structure of bind parameters"},"ERROR_QUERY_BIND_PARAMETER_MISSING":{"code":1551,"message":"no value specified for declared bind parameter '%s'"},"ERROR_QUERY_BIND_PARAMETER_UNDECLARED":{"code":1552,"message":"bind parameter '%s' was not declared in the query"},"ERROR_QUERY_BIND_PARAMETER_TYPE":{"code":1553,"message":"bind parameter '%s' has an invalid value or type"},"ERROR_QUERY_INVALID_LOGICAL_VALUE":{"code":1560,"message":"invalid logical value"},"ERROR_QUERY_INVALID_ARITHMETIC_VALUE":{"code":1561,"message":"invalid arithmetic value"},"ERROR_QUERY_DIVISION_BY_ZERO":{"code":1562,"message":"division by zero"},"ERROR_QUERY_ARRAY_EXPECTED":{"code":1563,"message":"array expected"},"ERROR_QUERY_FAIL_CALLED":{"code":1569,"message":"FAIL(%s) called"},"ERROR_QUERY_GEO_INDEX_MISSING":{"code":1570,"message":"no suitable geo index found for geo restriction on '%s'"},"ERROR_QUERY_FULLTEXT_INDEX_MISSING":{"code":1571,"message":"no suitable fulltext index found for fulltext query on '%s'"},"ERROR_QUERY_INVALID_DATE_VALUE":{"code":1572,"message":"invalid date value"},"ERROR_QUERY_MULTI_MODIFY":{"code":1573,"message":"multi-modify query"},"ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION":{"code":1574,"message":"invalid aggregate expression"},"ERROR_QUERY_COMPILE_TIME_OPTIONS":{"code":1575,"message":"query options must be readable at query compile time"},"ERROR_QUERY_EXCEPTION_OPTIONS":{"code":1576,"message":"query options expected"},"ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION":{"code":1577,"message":"collection '%s' used as expression operand"},"ERROR_QUERY_DISALLOWED_DYNAMIC_CALL":{"code":1578,"message":"disallowed dynamic call to '%s'"},"ERROR_QUERY_ACCESS_AFTER_MODIFICATION":{"code":1579,"message":"access after data-modification"},"ERROR_QUERY_FUNCTION_INVALID_NAME":{"code":1580,"message":"invalid user function name"},"ERROR_QUERY_FUNCTION_INVALID_CODE":{"code":1581,"message":"invalid user function code"},"ERROR_QUERY_FUNCTION_NOT_FOUND":{"code":1582,"message":"user function '%s()' not found"},"ERROR_QUERY_FUNCTION_RUNTIME_ERROR":{"code":1583,"message":"user function runtime error: %s"},"ERROR_QUERY_BAD_JSON_PLAN":{"code":1590,"message":"bad execution plan JSON"},"ERROR_QUERY_NOT_FOUND":{"code":1591,"message":"query ID not found"},"ERROR_QUERY_IN_USE":{"code":1592,"message":"query with this ID is in use"},"ERROR_CURSOR_NOT_FOUND":{"code":1600,"message":"cursor not found"},"ERROR_CURSOR_BUSY":{"code":1601,"message":"cursor is busy"},"ERROR_TRANSACTION_INTERNAL":{"code":1650,"message":"internal transaction error"},"ERROR_TRANSACTION_NESTED":{"code":1651,"message":"nested transactions detected"},"ERROR_TRANSACTION_UNREGISTERED_COLLECTION":{"code":1652,"message":"unregistered collection used in transaction"},"ERROR_TRANSACTION_DISALLOWED_OPERATION":{"code":1653,"message":"disallowed operation inside transaction"},"ERROR_TRANSACTION_ABORTED":{"code":1654,"message":"transaction aborted"},"ERROR_USER_INVALID_NAME":{"code":1700,"message":"invalid user name"},"ERROR_USER_INVALID_PASSWORD":{"code":1701,"message":"invalid password"},"ERROR_USER_DUPLICATE":{"code":1702,"message":"duplicate user"},"ERROR_USER_NOT_FOUND":{"code":1703,"message":"user not found"},"ERROR_USER_CHANGE_PASSWORD":{"code":1704,"message":"user must change his password"},"ERROR_APPLICATION_INVALID_NAME":{"code":1750,"message":"invalid application name"},"ERROR_APPLICATION_INVALID_MOUNT":{"code":1751,"message":"invalid mount"},"ERROR_APPLICATION_DOWNLOAD_FAILED":{"code":1752,"message":"application download failed"},"ERROR_APPLICATION_UPLOAD_FAILED":{"code":1753,"message":"application upload failed"},"ERROR_KEYVALUE_INVALID_KEY":{"code":1800,"message":"invalid key declaration"},"ERROR_KEYVALUE_KEY_EXISTS":{"code":1801,"message":"key already exists"},"ERROR_KEYVALUE_KEY_NOT_FOUND":{"code":1802,"message":"key not found"},"ERROR_KEYVALUE_KEY_NOT_UNIQUE":{"code":1803,"message":"key is not unique"},"ERROR_KEYVALUE_KEY_NOT_CHANGED":{"code":1804,"message":"key value not changed"},"ERROR_KEYVALUE_KEY_NOT_REMOVED":{"code":1805,"message":"key value not removed"},"ERROR_KEYVALUE_NO_VALUE":{"code":1806,"message":"missing value"},"ERROR_TASK_INVALID_ID":{"code":1850,"message":"invalid task id"},"ERROR_TASK_DUPLICATE_ID":{"code":1851,"message":"duplicate task id"},"ERROR_TASK_NOT_FOUND":{"code":1852,"message":"task not found"},"ERROR_GRAPH_INVALID_GRAPH":{"code":1901,"message":"invalid graph"},"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH":{"code":1902,"message":"could not create graph"},"ERROR_GRAPH_INVALID_VERTEX":{"code":1903,"message":"invalid vertex"},"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX":{"code":1904,"message":"could not create vertex"},"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX":{"code":1905,"message":"could not change vertex"},"ERROR_GRAPH_INVALID_EDGE":{"code":1906,"message":"invalid edge"},"ERROR_GRAPH_COULD_NOT_CREATE_EDGE":{"code":1907,"message":"could not create edge"},"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE":{"code":1908,"message":"could not change edge"},"ERROR_GRAPH_TOO_MANY_ITERATIONS":{"code":1909,"message":"too many iterations - try increasing the value of 'maxIterations'"},"ERROR_GRAPH_INVALID_FILTER_RESULT":{"code":1910,"message":"invalid filter result"},"ERROR_GRAPH_COLLECTION_MULTI_USE":{"code":1920,"message":"multi use of edge collection in edge def"},"ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS":{"code":1921,"message":"edge collection already used in edge def"},"ERROR_GRAPH_CREATE_MISSING_NAME":{"code":1922,"message":"missing graph name"},"ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION":{"code":1923,"message":"malformed edge definition"},"ERROR_GRAPH_NOT_FOUND":{"code":1924,"message":"graph not found"},"ERROR_GRAPH_DUPLICATE":{"code":1925,"message":"graph already exists"},"ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST":{"code":1926,"message":"vertex collection does not exist or is not part of the graph"},"ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX":{"code":1927,"message":"not a vertex collection"},"ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION":{"code":1928,"message":"not in orphan collection"},"ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF":{"code":1929,"message":"collection already used in edge def"},"ERROR_GRAPH_EDGE_COLLECTION_NOT_USED":{"code":1930,"message":"edge collection not used in graph"},"ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION":{"code":1931,"message":" is not an ArangoCollection"},"ERROR_GRAPH_NO_GRAPH_COLLECTION":{"code":1932,"message":"collection _graphs does not exist"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING":{"code":1933,"message":"Invalid example type. Has to be String, Array or Object"},"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT":{"code":1934,"message":"Invalid example type. Has to be Array or Object"},"ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS":{"code":1935,"message":"Invalid number of arguments. Expected: "},"ERROR_GRAPH_INVALID_PARAMETER":{"code":1936,"message":"Invalid parameter type."},"ERROR_GRAPH_INVALID_ID":{"code":1937,"message":"Invalid id"},"ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS":{"code":1938,"message":"collection used in orphans"},"ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST":{"code":1939,"message":"edge collection does not exist or is not part of the graph"},"ERROR_GRAPH_EMPTY":{"code":1940,"message":"empty graph"},"ERROR_SESSION_UNKNOWN":{"code":1950,"message":"unknown session"},"ERROR_SESSION_EXPIRED":{"code":1951,"message":"session expired"},"SIMPLE_CLIENT_UNKNOWN_ERROR":{"code":2000,"message":"unknown client error"},"SIMPLE_CLIENT_COULD_NOT_CONNECT":{"code":2001,"message":"could not connect to server"},"SIMPLE_CLIENT_COULD_NOT_WRITE":{"code":2002,"message":"could not write to server"},"SIMPLE_CLIENT_COULD_NOT_READ":{"code":2003,"message":"could not read from server"},"ERROR_MALFORMED_MANIFEST_FILE":{"code":3000,"message":"malformed manifest file"},"ERROR_INVALID_APPLICATION_MANIFEST":{"code":3001,"message":"manifest file is invalid"},"ERROR_INVALID_FOXX_OPTIONS":{"code":3004,"message":"invalid foxx options"},"ERROR_INVALID_MOUNTPOINT":{"code":3007,"message":"mountpoint is invalid"},"ERROR_APP_NOT_FOUND":{"code":3009,"message":"App not found"},"ERROR_APP_NEEDS_CONFIGURATION":{"code":3010,"message":"App not configured"},"ERROR_MODULE_NOT_FOUND":{"code":3100,"message":"cannot locate module"},"ERROR_MODULE_FAILURE":{"code":3103,"message":"failed to invoke module"},"RESULT_ELEMENT_EXISTS":{"code":10000,"message":"element not inserted into structure, because it already exists"},"RESULT_ELEMENT_NOT_FOUND":{"code":10001,"message":"element not found in structure"},"ERROR_QUEUE_ALREADY_EXISTS":{"code":21000,"message":"named queue already exists"},"ERROR_DISPATCHER_IS_STOPPING":{"code":21001,"message":"dispatcher stopped"},"ERROR_QUEUE_UNKNOWN":{"code":21002,"message":"named queue does not exist"},"ERROR_QUEUE_FULL":{"code":21003,"message":"named queue is full"}};})(); /*jshint -W051:true */ /*global jqconsole, Symbol */ /*eslint-disable */global.DEFINE_MODULE('console',(function(){'use strict'; /*eslint-enable */ ////////////////////////////////////////////////////////////////////////////////
/// @brief module "console"
///
/// @file
@@ -1183,7 +1183,7 @@ exports.createHelpHeadline = function(text){var i;var p="";var x=Math.abs(78 - t
/// throws an exception in case of an an error
////////////////////////////////////////////////////////////////////////////////
// must came after the export of createHelpHeadline
-var arangodb=require("@arangodb");var ArangoError=arangodb.ArangoError;exports.checkRequestResult = function(requestResult){if(requestResult === undefined){throw new ArangoError({"error":true,"code":500,"errorNum":arangodb.ERROR_INTERNAL,"errorMessage":"Unknown error. Request result is empty"});}if(requestResult.hasOwnProperty('error')){if(requestResult.error){if(requestResult.errorNum === arangodb.ERROR_TYPE_ERROR){throw new TypeError(requestResult.errorMessage);}throw new ArangoError(requestResult);} // remove the property from the original object
+var arangodb=require("@arangodb");var ArangoError=arangodb.ArangoError;exports.checkRequestResult = function(requestResult){if(requestResult === undefined){throw new ArangoError({"error":true,"code":500,"errorNum":arangodb.ERROR_INTERNAL,"errorMessage":"Unknown error. Request result is empty"});}if(requestResult.hasOwnProperty('error')){if(requestResult.error){if(requestResult.errorNum === arangodb.ERROR_TYPE_ERROR){throw new TypeError(requestResult.errorMessage);}var error=new ArangoError(requestResult);error.message = requestResult.message;throw error;} // remove the property from the original object
delete requestResult.error;}return requestResult;}; ////////////////////////////////////////////////////////////////////////////////
/// @brief general help
////////////////////////////////////////////////////////////////////////////////
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes6.js b/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes6.js
index 52a0edfd23..66e6ece074 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes6.js
+++ b/js/apps/system/_admin/aardvark/APP/frontend/build/arangoes6.js
@@ -49,22 +49,27 @@ if (global.ArangoError) {
this.errorNum = error.errorNum;
this.errorMessage = error.errorMessage;
}
-
- this.message = this.toString();
};
exports.ArangoError.prototype = new Error();
}
+Object.defineProperty(exports.ArangoError.prototype, 'message', {
+ configurable: true,
+ enumerable: true,
+ get() {
+ return this.errorMessage;
+ }
+});
+
+exports.ArangoError.prototype.name = 'ArangoError';
+
exports.ArangoError.prototype._PRINT = function(context) {
- context.output += this.toString();
+ context.output += '[' + this.toString() + ']';
};
exports.ArangoError.prototype.toString = function() {
- var errorNum = this.errorNum;
- var errorMessage = this.errorMessage || this.message;
-
- return '[ArangoError ' + errorNum + ': ' + errorMessage + ']';
+ return `${this.name} ${this.errorNum}: ${this.message}`;
};
@@ -2071,31 +2076,14 @@ return exports;
"SIMPLE_CLIENT_COULD_NOT_READ" : { "code" : 2003, "message" : "could not read from server" },
"ERROR_MALFORMED_MANIFEST_FILE" : { "code" : 3000, "message" : "malformed manifest file" },
"ERROR_INVALID_APPLICATION_MANIFEST" : { "code" : 3001, "message" : "manifest file is invalid" },
- "ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING" : { "code" : 3002, "message" : "missing manifest attribute" },
- "ERROR_CANNOT_EXTRACT_APPLICATION_ROOT" : { "code" : 3003, "message" : "unable to extract app root path" },
"ERROR_INVALID_FOXX_OPTIONS" : { "code" : 3004, "message" : "invalid foxx options" },
- "ERROR_FAILED_TO_EXECUTE_SCRIPT" : { "code" : 3005, "message" : "failed to execute script" },
- "ERROR_SYNTAX_ERROR_IN_SCRIPT" : { "code" : 3006, "message" : "syntax error in script" },
"ERROR_INVALID_MOUNTPOINT" : { "code" : 3007, "message" : "mountpoint is invalid" },
- "ERROR_NO_FOXX_FOUND" : { "code" : 3008, "message" : "No foxx found at this location" },
"ERROR_APP_NOT_FOUND" : { "code" : 3009, "message" : "App not found" },
"ERROR_APP_NEEDS_CONFIGURATION" : { "code" : 3010, "message" : "App not configured" },
"ERROR_MODULE_NOT_FOUND" : { "code" : 3100, "message" : "cannot locate module" },
- "ERROR_MODULE_SYNTAX_ERROR" : { "code" : 3101, "message" : "syntax error in module" },
- "ERROR_MODULE_BAD_WRAPPER" : { "code" : 3102, "message" : "failed to wrap module" },
"ERROR_MODULE_FAILURE" : { "code" : 3103, "message" : "failed to invoke module" },
- "ERROR_MODULE_UNKNOWN_FILE_TYPE" : { "code" : 3110, "message" : "unknown file type" },
- "ERROR_MODULE_PATH_MUST_BE_ABSOLUTE" : { "code" : 3111, "message" : "path must be absolute" },
- "ERROR_MODULE_CAN_NOT_ESCAPE" : { "code" : 3112, "message" : "cannot use '..' to escape top-level-directory" },
- "ERROR_MODULE_DRIVE_LETTER" : { "code" : 3113, "message" : "drive local path is not supported" },
- "ERROR_MODULE_BAD_MODULE_ORIGIN" : { "code" : 3120, "message" : "corrupted module origin" },
- "ERROR_MODULE_BAD_PACKAGE_ORIGIN" : { "code" : 3121, "message" : "corrupted package origin" },
- "ERROR_MODULE_DOCUMENT_IS_EMPTY" : { "code" : 3125, "message" : "no content" },
- "ERROR_MODULE_MAIN_NOT_READABLE" : { "code" : 3130, "message" : "cannot read main file" },
- "ERROR_MODULE_MAIN_NOT_JS" : { "code" : 3131, "message" : "main file is not of type 'js'" },
"RESULT_ELEMENT_EXISTS" : { "code" : 10000, "message" : "element not inserted into structure, because it already exists" },
"RESULT_ELEMENT_NOT_FOUND" : { "code" : 10001, "message" : "element not found in structure" },
- "ERROR_APP_ALREADY_EXISTS" : { "code" : 20000, "message" : "newest version of app already installed" },
"ERROR_QUEUE_ALREADY_EXISTS" : { "code" : 21000, "message" : "named queue already exists" },
"ERROR_DISPATCHER_IS_STOPPING" : { "code" : 21001, "message" : "dispatcher stopped" },
"ERROR_QUEUE_UNKNOWN" : { "code" : 21002, "message" : "named queue does not exist" },
@@ -6007,7 +5995,9 @@ exports.checkRequestResult = function (requestResult) {
throw new TypeError(requestResult.errorMessage);
}
- throw new ArangoError(requestResult);
+ const error = new ArangoError(requestResult);
+ error.message = requestResult.message;
+ throw error;
}
// remove the property from the original object
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/scripts.html.part b/js/apps/system/_admin/aardvark/APP/frontend/build/scripts.html.part
index 89973ca9b1..9dbe6415d6 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/build/scripts.html.part
+++ b/js/apps/system/_admin/aardvark/APP/frontend/build/scripts.html.part
@@ -1,3 +1,3 @@
-
-
-
+
+
+
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html
index 6852497622..750457cf23 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html
+++ b/js/apps/system/_admin/aardvark/APP/frontend/build/standalone-min.html
@@ -2780,4 +2780,4 @@ var cutByResolution = function (str) {