graphdb-workbench 2.4.0-RC1 → 2.4.0-RC3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/108.21ba9a6de554ddab0cb3.bundle.js +1 -1
- package/dist/{12.eb00a82848770f10d0ef.bundle.js → 12.e6a377cf888480f8f98d.bundle.js} +2 -2
- package/dist/{128.d595d6b6fb9ae610976d.bundle.js → 128.ad625978e3241953ffba.bundle.js} +1 -1
- package/dist/{143.6e364b1eca9d52b02b4b.bundle.js → 143.205bd5ed1d706768a171.bundle.js} +1 -1
- package/dist/168.2d82f1a487dc3ce888b0.bundle.js +1 -1
- package/dist/171.4f08cb300ca1440a3307.bundle.js +1 -1
- package/dist/{18.253aea7fe10e3ba2e32c.bundle.js → 18.1b68d0b88fa20176aa24.bundle.js} +1 -1
- package/dist/198.55e79d00713b2500f203.bundle.js +1 -1
- package/dist/{2.619c2619f736dbce2a2f.bundle.js → 2.c65777063a36c091a5bd.bundle.js} +1 -1
- package/dist/20.c6da63eaca8c7d70114f.bundle.js +1 -0
- package/dist/22.a052dbb90cc265342e5a.bundle.js +1 -1
- package/dist/{23.b4c0f0ceb8bd010f614b.bundle.js → 23.bb941b1c5b252f4ca45d.bundle.js} +1 -1
- package/dist/25.e270178ce42ba8e4e7ee.bundle.js +1 -0
- package/dist/{26.68f4f27950281a3c38f5.bundle.js → 26.40d859a0a8a84551e6a3.bundle.js} +1 -1
- package/dist/29.23338c84d369c009f196.bundle.js +1 -1
- package/dist/32.9a8e75f644f231ec2346.bundle.js +1 -0
- package/dist/{33.7cbb90a6b50f8930dbea.bundle.js → 33.19afa1f8be001d8dbb35.bundle.js} +1 -1
- package/dist/36.55a3af7ce65b4b20033b.bundle.js +1 -1
- package/dist/{4.c8e2274b40fd185a3738.bundle.js → 4.61bf53cda571e1e46d8b.bundle.js} +1 -1
- package/dist/40.f1f27b64356cd38da424.bundle.js +1 -0
- package/dist/{45.4be80cd242c82f24dee0.bundle.js → 45.0e828cba3f18851b0c36.bundle.js} +1 -1
- package/dist/48.4d17d325f11d472a147d.bundle.js +1 -1
- package/dist/{5.1638e5d352dd9ff72475.bundle.js → 5.df72ab6068dcb3268c22.bundle.js} +1 -1
- package/dist/{61.9bf61ab90dcbc0bb6276.bundle.js → 61.d58f9cc70caedb912d9f.bundle.js} +1 -1
- package/dist/64.305906a8eb2fa755117a.bundle.js +1 -0
- package/dist/{72.a2a2287694bcbc2550a8.bundle.js → 72.2a93a562e2af1ada5ce7.bundle.js} +1 -1
- package/dist/{bundle.4e5715c43e767d286da2.bundle.js → bundle.b51cb0800fa0b21c0a17.bundle.js} +6 -6
- package/dist/css/aclmanagement.css +9 -0
- package/dist/i18n/locale-en.json +5 -2
- package/dist/i18n/locale-fr.json +5 -2
- package/dist/index.html +3 -3
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/security/templates/user.html +1 -1
- package/dist/license-checker.json +2 -2
- package/dist/pages/aclmanagement.html +7 -11
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +4 -4
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +11 -11
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +1 -1
- package/dist/pages/jdbc-create.html +5 -5
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +2 -2
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +2 -2
- package/dist/pages/repository.html +2 -2
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-template-create.html +5 -5
- package/dist/pages/sparql.html +3 -3
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger/index.html +27 -27
- package/package.json +1 -1
- package/dist/20.89bc66429b9d42b35779.bundle.js +0 -1
- package/dist/25.144cbec4c8b6067b4862.bundle.js +0 -1
- package/dist/32.4b694d4b6b15e1e3ff16.bundle.js +0 -1
- package/dist/40.c569fcee033d5ae3fa2a.bundle.js +0 -1
- package/dist/64.951218e19b5a087d25f9.bundle.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[20,25,32,40,64],{133:function(e,t,l){"use strict";l.r(t);l(6),l(22),l(28),l(83),l(87),l(21);angular.module("graphdb.framework.aclmanagement",["ui.bootstrap","toastr","ngCookies","ngRoute","graphdb.framework.aclmanagement.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.controllers"])},61:function(e,t,l){"use strict";l.r(t),l.d(t,"mapAclRulesResponse",(function(){return r}));var s=l(62);const r=e=>{const t=new s.ACListModel;return e&&e.data&&e.data.forEach(e=>{t.appendNewRule(e.subject,e.predicate,e.object,e.context,e.role,e.policy)}),t}},62:function(e,t,l){"use strict";l.r(t),l.d(t,"ACListModel",(function(){return s})),l.d(t,"ACRuleModel",(function(){return r})),l.d(t,"ACL_POLICY",(function(){return o}));class s{constructor(e=[]){this._aclRules=e}size(){return this.aclRules.length}appendNewRule(e,t,l,s,o,n){this.aclRules.push(new r(e,t,l,s,o,n))}addRule(e){this.aclRules.splice(e,0,new r)}removeRule(e){this.aclRules.splice(e,1)}replaceRule(e,t){this.aclRules.splice(e,1,t)}getRule(e){return this.aclRules[e]}isRuleDuplicated(e){const t=this.aclRules[e];return this.aclRules.some((l,s)=>e!==s&&angular.equals(t,l))}getRuleCopy(e){const t=this.aclRules[e];return{subject:t.subject,predicate:t.predicate,object:t.object,context:t.context,role:t.role,policy:t.policy}}moveUp(e){const t=this.aclRules[e-1];this.aclRules[e-1]=this.aclRules[e],this.aclRules[e]=t}moveDown(e){const t=this.aclRules[e+1];this.aclRules[e+1]=this.aclRules[e],this.aclRules[e]=t}toJSON(){return this.aclRules.map(e=>({subject:e.subject,predicate:e.predicate,object:e.object,context:e.context,role:e.role,policy:e.policy}))}get aclRules(){return this._aclRules}set aclRules(e){this._aclRules=e}}class r{constructor(e="*",t="*",l="*",s="*",r="CUSTOM_",n=o.ALLOW){this._subject=e,this._predicate=t,this._object=l,this._context=s,this._role=r,this._policy=n}get subject(){return this._subject}set subject(e){this._subject=e}get predicate(){return this._predicate}set predicate(e){this._predicate=e}get object(){return this._object}set object(e){this._object=e}get context(){return this._context}set context(e){this._context=e}get role(){return this._role}set role(e){this._role=e}get policy(){return this._policy}set policy(e){this._policy=e}}const o={ALLOW:"allow",DENY:"deny"}},84:function(e,t,l){"use strict";l.r(t);l(61);angular.module("graphdb.framework.rest.aclmanagement.service",[]).factory("AclManagementRestService",s),s.$inject=["$http"];function s(e){return{getAcl:function(t){return e.get(`rest/repositories/${t}/acl`)},updateAcl:function(t,l){return e.put(`rest/repositories/${t}/acl`,l)}}}},87:function(e,t,l){"use strict";l.r(t);l(29),l(84);var s=l(61),r=l(82);function o(e,t,l,o,n,a,c){const i=[];e.ruleData={},e.loading=!1,e.rulesModel=void 0,e.rulesModelCopy=void 0,e.selectedRule=void 0,e.editedRuleIndex=void 0,e.editedRuleCopy=void 0,e.isNewRule=!1,e.modelIsDirty=!1,e.addRule=t=>{e.rulesModel.addRule(t),e.editedRuleIndex=t,e.isNewRule=!0,m()},e.editRule=t=>{e.editedRuleIndex=t,e.isNewRule=!1,e.editedRuleCopy=e.rulesModel.getRuleCopy(t),m()},e.deleteRule=t=>{c.openConfirmation(a.instant("common.confirm"),a.instant("acl_management.rulestable.messages.delete_rule_confirmation",{index:t}),()=>{e.rulesModel.removeRule(t),m()})},e.saveRule=()=>{e.rulesModel.isRuleDuplicated(e.editedRuleIndex)?g():(e.editedRuleIndex=void 0,e.isNewRule=!1,m())},e.cancelEditing=t=>{e.isNewRule?(e.rulesModel.removeRule(t),e.isNewRule=!1):(e.rulesModel.replaceRule(t,e.editedRuleCopy),e.editedRuleCopy=void 0),e.editedRuleIndex=void 0,m()},e.moveUp=t=>{e.rulesModel.moveUp(t),e.selectedRule=t-1,m()},e.moveDown=t=>{e.rulesModel.moveDown(t),e.selectedRule=t+1,m()},e.saveAcl=()=>{e.loading=!0,d().then(u).finally(()=>{e.loading=!1})},e.cancelAclSave=()=>{c.openConfirmation(a.instant("common.confirm"),a.instant("acl_management.rulestable.messages.revert_acl_list"),()=>{p(),l.success(a.instant("acl_management.rulestable.messages.rules_reverted"))})};const u=()=>{const t=R();return o.getAcl(t).then(t=>{e.rulesModel=Object(s.mapAclRulesResponse)(t),e.rulesModelCopy=Object(s.mapAclRulesResponse)(t),m()}).catch(e=>{const t=getError(e);l.error(t,a.instant("acl_management.errors.loading_rules"))})},d=()=>{const t=R();return o.updateAcl(t,e.rulesModel.toJSON()).then(()=>{l.success(a.instant("acl_management.rulestable.messages.rules_updated"))}).catch(e=>{const t=getError(e);l.error(t,a.instant("acl_management.errors.updating_rules"))})},p=()=>{R()&&(e.loading=!0,u().finally(()=>{e.loading=!1}))},m=()=>{e.modelIsDirty=!Object(r.isEqual)(e.rulesModel,e.rulesModelCopy)},R=()=>n.getActiveRepository(),g=()=>{l.error(a.instant("acl_management.errors.duplicated_rules"))},h=t=>{e.modelIsDirty&&(t.returnValue=!0)},b=()=>{window.removeEventListener("beforeunload",h),i.forEach(e=>e())},_=(l,s)=>{e.modelIsDirty&&(l.preventDefault(),c.openSimpleModal({title:a.instant("common.confirm"),message:a.instant("acl_management.rulestable.messages.unsaved_changes_confirmation"),warning:!0}).result.then((function(){b();const e=t.absUrl().length-t.url().length,l=s.substring(e);t.path(l)}),(function(){})))};i.push(e.$watch(R,p)),i.push(e.$on("$locationChangeStart",_)),i.push(e.$on("$destroy",b)),window.addEventListener("beforeunload",h)}angular.module("graphdb.framework.aclmanagement.controllers",["graphdb.framework.rest.plugins.service","graphdb.framework.rest.aclmanagement.service"]).controller("AclManagementCtrl",o),o.$inject=["$scope","$location","toastr","AclManagementRestService","$repositories","$translate","ModalService"]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{106:function(e,t,n){"use strict";n.r(t);var r=n(293),i=n.n(r),a=n(304),o=n(296),s=n(297);n(10);function l(e,t,n,r,l,c,d,u,f,h,p,v,y){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,g,m){!function(d,g){var m=d3.layout.pack().size([780,780]).value((function(e){return e.size})),x=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),w=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function S(){return w.append("svg:g").attr({id:"main-group",transform:"translate(400,400)"})}function C(){return"true"===p.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function E(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.4.0-RC1");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"class-hierarchy-"+c.getActiveRepository()+".svg"})}d.hidePrefixes=C();var T,R,A=S();if(!d.classHierarchyData.classCount&&c.getActiveRepository()&&!c.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=p.get("classHierarchy-selectedGraph-"+c.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&u.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",E)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var H,P,I,b,k,F,L,D,N={};function z(n,s,c,u){I&&I(),b&&b(),d3.selectAll("#main-group").remove(),A=S(),a.a.SingleChild.addPlaceholders(n,!0),P=c||n;var p,v=m.nodes(n);P.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(v),a.a.SingleChild.centerNodes(v),a.a.SingleChild.makePositionsRelativeToZero(v);var y=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));w.call(y);var g=A.selectAll("circle").data(v).enter().append("g");s.doFade&&g.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var C,E=[],k=g.append("circle").attr("class",(function(e){return e.role})).attr("guide-selector",(function(e){return"class-"+e.name})).style("fill",(function(e){return e.children?x(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==h){var t=e.name;E.push({name:t}),N[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){s.noPrefixes||e.textHidden?y.show(e):y.hide(e)})),e.circle.on("mouseout",y.hide)}})).on("gdb-focus",R).on("gdb-zoom",B);function F(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),C=e}function L(){d.showClassInfoPanel=!1}E&&(E=_.uniqBy(E,"name"),d.flattenedClassNames=E);var D=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D);R=function(e){B(e),e.name===h?(L(),d3.selectAll(".selected").classed("selected",!1)):(F(e),d.selectedClass=C,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),y.hide(),R(e)})),D.on("dblclick",(function(t){t!==n&&(y.hide(),F(t),e.$broadcast("goToDomainRangeGraphView",C,P),d3.event.stopPropagation())}));var $=0;w.on("wheel",(function(){y.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-$>100){$=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=P),"in"===n){if(i!==P){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<P.depth&&(i=P)}if(i===P&&i.children){for(var a=i.children[0],o=1;o<i.children.length;o++)i.children[o].sortingRank>a.sortingRank&&(a=i.children[o]);a.children&&(i=a)}else i.children||(i=i.parent);B(i,!0)}else"out"===n&&(i=P.parent)&&B(i,!0);P.name===h&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),O()}}));var z=A.selectAll("text").data(v).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));s.noPrefixes?(H!==n&&(z.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),H=n),z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),z.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&z.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),T=function(){function e(e){e&&k.each((function(t){e==t.id&&R(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var U=A.selectAll("circle, text");function M(e,t){var n=800/e[2];p=e,U.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),k.attr("r",(function(e){return e.r*n})),t&&z.each((function(e){e.fullName!==P.topLevelParentUri&&P.topLevelParentUri!==h||(e.textSel.style("display","none"),P.children&&P.children.length?_.each(P.children,(function(e){e.textSel.style("display","inline")})):P.textSel.style("display","inline"),P.parent&&_.each(P.parent.children,(function(e){e.name!==P.name&&e.textSel.style("display","inline")})))})),z.style("font-size",(function(e){return s.noPrefixes?o.a.Text.calcFontSize(e.noPrefixName,e.r*n):o.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return s.noPrefixes?o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function W(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function Y(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function B(e,t){if(l((function(){d.showExternalElements=e.name===h})),P!==e&&(e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),e.children||(e=e.parent,P!==e))){if(t&&(L(),d3.selectAll(".selected").classed("selected",!1)),P.parent)for(var n=P;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(P=e).r/(2*P.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)M([P.x,P.y,V(P.r)]),z.each((function(e){W.call(this,e),Y.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[P.x,P.y,V(P.r)]);return function(e){M(t(e))}})).selectAll("text").each("start",W).each("end",Y)}}M([P.x,P.y,V(P.r)],u),I=d.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),R(n)})),b=d.$on("classSearch",(function(e){R(e)}))}function O(){var t=d.classHierarchyData.classCount;let n=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",O),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",O),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){k&&k(),F&&F(),L&&L(),D&&D();var e=C();if(d.classHierarchyData.classCount){O();var t=angular.copy(d.classHierarchyData);var n,r,i=function(e){return m.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank||e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function a(e,t){var i={keepPrevState:!0,noPrefixes:C()};r=i.noPrefixes,z(n||e,i,P,!0),l((function(){p.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),T()}),70)}function o(e,i,o){if(e){p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};for(var s=new Set,l=1;l<=e;l++)s.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)s.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),o)r=angular.isUndefined(r)?C():r,z(n,{noPrefixes:r});else a(t)}}var s,c=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(c)o(c,i);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:C()};z(t,u),T()}k=d.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||p.set(v.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),a(t,!0)}),50)}),!0),F=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),D=d.$on("onEnterKeypressSearchAction",(function(e){s&&R(s)})),L=d.$on("searchedClass",(function(e,t){(s=N[t.name])&&R(s)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},293:function(e,t,n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,a=null,o=null,s=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,a=i.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(o=r.pop());var i,a=n.apply(this,r),u=t.apply(this,r),h=e.apply(this,r),p=f(),v=d.length,y=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,m=s.apply(this,r);for(p.html(a).style({opacity:1,"pointer-events":"all"});v--;)p.classed(d[v],!1);return i=c.get(h).apply(this),m?p.style(m):p.classed(h,!0).style({top:i.top+u[0]+y+"px",left:i.left+u[1]+g+"px"}),l},l.hide=function(){return f().style({opacity:0,"pointer-events":"none"}),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),l):n},l.customPosition=function(e){return arguments.length?(s=null==e?e:d3.functor(e),l):s},l.destroy=function(){return r&&(f().remove(),r=null),l};var c=d3.map({n:function(){var e=h();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=h();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=h();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=h();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=h();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=h();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=h();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=h();return{top:e.se.y,left:e.e.x}}}),d=c.keys();function u(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function h(){for(var e=o||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,s=r.height,l=r.x,c=r.y;return a.x=l,a.y=c,t.nw=a.matrixTransform(n),a.x+=i,t.ne=a.matrixTransform(n),a.y+=s,t.se=a.matrixTransform(n),a.x-=i,t.sw=a.matrixTransform(n),a.y-=s/2,t.w=a.matrixTransform(n),a.x+=i,t.e=a.matrixTransform(n),a.x-=i/2,a.y-=s/2,t.n=a.matrixTransform(n),a.y+=s,t.s=a.matrixTransform(n),t}return l}})?r.apply(t,i):r)||(e.exports=a)},296:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,a;i=n,a=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-a[0],2),Math.pow(i[1]-a[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},297:function(e,t,n){"use strict";var r=r||{};r.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(){var e=d3.selectAll("svg").attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg"}).node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(e)))}},t.a=r},304:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var i=1.2*t.size;n&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,i(n.children[0],r)}}function i(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,i(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var i=e[r];i.x-=t,i.y-=n}}},t.a=r}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{106:function(e,t,n){"use strict";n.r(t);var r=n(293),i=n.n(r),a=n(304),o=n(296),s=n(297);n(10);function l(e,t,n,r,l,c,d,u,f,h,p,v,y){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,g,m){!function(d,g){var m=d3.layout.pack().size([780,780]).value((function(e){return e.size})),x=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),w=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function S(){return w.append("svg:g").attr({id:"main-group",transform:"translate(400,400)"})}function C(){return"true"===p.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function E(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.4.0-RC3");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"class-hierarchy-"+c.getActiveRepository()+".svg"})}d.hidePrefixes=C();var T,R,A=S();if(!d.classHierarchyData.classCount&&c.getActiveRepository()&&!c.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=p.get("classHierarchy-selectedGraph-"+c.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&u.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",E)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var H,P,I,b,k,F,L,D,N={};function z(n,s,c,u){I&&I(),b&&b(),d3.selectAll("#main-group").remove(),A=S(),a.a.SingleChild.addPlaceholders(n,!0),P=c||n;var p,v=m.nodes(n);P.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(v),a.a.SingleChild.centerNodes(v),a.a.SingleChild.makePositionsRelativeToZero(v);var y=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));w.call(y);var g=A.selectAll("circle").data(v).enter().append("g");s.doFade&&g.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var C,E=[],k=g.append("circle").attr("class",(function(e){return e.role})).attr("guide-selector",(function(e){return"class-"+e.name})).style("fill",(function(e){return e.children?x(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==h){var t=e.name;E.push({name:t}),N[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){s.noPrefixes||e.textHidden?y.show(e):y.hide(e)})),e.circle.on("mouseout",y.hide)}})).on("gdb-focus",R).on("gdb-zoom",B);function F(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),C=e}function L(){d.showClassInfoPanel=!1}E&&(E=_.uniqBy(E,"name"),d.flattenedClassNames=E);var D=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D);R=function(e){B(e),e.name===h?(L(),d3.selectAll(".selected").classed("selected",!1)):(F(e),d.selectedClass=C,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),y.hide(),R(e)})),D.on("dblclick",(function(t){t!==n&&(y.hide(),F(t),e.$broadcast("goToDomainRangeGraphView",C,P),d3.event.stopPropagation())}));var $=0;w.on("wheel",(function(){y.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-$>100){$=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=P),"in"===n){if(i!==P){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<P.depth&&(i=P)}if(i===P&&i.children){for(var a=i.children[0],o=1;o<i.children.length;o++)i.children[o].sortingRank>a.sortingRank&&(a=i.children[o]);a.children&&(i=a)}else i.children||(i=i.parent);B(i,!0)}else"out"===n&&(i=P.parent)&&B(i,!0);P.name===h&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),O()}}));var z=A.selectAll("text").data(v).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));s.noPrefixes?(H!==n&&(z.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),H=n),z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),z.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&z.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),T=function(){function e(e){e&&k.each((function(t){e==t.id&&R(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var U=A.selectAll("circle, text");function M(e,t){var n=800/e[2];p=e,U.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),k.attr("r",(function(e){return e.r*n})),t&&z.each((function(e){e.fullName!==P.topLevelParentUri&&P.topLevelParentUri!==h||(e.textSel.style("display","none"),P.children&&P.children.length?_.each(P.children,(function(e){e.textSel.style("display","inline")})):P.textSel.style("display","inline"),P.parent&&_.each(P.parent.children,(function(e){e.name!==P.name&&e.textSel.style("display","inline")})))})),z.style("font-size",(function(e){return s.noPrefixes?o.a.Text.calcFontSize(e.noPrefixName,e.r*n):o.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return s.noPrefixes?o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function W(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function Y(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function B(e,t){if(l((function(){d.showExternalElements=e.name===h})),P!==e&&(e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),e.children||(e=e.parent,P!==e))){if(t&&(L(),d3.selectAll(".selected").classed("selected",!1)),P.parent)for(var n=P;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(P=e).r/(2*P.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)M([P.x,P.y,V(P.r)]),z.each((function(e){W.call(this,e),Y.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[P.x,P.y,V(P.r)]);return function(e){M(t(e))}})).selectAll("text").each("start",W).each("end",Y)}}M([P.x,P.y,V(P.r)],u),I=d.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),R(n)})),b=d.$on("classSearch",(function(e){R(e)}))}function O(){var t=d.classHierarchyData.classCount;let n=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",O),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",O),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){k&&k(),F&&F(),L&&L(),D&&D();var e=C();if(d.classHierarchyData.classCount){O();var t=angular.copy(d.classHierarchyData);var n,r,i=function(e){return m.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank||e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function a(e,t){var i={keepPrevState:!0,noPrefixes:C()};r=i.noPrefixes,z(n||e,i,P,!0),l((function(){p.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),T()}),70)}function o(e,i,o){if(e){p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};for(var s=new Set,l=1;l<=e;l++)s.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)s.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),o)r=angular.isUndefined(r)?C():r,z(n,{noPrefixes:r});else a(t)}}var s,c=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(c)o(c,i);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:C()};z(t,u),T()}k=d.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||p.set(v.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),a(t,!0)}),50)}),!0),F=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),D=d.$on("onEnterKeypressSearchAction",(function(e){s&&R(s)})),L=d.$on("searchedClass",(function(e,t){(s=N[t.name])&&R(s)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},293:function(e,t,n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,a=null,o=null,s=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,a=i.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(o=r.pop());var i,a=n.apply(this,r),u=t.apply(this,r),h=e.apply(this,r),p=f(),v=d.length,y=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,m=s.apply(this,r);for(p.html(a).style({opacity:1,"pointer-events":"all"});v--;)p.classed(d[v],!1);return i=c.get(h).apply(this),m?p.style(m):p.classed(h,!0).style({top:i.top+u[0]+y+"px",left:i.left+u[1]+g+"px"}),l},l.hide=function(){return f().style({opacity:0,"pointer-events":"none"}),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),l):n},l.customPosition=function(e){return arguments.length?(s=null==e?e:d3.functor(e),l):s},l.destroy=function(){return r&&(f().remove(),r=null),l};var c=d3.map({n:function(){var e=h();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=h();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=h();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=h();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=h();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=h();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=h();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=h();return{top:e.se.y,left:e.e.x}}}),d=c.keys();function u(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function h(){for(var e=o||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,s=r.height,l=r.x,c=r.y;return a.x=l,a.y=c,t.nw=a.matrixTransform(n),a.x+=i,t.ne=a.matrixTransform(n),a.y+=s,t.se=a.matrixTransform(n),a.x-=i,t.sw=a.matrixTransform(n),a.y-=s/2,t.w=a.matrixTransform(n),a.x+=i,t.e=a.matrixTransform(n),a.x-=i/2,a.y-=s/2,t.n=a.matrixTransform(n),a.y+=s,t.s=a.matrixTransform(n),t}return l}})?r.apply(t,i):r)||(e.exports=a)},296:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,a;i=n,a=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-a[0],2),Math.pow(i[1]-a[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},297:function(e,t,n){"use strict";var r=r||{};r.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(){var e=d3.selectAll("svg").attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg"}).node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(e)))}},t.a=r},304:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var i=1.2*t.size;n&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,i(n.children[0],r)}}function i(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,i(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var i=e[r];i.x-=t,i.y-=n}}},t.a=r}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[23,61,127,128,143],{122:function(e,r){function t(e,r,t,o){return{restrict:"E",scope:!0,templateUrl:"js/angular/repositories/templates/fedx-repo.html",link:function(n){const s="ResolvableRepository";n.fedxMembers=[],n.knownRepos=[],n.allAttachedRepos=[],n.editRepoPage&&(n.fedxMembers=n.repositoryInfo.params.member.value.slice());function i(){for(const e of n.fedxMembers)n.knownRepos=n.knownRepos.filter((function(r){return e.repositoryServer?r.id!==e.repositoryName||r.location!==e.repositoryServer:r.id!==e.repositoryName||!r.local}))}function a(){r.getRepositories(n.repositoryInfo.location).success((function(e){let r=[];_.values(e).forEach(e=>{r.push.apply(r,e)}),n.allAttachedRepos=_.cloneDeep(r)})).error((function(e){const r=getError(e);t.error(r,o.instant("common.error"))})).then((function(){n.knownRepos=n.allAttachedRepos.slice(),i()}))}n.setWritableRepo=function(e){let r=n.fedxMembers.find(e=>"true"===e.writable);r&&((r.store!==s||e.store===s&&r.repositoryName===e.repositoryName)&&("RemoteRepository"!==r.store||"RemoteRepository"===e.store&&r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)||(r.writable="false")),e.writable=JSON.stringify("false"===e.writable)},n.getActiveClass=function(e){return"true"===e.writable?" active":""},n.checkIfRepoExist=function(e){return!n.allAttachedRepos.length||(e.store===s?n.allAttachedRepos.find(r=>r.id===e.repositoryName&&!r.location):"RemoteRepository"!==e.store||n.allAttachedRepos.find(r=>r.id===e.repositoryName&&r.location===e.repositoryServer))},n.getRepositoryServer=function(e){return e.local?"Local":e.location};const c=setInterval((function(){a()}),5e3);function l(e){n.fedxMembers.push(e),n.repositoryInfo.params.member.value=n.fedxMembers}function p(e){return"/"===e.slice(-1)?e.slice(0,-1):e}function d(){return n.editRepoPage&&!n.editRepoPage||!n.model.editMode}n.$on("$destroy",(function(){clearInterval(c)})),n.addMember=function(e){let r;r="Local"===n.getRepositoryServer(e)?{store:s,repositoryName:e.id,repoType:e.type,respectRights:"true",writable:"false"}:{store:"RemoteRepository",repositoryName:e.id,repositoryServer:e.location,username:"",password:"",supportsASKQueries:"true",writable:"false"},n.knownRepos=n.knownRepos.filter(r=>r.id!==e.id||r.location!==e.location),l(r)},n.removeMember=function(e){e.store&&e.store===s?(n.fedxMembers=n.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName&&!r.repositoryServer),a()):e.store&&"SPARQLEndpoint"===e.store?n.fedxMembers=n.fedxMembers.filter(r=>r.endpoint!==e.endpoint):e.store&&"NativeStore"===e.store?n.fedxMembers=n.fedxMembers.filter(r=>r.repositoryLocation!==e.repositoryLocation):e.store&&"RemoteRepository"===e.store&&(n.fedxMembers=n.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer),a()),n.repositoryInfo.params.member.value=n.fedxMembers},n.addRemoteMember=function(){n.mode="remote",n.model={editMode:!1,store:"RemoteRepository",repositoryName:"",repositoryServer:"",sparqlEndpoint:"",username:"",password:"",supportsASKQueries:"true",writable:"false"},n.$uibModalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:n})},n.getMemberIcon=function(e){return e.repoType?"icon-repo-"+e.repoType:"NativeStore"===e.store?"icon-warning":"icon-link"},n.editFedXRepository=function(r){r.store===s?(n.mode="local",n.model={editMode:!0,store:r.store,respectRights:r.respectRights,repositoryName:r.repositoryName,repoType:r.repoType,writable:r.writable}):(n.mode="remote",n.model={editMode:!0,store:r.store,repositoryName:r.repositoryName,repositoryServer:r.repositoryServer,sparqlEndpoint:"SPARQLEndpoint"===r.store?r.endpoint:r.repositoryLocation,username:r.username,password:r.password,supportsASKQueries:r.supportsASKQueries,writable:r.writable}),n.$uibModalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:n})},n.resolveName=function(e){switch(e.store){case s:return e.repositoryName;case"RemoteRepository":return e.repositoryName+"@"+e.repositoryServer;case"SPARQLEndpoint":return e.endpoint;case"NativeStore":return e.repositoryLocation;default:return""}},n.cancel=function(){n.$uibModalInstance.dismiss("cancel")},n.ok=function(){let e;if(n.model.repositoryName&&n.model.store===s)e={store:s,repositoryName:n.model.repositoryName,repoType:n.model.repoType,respectRights:n.model.respectRights,writable:n.model.writable},n.fedxMembers=n.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.store!==e.store);else if(n.model.repositoryName&&"RemoteRepository"===n.model.store){if(e={store:"RemoteRepository",repositoryName:n.model.repositoryName,repositoryServer:p(n.model.repositoryServer),username:n.model.username,password:n.model.password,writable:n.model.writable},d()&&n.fedxMembers.find(r=>r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)){let r=n.resolveName(e);return t.error(o.instant("fedx.repo.already.added.member.error",{name:r})),void n.$uibModalInstance.close()}n.fedxMembers=n.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer)}else{if(e={store:"SPARQLEndpoint",endpoint:p(n.model.sparqlEndpoint),username:n.model.username,password:n.model.password,supportsASKQueries:n.model.supportsASKQueries,writable:n.model.writable},d()&&n.fedxMembers.find(r=>r.endpoint===e.endpoint)){let r=n.resolveName(e);return t.error(o.instant("fedx.repo.already.added.sparql.endpoint.error",{name:r})),void n.$uibModalInstance.close()}n.fedxMembers=n.fedxMembers.filter(r=>r.endpoint!==e.endpoint)}l(e),i(),n.$uibModalInstance.close()},n.$on("changedLocation",(function(){n.fedxMembers=[],a()})),a()}}}angular.module("graphdb.framework.repositories.fedx-repo.directive",[]).directive("fedxRepo",t),t.$inject=["$uibModal","RepositoriesRestService","toastr","$translate"]},123:function(e,r,t){"use strict";t.r(r);t(6),t(22),t(13),t(85),t(32),t(33),t(23),t(51),t(52);function o(e){e.interceptors.push("$unauthorizedInterceptor"),e.interceptors.push("$authenticationInterceptor")}function n(e,r,t){e.$on("$locationChangeStart",(function(){t.isLicenseHardcoded&&"/license/register"===r.url()&&r.path("license")}))}angular.module("graphdb.framework.settings",["toastr","ui.bootstrap","graphdb.framework.rest.license.service","graphdb.framework.settings.controllers","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.interceptors.authentication","graphdb.framework.core.services.jwtauth"]).config(o).run(n),o.$inject=["$httpProvider","$routeProvider"],n.$inject=["$rootScope","$location","$licenseService"]},129:function(e,r,t){"use strict";t.r(r);var o=t(82);const n={OBDA:"obdaFile",OWL:"owlFile",CONSTRAINT:"constraintFile",LENSES:"lensesFile",DB_METADATA:"dbMetadataFile"};class s{constructor(e="generic"){this.driverType=e,this.hostName="",this.port=void 0,this.databaseName="",this.username="",this.password="",this.driverClass="",this.url="",this.urlUserInput=""}}class i{constructor(e,r=!1){this.type=e,this.fileName="",this.loading=!1,this.required=r}}class a extends Error{}const c="generic",l="dremio",p="databricks",d="snowflake";class m{constructor(){this.classAvailable=!1,this.downloadDriverUrl="",this.driverClass="",this.driverName="",this.driverType="",this.portRequired=!1,this.urlTemplate=""}static isGenericDriver(e){return e===c}static isSnowflakeDriver(e){return e===d}}function f(e,r,t,f,u){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(v){v.isGenericDriver=!0,v.defaultUrlTemplate="jdbc:database://localhost:port/database_name",v.ontopProperiesLink="https://ontop-vkg.org/guide/advanced/configuration.html",v.ontopFileType=n,v.selectedDriver=new m,v.supportedDriversData=[],v.formData={connectionInformation:new s,settings:{additionalProperties:"",ontopFiles:[]}},v.selectDriver=e=>{v.selectedDriver=v.supportedDriversData.find(r=>r.driverType===e),v.isGenericDriver=m.isGenericDriver(v.selectedDriver.driverType),v.editRepoPage&&v.currentOntopRepoInfo&&v.currentOntopRepoInfo.connectionInformation.driverType===e?v.formData=angular.copy(v.currentOntopRepoInfo):(L(),v.formData.connectionInformation.driverType=v.selectedDriver.driverType),v.formData.connectionInformation.driverClass=v.selectedDriver.driverClass,v.updateUrl()},v.getOntopFileInfo=e=>v.formData.settings.ontopFiles.find(r=>e===r.type),v.getHostNameLabel=()=>{const e=m.isSnowflakeDriver(v.selectedDriver.driverType)?"ontop.repo.database.snowflake.host_name":"ontop.repo.database.host_name";return u.instant(e)+"*"},v.getDatabaseNameLabel=()=>{let e="";switch(v.selectedDriver.driverType){case d:e="ontop.repo.database.warehouse.database_name";break;case p:e="ontop.repo.database.http_path.database_name";break;case l:e="ontop.repo.database.schema.database_name";break;default:e="ontop.repo.database.database_name"}return u.instant(e)},v.updateUrl=()=>{const e=y()||"";v.formData.connectionInformation.url=e+v.formData.connectionInformation.urlUserInput},v.isTestConnectionDisabled=()=>{const e=v.formData.connectionInformation,r=v.selectedDriver;return!(e.driverClass&&e.url&&(!r.portRequired||e.port))||!(m.isGenericDriver(r.driverType)||e.hostName&&e.databaseName)},v.testConnection=()=>{I().then(T).then(R).then(S).then(k).then(D).then(()=>r.validateOntopPropertiesConnection(v.repositoryInfo)).then(()=>t.success(u.instant("ontop.repo.successful.connection.msg"))).catch(e=>{e instanceof a?t.error(e.message):N(u.instant("ontop.repo.failed.to.connect"),e)})},v.editFile=t=>{const n=v.repositoryInfo.params[t.type].label,s=u.instant("update.file.edit.content.header",{fileName:n});e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",windowClass:"update-ontop-repo-dialog",resolve:{file:()=>{const e=v.repositoryInfo.params[t.type];return e?e.value:""},dialogTitle:()=>s}}).result.then(e=>{r.updateRepositoryFileContent(e.fileLocation,e.content,v.repositoryInfo.location).success(e=>{t.fileName=Object(o.getFileName)(e.fileLocation),v.repositoryInfo.params[t.type].value=e.fileLocation}).error(e=>{N(u.instant("common.error"),e)})})},v.uploadOntopFile=(e,r)=>{if(e&&e.length){const o=e[0];r.loading=!0;const n={url:"rest/repositories/file/upload",data:{file:o,location:v.repositoryInfo.location}};f.upload(n).success(e=>{e.success?(r.fileName=o.name,v.repositoryInfo.params[r.type].value=e.fileLocation):t.error(e.errorMessage)}).error(e=>{N(u.instant("common.error"),e),v.uploadFile=""}).finally(()=>{r.loading=!1})}},v.updateOntopRepo=()=>{const e=v.editRepoPage?v.editRepository:v.createRepo;$().then(I).then(T).then(R).then(S).then(k).then(M).then(D).then(e).catch(e=>{e instanceof a?t.error(e.message):console.log(e)})},v.onKeyDownInUrlInput=e=>{const r=e.keyCode;if(37===r||39===r||36===r||35===r)return;const t=y();if(!t)return;const o=e.ctrlKey||e.metaKey;if(o&&65===r||o&&67===r)return;const n=e.target.selectionStart;8===r&&n-1<t.length&&(e.preventDefault(),e.stopPropagation()),n<t.length&&(e.preventDefault(),e.stopPropagation())},v.onKeyUpInUrlInput=()=>{g()};const g=()=>{const e=y();e&&v.formData.connectionInformation.url.startsWith(e)?v.formData.connectionInformation.urlUserInput=v.formData.connectionInformation.url.substring(e.length):v.formData.connectionInformation.urlUserInput=v.formData.connectionInformation.url},y=()=>m.isSnowflakeDriver(v.selectedDriver.driverType)?h():b(),h=()=>{let e=v.selectedDriver.urlTemplate;const r=v.formData.connectionInformation;return r.hostName&&(e=e.replace("{identifier}",r.hostName)),r.port&&(e=e.replace(".snowflakecomputing.com/?",`.snowflakecomputing.com:${r.port}/?`)),r.databaseName&&(e=e.replace("{database}",r.databaseName)),e},b=()=>{let e=v.selectedDriver.urlTemplate;const r=v.formData.connectionInformation;return r.hostName&&(e=r.port?e.replace("{hostport}",`${r.hostName}:${r.port}`):e.replace("{hostport}",""+r.hostName)),r.databaseName&&(e=e.replace("{database}",r.databaseName)),e},w=e=>{v.formData.settings.ontopFiles.forEach(r=>{r.loading=e})},D=()=>{w(!0);const e=v.formData.connectionInformation,t={hostName:e.hostName,port:e.port,databaseName:e.databaseName,userName:e.username,password:e.password,driverClass:e.driverClass,url:e.url,additionalProperties:v.formData.settings.additionalProperties};return r.updatePropertiesFile(v.repositoryInfo.params.propertiesFile.value,t,v.repositoryInfo.location,v.selectedDriver.driverType).success(e=>{v.repositoryInfo.params.propertiesFile.value=e.fileLocation}).error(e=>{N(u.instant("common.error"),e)}).finally(()=>w(!1))},N=(e,r)=>{const o=getError(r);t.error(o,e)},I=()=>m.isGenericDriver(v.selectedDriver.driverType)||v.formData.connectionInformation.hostName?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.host_name")}))),R=()=>m.isGenericDriver(v.selectedDriver.driverType)||v.formData.connectionInformation.databaseName?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.database_name")}))),S=()=>v.formData.connectionInformation.driverClass?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.driver_class")}))),k=()=>v.formData.connectionInformation.url?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.url")}))),$=()=>v.repositoryInfo.id?Promise.resolve():Promise.reject(new a(u.instant("empty.repoid.warning"))),M=()=>v.getOntopFileInfo(n.OBDA).fileName?Promise.resolve():Promise.reject(new a(u.instant("ontop.repo.missing.required.file",{fileName:v.repositoryInfo.params[n.OBDA].label}))),T=()=>v.selectedDriver.portRequired&&!v.formData.connectionInformation.port?Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.port")}))):Promise.resolve(),L=()=>{v.formData={connectionInformation:new s,settings:{additionalProperties:"",ontopFiles:[]}},Object.values(n).forEach(e=>{const r=new i(e);v.formData.settings.ontopFiles.push(r)}),v.getOntopFileInfo(n.OBDA).required=!0};r.getSupportedDriversData(v.repositoryInfo).success(e=>{v.supportedDriversData=e}).error(e=>{N(u.instant("common.error"),e)}).then(()=>{v.editRepoPage?(w(!0),r.loadPropertiesFile(v.repositoryInfo.params.propertiesFile.value,v.repositoryInfo.location,v.selectedDriver.driverType).success(e=>{let r=v.supportedDriversData.find(r=>r.driverClass===e.driverClass);r&&e.hostName||(r=v.supportedDriversData.find(e=>m.isGenericDriver(e.driverType))),v.selectDriver(r.driverType),v.formData.connectionInformation.driverType=r.driverType,v.formData.connectionInformation.driverClass=e.driverClass,v.formData.connectionInformation.password=e.password,v.formData.connectionInformation.username=e.userName,v.formData.connectionInformation.url=e.url,v.formData.settings.additionalProperties=e.additionalProperties,m.isGenericDriver(r.driverType)||(v.formData.connectionInformation.hostName=e.hostName,v.formData.connectionInformation.databaseName=e.databaseName,v.formData.connectionInformation.port=e.port?parseInt(e.port,10):void 0),g(),v.updateUrl(),Object.values(n).forEach(e=>{const r=v.repositoryInfo.params[e],t=v.getOntopFileInfo(e);r&&(t.fileName=Object(o.getFileName)(r.value))}),v.currentOntopRepoInfo=angular.copy(v.formData)}).error(e=>{N(u.instant("common.error"),e)}).finally(()=>{w(!1)})):v.selectDriver(c)})}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",f),f.$inject=["$uibModal","RepositoriesRestService","toastr","Upload","$translate"]},185:function(e,r,t){"use strict";t.r(r);t(6),t(22),t(28),t(82),t(129),t(122),t(21),t(123),t(51),t(52);angular.module("graphdb.framework.repositories",["ui.bootstrap","toastr","ngCookies","ngRoute","graphdb.framework.repositories.controllers","graphdb.framework.repositories.ontop-repo.directive","graphdb.framework.repositories.fedx-repo.directive","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.controllers","graphdb.framework.settings"])},85:function(e,r,t){"use strict";t.r(r);t(6),t(23);function o(e,r,t,o,n){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,o.getStatistics().then((function(r){e.settings.statistics="true"===r.data,e.supportsStatistics=!0}),(function(t){if(404===t.status)e.supportsStatistics=!1;else{const e=getError(t.data);r.error(e,n.instant("error.getting.settings"))}}))},e.getSettings(),e.setSettings=function(){e.loader=!0,o.toggleStatistics(e.settings.statistics).then((function(){t.close(),r.success(n.instant("saving.settings.success"))}),(function(e){const t=getError(e.data);r.error(t,n.instant("saving.settings.error"))}))},e.submitForm=function(){e.setSettings()},e.cancel=function(){t.dismiss("cancel")}}function n(e,r,t,o,n,s,i){e.loadingLicense=function(){return t.loadingLicense},t.checkLicenseStatus(),e.revertToFree=function(){s.openSimpleModal({title:i.instant("confirm.operation"),message:i.instant("revert.to.free.warning.msg"),warning:!0}).result.then((function(){r.unregisterLicense().success((function(){t.checkLicenseStatus()}))}))}}function s(e,r,t,o,n,s,i,a){e.$on("securityInit",(function(){i.isAdmin()||t.path("/license")})),e.sendLicenseToValidateAndActivate=l;const c=$(".license-textarea");function l(e){r.sendLicenseToValidate(e).success((function(t){"Invalid"!==t.licensee?(c.val(e),function(e,t){o.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then((function(){!function(e){e||(e=c.val());if(e){const t=atob(e.replace(/\s/g,""));r.registerLicense(t).success((function(){s.history.back()})).error((function(){n.error(a.instant("license.register.error"))}))}else n.error(a.instant("no.license.code.error"))}(t)}))}(t,e)):(c.val(""),n.error(t.message))})).error((function(){n.error(a.instant("invalid.license"))}))}e.$watch("currentFile",(function(){if(e.currentFile){const t=e.currentFile;r.extractFromLicenseFile(t).success((function(e){l(e)})).error((function(){n.error(a.instant("could.not.upload.file.error"))}))}})),e.getBackToPreviousPage=function(){s.history.back()}}function i(e,r,t){e.ok=function(){r.close()},e.cancel=function(){r.dismiss("cancel")},e.license=t}function a(e){e.loader=!0,e.setLoader=function(r){e.loader=r}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",o).controller("ValidateLicenseModalCtrl",i).controller("LicenseCtrl",n).controller("RegisterLicenseCtrl",s).controller("LoaderSamplesCtrl",a),o.$inject=["$scope","toastr","$uibModalInstance","LicenseRestService","$translate"],n.$inject=["$scope","LicenseRestService","$licenseService","toastr","$rootScope","ModalService","$translate"],s.$inject=["$scope","LicenseRestService","$location","$uibModal","toastr","$window","$jwtAuth","$translate"],i.$inject=["$scope","$uibModalInstance","license"],a.$inject=["$scope"]}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[23,61,127,128,143],{122:function(e,r){function t(e,r,t,o){return{restrict:"E",scope:!0,templateUrl:"js/angular/repositories/templates/fedx-repo.html",link:function(n){const s="ResolvableRepository";n.fedxMembers=[],n.knownRepos=[],n.allAttachedRepos=[],n.editRepoPage&&(n.fedxMembers=n.repositoryInfo.params.member.value.slice());function i(){for(const e of n.fedxMembers)n.knownRepos=n.knownRepos.filter((function(r){return e.repositoryServer?r.id!==e.repositoryName||r.location!==e.repositoryServer:r.id!==e.repositoryName||!r.local}))}function a(){r.getRepositories(n.repositoryInfo.location).success((function(e){let r=[];_.values(e).forEach(e=>{r.push.apply(r,e)}),n.allAttachedRepos=_.cloneDeep(r)})).error((function(e){const r=getError(e);t.error(r,o.instant("common.error"))})).then((function(){n.knownRepos=n.allAttachedRepos.slice(),i()}))}n.setWritableRepo=function(e){let r=n.fedxMembers.find(e=>"true"===e.writable);r&&((r.store!==s||e.store===s&&r.repositoryName===e.repositoryName)&&("RemoteRepository"!==r.store||"RemoteRepository"===e.store&&r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)||(r.writable="false")),e.writable=JSON.stringify("false"===e.writable)},n.getActiveClass=function(e){return"true"===e.writable?" active":""},n.checkIfRepoExist=function(e){return!n.allAttachedRepos.length||(e.store===s?n.allAttachedRepos.find(r=>r.id===e.repositoryName&&!r.location):"RemoteRepository"!==e.store||n.allAttachedRepos.find(r=>r.id===e.repositoryName&&r.location===e.repositoryServer))},n.getRepositoryServer=function(e){return e.local?"Local":e.location};const c=setInterval((function(){a()}),5e3);function l(e){n.fedxMembers.push(e),n.repositoryInfo.params.member.value=n.fedxMembers}function p(e){return"/"===e.slice(-1)?e.slice(0,-1):e}function d(){return n.editRepoPage&&!n.editRepoPage||!n.model.editMode}n.$on("$destroy",(function(){clearInterval(c)})),n.addMember=function(e){let r;r="Local"===n.getRepositoryServer(e)?{store:s,repositoryName:e.id,repoType:e.type,respectRights:"true",writable:"false"}:{store:"RemoteRepository",repositoryName:e.id,repositoryServer:e.location,username:"",password:"",supportsASKQueries:"true",writable:"false"},n.knownRepos=n.knownRepos.filter(r=>r.id!==e.id||r.location!==e.location),l(r)},n.removeMember=function(e){e.store&&e.store===s?(n.fedxMembers=n.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName&&!r.repositoryServer),a()):e.store&&"SPARQLEndpoint"===e.store?n.fedxMembers=n.fedxMembers.filter(r=>r.endpoint!==e.endpoint):e.store&&"NativeStore"===e.store?n.fedxMembers=n.fedxMembers.filter(r=>r.repositoryLocation!==e.repositoryLocation):e.store&&"RemoteRepository"===e.store&&(n.fedxMembers=n.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer),a()),n.repositoryInfo.params.member.value=n.fedxMembers},n.addRemoteMember=function(){n.mode="remote",n.model={editMode:!1,store:"RemoteRepository",repositoryName:"",repositoryServer:"",sparqlEndpoint:"",username:"",password:"",supportsASKQueries:"true",writable:"false"},n.$uibModalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:n})},n.getMemberIcon=function(e){return e.repoType?"icon-repo-"+e.repoType:"NativeStore"===e.store?"icon-warning":"icon-link"},n.editFedXRepository=function(r){r.store===s?(n.mode="local",n.model={editMode:!0,store:r.store,respectRights:r.respectRights,repositoryName:r.repositoryName,repoType:r.repoType,writable:r.writable}):(n.mode="remote",n.model={editMode:!0,store:r.store,repositoryName:r.repositoryName,repositoryServer:r.repositoryServer,sparqlEndpoint:"SPARQLEndpoint"===r.store?r.endpoint:r.repositoryLocation,username:r.username,password:r.password,supportsASKQueries:r.supportsASKQueries,writable:r.writable}),n.$uibModalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:n})},n.resolveName=function(e){switch(e.store){case s:return e.repositoryName;case"RemoteRepository":return e.repositoryName+"@"+e.repositoryServer;case"SPARQLEndpoint":return e.endpoint;case"NativeStore":return e.repositoryLocation;default:return""}},n.cancel=function(){n.$uibModalInstance.dismiss("cancel")},n.ok=function(){let e;if(n.model.repositoryName&&n.model.store===s)e={store:s,repositoryName:n.model.repositoryName,repoType:n.model.repoType,respectRights:n.model.respectRights,writable:n.model.writable},n.fedxMembers=n.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.store!==e.store);else if(n.model.repositoryName&&"RemoteRepository"===n.model.store){if(e={store:"RemoteRepository",repositoryName:n.model.repositoryName,repositoryServer:p(n.model.repositoryServer),username:n.model.username,password:n.model.password,writable:n.model.writable},d()&&n.fedxMembers.find(r=>r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)){let r=n.resolveName(e);return t.error(o.instant("fedx.repo.already.added.member.error",{name:r})),void n.$uibModalInstance.close()}n.fedxMembers=n.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer)}else{if(e={store:"SPARQLEndpoint",endpoint:p(n.model.sparqlEndpoint),username:n.model.username,password:n.model.password,supportsASKQueries:n.model.supportsASKQueries,writable:n.model.writable},d()&&n.fedxMembers.find(r=>r.endpoint===e.endpoint)){let r=n.resolveName(e);return t.error(o.instant("fedx.repo.already.added.sparql.endpoint.error",{name:r})),void n.$uibModalInstance.close()}n.fedxMembers=n.fedxMembers.filter(r=>r.endpoint!==e.endpoint)}l(e),i(),n.$uibModalInstance.close()},n.$on("changedLocation",(function(){n.fedxMembers=[],a()})),a()}}}angular.module("graphdb.framework.repositories.fedx-repo.directive",[]).directive("fedxRepo",t),t.$inject=["$uibModal","RepositoriesRestService","toastr","$translate"]},123:function(e,r,t){"use strict";t.r(r);t(6),t(22),t(13),t(86),t(32),t(33),t(23),t(51),t(52);function o(e){e.interceptors.push("$unauthorizedInterceptor"),e.interceptors.push("$authenticationInterceptor")}function n(e,r,t){e.$on("$locationChangeStart",(function(){t.isLicenseHardcoded&&"/license/register"===r.url()&&r.path("license")}))}angular.module("graphdb.framework.settings",["toastr","ui.bootstrap","graphdb.framework.rest.license.service","graphdb.framework.settings.controllers","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.interceptors.authentication","graphdb.framework.core.services.jwtauth"]).config(o).run(n),o.$inject=["$httpProvider","$routeProvider"],n.$inject=["$rootScope","$location","$licenseService"]},129:function(e,r,t){"use strict";t.r(r);var o=t(83);const n={OBDA:"obdaFile",OWL:"owlFile",CONSTRAINT:"constraintFile",LENSES:"lensesFile",DB_METADATA:"dbMetadataFile"};class s{constructor(e="generic"){this.driverType=e,this.hostName="",this.port=void 0,this.databaseName="",this.username="",this.password="",this.driverClass="",this.url="",this.urlUserInput=""}}class i{constructor(e,r=!1){this.type=e,this.fileName="",this.loading=!1,this.required=r}}class a extends Error{}const c="generic",l="dremio",p="databricks",d="snowflake";class m{constructor(){this.classAvailable=!1,this.downloadDriverUrl="",this.driverClass="",this.driverName="",this.driverType="",this.portRequired=!1,this.urlTemplate=""}static isGenericDriver(e){return e===c}static isSnowflakeDriver(e){return e===d}}function f(e,r,t,f,u){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(v){v.isGenericDriver=!0,v.defaultUrlTemplate="jdbc:database://localhost:port/database_name",v.ontopProperiesLink="https://ontop-vkg.org/guide/advanced/configuration.html",v.ontopFileType=n,v.selectedDriver=new m,v.supportedDriversData=[],v.formData={connectionInformation:new s,settings:{additionalProperties:"",ontopFiles:[]}},v.selectDriver=e=>{v.selectedDriver=v.supportedDriversData.find(r=>r.driverType===e),v.isGenericDriver=m.isGenericDriver(v.selectedDriver.driverType),v.editRepoPage&&v.currentOntopRepoInfo&&v.currentOntopRepoInfo.connectionInformation.driverType===e?v.formData=angular.copy(v.currentOntopRepoInfo):(L(),v.formData.connectionInformation.driverType=v.selectedDriver.driverType),v.formData.connectionInformation.driverClass=v.selectedDriver.driverClass,v.updateUrl()},v.getOntopFileInfo=e=>v.formData.settings.ontopFiles.find(r=>e===r.type),v.getHostNameLabel=()=>{const e=m.isSnowflakeDriver(v.selectedDriver.driverType)?"ontop.repo.database.snowflake.host_name":"ontop.repo.database.host_name";return u.instant(e)+"*"},v.getDatabaseNameLabel=()=>{let e="";switch(v.selectedDriver.driverType){case d:e="ontop.repo.database.warehouse.database_name";break;case p:e="ontop.repo.database.http_path.database_name";break;case l:e="ontop.repo.database.schema.database_name";break;default:e="ontop.repo.database.database_name"}return u.instant(e)},v.updateUrl=()=>{const e=y()||"";v.formData.connectionInformation.url=e+v.formData.connectionInformation.urlUserInput},v.isTestConnectionDisabled=()=>{const e=v.formData.connectionInformation,r=v.selectedDriver;return!(e.driverClass&&e.url&&(!r.portRequired||e.port))||!(m.isGenericDriver(r.driverType)||e.hostName&&e.databaseName)},v.testConnection=()=>{I().then(T).then(R).then(S).then(k).then(D).then(()=>r.validateOntopPropertiesConnection(v.repositoryInfo)).then(()=>t.success(u.instant("ontop.repo.successful.connection.msg"))).catch(e=>{e instanceof a?t.error(e.message):N(u.instant("ontop.repo.failed.to.connect"),e)})},v.editFile=t=>{const n=v.repositoryInfo.params[t.type].label,s=u.instant("update.file.edit.content.header",{fileName:n});e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",windowClass:"update-ontop-repo-dialog",resolve:{file:()=>{const e=v.repositoryInfo.params[t.type];return e?e.value:""},dialogTitle:()=>s}}).result.then(e=>{r.updateRepositoryFileContent(e.fileLocation,e.content,v.repositoryInfo.location).success(e=>{t.fileName=Object(o.getFileName)(e.fileLocation),v.repositoryInfo.params[t.type].value=e.fileLocation}).error(e=>{N(u.instant("common.error"),e)})})},v.uploadOntopFile=(e,r)=>{if(e&&e.length){const o=e[0];r.loading=!0;const n={url:"rest/repositories/file/upload",data:{file:o,location:v.repositoryInfo.location}};f.upload(n).success(e=>{e.success?(r.fileName=o.name,v.repositoryInfo.params[r.type].value=e.fileLocation):t.error(e.errorMessage)}).error(e=>{N(u.instant("common.error"),e),v.uploadFile=""}).finally(()=>{r.loading=!1})}},v.updateOntopRepo=()=>{const e=v.editRepoPage?v.editRepository:v.createRepo;$().then(I).then(T).then(R).then(S).then(k).then(M).then(D).then(e).catch(e=>{e instanceof a?t.error(e.message):console.log(e)})},v.onKeyDownInUrlInput=e=>{const r=e.keyCode;if(37===r||39===r||36===r||35===r)return;const t=y();if(!t)return;const o=e.ctrlKey||e.metaKey;if(o&&65===r||o&&67===r)return;const n=e.target.selectionStart;8===r&&n-1<t.length&&(e.preventDefault(),e.stopPropagation()),n<t.length&&(e.preventDefault(),e.stopPropagation())},v.onKeyUpInUrlInput=()=>{g()};const g=()=>{const e=y();e&&v.formData.connectionInformation.url.startsWith(e)?v.formData.connectionInformation.urlUserInput=v.formData.connectionInformation.url.substring(e.length):v.formData.connectionInformation.urlUserInput=v.formData.connectionInformation.url},y=()=>m.isSnowflakeDriver(v.selectedDriver.driverType)?h():b(),h=()=>{let e=v.selectedDriver.urlTemplate;const r=v.formData.connectionInformation;return r.hostName&&(e=e.replace("{identifier}",r.hostName)),r.port&&(e=e.replace(".snowflakecomputing.com/?",`.snowflakecomputing.com:${r.port}/?`)),r.databaseName&&(e=e.replace("{database}",r.databaseName)),e},b=()=>{let e=v.selectedDriver.urlTemplate;const r=v.formData.connectionInformation;return r.hostName&&(e=r.port?e.replace("{hostport}",`${r.hostName}:${r.port}`):e.replace("{hostport}",""+r.hostName)),r.databaseName&&(e=e.replace("{database}",r.databaseName)),e},w=e=>{v.formData.settings.ontopFiles.forEach(r=>{r.loading=e})},D=()=>{w(!0);const e=v.formData.connectionInformation,t={hostName:e.hostName,port:e.port,databaseName:e.databaseName,userName:e.username,password:e.password,driverClass:e.driverClass,url:e.url,additionalProperties:v.formData.settings.additionalProperties};return r.updatePropertiesFile(v.repositoryInfo.params.propertiesFile.value,t,v.repositoryInfo.location,v.selectedDriver.driverType).success(e=>{v.repositoryInfo.params.propertiesFile.value=e.fileLocation}).error(e=>{N(u.instant("common.error"),e)}).finally(()=>w(!1))},N=(e,r)=>{const o=getError(r);t.error(o,e)},I=()=>m.isGenericDriver(v.selectedDriver.driverType)||v.formData.connectionInformation.hostName?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.host_name")}))),R=()=>m.isGenericDriver(v.selectedDriver.driverType)||v.formData.connectionInformation.databaseName?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.database_name")}))),S=()=>v.formData.connectionInformation.driverClass?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.driver_class")}))),k=()=>v.formData.connectionInformation.url?Promise.resolve():Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.url")}))),$=()=>v.repositoryInfo.id?Promise.resolve():Promise.reject(new a(u.instant("empty.repoid.warning"))),M=()=>v.getOntopFileInfo(n.OBDA).fileName?Promise.resolve():Promise.reject(new a(u.instant("ontop.repo.missing.required.file",{fileName:v.repositoryInfo.params[n.OBDA].label}))),T=()=>v.selectedDriver.portRequired&&!v.formData.connectionInformation.port?Promise.reject(new a(u.instant("missing.required.field",{fieldName:u.instant("ontop.repo.database.port")}))):Promise.resolve(),L=()=>{v.formData={connectionInformation:new s,settings:{additionalProperties:"",ontopFiles:[]}},Object.values(n).forEach(e=>{const r=new i(e);v.formData.settings.ontopFiles.push(r)}),v.getOntopFileInfo(n.OBDA).required=!0};r.getSupportedDriversData(v.repositoryInfo).success(e=>{v.supportedDriversData=e}).error(e=>{N(u.instant("common.error"),e)}).then(()=>{v.editRepoPage?(w(!0),r.loadPropertiesFile(v.repositoryInfo.params.propertiesFile.value,v.repositoryInfo.location,v.selectedDriver.driverType).success(e=>{let r=v.supportedDriversData.find(r=>r.driverClass===e.driverClass);r&&e.hostName||(r=v.supportedDriversData.find(e=>m.isGenericDriver(e.driverType))),v.selectDriver(r.driverType),v.formData.connectionInformation.driverType=r.driverType,v.formData.connectionInformation.driverClass=e.driverClass,v.formData.connectionInformation.password=e.password,v.formData.connectionInformation.username=e.userName,v.formData.connectionInformation.url=e.url,v.formData.settings.additionalProperties=e.additionalProperties,m.isGenericDriver(r.driverType)||(v.formData.connectionInformation.hostName=e.hostName,v.formData.connectionInformation.databaseName=e.databaseName,v.formData.connectionInformation.port=e.port?parseInt(e.port,10):void 0),g(),v.updateUrl(),Object.values(n).forEach(e=>{const r=v.repositoryInfo.params[e],t=v.getOntopFileInfo(e);r&&(t.fileName=Object(o.getFileName)(r.value))}),v.currentOntopRepoInfo=angular.copy(v.formData)}).error(e=>{N(u.instant("common.error"),e)}).finally(()=>{w(!1)})):v.selectDriver(c)})}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",f),f.$inject=["$uibModal","RepositoriesRestService","toastr","Upload","$translate"]},185:function(e,r,t){"use strict";t.r(r);t(6),t(22),t(28),t(83),t(129),t(122),t(21),t(123),t(51),t(52);angular.module("graphdb.framework.repositories",["ui.bootstrap","toastr","ngCookies","ngRoute","graphdb.framework.repositories.controllers","graphdb.framework.repositories.ontop-repo.directive","graphdb.framework.repositories.fedx-repo.directive","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.controllers","graphdb.framework.settings"])},86:function(e,r,t){"use strict";t.r(r);t(6),t(23);function o(e,r,t,o,n){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,o.getStatistics().then((function(r){e.settings.statistics="true"===r.data,e.supportsStatistics=!0}),(function(t){if(404===t.status)e.supportsStatistics=!1;else{const e=getError(t.data);r.error(e,n.instant("error.getting.settings"))}}))},e.getSettings(),e.setSettings=function(){e.loader=!0,o.toggleStatistics(e.settings.statistics).then((function(){t.close(),r.success(n.instant("saving.settings.success"))}),(function(e){const t=getError(e.data);r.error(t,n.instant("saving.settings.error"))}))},e.submitForm=function(){e.setSettings()},e.cancel=function(){t.dismiss("cancel")}}function n(e,r,t,o,n,s,i){e.loadingLicense=function(){return t.loadingLicense},t.checkLicenseStatus(),e.revertToFree=function(){s.openSimpleModal({title:i.instant("confirm.operation"),message:i.instant("revert.to.free.warning.msg"),warning:!0}).result.then((function(){r.unregisterLicense().success((function(){t.checkLicenseStatus()}))}))}}function s(e,r,t,o,n,s,i,a){e.$on("securityInit",(function(){i.isAdmin()||t.path("/license")})),e.sendLicenseToValidateAndActivate=l;const c=$(".license-textarea");function l(e){r.sendLicenseToValidate(e).success((function(t){"Invalid"!==t.licensee?(c.val(e),function(e,t){o.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then((function(){!function(e){e||(e=c.val());if(e){const t=atob(e.replace(/\s/g,""));r.registerLicense(t).success((function(){s.history.back()})).error((function(){n.error(a.instant("license.register.error"))}))}else n.error(a.instant("no.license.code.error"))}(t)}))}(t,e)):(c.val(""),n.error(t.message))})).error((function(){n.error(a.instant("invalid.license"))}))}e.$watch("currentFile",(function(){if(e.currentFile){const t=e.currentFile;r.extractFromLicenseFile(t).success((function(e){l(e)})).error((function(){n.error(a.instant("could.not.upload.file.error"))}))}})),e.getBackToPreviousPage=function(){s.history.back()}}function i(e,r,t){e.ok=function(){r.close()},e.cancel=function(){r.dismiss("cancel")},e.license=t}function a(e){e.loader=!0,e.setLoader=function(r){e.loader=r}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",o).controller("ValidateLicenseModalCtrl",i).controller("LicenseCtrl",n).controller("RegisterLicenseCtrl",s).controller("LoaderSamplesCtrl",a),o.$inject=["$scope","toastr","$uibModalInstance","LicenseRestService","$translate"],n.$inject=["$scope","LicenseRestService","$licenseService","toastr","$rootScope","ModalService","$translate"],s.$inject=["$scope","LicenseRestService","$location","$uibModal","toastr","$window","$jwtAuth","$translate"],i.$inject=["$scope","$uibModalInstance","license"],a.$inject=["$scope"]}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[25,32,40,64],{61:function(e,t,l){"use strict";l.r(t),l.d(t,"mapAclRulesResponse",(function(){return n}));var s=l(62);const n=e=>{const t=new s.ACListModel;return e&&e.data&&e.data.forEach(e=>{t.appendNewRule(e.subject,e.predicate,e.object,e.context,e.role,e.policy)}),t}},62:function(e,t,l){"use strict";l.r(t),l.d(t,"ACListModel",(function(){return s})),l.d(t,"ACRuleModel",(function(){return n})),l.d(t,"ACL_POLICY",(function(){return o}));class s{constructor(e=[]){this._aclRules=e}size(){return this.aclRules.length}appendNewRule(e,t,l,s,o,r){this.aclRules.push(new n(e,t,l,s,o,r))}addRule(e){this.aclRules.splice(e,0,new n)}removeRule(e){this.aclRules.splice(e,1)}replaceRule(e,t){this.aclRules.splice(e,1,t)}getRule(e){return this.aclRules[e]}isRuleDuplicated(e){const t=this.aclRules[e];return this.aclRules.some((l,s)=>e!==s&&angular.equals(t,l))}getRuleCopy(e){const t=this.aclRules[e];return{subject:t.subject,predicate:t.predicate,object:t.object,context:t.context,role:t.role,policy:t.policy}}moveUp(e){const t=this.aclRules[e-1];this.aclRules[e-1]=this.aclRules[e],this.aclRules[e]=t}moveDown(e){const t=this.aclRules[e+1];this.aclRules[e+1]=this.aclRules[e],this.aclRules[e]=t}toJSON(){return this.aclRules.map(e=>({subject:e.subject,predicate:e.predicate,object:e.object,context:e.context,role:e.role,policy:e.policy}))}get aclRules(){return this._aclRules}set aclRules(e){this._aclRules=e}}class n{constructor(e="*",t="*",l="*",s="*",n="CUSTOM_",r=o.ALLOW){this._subject=e,this._predicate=t,this._object=l,this._context=s,this._role=n,this._policy=r}get subject(){return this._subject}set subject(e){this._subject=e}get predicate(){return this._predicate}set predicate(e){this._predicate=e}get object(){return this._object}set object(e){this._object=e}get context(){return this._context}set context(e){this._context=e}get role(){return this._role}set role(e){this._role=e}get policy(){return this._policy}set policy(e){this._policy=e}}const o={ALLOW:"allow",DENY:"deny"}},84:function(e,t,l){"use strict";l.r(t);l(61);angular.module("graphdb.framework.rest.aclmanagement.service",[]).factory("AclManagementRestService",s),s.$inject=["$http"];function s(e){return{getAcl:function(t){return e.get(`rest/repositories/${t}/acl`)},updateAcl:function(t,l){return e.put(`rest/repositories/${t}/acl`,l)}}}},87:function(e,t,l){"use strict";l.r(t);l(29),l(84);var s=l(61),n=l(82);function o(e,t,l,o,r,c,a){const i=[];e.ruleData={},e.loading=!1,e.rulesModel=void 0,e.rulesModelCopy=void 0,e.selectedRule=void 0,e.editedRuleIndex=void 0,e.editedRuleCopy=void 0,e.isNewRule=!1,e.modelIsDirty=!1,e.addRule=t=>{e.rulesModel.addRule(t),e.editedRuleIndex=t,e.isNewRule=!0,m()},e.editRule=t=>{e.editedRuleIndex=t,e.isNewRule=!1,e.editedRuleCopy=e.rulesModel.getRuleCopy(t),m()},e.deleteRule=t=>{a.openConfirmation(c.instant("common.confirm"),c.instant("acl_management.rulestable.messages.delete_rule_confirmation",{index:t}),()=>{e.rulesModel.removeRule(t),m()})},e.saveRule=()=>{e.rulesModel.isRuleDuplicated(e.editedRuleIndex)?h():(e.editedRuleIndex=void 0,e.isNewRule=!1,m())},e.cancelEditing=t=>{e.isNewRule?(e.rulesModel.removeRule(t),e.isNewRule=!1):(e.rulesModel.replaceRule(t,e.editedRuleCopy),e.editedRuleCopy=void 0),e.editedRuleIndex=void 0,m()},e.moveUp=t=>{e.rulesModel.moveUp(t),e.selectedRule=t-1,m()},e.moveDown=t=>{e.rulesModel.moveDown(t),e.selectedRule=t+1,m()},e.saveAcl=()=>{e.loading=!0,d().then(u).finally(()=>{e.loading=!1})},e.cancelAclSave=()=>{a.openConfirmation(c.instant("common.confirm"),c.instant("acl_management.rulestable.messages.revert_acl_list"),()=>{p(),l.success(c.instant("acl_management.rulestable.messages.rules_reverted"))})};const u=()=>{const t=R();return o.getAcl(t).then(t=>{e.rulesModel=Object(s.mapAclRulesResponse)(t),e.rulesModelCopy=Object(s.mapAclRulesResponse)(t),m()}).catch(e=>{const t=getError(e);l.error(t,c.instant("acl_management.errors.loading_rules"))})},d=()=>{const t=R();return o.updateAcl(t,e.rulesModel.toJSON()).then(()=>{l.success(c.instant("acl_management.rulestable.messages.rules_updated"))}).catch(e=>{const t=getError(e);l.error(t,c.instant("acl_management.errors.updating_rules"))})},p=()=>{R()&&(e.loading=!0,u().finally(()=>{e.loading=!1}))},m=()=>{e.modelIsDirty=!Object(n.isEqual)(e.rulesModel,e.rulesModelCopy)},R=()=>r.getActiveRepository(),h=()=>{l.error(c.instant("acl_management.errors.duplicated_rules"))},g=t=>{e.modelIsDirty&&(t.returnValue=!0)},_=()=>{window.removeEventListener("beforeunload",g),i.forEach(e=>e())},b=(l,s)=>{e.modelIsDirty&&(l.preventDefault(),a.openSimpleModal({title:c.instant("common.confirm"),message:c.instant("acl_management.rulestable.messages.unsaved_changes_confirmation"),warning:!0}).result.then((function(){_();const e=t.absUrl().length-t.url().length,l=s.substring(e);t.path(l)}),(function(){})))};i.push(e.$watch(R,p)),i.push(e.$on("$locationChangeStart",b)),i.push(e.$on("$destroy",_)),window.addEventListener("beforeunload",g)}angular.module("graphdb.framework.aclmanagement.controllers",["graphdb.framework.rest.plugins.service","graphdb.framework.rest.aclmanagement.service"]).controller("AclManagementCtrl",o),o.$inject=["$scope","$location","toastr","AclManagementRestService","$repositories","$translate","ModalService"]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[26,33,72],{141:function(t,e,n){"use strict";n.r(e);n(6),n(22),n(75),n(91),n(21),n(298),n(300),n(307);angular.module("graphdb.framework.clustermanagement",["ngAnimate","toastr","graphdb.framework.clustermanagement.controllers","graphdb.framework.clustermanagement.directives"])},293:function(t,e,n){var o,r,a;r=[],void 0===(a="function"==typeof(o=function(){return function(){var t=function(){return"n"},e=function(){return[0,0]},n=function(){return" "},o=u(),r=null,a=null,s=null,c=null;function d(t){var e;r="svg"===(e=(e=t).node()).tagName.toLowerCase()?e:e.ownerSVGElement,a=r.createSVGPoint(),document.body.appendChild(o)}d.show=function(){var o=Array.prototype.slice.call(arguments);o[o.length-1]instanceof SVGElement&&(s=o.pop());var r,a=n.apply(this,o),u=e.apply(this,o),p=t.apply(this,o),h=f(),y=l.length,_=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,S=c.apply(this,o);for(h.html(a).style({opacity:1,"pointer-events":"all"});y--;)h.classed(l[y],!1);return r=i.get(p).apply(this),S?h.style(S):h.classed(p,!0).style({top:r.top+u[0]+_+"px",left:r.left+u[1]+g+"px"}),d},d.hide=function(){return f().style({opacity:0,"pointer-events":"none"}),d},d.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().attr(t);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),d},d.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().style(t);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),d},d.direction=function(e){return arguments.length?(t=null==e?e:d3.functor(e),d):t},d.offset=function(t){return arguments.length?(e=null==t?t:d3.functor(t),d):e},d.html=function(t){return arguments.length?(n=null==t?t:d3.functor(t),d):n},d.customPosition=function(t){return arguments.length?(c=null==t?t:d3.functor(t),d):c},d.destroy=function(){return o&&(f().remove(),o=null),d};var i=d3.map({n:function(){var t=p();return{top:t.n.y-o.offsetHeight,left:t.n.x-o.offsetWidth/2}},s:function(){var t=p();return{top:t.s.y,left:t.s.x-o.offsetWidth/2}},e:function(){var t=p();return{top:t.e.y-o.offsetHeight/2,left:t.e.x}},w:function(){var t=p();return{top:t.w.y-o.offsetHeight/2,left:t.w.x-o.offsetWidth}},nw:function(){var t=p();return{top:t.nw.y-o.offsetHeight,left:t.nw.x-o.offsetWidth}},ne:function(){var t=p();return{top:t.ne.y-o.offsetHeight,left:t.ne.x}},sw:function(){var t=p();return{top:t.sw.y,left:t.sw.x-o.offsetWidth}},se:function(){var t=p();return{top:t.se.y,left:t.e.x}}}),l=i.keys();function u(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),t.node()}function f(){return null===o&&(o=u(),document.body.appendChild(o)),d3.select(o)}function p(){for(var t=s||d3.event.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var e={},n=t.getScreenCTM(),o=t.getBBox(),r=o.width,c=o.height,d=o.x,i=o.y;return a.x=d,a.y=i,e.nw=a.matrixTransform(n),a.x+=r,e.ne=a.matrixTransform(n),a.y+=c,e.se=a.matrixTransform(n),a.x-=r,e.sw=a.matrixTransform(n),a.y-=c/2,e.w=a.matrixTransform(n),a.x+=r,e.e=a.matrixTransform(n),a.x-=r/2,a.y-=c/2,e.n=a.matrixTransform(n),a.y+=c,e.s=a.matrixTransform(n),e}return d}})?o.apply(e,r):o)||(t.exports=a)},84:function(t,e,n){"use strict";n.r(e),n.d(e,"clusterColors",(function(){return r})),n.d(e,"createClusterSvgElement",(function(){return a})),n.d(e,"createClusterZone",(function(){return s})),n.d(e,"setCreateClusterZone",(function(){return c})),n.d(e,"updateClusterZoneLabels",(function(){return d})),n.d(e,"moveElement",(function(){return i})),n.d(e,"createNodes",(function(){return l})),n.d(e,"updateNodes",(function(){return u})),n.d(e,"createLinks",(function(){return p})),n.d(e,"updateLinks",(function(){return h})),n.d(e,"setLinkColor",(function(){return y})),n.d(e,"setLinkStyle",(function(){return g})),n.d(e,"positionNodesOnClusterZone",(function(){return S}));var o=n(75);const r={ontoOrange:"var(--primary-color)",ontoBlue:"var(--secondary-color)",ontoGreen:"var(--tertiary-color)",ontoGrey:"var(--gray-color)"};function a(t){return d3.select(t).append("svg")}function s(t){const e=t.append("g");return e.append("circle").classed("cluster-zone",!0).style("fill","transparent").style("stroke-width","2"),e}function c(t,e,n,o=!1){if(e.select(".cluster-zone").classed("no-cluster",!t).classed("has-access",o),t)e.selectAll("#no-cluster-zone").remove();else{const t=e.append("g").attr("id","no-cluster-zone");t.append("text").attr("id","no-cluster-label").text(n.no_cluster_configured).attr("y",-50).classed("h2",!0).style("text-anchor","middle"),o&&t.append("text").attr("id","create-cluster-label").classed("h3",!0).text(n.create_cluster_btn).style("text-anchor","middle"),t.append("text").attr("y",130).attr("class","icon-any repo").attr("fill",r.ontoOrange).style("text-anchor","middle").classed("settings-icon",!0).text("")}}function d(t,e,n){t||(e.select("#no-cluster-zone #no-cluster-label").text(n.no_cluster_configured),e.select("#no-cluster-zone #create-cluster-label").text(n.create_cluster_btn))}function i(t,e,n){t.attr("transform",()=>`translate(${e}, ${n})`)}function l(t,e,n){const o=t.enter().append("g").attr("id","node-group").classed("legend",n);!function(t,e){const n=Math.sqrt(3)/2,o=[[e+0,0],[e/2+0,e*n+0],[-e/2+0,e*n+0],[0-e,0],[-e/2+0,-e*n+0],[e/2+0,-e*n+0],[e+0,0],[e/2+0,e*n+0]];t.selectAll("path.area").data([o]).enter().append("path").attr("class","node member").attr("d",d3.svg.line())}(o,e),t.exit().remove(),o.append("text").attr("class","icon-any node-icon"),function(t,e,n){const o=t.append("g");n?o.append("foreignObject").attr("y",e).attr("x",-e).attr("width",2*e).attr("height",10).attr("class","label-wrapper").append("xhtml:div").attr("class","id id-host"):(o.append("rect").attr("class","id-host-background").attr("rx",6),o.append("text").attr("y",e+15).attr("class","id id-host"),o.append("rect").attr("class","node-info-background").attr("rx",6),o.append("text").attr("y",e+45).attr("class","node-info-text"))}(o,e,n)}function u(t){!function(t){t.select(".node-icon").classed("icon-any",(function(t){return!f(t)})).classed("fa-d3",f).text((function(t){return f(t)?function(t){if(_.isEmpty(t.recoveryStatus))return"";switch(t.recoveryStatus.state){case o.RecoveryState.SEARCHING_FOR_NODE:return"";case o.RecoveryState.WAITING_FOR_SNAPSHOT:return"";case o.RecoveryState.RECEIVING_SNAPSHOT:return"";case o.RecoveryState.APPLYING_SNAPSHOT:return"";case o.RecoveryState.BUILDING_SNAPSHOT:return"";case o.RecoveryState.SENDING_SNAPSHOT:return"";default:return""}}(t):function(t){if(t.nodeState===o.NodeState.LEADER)return"";if(t.nodeState===o.NodeState.FOLLOWER)return"";if(t.nodeState===o.NodeState.CANDIDATE)return"";if(t.nodeState===o.NodeState.NO_CONNECTION)return"";if(t.nodeState===o.NodeState.OUT_OF_SYNC)return"";if(t.nodeState===o.NodeState.READ_ONLY)return"";if(t.nodeState===o.NodeState.RESTRICTED)return"";return""}(t)}))}(t),function(t){t.select(".node.member").classed("leader",t=>t.nodeState===o.NodeState.LEADER).classed("follower",t=>t.nodeState===o.NodeState.FOLLOWER).classed("candidate",t=>t.nodeState===o.NodeState.CANDIDATE).classed("other",t=>t.nodeState!==o.NodeState.LEADER&&t.nodeState!==o.NodeState.FOLLOWER&&t.nodeState!==o.NodeState.CANDIDATE)}(t),function(t){t.select(".id.id-host").each((function(t){t.labelNode=this})).text((function(t){return t.hostname})),t.select(".id-host-background").attr("width",(function(t){return d3.select(t.labelNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.labelNode).node().getBBox().height+10})).attr("x",(function(t){return d3.select(t.labelNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.labelNode).node().getBBox().y-5}))}(t),function(t){t.select(".node-info-text").each((function(t){t.infoNode=this})).text((function(t){return t.recoveryStatus&&t.recoveryStatus.message})),t.select(".node-info-background").attr("width",(function(t){return d3.select(t.infoNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.infoNode).node().getBBox().height+10})).attr("x",(function(t){return d3.select(t.infoNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.infoNode).node().getBBox().y-5})).classed("hidden",(function(t){return _.isEmpty(t.recoveryStatus)}))}(t)}function f(t){return!_.isEmpty(t.recoveryStatus)}function p(t){t.enter().append("path").classed("link",!0),t.exit().remove()}function h(t,e){t.attr("stroke",y).style("stroke-dasharray",g).attr("d",t=>function(t,e){const n=e.find(e=>e.address===t.source),o=e.find(e=>e.address===t.target),r=o.x-n.x,a=o.y-n.y,s=Math.sqrt(r*r+a*a),c=r/s,d=a/s,i=n.x+55*c,l=n.y+55*d,u=o.x-55*c,f=o.y-55*d;return"M"+i+","+l+"L"+u+","+f}(t,e))}function y(t){return t.status===o.LinkState.IN_SYNC||t.status===o.LinkState.SYNCING?r.ontoGreen:t.status===o.LinkState.OUT_OF_SYNC?r.ontoGrey:"none"}function g(t){return t.status===o.LinkState.OUT_OF_SYNC||t.status===o.LinkState.SYNCING?"10 10":"none"}function S(t,e,n,o){t.attr("transform",(r,a)=>{const s=2*Math.PI*a/t[0].length;var c=e+Math.cos(s)*o,d=n+Math.sin(s)*o;return r.x=c,r.y=d,`translate(${c}, ${d})`})}},91:function(t,e,n){"use strict";n.r(e);n(10);var o=n(84),r=n(75),a=n(293),s=n.n(a);let c=240;const d=angular.module("graphdb.framework.clustermanagement.directives",["graphdb.framework.utils.localstorageadapter"]),i={no_cluster_configured:"",create_cluster_btn:"",legend_node_state:"",legend_link_state:"",node_state_leader:"Leader",node_state_follower:"Follower",node_state_candidate:"Candidate",node_state_no_cluster:"No cluster",node_state_out_of_sync:"Out of sync",node_state_no_connection:"No connection",node_state_read_only:"Read only",node_state_restricted:"Restricted",link_state_in_sync:"In sync",link_state_syncing:"Syncing",link_state_out_of_sync:"Out of sync",recovery_state:{searching_for_node:"Searching for node",waiting_for_snapshot:"Waiting for snapshot from node",receiving_snapshot:"Receiving a snapshot from node",applying_snapshot:"Applying a snapshot",building_snapshot:"Building a snapshot for node",sending_snapshot:"Sending a snapshot to node"}},l={node_state:"legend_node_state",link_state:"legend_link_state"};d.directive("clusterGraphicalView",["$window","LocalStorageAdapter","LSKeys","UriUtils","$translate","$rootScope",function(t,e,n,r,a,d){return{restrict:"A",link:function(p,h){const y=p.isAdmin();function g(t,e=""){Object.keys(t).forEach(n=>{let o="";e&&(o+=e),o+="."+n;const r=t[n];"string"==typeof r?t[n]=a.instant("cluster_management.cluster_graphical_view"+o):"object"==typeof r&&g(r,o)})}function S(){const o="collapsedMenu"===e.get(n.MENU_STATE);return c=o?70:240,Math.max(Math.floor(.95*(t.innerWidth-c)),600)}function m(){return Math.max(.95*(t.innerHeight-250),600)}let N,x,v;p.showLegend=!1,d.$on("$translateChangeSuccess",(function(){g(i),function(){o.updateClusterZoneLabels(T,w,i),Object.keys(l).forEach(t=>{d3.select("#"+t).text(B(t))}),N&&N.remove();D(),F()}()})),p.$on("$destroy",(function(){G.destroy()}));let T,E,w,O,k,C,L=S(),b=m(),A=Math.min(L,b)/2-100,R=L/2,I=b/2;function B(t){return i[l[t]]}function D(){N=E.append("g").attr("id","legend-group").classed("hidden",!p.showLegend).classed("legend-group",!0)}p.width=function(){return L},p.height=function(){return b};const G=s()().attr("class","d3-tip").customPosition((function(){const t=C.getBoundingClientRect(),e=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.scrollLeft||document.body.scrollLeft;return{left:t.left+n+"px",top:t.top-30+e+"px"}})).html((function(t){return t.toolTip})),M=function(t,e){C=e,G.show(t,C)},Y=function(){C=null,G.hide()};function F(){const t=u(),e=f();!function(t,e){t.forEach(t=>{const e=_.get(i,t.customText);t.toolTip=t.hostname=e}),e.forEach(t=>{t.toolTip=t.linkTypeText=i[t.linkTypeKey]})}(t,e),N.append("rect").attr("id","legend-background").attr("class","legend-background").attr("fill","#EEEEEE");const n=N.append("text").attr("id","node_state").attr("class","id id-host").attr("x",200).attr("y",24).text(B("node_state")),r=N.append("text").attr("id","link_state").attr("class","id id-host").attr("x",200).attr("y",319).text(B("link_state")),a=N.selectAll("#node-group").data(t);o.createNodes(a,25,!0),o.updateNodes(a),a.select(".node.member").on("mouseover",(function(t){d3.event.stopPropagation(),M(t,this)})).on("mouseout",Y),a.attr("transform",(function(t){const e=Math.floor(t.id/4);return`translate(${35+65*(t.id%4)}, ${59+65*e})`})),N.call((function(){x=this.node().getBBox().width})),n.attr("x",10+x/2),r.attr("x",10+x/2);const s=x/3,c=N.append("g").attr("id","links-group");c.attr("transform","translate(10, 329)"),e.forEach((t,e)=>{const n=s-5,r=c.append("g").classed("link",!0).classed("legend",!0).attr("transform",()=>`translate(${e*s}, 0)`);r.append("path").classed("link",!0).attr("stroke-dasharray",()=>o.setLinkStyle(t)).attr("stroke",()=>o.setLinkColor(t)).attr("d",()=>`M5,0,${n},0`),r.append("foreignObject").attr("y",10).attr("x",5).attr("width",s-10).attr("height",10).attr("class","label-wrapper").append("xhtml:div").attr("class","id id-host").style("font-size","9px").html(t.linkTypeText),r.on("mouseover",(function(){d3.event.stopPropagation(),M(t,this)})).on("mouseout",Y)}),N.call((function(t){v=this.node().getBBox().height,x=this.node().getBBox().width})),N.select(".legend-background").attr("height",v+50).attr("width",x+20).attr("rx","6"),P()}function P(){const t=b-(v+40+50);o.moveElement(N,0,t)}function H(){A=Math.min(L,b)/2-100,R=L/2,I=b/2,o.moveElement(w,R,I),w.select(".cluster-zone").attr("r",A)}function U(){H(),T!==p.clusterModel.hasCluster&&(T=!!p.clusterModel.hasCluster,function(t){let e;o.setCreateClusterZone(t,w,i,y),!t&&y&&(e=()=>{p.$apply((function(){p.showCreateClusterDialog()}))}),w.on("mouseup",e)}(T));const t=_.cloneDeep(p.clusterModel.nodes)||[],e=_.cloneDeep(p.clusterModel.links)||[];!function(t){t.forEach(t=>{if(t.hostname=r.shortenIri(t.endpoint),!_.isEmpty(t.recoveryStatus)){const e="cluster_management.cluster_graphical_view.recovery_state."+t.recoveryStatus.state.toLowerCase();t.recoveryStatus.message=a.instant(e,{node:t.recoveryStatus.affectedNodes.join(", ")})}});const e=O.selectAll("#node-group").data(t,t=>t.address);e.on("click",t=>{p.childContext.selectNode(t);const e=d3.select(".nodetooltip"),n=$(window).width();d3.event.pageX<n/2?(e.style("left",d3.event.pageX+"px"),e.style("right","")):(e.style("left",""),e.style("right",n-d3.event.pageX+"px")),e.style("top",d3.event.pageY-28+"px")}),o.createNodes(e,50),o.updateNodes(e),o.positionNodesOnClusterZone(e,R,I,A)}(t),function(t,e){const n=k.selectAll(".link").data(t,t=>t.id);o.createLinks(n),o.updateLinks(n,e)}(e,t)}p.childContext.redraw=U,p.childContext.resize=function(){L=S(),b=m(),E.attr("width",L),E.attr("height",b),U(),P()},p.childContext.toggleLegend=()=>{p.showLegend=!p.showLegend,N.classed("hidden",!p.showLegend)},g(i),function(t){E=o.createClusterSvgElement(h[0]).attr("width",L).attr("height",b),E.call(G),w=o.createClusterZone(E,t),k=E.append("g").attr("id","links-group"),O=E.append("g").attr("id","nodes-group"),D()}(!(!p.clusterModel.nodes||!p.clusterModel.nodes.length)),F(),U()}}}]);const u=function(){const t=[];return t.push({nodeState:r.NodeState.LEADER,customText:"node_state_leader"}),t.push({nodeState:r.NodeState.FOLLOWER,customText:"node_state_follower"}),t.push({nodeState:r.NodeState.CANDIDATE,customText:"node_state_candidate"}),t.push({nodeState:r.NodeState.NO_CLUSTER,customText:"node_state_no_cluster"}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"node_state_out_of_sync"}),t.push({nodeState:r.NodeState.NO_CONNECTION,customText:"node_state_no_connection"}),t.push({nodeState:r.NodeState.READ_ONLY,customText:"node_state_read_only"}),t.push({nodeState:r.NodeState.RESTRICTED,customText:"node_state_restricted"}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.searching_for_node",recoveryStatus:{state:r.RecoveryState.SEARCHING_FOR_NODE}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.waiting_for_snapshot",recoveryStatus:{state:r.RecoveryState.WAITING_FOR_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.receiving_snapshot",recoveryStatus:{state:r.RecoveryState.RECEIVING_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.applying_snapshot",recoveryStatus:{state:r.RecoveryState.APPLYING_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.building_snapshot",recoveryStatus:{state:r.RecoveryState.BUILDING_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.sending_snapshot",recoveryStatus:{state:r.RecoveryState.SENDING_SNAPSHOT}}),t.forEach((t,e)=>t.id=e),t},f=function(){const t=[];return t.push({status:r.LinkState.IN_SYNC,linkTypeKey:"link_state_in_sync"}),t.push({status:r.LinkState.SYNCING,linkTypeKey:"link_state_syncing"}),t.push({status:r.LinkState.OUT_OF_SYNC,linkTypeKey:"link_state_out_of_sync"}),t.forEach((t,e)=>t.id=e),t}}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[26,33,72],{141:function(t,e,n){"use strict";n.r(e);n(6),n(22),n(75),n(91),n(21),n(298),n(300),n(307);angular.module("graphdb.framework.clustermanagement",["ngAnimate","toastr","graphdb.framework.clustermanagement.controllers","graphdb.framework.clustermanagement.directives"])},293:function(t,e,n){var o,r,a;r=[],void 0===(a="function"==typeof(o=function(){return function(){var t=function(){return"n"},e=function(){return[0,0]},n=function(){return" "},o=u(),r=null,a=null,s=null,c=null;function d(t){var e;r="svg"===(e=(e=t).node()).tagName.toLowerCase()?e:e.ownerSVGElement,a=r.createSVGPoint(),document.body.appendChild(o)}d.show=function(){var o=Array.prototype.slice.call(arguments);o[o.length-1]instanceof SVGElement&&(s=o.pop());var r,a=n.apply(this,o),u=e.apply(this,o),p=t.apply(this,o),h=f(),y=l.length,_=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,S=c.apply(this,o);for(h.html(a).style({opacity:1,"pointer-events":"all"});y--;)h.classed(l[y],!1);return r=i.get(p).apply(this),S?h.style(S):h.classed(p,!0).style({top:r.top+u[0]+_+"px",left:r.left+u[1]+g+"px"}),d},d.hide=function(){return f().style({opacity:0,"pointer-events":"none"}),d},d.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().attr(t);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),d},d.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().style(t);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),d},d.direction=function(e){return arguments.length?(t=null==e?e:d3.functor(e),d):t},d.offset=function(t){return arguments.length?(e=null==t?t:d3.functor(t),d):e},d.html=function(t){return arguments.length?(n=null==t?t:d3.functor(t),d):n},d.customPosition=function(t){return arguments.length?(c=null==t?t:d3.functor(t),d):c},d.destroy=function(){return o&&(f().remove(),o=null),d};var i=d3.map({n:function(){var t=p();return{top:t.n.y-o.offsetHeight,left:t.n.x-o.offsetWidth/2}},s:function(){var t=p();return{top:t.s.y,left:t.s.x-o.offsetWidth/2}},e:function(){var t=p();return{top:t.e.y-o.offsetHeight/2,left:t.e.x}},w:function(){var t=p();return{top:t.w.y-o.offsetHeight/2,left:t.w.x-o.offsetWidth}},nw:function(){var t=p();return{top:t.nw.y-o.offsetHeight,left:t.nw.x-o.offsetWidth}},ne:function(){var t=p();return{top:t.ne.y-o.offsetHeight,left:t.ne.x}},sw:function(){var t=p();return{top:t.sw.y,left:t.sw.x-o.offsetWidth}},se:function(){var t=p();return{top:t.se.y,left:t.e.x}}}),l=i.keys();function u(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),t.node()}function f(){return null===o&&(o=u(),document.body.appendChild(o)),d3.select(o)}function p(){for(var t=s||d3.event.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var e={},n=t.getScreenCTM(),o=t.getBBox(),r=o.width,c=o.height,d=o.x,i=o.y;return a.x=d,a.y=i,e.nw=a.matrixTransform(n),a.x+=r,e.ne=a.matrixTransform(n),a.y+=c,e.se=a.matrixTransform(n),a.x-=r,e.sw=a.matrixTransform(n),a.y-=c/2,e.w=a.matrixTransform(n),a.x+=r,e.e=a.matrixTransform(n),a.x-=r/2,a.y-=c/2,e.n=a.matrixTransform(n),a.y+=c,e.s=a.matrixTransform(n),e}return d}})?o.apply(e,r):o)||(t.exports=a)},85:function(t,e,n){"use strict";n.r(e),n.d(e,"clusterColors",(function(){return r})),n.d(e,"createClusterSvgElement",(function(){return a})),n.d(e,"createClusterZone",(function(){return s})),n.d(e,"setCreateClusterZone",(function(){return c})),n.d(e,"updateClusterZoneLabels",(function(){return d})),n.d(e,"moveElement",(function(){return i})),n.d(e,"createNodes",(function(){return l})),n.d(e,"updateNodes",(function(){return u})),n.d(e,"createLinks",(function(){return p})),n.d(e,"updateLinks",(function(){return h})),n.d(e,"setLinkColor",(function(){return y})),n.d(e,"setLinkStyle",(function(){return g})),n.d(e,"positionNodesOnClusterZone",(function(){return S}));var o=n(75);const r={ontoOrange:"var(--primary-color)",ontoBlue:"var(--secondary-color)",ontoGreen:"var(--tertiary-color)",ontoGrey:"var(--gray-color)"};function a(t){return d3.select(t).append("svg")}function s(t){const e=t.append("g");return e.append("circle").classed("cluster-zone",!0).style("fill","transparent").style("stroke-width","2"),e}function c(t,e,n,o=!1){if(e.select(".cluster-zone").classed("no-cluster",!t).classed("has-access",o),t)e.selectAll("#no-cluster-zone").remove();else{const t=e.append("g").attr("id","no-cluster-zone");t.append("text").attr("id","no-cluster-label").text(n.no_cluster_configured).attr("y",-50).classed("h2",!0).style("text-anchor","middle"),o&&t.append("text").attr("id","create-cluster-label").classed("h3",!0).text(n.create_cluster_btn).style("text-anchor","middle"),t.append("text").attr("y",130).attr("class","icon-any repo").attr("fill",r.ontoOrange).style("text-anchor","middle").classed("settings-icon",!0).text("")}}function d(t,e,n){t||(e.select("#no-cluster-zone #no-cluster-label").text(n.no_cluster_configured),e.select("#no-cluster-zone #create-cluster-label").text(n.create_cluster_btn))}function i(t,e,n){t.attr("transform",()=>`translate(${e}, ${n})`)}function l(t,e,n){const o=t.enter().append("g").attr("id","node-group").classed("legend",n);!function(t,e){const n=Math.sqrt(3)/2,o=[[e+0,0],[e/2+0,e*n+0],[-e/2+0,e*n+0],[0-e,0],[-e/2+0,-e*n+0],[e/2+0,-e*n+0],[e+0,0],[e/2+0,e*n+0]];t.selectAll("path.area").data([o]).enter().append("path").attr("class","node member").attr("d",d3.svg.line())}(o,e),t.exit().remove(),o.append("text").attr("class","icon-any node-icon"),function(t,e,n){const o=t.append("g");n?o.append("foreignObject").attr("y",e).attr("x",-e).attr("width",2*e).attr("height",10).attr("class","label-wrapper").append("xhtml:div").attr("class","id id-host"):(o.append("rect").attr("class","id-host-background").attr("rx",6),o.append("text").attr("y",e+15).attr("class","id id-host"),o.append("rect").attr("class","node-info-background").attr("rx",6),o.append("text").attr("y",e+45).attr("class","node-info-text"))}(o,e,n)}function u(t){!function(t){t.select(".node-icon").classed("icon-any",(function(t){return!f(t)})).classed("fa-d3",f).text((function(t){return f(t)?function(t){if(_.isEmpty(t.recoveryStatus))return"";switch(t.recoveryStatus.state){case o.RecoveryState.SEARCHING_FOR_NODE:return"";case o.RecoveryState.WAITING_FOR_SNAPSHOT:return"";case o.RecoveryState.RECEIVING_SNAPSHOT:return"";case o.RecoveryState.APPLYING_SNAPSHOT:return"";case o.RecoveryState.BUILDING_SNAPSHOT:return"";case o.RecoveryState.SENDING_SNAPSHOT:return"";default:return""}}(t):function(t){if(t.nodeState===o.NodeState.LEADER)return"";if(t.nodeState===o.NodeState.FOLLOWER)return"";if(t.nodeState===o.NodeState.CANDIDATE)return"";if(t.nodeState===o.NodeState.NO_CONNECTION)return"";if(t.nodeState===o.NodeState.OUT_OF_SYNC)return"";if(t.nodeState===o.NodeState.READ_ONLY)return"";if(t.nodeState===o.NodeState.RESTRICTED)return"";return""}(t)}))}(t),function(t){t.select(".node.member").classed("leader",t=>t.nodeState===o.NodeState.LEADER).classed("follower",t=>t.nodeState===o.NodeState.FOLLOWER).classed("candidate",t=>t.nodeState===o.NodeState.CANDIDATE).classed("other",t=>t.nodeState!==o.NodeState.LEADER&&t.nodeState!==o.NodeState.FOLLOWER&&t.nodeState!==o.NodeState.CANDIDATE)}(t),function(t){t.select(".id.id-host").each((function(t){t.labelNode=this})).text((function(t){return t.hostname})),t.select(".id-host-background").attr("width",(function(t){return d3.select(t.labelNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.labelNode).node().getBBox().height+10})).attr("x",(function(t){return d3.select(t.labelNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.labelNode).node().getBBox().y-5}))}(t),function(t){t.select(".node-info-text").each((function(t){t.infoNode=this})).text((function(t){return t.recoveryStatus&&t.recoveryStatus.message})),t.select(".node-info-background").attr("width",(function(t){return d3.select(t.infoNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.infoNode).node().getBBox().height+10})).attr("x",(function(t){return d3.select(t.infoNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.infoNode).node().getBBox().y-5})).classed("hidden",(function(t){return _.isEmpty(t.recoveryStatus)}))}(t)}function f(t){return!_.isEmpty(t.recoveryStatus)}function p(t){t.enter().append("path").classed("link",!0),t.exit().remove()}function h(t,e){t.attr("stroke",y).style("stroke-dasharray",g).attr("d",t=>function(t,e){const n=e.find(e=>e.address===t.source),o=e.find(e=>e.address===t.target),r=o.x-n.x,a=o.y-n.y,s=Math.sqrt(r*r+a*a),c=r/s,d=a/s,i=n.x+55*c,l=n.y+55*d,u=o.x-55*c,f=o.y-55*d;return"M"+i+","+l+"L"+u+","+f}(t,e))}function y(t){return t.status===o.LinkState.IN_SYNC||t.status===o.LinkState.SYNCING?r.ontoGreen:t.status===o.LinkState.OUT_OF_SYNC?r.ontoGrey:"none"}function g(t){return t.status===o.LinkState.OUT_OF_SYNC||t.status===o.LinkState.SYNCING?"10 10":"none"}function S(t,e,n,o){t.attr("transform",(r,a)=>{const s=2*Math.PI*a/t[0].length;var c=e+Math.cos(s)*o,d=n+Math.sin(s)*o;return r.x=c,r.y=d,`translate(${c}, ${d})`})}},91:function(t,e,n){"use strict";n.r(e);n(10);var o=n(85),r=n(75),a=n(293),s=n.n(a);let c=240;const d=angular.module("graphdb.framework.clustermanagement.directives",["graphdb.framework.utils.localstorageadapter"]),i={no_cluster_configured:"",create_cluster_btn:"",legend_node_state:"",legend_link_state:"",node_state_leader:"Leader",node_state_follower:"Follower",node_state_candidate:"Candidate",node_state_no_cluster:"No cluster",node_state_out_of_sync:"Out of sync",node_state_no_connection:"No connection",node_state_read_only:"Read only",node_state_restricted:"Restricted",link_state_in_sync:"In sync",link_state_syncing:"Syncing",link_state_out_of_sync:"Out of sync",recovery_state:{searching_for_node:"Searching for node",waiting_for_snapshot:"Waiting for snapshot from node",receiving_snapshot:"Receiving a snapshot from node",applying_snapshot:"Applying a snapshot",building_snapshot:"Building a snapshot for node",sending_snapshot:"Sending a snapshot to node"}},l={node_state:"legend_node_state",link_state:"legend_link_state"};d.directive("clusterGraphicalView",["$window","LocalStorageAdapter","LSKeys","UriUtils","$translate","$rootScope",function(t,e,n,r,a,d){return{restrict:"A",link:function(p,h){const y=p.isAdmin();function g(t,e=""){Object.keys(t).forEach(n=>{let o="";e&&(o+=e),o+="."+n;const r=t[n];"string"==typeof r?t[n]=a.instant("cluster_management.cluster_graphical_view"+o):"object"==typeof r&&g(r,o)})}function S(){const o="collapsedMenu"===e.get(n.MENU_STATE);return c=o?70:240,Math.max(Math.floor(.95*(t.innerWidth-c)),600)}function m(){return Math.max(.95*(t.innerHeight-250),600)}let N,x,v;p.showLegend=!1,d.$on("$translateChangeSuccess",(function(){g(i),function(){o.updateClusterZoneLabels(T,w,i),Object.keys(l).forEach(t=>{d3.select("#"+t).text(B(t))}),N&&N.remove();D(),F()}()})),p.$on("$destroy",(function(){G.destroy()}));let T,E,w,O,k,C,L=S(),b=m(),A=Math.min(L,b)/2-100,R=L/2,I=b/2;function B(t){return i[l[t]]}function D(){N=E.append("g").attr("id","legend-group").classed("hidden",!p.showLegend).classed("legend-group",!0)}p.width=function(){return L},p.height=function(){return b};const G=s()().attr("class","d3-tip").customPosition((function(){const t=C.getBoundingClientRect(),e=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.scrollLeft||document.body.scrollLeft;return{left:t.left+n+"px",top:t.top-30+e+"px"}})).html((function(t){return t.toolTip})),M=function(t,e){C=e,G.show(t,C)},Y=function(){C=null,G.hide()};function F(){const t=u(),e=f();!function(t,e){t.forEach(t=>{const e=_.get(i,t.customText);t.toolTip=t.hostname=e}),e.forEach(t=>{t.toolTip=t.linkTypeText=i[t.linkTypeKey]})}(t,e),N.append("rect").attr("id","legend-background").attr("class","legend-background").attr("fill","#EEEEEE");const n=N.append("text").attr("id","node_state").attr("class","id id-host").attr("x",200).attr("y",24).text(B("node_state")),r=N.append("text").attr("id","link_state").attr("class","id id-host").attr("x",200).attr("y",319).text(B("link_state")),a=N.selectAll("#node-group").data(t);o.createNodes(a,25,!0),o.updateNodes(a),a.select(".node.member").on("mouseover",(function(t){d3.event.stopPropagation(),M(t,this)})).on("mouseout",Y),a.attr("transform",(function(t){const e=Math.floor(t.id/4);return`translate(${35+65*(t.id%4)}, ${59+65*e})`})),N.call((function(){x=this.node().getBBox().width})),n.attr("x",10+x/2),r.attr("x",10+x/2);const s=x/3,c=N.append("g").attr("id","links-group");c.attr("transform","translate(10, 329)"),e.forEach((t,e)=>{const n=s-5,r=c.append("g").classed("link",!0).classed("legend",!0).attr("transform",()=>`translate(${e*s}, 0)`);r.append("path").classed("link",!0).attr("stroke-dasharray",()=>o.setLinkStyle(t)).attr("stroke",()=>o.setLinkColor(t)).attr("d",()=>`M5,0,${n},0`),r.append("foreignObject").attr("y",10).attr("x",5).attr("width",s-10).attr("height",10).attr("class","label-wrapper").append("xhtml:div").attr("class","id id-host").style("font-size","9px").html(t.linkTypeText),r.on("mouseover",(function(){d3.event.stopPropagation(),M(t,this)})).on("mouseout",Y)}),N.call((function(t){v=this.node().getBBox().height,x=this.node().getBBox().width})),N.select(".legend-background").attr("height",v+50).attr("width",x+20).attr("rx","6"),P()}function P(){const t=b-(v+40+50);o.moveElement(N,0,t)}function H(){A=Math.min(L,b)/2-100,R=L/2,I=b/2,o.moveElement(w,R,I),w.select(".cluster-zone").attr("r",A)}function U(){H(),T!==p.clusterModel.hasCluster&&(T=!!p.clusterModel.hasCluster,function(t){let e;o.setCreateClusterZone(t,w,i,y),!t&&y&&(e=()=>{p.$apply((function(){p.showCreateClusterDialog()}))}),w.on("mouseup",e)}(T));const t=_.cloneDeep(p.clusterModel.nodes)||[],e=_.cloneDeep(p.clusterModel.links)||[];!function(t){t.forEach(t=>{if(t.hostname=r.shortenIri(t.endpoint),!_.isEmpty(t.recoveryStatus)){const e="cluster_management.cluster_graphical_view.recovery_state."+t.recoveryStatus.state.toLowerCase();t.recoveryStatus.message=a.instant(e,{node:t.recoveryStatus.affectedNodes.join(", ")})}});const e=O.selectAll("#node-group").data(t,t=>t.address);e.on("click",t=>{p.childContext.selectNode(t);const e=d3.select(".nodetooltip"),n=$(window).width();d3.event.pageX<n/2?(e.style("left",d3.event.pageX+"px"),e.style("right","")):(e.style("left",""),e.style("right",n-d3.event.pageX+"px")),e.style("top",d3.event.pageY-28+"px")}),o.createNodes(e,50),o.updateNodes(e),o.positionNodesOnClusterZone(e,R,I,A)}(t),function(t,e){const n=k.selectAll(".link").data(t,t=>t.id);o.createLinks(n),o.updateLinks(n,e)}(e,t)}p.childContext.redraw=U,p.childContext.resize=function(){L=S(),b=m(),E.attr("width",L),E.attr("height",b),U(),P()},p.childContext.toggleLegend=()=>{p.showLegend=!p.showLegend,N.classed("hidden",!p.showLegend)},g(i),function(t){E=o.createClusterSvgElement(h[0]).attr("width",L).attr("height",b),E.call(G),w=o.createClusterZone(E,t),k=E.append("g").attr("id","links-group"),O=E.append("g").attr("id","nodes-group"),D()}(!(!p.clusterModel.nodes||!p.clusterModel.nodes.length)),F(),U()}}}]);const u=function(){const t=[];return t.push({nodeState:r.NodeState.LEADER,customText:"node_state_leader"}),t.push({nodeState:r.NodeState.FOLLOWER,customText:"node_state_follower"}),t.push({nodeState:r.NodeState.CANDIDATE,customText:"node_state_candidate"}),t.push({nodeState:r.NodeState.NO_CLUSTER,customText:"node_state_no_cluster"}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"node_state_out_of_sync"}),t.push({nodeState:r.NodeState.NO_CONNECTION,customText:"node_state_no_connection"}),t.push({nodeState:r.NodeState.READ_ONLY,customText:"node_state_read_only"}),t.push({nodeState:r.NodeState.RESTRICTED,customText:"node_state_restricted"}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.searching_for_node",recoveryStatus:{state:r.RecoveryState.SEARCHING_FOR_NODE}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.waiting_for_snapshot",recoveryStatus:{state:r.RecoveryState.WAITING_FOR_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.receiving_snapshot",recoveryStatus:{state:r.RecoveryState.RECEIVING_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.applying_snapshot",recoveryStatus:{state:r.RecoveryState.APPLYING_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.building_snapshot",recoveryStatus:{state:r.RecoveryState.BUILDING_SNAPSHOT}}),t.push({nodeState:r.NodeState.OUT_OF_SYNC,customText:"recovery_state.sending_snapshot",recoveryStatus:{state:r.RecoveryState.SENDING_SNAPSHOT}}),t.forEach((t,e)=>t.id=e),t},f=function(){const t=[];return t.push({status:r.LinkState.IN_SYNC,linkTypeKey:"link_state_in_sync"}),t.push({status:r.LinkState.SYNCING,linkTypeKey:"link_state_syncing"}),t.push({status:r.LinkState.OUT_OF_SYNC,linkTypeKey:"link_state_out_of_sync"}),t.forEach((t,e)=>t.id=e),t}}}]);
|