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 45717c67a2..891d950381 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 @@ -8,7 +8,7 @@ edgeDefintionTemplate:templateEngine.createTemplate("edgeDefinitionTable.ejs"),e gv:["#68BDF6","#6DCE9E","#FF756E","#DE9BF9","#FB95AF","#FFD86E","#A5ABB6"]},activeNodes:[],selectedNodes:{},aqlMode:!1,events:{"click #downloadPNG":"downloadPNG","click #loadFullGraph":"loadFullGraphModal","click #reloadGraph":"reloadGraph","click #settingsMenu":"toggleSettings","click #toggleForce":"toggleLayout","click #selectNodes":"toggleLasso"},cursorX:0,cursorY:0,layouting:!1,model:null,viewStates:{captureMode:!1},graphConfig:null,graphSettings:null,downloadPNG:function(){var a=parseInt($("#graph-container").width(),10);sigma.plugins.image(this.currentGraph,this.currentGraph.renderers[0],{download:!0,size:a,clip:!0,labels:!0,background:"white",zoom:!1})},loadFullGraphModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("load-full-graph-a","Caution","Really load full graph? If no limit is set, your result set could be too big.")),a.push(window.modalView.createSuccessButton("Load full graph",this.loadFullGraph.bind(this))),window.modalView.show("modalTable.ejs","Load full graph",a,b)},loadFullGraph:function(){var a=this,b={};this.graphConfig&&(b=_.clone(this.graphConfig),delete b.layout,delete b.edgeType,delete b.renderer),b.mode="all",$.ajax({type:"GET",url:arangoHelper.databaseUrl("/_admin/aardvark/graph/"+encodeURIComponent(this.name)),contentType:"application/json",data:b,success:function(b){a.killCurrentGraph(),a.renderGraph(b)},error:function(a){console.log(a),arangoHelper.arangoError("Graph","Could not load full graph.")}}),window.modalView.hide()},resize:function(){$("#graph-container").width($(".centralContent").width()),$("#graph-container").height($(".centralRow").height()-155)},toggleSettings:function(){this.graphSettingsView.toggle()},render:function(a){this.$el.html(this.template.render({})),$("#subNavigationBar .breadcrumb").html("Graph: "+this.name),this.resize(),this.fetchGraph(a),this.initFullscreen()},initFullscreen:function(){var a=this;if(window.App.initializedFullscreen===!1||void 0===window.App.initializedFullscreen){window.App.initializedFullscreen=!0,this.isFullscreen=!1;var b=function(b){(document.webkitIsFullScreen||document.mozFullScreen||null!==document.msFullscreenElement)&&(a.isFullscreen===!1?(a.isFullscreen=!0,$("#toggleForce").css("bottom","10px"),$("#toggleForce").css("right","10px"),$("#objectCount").css("bottom","10px"),$("#objectCount").css("left","10px"),$(".nodeInfoDiv").css("top","10px"),$(".nodeInfoDiv").css("left","10px")):(a.isFullscreen=!1,$("#toggleForce").css("bottom","40px"),$("#toggleForce").css("right","40px"),$("#objectCount").css("bottom","50px"),$("#objectCount").css("left","25px"),$(".nodeInfoDiv").css("top",""),$(".nodeInfoDiv").css("left","165px")))};document.addEventListener&&(document.addEventListener("webkitfullscreenchange",b,!1),document.addEventListener("mozfullscreenchange",b,!1),document.addEventListener("fullscreenchange",b,!1),document.addEventListener("MSFullscreenChange",b,!1))}},renderAQLPreview:function(a){this.$el.html(this.template.render({})),this.$el.find(".headerBar").remove();var b=$(".centralRow").height()-250;this.$el.find("#graph-container").css("height",b),this.graphData.modified=this.parseData(this.graphData.original,this.graphData.graphInfo);var c=!1;try{this.renderGraph(this.graphData.modified,null,!0),c=!0}catch(d){}return c},renderAQL:function(a){this.$el.html(this.template.render({})),$("#subNavigationBar .breadcrumb").html("AQL Graph"),$("#subNavigationBar .bottom").html(""),$(".queries-menu").removeClass("active"),this.resize(),this.graphData.modified=this.parseData(this.graphData.original,this.graphData.graphInfo),this.renderGraph(this.graphData.modified,null,!1),this.initFullscreen(),this.graphSettingsView=new window.GraphSettingsView({name:this.name,userConfig:void 0,saveCallback:void 0,noDefinedGraph:!0}),this.graphSettingsView.render()},killCurrentGraph:function(){if(this.currentGraph&&this.currentGraph.renderers)for(var a in this.currentGraph.renderers)try{this.currentGraph.renderers[a].clear(),this.currentGraph.kill(a)}catch(b){}},rerenderAQL:function(a,b){this.killCurrentGraph(),this.renderGraph(this.graphData.modified,null,!1,a,"canvas"),"true"===$("#g_nodeColorByCollection").val()?this.switchNodeColorByCollection(!0):$("#g_nodeColor").is(":disabled")?this.updateColors(!0,!0,null,null,!0):this.ncolor?this.updateColors(!0,!0,this.ncolor,this.ecolor):this.updateColors(!0,!0,"#2ecc71","#2ecc71"),"true"===$("#g_edgeColorByCollection").val()?this.switchEdgeColorByCollection(!0):$("#g_edgeColor").is(":disabled")?this.updateColors(!0,!0,null,null,!0):this.ecolor?this.updateColors(!0,!0,this.ncolor,this.ecolor):this.updateColors(!0,!0,"#2ecc71","#2ecc71")},buildCollectionColors:function(){var a=this;if(!a.collectionColors){a.collectionColors={};var b=0,c={},d={};_.each(this.currentGraph.graph.nodes(),function(a){c[a.id]=void 0}),_.each(a.currentGraph.graph.edges(),function(a){d[a.id]=void 0}),_.each(c,function(c,d){void 0===a.collectionColors[d.split("/")[0]]&&(a.collectionColors[d.split("/")[0]]={color:a.colors.jans[b]},b++)}),b=0,_.each(d,function(c,d){void 0===a.collectionColors[d.split("/")[0]]&&(a.collectionColors[d.split("/")[0]]={color:a.colors.jans[b]},b++)})}},switchNodeColorByCollection:function(a,b){var c=this;c.buildCollectionColors(),a?(c.currentGraph.graph.nodes().forEach(function(a){a.color=c.collectionColors[a.id.split("/")[0]].color}),c.currentGraph.refresh()):b?this.updateColors(!0,null,null,null,b):this.ncolor?this.updateColors(!0,null,this.ncolor,this.ecolor):this.updateColors(!0,null,"#2ecc71","#2ecc71")},switchEdgeColorByCollection:function(a,b){var c=this;c.buildCollectionColors(),a?(c.currentGraph.graph.edges().forEach(function(a){a.color=c.collectionColors[a.id.split("/")[0]].color}),c.currentGraph.refresh()):b?this.updateColors(!0,null,null,null,b):this.ecolor?this.updateColors(null,!0,this.ncolor,this.ecolor):this.updateColors(null,!0,"#2ecc71","#2ecc71")},buildCollectionSizes:function(){var a=this;if(!a.nodeEdgesCount){a.nodeEdgesCount={};var b={};_.each(this.currentGraph.graph.edges(),function(c){void 0===b[c.id]&&(b[c.id]=!0,void 0===a.nodeEdgesCount[c.source]?a.nodeEdgesCount[c.source]=1:a.nodeEdgesCount[c.source]+=1,void 0===a.nodeEdgesCount[c.target]?a.nodeEdgesCount[c.target]=1:a.nodeEdgesCount[c.target]+=1)})}},switchNodeSizeByCollection:function(a){var b=this;a?(b.buildCollectionSizes(),b.currentGraph.graph.nodes().forEach(function(a){a.size=b.nodeEdgesCount[a.id]})):b.currentGraph.graph.nodes().forEach(function(a){a.size=15}),b.currentGraph.refresh()},switchEdgeType:function(a){var b={nodes:this.currentGraph.graph.nodes(),edges:this.currentGraph.graph.edges(),settings:{}};this.killCurrentGraph(),this.renderGraph(b,null,!1,null,null,a)},switchLayout:function(a){var b={nodes:this.currentGraph.graph.nodes(),edges:this.currentGraph.graph.edges(),settings:{}};this.killCurrentGraph(),this.renderGraph(b,null,!1,a),"true"===$("#g_nodeColorByCollection").val()&&this.switchNodeColorByCollection(!0),"true"===$("#g_edgeColorByCollection").val()?this.switchEdgeColorByCollection(!0):this.switchEdgeColorByCollection(!1)},parseData:function(a,b){var c={},d={},e="#2ecc71",f={nodes:[],edges:[],settings:{}};if(this.ncolor&&(e=this.ncolor),"object"===b){_.each(a,function(a){a.edges&&a.vertices&&(_.each(a.edges,function(a){null!==a&&(d[a._id]={id:a._id,source:a._from,color:"#cccccc",target:a._to})}),_.each(a.vertices,function(a){null!==a&&(c[a._id]={id:a._id,label:a._key,size:.3,color:e,x:Math.random(),y:Math.random()})}))});var g=[];_.each(c,function(a){f.nodes.push(a),g.push(a.id)}),_.each(d,function(a){g.includes(a.source)&&g.includes(a.target)&&f.edges.push(a)})}else"array"===b&&(_.each(a,function(a){c[a._from]=null,c[a._to]=null,f.edges.push({id:a._id,source:a._from,color:"#cccccc",target:a._to})}),_.each(c,function(a,b){f.nodes.push({id:b,label:b,size:.3,color:e,x:Math.random(),y:Math.random()})}));return f},rerender:function(){this.fetchGraph()},fetchGraph:function(a){var b=this;$(this.el).append('
'+a+"
"),$("#modal-dialog").is(":visible")?$("#modal-dialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled"):$(".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?$("#modal-dialog").is(":visible")?$("#modal-dialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled"):$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled"):$("#modal-dialog").is(":visible")?$("#modal-dialog .modal-footer .button-success").prop("disabled",!1).removeClass("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")}})}(),function(){"use strict";window.NavigationView=Backbone.View.extend({el:"#navigationBar",subEl:"#subNavigationBar",events:{"change #arangoCollectionSelect":"navigateBySelect","click .tab":"navigateByTab","click li":"switchTab","click .arangodbLogo":"selectMenuItem","mouseenter .dropdown > *":"showDropdown","click .shortcut-icons p":"showShortcutModal","mouseleave .dropdown":"hideDropdown"},renderFirst:!0,activeSubMenu:void 0,changeDB:function(){window.location.hash="#login"},initialize:function(a){var b=this;this.userCollection=a.userCollection,this.currentDB=a.currentDB,this.dbSelectionView=new window.DBSelectionView({collection:a.database,current:this.currentDB}),this.userBarView=new window.UserBarView({userCollection:this.userCollection}),this.notificationView=new window.NotificationView({collection:a.notificationCollection}),this.statisticBarView=new window.StatisticBarView({currentDB:this.currentDB}),this.isCluster=a.isCluster,this.handleKeyboardHotkeys(),Backbone.history.on("all",function(){b.selectMenuItem()})},showShortcutModal:function(){arangoHelper.hotkeysFunctions.showHotkeysModal()},handleSelectDatabase:function(){this.dbSelectionView.render($("#dbSelect"))},template:templateEngine.createTemplate("navigationView.ejs"),templateSub:templateEngine.createTemplate("subNavigationView.ejs"),render:function(){arangoHelper.checkDatabasePermissions(this.continueRender.bind(this),this.continueRender.bind(this))},continueRender:function(a){var b=this;$(this.el).html(this.template.render({currentDB:this.currentDB,isCluster:this.isCluster,readOnly:a})),"_system"!==this.currentDB.get("name")&&$("#dashboard").parent().remove(),$(this.subEl).html(this.templateSub.render({currentDB:this.currentDB.toJSON()})),this.dbSelectionView.render($("#dbSelect"));var c=function(a){a||this.userBarView.render()}.bind(this);return this.userCollection.whoAmI(c),this.renderFirst&&(this.renderFirst=!1,this.selectMenuItem(),$(".arangodbLogo").on("click",function(){b.selectMenuItem()}),$("#dbStatus").on("click",function(){b.changeDB()})),b.resize(),window.frontendConfig.isEnterprise===!0?($("#ArangoDBLogo").after(' '),$("#enterpriseLabel").fadeIn("slow")):($("#ArangoDBLogo").after(' '),$("#communityLabel").fadeIn("slow"),$(".enterprise-menu").show()),this},resize:function(){var a=$(window).height()-$(".subMenuEntries").first().height();$("#navigationBar").css("min-height",a),$("#navigationBar").css("height",a)},navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},handleKeyboardHotkeys:function(){arangoHelper.enableKeyboardHotkeys(!0)},navigateByTab:function(a){var b=a.target||a.srcElement,c=b.id,d=!1;"enterprise"!==c&&($(b).hasClass("fa")||(""===c&&(c=$(b).attr("class")),"links"===c?(d=!0,$("#link_dropdown").slideToggle(1),a.preventDefault()):"tools"===c?(d=!0,$("#tools_dropdown").slideToggle(1),a.preventDefault()):"dbselection"===c&&(d=!0,$("#dbs_dropdown").slideToggle(1),a.preventDefault()),d||(window.App.navigate(c,{trigger:!0}),a.preventDefault())))},handleSelectNavigation:function(){var a=this;$("#arangoCollectionSelect").change(function(){a.navigateBySelect()})},subViewConfig:{documents:"collections",collection:"collections"},subMenuConfig:{cluster:[{name:"Dashboard",view:void 0,active:!0}],collections:[{name:"",view:void 0,active:!1}],queries:[{name:"Editor",route:"query",active:!0},{name:"Running Queries",route:"queryManagement",params:{active:!0},active:void 0},{name:"Slow Query History",route:"queryManagement",params:{active:!1},active:void 0}]},renderSubMenu:function(a){var b=this;if(void 0===a&&(a=window.isCluster?"cluster":"dashboard"),this.subMenuConfig[a]){$(this.subEl+" .bottom").html("");var c="";_.each(this.subMenuConfig[a],function(a){c=a.active?"active":"",a.disabled&&(c="disabled"),$(b.subEl+" .bottom").append(''+g[l]+'
Contributors:';this.model.get("contributors")&&this.model.get("contributors").length>0?_.each(this.model.get("contributors"),function(a){a.email?b+=''+(a.name||a.email)+"":a.name&&(b+="contributor.name")}):b+="No contributors",b+="
",$(".information").append(b),this.model.get("author")&&$(".information").append('Author:'+this.model.get("author")+"
"),this.model.get("mount")&&$(".information").append('Mount:'+this.model.get("mount")+"
"),this.model.get("development")&&this.model.get("path")&&$(".information").append('Path:'+this.model.get("path")+"
"),$("#subNavigationBar .breadcrumb").html(a)},storeUrl:function(a){return arangoHelper.databaseUrl(this.model.get("mount"),a)}})}(),function(){"use strict";window.SupportView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("supportView.ejs"),events:{"click .subViewNavbar .subMenuEntry":"toggleViews"},render:function(){this.$el.html(this.template.render({}))},resize:function(a){a?$(".innerContent").css("height","auto"):$(".innerContent").height($(".centralRow").height()-170)},renderSwagger:function(){var a=window.location.pathname.split("/"),b=window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/"+a[1]+"/"+a[2]+"/_admin/aardvark/api/index.html";$("#swagger").html(""),$("#swagger").append('')},toggleViews:function(a){var b=this,c=a.currentTarget.id.split("-")[0],d=["community","documentation","swagger"];_.each(d,function(a){c!==a?$("#"+a).hide():("swagger"===c?(b.renderSwagger(),$("#swagger iframe").css("height","100%"),$("#swagger iframe").css("width","100%"),$("#swagger iframe").css("margin-top","-13px"),b.resize()):b.resize(!0),$("#"+a).show())}),$(".subMenuEntries").children().removeClass("active"),$("#"+c+"-support").addClass("active")}})}(),function(){"use strict";window.TableView=Backbone.View.extend({template:templateEngine.createTemplate("tableView.ejs"),loading:templateEngine.createTemplate("loadingTableView.ejs"),initialize:function(a){this.rowClickCallback=a.rowClick},events:{"click .pure-table-body .pure-table-row":"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.UserBarView=Backbone.View.extend({events:{"change #userBarSelect":"navigateBySelect","click .tab":"navigateByTab","mouseenter .dropdown":"showDropdown","mouseleave .dropdown":"hideDropdown","click #userLogoutIcon":"userLogout","click #userLogout":"userLogout"},initialize:function(a){arangoHelper.checkDatabasePermissions(this.setUserCollectionMode.bind(this)),this.userCollection=a.userCollection,this.userCollection.fetch({cache:!1,async:!0}),this.userCollection.bind("change:extra",this.render.bind(this))},setUserCollectionMode:function(a){a&&(this.userCollection.authOptions.ro=!0)},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())},toggleUserMenu:function(){$("#userBar .subBarDropdown").toggle()},showDropdown:function(){$("#user_dropdown").fadeIn(1)},hideDropdown:function(){$("#user_dropdown").fadeOut(1)},render:function(){if(frontendConfig.authenticationEnabled!==!1){var a=this,b=function(b,c){if(b)arangoHelper.arangoErro("User","Could not fetch user.");else{var d=null,e=null,f=!1,g=null;if(c!==!1){var h=function(){return frontendConfig.ldapEnabled&&a.userCollection.add({name:window.App.currentUser,user:window.App.currentUser,username:window.App.currentUser,active:!0,img:void 0}),g=a.userCollection.findWhere({user:c}),g.set({loggedIn:!0}),e=g.get("extra").name,d=g.get("extra").img,f=g.get("active"),d=d?"https://s.gravatar.com/avatar/"+d+"?s=80":"img/default_user.png",e||(e=""),a.$el=$("#userBar"),a.$el.html(a.template.render({img:d,name:e,username:c,active:f})),a.delegateEvents(),a.$el};0===a.userCollection.models.length?a.userCollection.fetch({success:function(){h(b,c)}}):h(b,c)}}};$("#userBar").on("click",function(){a.toggleUserMenu()}),this.userCollection.whoAmI(b)}},userLogout:function(){var a=function(a){a?arangoHelper.arangoError("User","Logout error"):this.userCollection.logout()}.bind(this);this.userCollection.whoAmI(a)}})}(),function(){"use strict";window.UserManagementView=Backbone.View.extend({el:"#content",el2:"#userManagementThumbnailsIn",template:templateEngine.createTemplate("userManagementView.ejs"),remove:function(){return this.$el.empty().off(),this.stopListening(),this.unbind(),delete this.el,this},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(){var a=this,b=function(a,b){frontendConfig.authenticationEnabled===!0&&(a||null===b?arangoHelper.arangoError("User","Could not fetch user data"):this.currentUser=this.collection.findWhere({user:b}))}.bind(this);this.collection.fetch({cache:!1,success:function(){a.collection.whoAmI(b)}})},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;$("#userManagementDropdown").is(":visible")&&(b=!0);var c=function(){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")}.bind(this);return this.collection.fetch({cache:!1,success:function(){c()}}),this},search:function(){var a,b,c,d;a=$("#userManagementSearchInput"),b=$("#userManagementSearchInput").val(),d=this.collection.filter(function(a){return a.get("user").indexOf(b)!==-1}),$(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}};frontendConfig.isEnterprise&&$("#newRole").is(":checked")&&(f.user=":role:"+b,delete f.passwd),this.collection.create(f,{wait:!0,error:function(a,b){arangoHelper.parseError("User",b,a)},success:function(){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)},updateUserManagement:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})},editUser:function(a){if("createUser"!==$(a.currentTarget).find("a").attr("id")){$(a.currentTarget).hasClass("tile")&&(a.currentTarget=$(a.currentTarget).find(".fa")),this.collection.fetch({cache:!1});var b=this.evaluateUserName($(a.currentTarget).attr("id"),"_edit-user");""===b&&(b=$(a.currentTarget).attr("id")),window.App.navigate("user/"+encodeURIComponent(b),{trigger:!0})}},toggleView:function(){$("#userSortDesc").attr("checked",this.collection.sortOptions.desc),$("#userManagementToggle").toggleClass("activated"),$("#userManagementDropdown2").slideToggle(200)},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)),frontendConfig.isEnterprise&&b.push(window.modalView.createCheckboxEntry("newRole","Role",!1,!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),frontendConfig.isEnterprise&&$("#newRole").on("change",function(){$("#newRole").is(":checked")?$("#newPassword").attr("disabled",!0):$("#newPassword").attr("disabled",!1)})},evaluateUserName:function(a,b){if(a){var c=a.lastIndexOf(b);return a.substring(0,c)}},updateUserProfile:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})}})}(),function(){"use strict";window.UserPermissionView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("userPermissionView.ejs"),initialize:function(a){this.username=a.username},remove:function(){return this.$el.empty().off(),this.stopListening(),this.unbind(),delete this.el,this},events:{"click #userPermissionView .dbCheckbox":"setDBPermission", "click #userPermissionView .collCheckbox":"setCollPermission","click .db-row":"toggleAccordion"},render:function(a,b){var c=this;this.collection.fetch({success:function(){c.continueRender(a,b)}})},toggleAccordion:function(a){if(!($(a.target).attr("type")||$(a.target).parent().hasClass("noAction")||$(a.target).hasClass("inner")||$(a.target).is("span"))){var b=$(a.currentTarget).find(".collection-row").is(":visible"),c=$(a.currentTarget).attr("id").split("-")[0];$(".collection-row").hide(),$(".db-label").css("font-weight",200),$(".db-label").css("color","#8a969f"),$(a.currentTarget).find(".collection-row").children().length>4?($(".db-row .fa-caret-down").hide(),$(".db-row .fa-caret-right").show(),b?$(a.currentTarget).find(".collection-row").hide():($(a.currentTarget).find(".collection-row").fadeIn("fast"),$(a.currentTarget).find(".db-label").css("font-weight",600),$(a.currentTarget).find(".db-label").css("color","rgba(64, 74, 83, 1)"),$(a.currentTarget).find(".fa-caret-down").show(),$(a.currentTarget).find(".fa-caret-right").hide())):($(".db-row .fa-caret-down").hide(),$(".db-row .fa-caret-right").show(),arangoHelper.arangoNotification("Permissions",'No collections in "'+c+'" available.'))}},setCollPermission:function(a){var b,c=$(a.currentTarget).attr("db"),d=$(a.currentTarget).attr("collection");b=$(a.currentTarget).hasClass("readOnly")?"ro":$(a.currentTarget).hasClass("readWrite")?"rw":$(a.currentTarget).hasClass("noAccess")?"none":"undefined",this.sendCollPermission(this.currentUser.get("user"),c,d,b)},setDBPermission:function(a){var b,c=$(a.currentTarget).attr("name");if(b=$(a.currentTarget).hasClass("readOnly")?"ro":$(a.currentTarget).hasClass("readWrite")?"rw":$(a.currentTarget).hasClass("noAccess")?"none":"undefined","_system"===c){var d=[],e=[];e.push(window.modalView.createReadOnlyEntry("db-system-revoke-button","Caution","You are changing the _system database permission. Really continue?",void 0,void 0,!1)),d.push(window.modalView.createSuccessButton("Ok",this.sendDBPermission.bind(this,this.currentUser.get("user"),c,b))),d.push(window.modalView.createCloseButton("Cancel",this.rollbackInputButton.bind(this,c))),window.modalView.show("modalTable.ejs","Change _system Database Permission",d,e)}else this.sendDBPermission(this.currentUser.get("user"),c,b)},rollbackInputButton:function(a,b){var c;_.each($(".collection-row"),function(a,b){$(a).is(":visible")&&(c=$(a).parent().attr("id"))}),c?this.render(c,b):this.render(),window.modalView.hide()},sendCollPermission:function(a,b,c,d){var e=this;"undefined"===d?this.revokeCollPermission(a,b,c):$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)+"/"+encodeURIComponent(c)),contentType:"application/json",data:JSON.stringify({grant:d})}).success(function(a){e.styleDefaultRadios(null,!0)}).error(function(a){e.rollbackInputButton(null,a)})},revokeCollPermission:function(a,b,c){var d=this;$.ajax({type:"DELETE",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)+"/"+encodeURIComponent(c)),contentType:"application/json"}).success(function(a){d.styleDefaultRadios(null,!0)}).error(function(a){d.rollbackInputButton(null,a)})},sendDBPermission:function(a,b,c){var d=this;"undefined"===c?this.revokeDBPermission(a,b):$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)),contentType:"application/json",data:JSON.stringify({grant:c})}).success(function(a){d.styleDefaultRadios(null,!0)}).error(function(a){d.rollbackInputButton(null,a)})},revokeDBPermission:function(a,b){var c=this;$.ajax({type:"DELETE",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)),contentType:"application/json"}).success(function(a){c.styleDefaultRadios(null,!0)}).error(function(a){c.rollbackInputButton(null,a)})},continueRender:function(a,b){var c=this;this.currentUser=this.collection.findWhere({user:this.username}),this.breadcrumb();var d=arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(c.currentUser.get("user"))+"/database?full=true");$.ajax({type:"GET",url:d,contentType:"application/json",success:function(d){c.finishRender(d.result,a,b)},error:function(a){arangoHelper.arangoError("User","Could not fetch user permissions")}})},finishRender:function(a,b,c){var d=_.pairs(a);d.sort(),d=_.object(d),$(this.el).html(this.template.render({permissions:d})),$(".noAction").first().appendTo(".pure-table-body"),$(".pure-table-body").height(window.innerHeight-200),b&&$("#"+b).click(),c&&c.responseJSON&&c.responseJSON.errorMessage&&arangoHelper.arangoError("User",c.responseJSON.errorMessage),this.styleDefaultRadios(a),arangoHelper.createTooltips(),this.checkRoot()},checkRoot:function(){"root"===this.currentUser.get("user")&&$("#_system-db #___-collection input").attr("disabled","true")},styleDefaultRadios:function(a,b){var c=this,d=function(a){$(".db-row input").css("box-shadow","none");var b="rgba(0, 0, 0, 0.3) 0px 1px 4px 4px";_.each(a,function(a,c){if(a.collections){var d=a.collections["*"];_.each(a.collections,function(a,e){"_"!==e.charAt(0)&&"*"!==e.charAt(0)&&"undefined"===a&&("rw"===d?$("#"+c+"-db #"+e+"-collection .readWrite").css("box-shadow",b):"ro"===d?$("#"+c+"-db #"+e+"-collection .readOnly").css("box-shadow",b):"none"===d&&$("#"+c+"-db #"+e+"-collection .noAccess").css("box-shadow",b))})}})};if(b){var e=arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(c.currentUser.get("user"))+"/database?full=true");$.ajax({type:"GET",url:e,contentType:"application/json",success:function(a){d(a.result)},error:function(a){arangoHelper.arangoError("User","Could not fetch user permissions")}})}else d(a);window.modalView.hide()},breadcrumb:function(){var a=this;window.App.naviView?($("#subNavigationBar .breadcrumb").html("User: "+this.currentUser.get("user")),arangoHelper.buildUserSubNav(a.currentUser.get("user"),"Permissions")):window.setTimeout(function(){a.breadcrumb()},100)}})}(),function(){"use strict";window.UserView=Backbone.View.extend({el:"#content",initialize:function(a){this.username=a.username},render:function(){var a=this;this.collection.fetch({success:function(){a.continueRender()}})},editCurrentUser:function(){this.createEditCurrentUserModal(this.currentUser.get("user"),this.currentUser.get("extra").name,this.currentUser.get("extra").img)},continueRender:function(){this.currentUser=this.collection.findWhere({user:this.username}),this.breadcrumb(),this.currentUser.get("loggedIn")?this.editCurrentUser():this.createEditUserModal(this.currentUser.get("user"),this.currentUser.get("extra").name,this.currentUser.get("active"))},createEditUserPasswordModal:function(){var a=[],b=[];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)},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")),":role:"===this.username.substring(0,6)?d.push(window.modalView.createDisabledButton("Change Password")):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,null,null,this.events,null,null,"content")},parseImgString:function(a){return a.indexOf("@")===-1?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=[],d.push({title:"Delete",type:window.modalView.buttons.DELETE,callback:this.submitDeleteUser.bind(this,a)}),":role:"===this.username.substring(0,6)?d.push({title:"Change Password",type:window.modalView.buttons.DISABLED,callback:this.createEditUserPasswordModal.bind(this,a)}):d.push({title:"Change Password",type:window.modalView.buttons.NOTIFICATION,callback:this.createEditUserPasswordModal.bind(this,a)}),d.push({title:"Save",type:window.modalView.buttons.SUCCESS,callback:this.submitEditUser.bind(this,a)}),window.modalView.show("modalTable.ejs","Edit User",d,e,null,null,this.events,null,null,"content")},validateStatus:function(a){return""!==a},submitDeleteUser:function(a){var b=this.collection.findWhere({user:a});b.destroy({wait:!0}),window.App.navigate("#users",{trigger:!0})},submitEditCurrentUserProfile:function(){var a=$("#editCurrentName").val(),b=$("#editCurrentUserProfileImg").val();b=this.parseImgString(b);var c=function(a){a?arangoHelper.arangoError("User","Could not edit user settings"):(arangoHelper.arangoNotification("User","Changes confirmed."),this.updateUserProfile())}.bind(this);this.currentUser.setExtras(a,b,c),window.modalView.hide()},submitEditUserPassword:function(){var a=$("#newCurrentPassword").val(),b=$("#confirmCurrentPassword").val();$("#newCurrentPassword").val(""),$("#confirmCurrentPassword").val(""),$("#newCurrentPassword").closest("th").css("backgroundColor","white"),$("#confirmCurrentPassword").closest("th").css("backgroundColor","white");var c=!1;a!==b&&(arangoHelper.arangoError("User","New passwords do not match."),c=!0),c||(this.currentUser.setPassword(a),arangoHelper.arangoNotification("User","Password changed."),window.modalView.hide())},editUserPassword:function(){window.modalView.hide(),this.createEditUserPasswordModal()},submitEditUser:function(a){var b=$("#editName").val(),c=$("#editStatus").is(":checked");if(!this.validateStatus(c))return void $("#editStatus").closest("th").css("backgroundColor","red");var d=this.collection.findWhere({user:a});d.save({extra:{name:b},active:c},{type:"PATCH",success:function(){arangoHelper.arangoNotification("User",d.get("user")+" updated.")},error:function(){arangoHelper.arangoError("User","Could not update "+d.get("user")+".")}})},breadcrumb:function(){var a=this;window.App.naviView?($("#subNavigationBar .breadcrumb").html("User: "+this.username),arangoHelper.buildUserSubNav(a.currentUser.get("user"),"General")):window.setTimeout(function(){a.breadcrumb()},100)}})}(),function(){"use strict";window.ViewsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("viewsView.ejs"),initialize:function(){},remove:function(){return this.$el.empty().off(),this.stopListening(),this.unbind(),delete this.el,this},events:{"click #createView":"createView","click .tile":"gotoView"},render:function(){this.getViews(),this.$el.html(this.template.render({views:[]}))},gotoView:function(a){var b=$(a.currentTarget).attr("id");b&&(window.location.hash=window.location.hash.substr(0,window.location.hash.length-1)+"/"+encodeURIComponent(b))},getViews:function(){var a=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/view"),contentType:"application/json",processData:!1,success:function(b){a.$el.html(a.template.render({views:b}))},error:function(a){console.log(a)}})},createView:function(a){a.preventDefault(),this.createViewModal()},createViewModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newName","Name","",!1,"Name",!0,[{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only symbols, "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No view name given."}])),b.push(window.modalView.createReadOnlyEntry(void 0,"Type","arangosearch",void 0,void 0,!1,void 0)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateView.bind(this))),window.modalView.show("modalTable.ejs","Create New View",a,b)},submitCreateView:function(){var a=this,b=$("#newName").val(),c=JSON.stringify({name:b,type:"arangosearch",properties:{}});$.ajax({type:"POST",cache:!1,url:arangoHelper.databaseUrl("/_api/view"),contentType:"application/json",processData:!1,data:c,success:function(b){window.modalView.hide(),a.getViews()},error:function(a){console.log(a)}})}})}(),function(){"use strict";window.ViewView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("viewView.ejs"),initialize:function(a){this.name=a.name},remove:function(){return this.$el.empty().off(),this.stopListening(),this.unbind(),delete this.el,this},events:{"click #savePropertiesButton":"patchView","click #renameViewButton":"renameView","click #deleteViewButton":"deleteView"},render:function(){this.breadcrumb(),this.$el.html(this.template.render({})),$("#propertiesEditor").height($(".centralRow").height()-300+70),this.initAce(),this.getView()},jsonContentChanged:function(){this.enableSaveButton()},enableSaveButton:function(){$("#savePropertiesButton").prop("disabled",!1),$("#savePropertiesButton").addClass("button-success"),$("#savePropertiesButton").removeClass("button-close")},disableSaveButton:function(){$("#savePropertiesButton").prop("disabled",!0),$("#savePropertiesButton").addClass("button-close"),$("#savePropertiesButton").removeClass("button-success")},initAce:function(a){var b=this,c=document.getElementById("propertiesEditor"),d={onChange:function(){b.jsonContentChanged()},search:!0,mode:"tree",modes:["tree","code"],ace:window.ace};this.editor=new JSONEditor(c,d),this.defaultMode&&this.editor.setMode(this.defaultMode)},getView:function(){var a=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/view/"+encodeURIComponent(a.name)),contentType:"application/json",processData:!1,success:function(b){a.editor.set(b.properties)},error:function(a){arangoHelper.arangoError("View",a.errorMessage)}})},patchView:function(){var a=this;$.ajax({type:"PATCH",cache:!1,url:arangoHelper.databaseUrl("/_api/view/"+encodeURIComponent(a.name)+"/properties"),contentType:"application/json",processData:!1,data:JSON.stringify(a.editor.get()),success:function(b){a.disableSaveButton(),a.editor.set(b),arangoHelper.arangoNotification("View","Saved properties.")},error:function(a){arangoHelper.arangoError("View",a.responseJSON.errorMessage)}})},deleteView:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("view-delete-button","Delete","Really delete View?",void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createDeleteButton("Delete",this.deleteViewTrue.bind(this))),window.modalView.show("modalTable.ejs","Delete View",a,b)},deleteViewTrue:function(){var a=this;$.ajax({type:"DELETE",cache:!1,url:arangoHelper.databaseUrl("/_api/view/"+encodeURIComponent(a.name)),contentType:"application/json",processData:!1,success:function(){window.modalView.hide(),window.App.navigate("#views",{trigger:!0})},error:function(a){window.modalView.hide(),arangoHelper.arangoError("View",a.responseJSON.errorMessage)}})},renameView:function(){var a=this,b=[],c=[];c.push(window.modalView.createTextEntry("editCurrentName","Name",a.name,!1,"Name",!1)),b.push(window.modalView.createSuccessButton("Rename",this.renameViewTrue.bind(this))),window.modalView.show("modalTable.ejs","Rename View",b,c)},renameViewTrue:function(){var a=this,b=$("#editCurrentName").val();return b?void $.ajax({type:"PUT",cache:!1,url:arangoHelper.databaseUrl("/_api/view/"+encodeURIComponent(a.name)+"/rename"),contentType:"application/json",processData:!1,data:JSON.stringify({name:$("#editCurrentName").val()}),success:function(b){a.name=b.name,a.breadcrumb(),window.modalView.hide()},error:function(a){window.modalView.hide(),arangoHelper.arangoError("View",a.responseJSON.errorMessage)}}):void arangoHelper.arangoError("View","Please fill in a view name.")},breadcrumb:function(){var a=this;window.App.naviView?$("#subNavigationBar .breadcrumb").html("View: "+this.name):window.setTimeout(function(){a.breadcrumb()},100)}})}(),function(){"use strict";window.Router=Backbone.Router.extend({toUpdate:[],dbServers:[],isCluster:void 0,lastRoute:void 0,routes:{"":"cluster",dashboard:"dashboard",collections:"collections","new":"newCollection",login:"login","collection/:colid/documents/:pageid":"documents","cIndices/:colname":"cIndices","cSettings/:colname":"cSettings","cInfo/:colname":"cInfo","collection/:colid/:docid":"document",shell:"shell",queries:"query",databases:"databases",settings:"databases",services:"applications","services/install":"installService","services/install/new":"installNewService","services/install/github":"installGitHubService","services/install/upload":"installUploadService","services/install/remote":"installUrlService","service/:mount":"applicationDetail","store/:name":"storeDetail",graphs:"graphManagement","graphs/:name":"showGraph",users:"userManagement","user/:name":"userView","user/:name/permission":"userPermission",userProfile:"userProfile",cluster:"cluster",nodes:"nodes",shards:"shards","node/:name":"node","nodeInfo/:id":"nodeInfo",logs:"logger",helpus:"helpUs",views:"views","view/:name":"view","graph/:name":"graph","graph/:name/settings":"graphSettings",support:"support"},execute:function(a,b){if("#queries"===this.lastRoute&&(this.queryView.removeInputEditors(),this.queryView.cleanupGraphs(),this.queryView.removeResults()),this.lastRoute){var c=this.lastRoute.split("/")[0],d=this.lastRoute.split("/")[1],e=this.lastRoute.split("/")[2];"#service"!==c&&(window.App.replaceApp?"install"!==d&&e&&(window.App.replaceApp=!1):window.App.replaceApp=!1),"#collection"===this.lastRoute.substr(0,11)&&3===this.lastRoute.split("/").length&&this.documentView.cleanupEditor(),"#dasboard"!==this.lastRoute&&"#node"!==window.location.hash.substr(0,5)||d3.selectAll("svg > *").remove(),"#logger"===this.lastRoute&&(this.loggerView.logLevelView&&this.loggerView.logLevelView.remove(),this.loggerView.logTopicView&&this.loggerView.logTopicView.remove())}this.lastRoute=window.location.hash,$("#subNavigationBar .breadcrumb").html(""),$("#subNavigationBar .bottom").html(""),$("#loadingScreen").hide(),$("#content").show(),a&&a.apply(this,b),"#services"===this.lastRoute&&(window.App.replaceApp=!1),this.graphViewer&&this.graphViewer.graphSettingsView&&this.graphViewer.graphSettingsView.hide(),this.queryView&&this.queryView.graphViewer&&this.queryView.graphViewer.graphSettingsView&&this.queryView.graphViewer.graphSettingsView.hide()},listenerFunctions:{},listener:function(a){_.each(window.App.listenerFunctions,function(b,c){b(a)})},checkUser:function(){var a=this;if("#login"!==window.location.hash){var b=function(){this.initOnce(),$(".bodyWrapper").show(),$(".navbar").show()}.bind(this),c=function(c,d){frontendConfig.authenticationEnabled?(a.currentUser=d,c||null===d?"#login"!==window.location.hash&&this.navigate("login",{trigger:!0}):b()):b()}.bind(this);frontendConfig.authenticationEnabled?this.userCollection.whoAmI(c):(this.initOnce(),$(".bodyWrapper").show(),$(".navbar").show())}},waitForInit:function(a,b,c){this.initFinished?(b||a(!0),b&&!c&&a(b,!0),b&&c&&a(b,c,!0)):setTimeout(function(){b||a(!1),b&&!c&&a(b,!1),b&&c&&a(b,c,!1)},350)},initFinished:!1,initialize:function(){frontendConfig.isCluster===!0&&(this.isCluster=!0),document.addEventListener("keyup",this.listener,!1),window.modalView=new window.ModalView,this.foxxList=new window.FoxxCollection,window.foxxInstallView=new window.FoxxInstallView({collection:this.foxxList}),this.foxxRepo=new window.FoxxRepository,this.foxxRepo.fetch({success:function(){a.serviceInstallView&&(a.serviceInstallView.collection=a.foxxRepo)}}),window.progressView=new window.ProgressView;var a=this;this.userCollection=new window.ArangoUsers,this.initOnce=function(){this.initOnce=function(){};var b=function(b,c){a=this,c===!0&&a.coordinatorCollection.fetch({success:function(){a.fetchDBS()}}),b&&console.log(b)}.bind(this);window.isCoordinator(b),frontendConfig.isCluster===!1&&(this.initFinished=!0),this.arangoDatabase=new window.ArangoDatabase,this.currentDB=new window.CurrentDatabase,this.arangoCollectionsStore=new window.ArangoCollections,this.arangoDocumentStore=new window.ArangoDocument,this.coordinatorCollection=new window.ClusterCoordinators,arangoHelper.setDocumentStore(this.arangoDocumentStore),this.arangoCollectionsStore.fetch({cache:!1}),window.spotlightView=new window.SpotlightView({collection:this.arangoCollectionsStore}),this.footerView=new window.FooterView({collection:a.coordinatorCollection}),this.notificationList=new window.NotificationCollection,this.currentDB.fetch({cache:!1,success:function(){a.naviView=new window.NavigationView({database:a.arangoDatabase,currentDB:a.currentDB,notificationCollection:a.notificationList,userCollection:a.userCollection,isCluster:a.isCluster}),a.naviView.render()}}),this.queryCollection=new window.ArangoQueries,this.footerView.render(),window.checkVersion(),this.userConfig=new window.UserConfig({ldapEnabled:frontendConfig.ldapEnabled}),this.userConfig.fetch(),this.documentsView=new window.DocumentsView({collection:new window.ArangoDocuments,documentStore:this.arangoDocumentStore,collectionsStore:this.arangoCollectionsStore}),arangoHelper.initSigma()}.bind(this),$(window).resize(function(){a.handleResize()}),$(window).scroll(function(){})},handleScroll:function(){$(window).scrollTop()>50?($(".navbar > .secondary").css("top",$(window).scrollTop()),$(".navbar > .secondary").css("position","absolute"),$(".navbar > .secondary").css("z-index","10"),$(".navbar > .secondary").css("width",$(window).width())):($(".navbar > .secondary").css("top","0"),$(".navbar > .secondary").css("position","relative"),$(".navbar > .secondary").css("width",""))},cluster:function(a){return this.checkUser(),a?this.isCluster===!1||void 0===this.isCluster?void("_system"===this.currentDB.get("name")?(this.routes[""]="dashboard",this.navigate("#dashboard",{trigger:!0})):(this.routes[""]="collections",this.navigate("#collections",{trigger:!0}))):(this.clusterView||(this.clusterView=new window.ClusterView({coordinators:this.coordinatorCollection,dbServers:this.dbServers})),void this.clusterView.render()):void this.waitForInit(this.cluster.bind(this))},node:function(a,b){return this.checkUser(),b&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodeView&&this.nodeView.remove(),this.nodeView=new window.NodeView({coordid:a,coordinators:this.coordinatorCollection,dbServers:this.dbServers}),void this.nodeView.render()):void this.waitForInit(this.node.bind(this),a)},nodeInfo:function(a,b){return this.checkUser(),b&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodeInfoView&&this.nodeInfoView.remove(),this.nodeInfoView=new window.NodeInfoView({nodeId:a,coordinators:this.coordinatorCollection,dbServers:this.dbServers[0]}),void this.nodeInfoView.render()):void this.waitForInit(this.nodeInfo.bind(this),a)},shards:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.shardsView&&this.shardsView.remove(),this.shardsView=new window.ShardsView({dbServers:this.dbServers}),void this.shardsView.render()):void this.waitForInit(this.shards.bind(this))},nodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodesView&&this.nodesView.remove(),this.nodesView=new window.NodesView({}),void this.nodesView.render()):void this.waitForInit(this.nodes.bind(this))},cNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodesView=new window.NodesView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0],toRender:"coordinator"}),void this.nodesView.render()):void this.waitForInit(this.cNodes.bind(this))},dNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):0===this.dbServers.length?void this.navigate("#cNodes",{trigger:!0}):(this.nodesView=new window.NodesView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0],toRender:"dbserver"}),void this.nodesView.render()):void this.waitForInit(this.dNodes.bind(this))},sNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.scaleView=new window.ScaleView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0]}),void this.scaleView.render()):void this.waitForInit(this.sNodes.bind(this))},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))},logger:function(a,b){if(this.checkUser(),!b)return void this.waitForInit(this.logger.bind(this),a);if(!this.loggerView){var c=new window.ArangoLogs({upto:!0,loglevel:4});this.loggerView=new window.LoggerView({collection:c})}this.loggerView.render()},applicationDetail:function(a,b){if(this.checkUser(),!b)return void this.waitForInit(this.applicationDetail.bind(this),a);var c=function(){this.hasOwnProperty("applicationDetailView")&&this.applicationDetailView.remove(),this.applicationDetailView=new window.ApplicationDetailView({model:this.foxxList.get(decodeURIComponent(a))}),this.applicationDetailView.model=this.foxxList.get(decodeURIComponent(a)),this.applicationDetailView.render("swagger")}.bind(this);0===this.foxxList.length?this.foxxList.fetch({cache:!1,success:function(){c()}}):c()},storeDetail:function(a,b){if(this.checkUser(),!b)return void this.waitForInit(this.storeDetail.bind(this),a);var c=function(){this.hasOwnProperty("storeDetailView")&&this.storeDetailView.remove(),this.storeDetailView=new window.StoreDetailView({model:this.foxxRepo.get(decodeURIComponent(a)),collection:this.foxxList}),this.storeDetailView.model=this.foxxRepo.get(decodeURIComponent(a)),this.storeDetailView.render()}.bind(this);0===this.foxxRepo.length?this.foxxRepo.fetch({cache:!1,success:function(){c()}}):c()},login:function(){var a=function(a,b){this.loginView||(this.loginView=new window.LoginView({collection:this.userCollection})),a||null===b?this.loginView.render():this.loginView.render(!0)}.bind(this);this.userCollection.whoAmI(a)},collections:function(a){if(this.checkUser(),!a)return void this.waitForInit(this.collections.bind(this));var b=this;this.collectionsView&&this.collectionsView.remove(),this.collectionsView=new window.CollectionsView({collection:this.arangoCollectionsStore}),this.arangoCollectionsStore.fetch({cache:!1,success:function(){b.collectionsView.render()}})},cIndices:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.indicesView=new window.IndicesView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.indicesView.render()}}):void this.waitForInit(this.cIndices.bind(this),a)},cSettings:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.settingsView=new window.SettingsView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.settingsView.render()}}):void this.waitForInit(this.cSettings.bind(this),a)},cInfo:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.infoView=new window.InfoView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.infoView.render()}}):void this.waitForInit(this.cInfo.bind(this),a)},documents:function(a,b,c){return this.checkUser(),c?(this.documentsView&&this.documentsView.unbindEvents(),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(),void this.documentsView.delegateEvents()):void this.waitForInit(this.documents.bind(this),a,b)},document:function(a,b,c){if(this.checkUser(),!c)return void this.waitForInit(this.document.bind(this),a,b);var d;this.documentView&&(this.documentView.defaultMode&&(d=this.documentView.defaultMode),this.documentView.remove()),this.documentView=new window.DocumentView({collection:this.arangoDocumentStore}),this.documentView.colid=a,this.documentView.defaultMode=d;var e=window.location.hash.split("/")[2],f=(e.split("%").length-1)%3;decodeURI(e)!==e&&0!==f&&(e=decodeURIComponent(e)),this.documentView.docid=e,this.documentView.render();var g=function(a,b){a?console.log("Error","Could not fetch collection type"):this.documentView.setType()}.bind(this);arangoHelper.collectionApiType(a,null,g)},query:function(a){return this.checkUser(),a?(this.queryView||(this.queryView=new window.QueryView({collection:this.queryCollection})),void this.queryView.render()):void this.waitForInit(this.query.bind(this))},graph:function(a,b){return this.checkUser(),b?(this.graphViewer&&(this.graphViewer.graphSettingsView&&this.graphViewer.graphSettingsView.remove(),this.graphViewer.killCurrentGraph(),this.graphViewer.unbind(),this.graphViewer.remove()),this.graphViewer=new window.GraphViewer({name:a,documentStore:this.arangoDocumentStore,collection:new window.GraphCollection,userConfig:this.userConfig}),void this.graphViewer.render()):void this.waitForInit(this.graph.bind(this),a)},graphSettings:function(a,b){return this.checkUser(),b?(this.graphSettingsView&&this.graphSettingsView.remove(),this.graphSettingsView=new window.GraphSettingsView({name:a,userConfig:this.userConfig}),void this.graphSettingsView.render()):void this.waitForInit(this.graphSettings.bind(this),a)},helpUs:function(a){return this.checkUser(),a?(this.testView||(this.helpUsView=new window.HelpUsView({})),void this.helpUsView.render()):void this.waitForInit(this.helpUs.bind(this))},support:function(a){return this.checkUser(),a?(this.testView||(this.supportView=new window.SupportView({})),void this.supportView.render()):void this.waitForInit(this.support.bind(this))},queryManagement:function(a){return this.checkUser(),a?(this.queryManagementView||(this.queryManagementView=new window.QueryManagementView({collection:void 0})),void this.queryManagementView.render()):void this.waitForInit(this.queryManagement.bind(this))},databases:function(a){if(this.checkUser(),!a)return void this.waitForInit(this.databases.bind(this));var b=function(a){a?(arangoHelper.arangoError("DB","Could not get list of allowed databases"),this.navigate("#",{trigger:!0}),$("#databaseNavi").css("display","none"),$("#databaseNaviSelect").css("display","none")):(this.databaseView&&this.databaseView.remove(),this.databaseView=new window.DatabaseView({users:this.userCollection,collection:this.arangoDatabase}),this.databaseView.render())}.bind(this);arangoHelper.databaseAllowed(b)},dashboard:function(a){return this.checkUser(),a?(void 0===this.dashboardView&&(this.dashboardView=new window.DashboardView({dygraphConfig:window.dygraphConfig,database:this.arangoDatabase})),void this.dashboardView.render()):void this.waitForInit(this.dashboard.bind(this))},graphManagement:function(a){return this.checkUser(),a?(this.graphManagementView&&this.graphManagementView.undelegateEvents(),this.graphManagementView=new window.GraphManagementView({ 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 e00c78d1cd..cdcbfdfe1b 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/index-min.html b/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html index 083e4ab4b9..e878cbe350 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html +++ b/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html @@ -3370,4 +3370,4 @@ var cutByResolution = function (str) {