(window.webpackJsonp=window.webpackJsonp||[]).push([[68,203],{193:function(e,t,o){"use strict";o.r(t);o(7),o(28);const n=angular.module("graphdb.framework.jmx.queries.controllers",["ui.bootstrap","toastr","graphdb.framework.rest.monitoring.service"]);n.controller("QueriesCtrl",["$scope","$uibModal","toastr","$interval","$repositories","$jwtAuth","ModalService","MonitoringRestService","$translate","AuthTokenService",function(e,t,o,n,r,i,s,u,a,c){e.loader=!0,e.stringLimit=500,e.expanded={},e.error="",e.paused=!1;const l=document.createElement("a");e.parseNode=function(e){if(null==e)return null;let t="local";if(e.indexOf("://localhost:")<0&&e.indexOf("://localhost/")<0){l.href=e;let o=l.hostname;(function(e){const t=e.split(".");for(let e=0,o=0;e<t.length;e++)if(parseInt(t[e],10)>=0&&parseInt(t[e],10)<=255?o++:o=0,4===o)return!0;return!1})(l.hostname)||(o=l.hostname.split(".")[0]),t=o+":"+l.port}const o=e.match(/\/repositories\/([^\/]+)#(\d+)/);return[o[2],t,o[1]]},e.togglePause=function(){e.paused=!e.paused},e.getQueries=function(){e.getQueriesRunning||e.paused||e.error||!r.getActiveRepository()||(e.getQueriesRunning=!0,u.monitorQuery(r.getActiveRepository()).success((function(t){const o=t;e.noQueries=0===o.length,e.queries={};for(let t=0;t<o.length;t++)o[t].parsedNode=e.parseNode(o[t].node),e.queries[o[t].trackId]=o[t];e.noActiveRepository=!1,e.loader=!1,e.getQueriesRunning=!1})).error((function(t){e.error=getError(t),e.loader=!1,e.getQueriesRunning=!1})))};const d=n((function(){r.isActiveRepoOntopType()||e.getQueries()}),1e3);e.$on("$destroy",(function(){n.cancel(d)})),e.deleteQueryHttp=function(t){e.loader=!0,u.deleteQuery(t,r.getActiveRepository()).success((function(){o.success(a.instant("abort.request.sent.msg")),e.loader=!1})).error((function(t){const n=getError(t);o.error(n,a.instant("common.error")),e.loader=!1}))},e.abortQuery=function(t){s.openSimpleModal({title:a.instant("confirm.abort"),message:a.instant("confirm.abort.warning.msg"),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.downloadQuery=function(e){const t="query_"+e+".rq";let o="/rest/monitor/repository/"+r.getActiveRepository()+"/query/download?query="+encodeURIComponent(e)+"&filename="+encodeURIComponent(t);i.isAuthenticated()&&(o=o+"&authToken="+encodeURIComponent(c.getAuthToken())),window.open(o,"_blank")},e.toggleQueryExpanded=function(t){e.expanded[t]=!e.expanded[t]}}]),n.controller("DeleteQueryCtrl",["$scope","$uibModalInstance",function(e,t){e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")}}])},275:function(e,t,o){"use strict";o.r(t);o(7),o(24),o(193);angular.module("graphdb.framework.jmx.queries",["toastr","ui.bootstrap","graphdb.framework.jmx.queries.controllers","graphdb.framework.core.directives"])}}]);