export const __webpack_esm_id__=10804;export const __webpack_esm_ids__=[10804,29733,86806];export const __webpack_esm_modules__={86806(e,t,n){n.d(t,{z:()=>o});const o={QUERY:"QUERY",UPDATE:"UPDATE",GRAPHQL:"GRAPHQL",ANY:"ANY"}},29733(e,t,n){n.d(t,{l:()=>o});class o{constructor(e={}){this.trackId=e.trackId,this.trackAlias=e.trackAlias,this.username=e.username,this.node=e.node,this.isRequestedToStop=e.isRequestedToStop,this.sparqlString=e.sparqlString,this.state=e.state,this.type=e.type,this.numberOfOperations=e.numberOfOperations||0,this.msSinceCreated=e.msSinceCreated||0,this.humanLifetime=e.humanLifetime}}},10804(e,t,n){n(22742),n(21610);var o=n(29733),r=n(86806),s=n(57154),i=n(33645);const a=angular.module("graphdb.framework.jmx.queries.controllers",["ui.bootstrap","toastr","graphdb.framework.rest.monitoring.service"]);a.controller("QueriesCtrl",["$scope","$uibModal","toastr","$interval","$repositories","$jwtAuth","ModalService","MonitoringRestService","$translate",function(e,t,n,a,c,u,l,d,p){const m=(0,s.service)(s.AuthenticationService),g=(0,s.service)(s.AuthenticationStorageService);e.loader=!0,e.stringLimit=500,e.expanded={},e.error="",e.paused=!1;const f=document.createElement("a");e.parseNode=function(e){if(i.B.isNullOrUndefined(e))return null;let t="local";if(e.indexOf("://localhost:")<0&&e.indexOf("://localhost/")<0){f.href=e;let n=f.hostname;(function(e){const t=e.split(".");for(let e=0,n=0;e<t.length;e++)if(parseInt(t[e],10)>=0&&parseInt(t[e],10)<=255?n++:n=0,4===n)return!0;return!1})(f.hostname)||(n=f.hostname.split(".")[0]),t=n+":"+f.port}const n=e.match(/\/repositories\/([^/]+)#(\d+)/);return[n[2],t,n[1]]},e.togglePause=function(){e.paused=!e.paused},e.getQueries=function(){e.getQueriesRunning||e.paused||e.error||!c.getActiveRepository()||(e.getQueriesRunning=!0,d.monitorQuery(c.getActiveRepository()).success(function(t){const n=t;e.noQueries=0===n.length,e.queries={};for(let t=0;t<n.length;t++)n[t].parsedNode=e.parseNode(n[t].node),e.queries[n[t].trackId]=new o.l(n[t]);e.noActiveRepository=!1,e.loader=!1,e.getQueriesRunning=!1}).error(function(t){e.error=getError(t),e.loader=!1,e.getQueriesRunning=!1}))};const h=a(function(){c.isActiveRepoOntopType()||e.getQueries()},1e3);e.$on("$destroy",function(){a.cancel(h)}),e.deleteQueryHttp=function(t){e.loader=!0,d.deleteQuery(t,c.getActiveRepository()).success(function(){n.success(p.instant("abort.request.sent.msg")),e.loader=!1}).error(function(t){const o=getError(t);n.error(o,p.instant("common.error")),e.loader=!1})},e.abortQuery=function(t){l.openSimpleModal({title:p.instant("confirm.abort"),message:p.instant("confirm.abort.warning.msg"),warning:!0}).result.then(function(){e.deleteQueryHttp(t)})},e.downloadQuery=function(e){const t=e.trackId,n="query_"+t+(e.type===r.z.GRAPHQL?".json":".rq");let o="rest/monitor/repository/"+c.getActiveRepository()+"/query/download?query="+encodeURIComponent(t)+"&filename="+encodeURIComponent(n);m.isAuthenticated()&&(o=o+"&authToken="+encodeURIComponent(g.getAuthToken().getValue())),window.open(o,"_blank")},e.toggleQueryExpanded=function(t){e.expanded[t]=!e.expanded[t]}}]),a.controller("DeleteQueryCtrl",["$scope","$uibModalInstance",function(e,t){e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")}}])}};
//# sourceMappingURL=10804.9c5eb1358106e43a56ff.bundle.js.map