graphdb-workbench 2.1.0 → 2.1.1-TR2
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/{10.018ca946a702a519142b.bundle.js → 10.5c9aa6773dd62b4ed854.bundle.js} +2 -2
- package/dist/10.5c9aa6773dd62b4ed854.bundle.js.map +1 -0
- package/dist/{11.52641542d9a31c527b7c.bundle.js → 11.8983e1d1c930328e9b0d.bundle.js} +2 -2
- package/dist/11.8983e1d1c930328e9b0d.bundle.js.map +1 -0
- package/dist/135.c1de0deb98c8a45a4b21.bundle.js +1 -1
- package/dist/135.c1de0deb98c8a45a4b21.bundle.js.map +1 -1
- package/dist/{15.510970e84b3d1a7768c2.bundle.js → 15.9ce4fa5c14638d63736a.bundle.js} +2 -2
- package/dist/{15.510970e84b3d1a7768c2.bundle.js.map → 15.9ce4fa5c14638d63736a.bundle.js.map} +1 -1
- package/dist/162.7c19d57c3792c9ca08d0.bundle.js +2 -0
- package/dist/162.7c19d57c3792c9ca08d0.bundle.js.map +1 -0
- package/dist/18.201bf87e7629b325646c.bundle.js +1 -1
- package/dist/18.201bf87e7629b325646c.bundle.js.map +1 -1
- package/dist/25.42f3d944b5ec15e01ceb.bundle.js +2 -0
- package/dist/25.42f3d944b5ec15e01ceb.bundle.js.map +1 -0
- package/dist/{3.1b96b660b1d11c328e50.bundle.js → 3.0a892888d711fa9009b7.bundle.js} +2 -2
- package/dist/3.0a892888d711fa9009b7.bundle.js.map +1 -0
- package/dist/30.4b987e71408e0643680a.bundle.js +1 -1
- package/dist/30.4b987e71408e0643680a.bundle.js.map +1 -1
- package/dist/31.5af5b75cd1ac5d00370e.bundle.js +1 -1
- package/dist/31.5af5b75cd1ac5d00370e.bundle.js.map +1 -1
- package/dist/36.618ccd9d5a8d4d11cb47.bundle.js +2 -0
- package/dist/36.618ccd9d5a8d4d11cb47.bundle.js.map +1 -0
- package/dist/39.88a2db4f9ab5946bf2cd.bundle.js +2 -0
- package/dist/39.88a2db4f9ab5946bf2cd.bundle.js.map +1 -0
- package/dist/55.5b44653775bb1592cb26.bundle.js +2 -0
- package/dist/55.5b44653775bb1592cb26.bundle.js.map +1 -0
- package/dist/83.73515cde0a2215275d32.bundle.js +1 -1
- package/dist/83.73515cde0a2215275d32.bundle.js.map +1 -1
- package/dist/93.d4fb5fe720a8d95b2b37.bundle.js +2 -0
- package/dist/93.d4fb5fe720a8d95b2b37.bundle.js.map +1 -0
- package/dist/{bundle.2b813785fc0b4f08d48c.bundle.js → bundle.d68a2441048bc7e965e6.bundle.js} +3 -3
- package/dist/bundle.d68a2441048bc7e965e6.bundle.js.map +1 -0
- package/dist/index.html +3 -3
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/security/templates/user.html +4 -2
- 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/queries.html +2 -3
- 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/10.018ca946a702a519142b.bundle.js.map +0 -1
- package/dist/11.52641542d9a31c527b7c.bundle.js.map +0 -1
- package/dist/162.611f7dba5a7f2ab9fa7b.bundle.js +0 -2
- package/dist/162.611f7dba5a7f2ab9fa7b.bundle.js.map +0 -1
- package/dist/25.9c19fb9c35fcd792dff5.bundle.js +0 -2
- package/dist/25.9c19fb9c35fcd792dff5.bundle.js.map +0 -1
- package/dist/3.1b96b660b1d11c328e50.bundle.js.map +0 -1
- package/dist/36.991eae8184e7b5fa5cbf.bundle.js +0 -2
- package/dist/36.991eae8184e7b5fa5cbf.bundle.js.map +0 -1
- package/dist/39.3f07a4be36e81e42c86e.bundle.js +0 -2
- package/dist/39.3f07a4be36e81e42c86e.bundle.js.map +0 -1
- package/dist/55.975653547fd9764a2a71.bundle.js +0 -2
- package/dist/55.975653547fd9764a2a71.bundle.js.map +0 -1
- package/dist/93.5f0ae85fb24657fd13c5.bundle.js +0 -2
- package/dist/93.5f0ae85fb24657fd13c5.bundle.js.map +0 -1
- package/dist/bundle.2b813785fc0b4f08d48c.bundle.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[3,101],{45:function(e,t,n){"use strict";n.r(t),n.d(t,"NodeState",(function(){return o})),n.d(t,"LinkState",(function(){return r}));n(4),n(54);angular.module("graphdb.framework.clustermanagement.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.repositories.service","graphdb.framework.rest.cluster.service","toastr","pageslide-directive"]).controller("ClusterManagementCtrl",s).controller("CreateClusterCtrl",l).controller("DeleteClusterCtrl",c).controller("EditClusterCtrl",d).controller("AddLocationFromClusterCtrl",u).controller("AddNodesDialogCtrl",f).controller("RemoveNodesDialogCtrl",m).factory("RemoteLocationsService",i);const o={LEADER:"LEADER",FOLLOWER:"FOLLOWER",CANDIDATE:"CANDIDATE",OUT_OF_SYNC:"OUT_OF_SYNC",NO_CONNECTION:"NO_CONNECTION",READ_ONLY:"READ_ONLY",RESTRICTED:"RESTRICTED",NO_CLUSTER:"NO_CLUSTER",DELETED:"DELETED"},r={IN_SYNC:"IN_SYNC",OUT_OF_SYNC:"OUT_OF_SYNC",SYNCING:"SYNCING",NO_CONNECTION:"NO_CONNECTION"};function s(e,t,n,s,a,l,c,i,u,d,g,f,m,p,C){let h;function _(t){h||(h=e.getClusterStatus().then(()=>{if(t||!e.clusterConfiguration)return e.getClusterConfiguration()}).then(()=>{if(!e.currentNode||e.leaderChanged)return e.getCurrentNodeStatus()}).finally(()=>{h=null,e.childContext.redraw()}))}function N(){return C.getLocationsWithRpcAddresses().then(t=>{const n=t.find(e=>e.isLocal);n&&(n.endpoint=e.currentNode.endpoint,n.rpcAddress=e.currentNode.address),e.clusterModel.locations=t})}function L(t){s.success(t),e.getClusterConfiguration()}function $(e,t,n){let o=e.message||e;400===t&&Array.isArray(e)?o=e.reduce((e,t)=>e+`<div>${t}</div>`,""):412===t&&(o=Object.keys(e).reduce((t,n)=>t+`<div>${n} - ${e[n]}</div>`,"")),s.error(o,n,{allowHtml:!0})}e.loader=!0,e.isLeader=!1,e.currentNode=null,e.clusterModel={},e.NodeState=o,e.leaderChanged=!1,e.currentLeader=null,e.childContext={},e.shouldShowClusterSettingsPanel=!1,e.onopen=e.onclose=()=>angular.noop(),e.toggleSidePanel=()=>{e.shouldShowClusterSettingsPanel=!e.shouldShowClusterSettingsPanel},e.toggleLegend=()=>{e.childContext.toggleLegend&&e.childContext.toggleLegend()},e.setLoader=function(t,n){g.cancel(e.loaderTimeout),t?(e.loaderMessage=n,e.loaderTimeout=g((function(){e.loader=t}),50)):e.loader=!1},e.childContext.selectNode=function(t){e.selectedNode!==t?e.selectedNode=t:e.selectedNode=null,e.$apply()},e.getLoaderMessage=function(){return e.loaderMessage||p.instant("common.loading")},e.getClusterConfiguration=()=>f.getClusterConfig().then(t=>{if(e.clusterConfiguration=t.data,!e.currentNode)return e.getCurrentNodeStatus()}).catch(()=>{e.clusterConfiguration=null}),e.getClusterStatus=function(){return f.getClusterStatus().then((function(t){const n=t.data.slice(),s=n.find(e=>e.nodeState===o.LEADER);var a,l;a=e.currentLeader,(l=s)&&a&&a.address===l.address||(e.currentLeader=s,e.leaderChanged=!0),e.currentNode=n.find(t=>t.address===e.currentNode.address);const c=[];s&&Object.keys(s.syncStatus).forEach(e=>{const t=s.syncStatus[e];t!==r.NO_CONNECTION&&c.push({id:`${s.address}-${e}`,source:s.address,target:e,status:t})}),e.clusterModel.hasCluster=!0,e.clusterModel.nodes=n,e.clusterModel.links=c})).catch((function(t){404===t.status&&(e.clusterModel.hasCluster=!1,e.clusterModel.nodes=[],e.clusterModel.links=[],e.clusterConfiguration=null)}))},e.showCreateClusterDialog=function(){l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-create-dialog.html",controller:"CreateClusterCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel}}}}).result.finally((function(){N(),_(!0)}))},e.showDeleteDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then((function(t){const n=p.instant("cluster_management.delete_cluster_dialog.loader_message");e.setLoader(!0,n),f.deleteCluster(t).then(t=>{if(Object.values(t.data).every(e=>e===o.DELETED)){const e=p.instant("cluster_management.delete_cluster_dialog.notifications.success_delete");s.success(e)}else{const e=p.instant("cluster_management.delete_cluster_dialog.notifications.success_delete_partial"),n=Object.keys(t.data).reduce((e,n)=>e+`<div>${n} - ${t.data[n]}</div>`,"");s.success(n,e,{allowHtml:!0})}e.getClusterConfiguration()}).catch(e=>{const t=p.instant("cluster_management.delete_cluster_dialog.notifications.fail_delete"),n=Object.keys(e.data).reduce((t,n)=>t+`<div>${n} - ${e.data[n]}</div>`,"");s.error(n,t,{allowHtml:!0})}).finally(()=>{e.setLoader(!1),_(!0)})}))},e.showEditConfigurationDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:function(){return{clusterConfiguration:e.clusterConfiguration}}}}).result.finally((function(){_(!0)}))},e.getCurrentNodeStatus=()=>f.getNodeStatus().then(t=>{e.leaderChanged=!1,e.currentNode=t.data}).catch(t=>{e.currentNode=t.data,e.clusterModel.hasCluster=!1}).then(()=>N()),e.showAddNodeToClusterDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/add-nodes-dialog.html",controller:"AddNodesDialogCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel,clusterConfiguration:e.clusterConfiguration}}}}).result.then((function(t){const n=p.instant("cluster_management.cluster_page.add_nodes_loader");e.setLoader(!0,n);const o=t.map(e=>e.rpcAddress);f.addNodesToCluster(o).then(()=>{L(p.instant("cluster_management.cluster_page.notifications.add_nodes_success"))}).catch(e=>{const t=p.instant("cluster_management.cluster_page.notifications.add_nodes_fail");$(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),_(!0)})})).finally(()=>N())},e.showRemoveNodesFromClusterDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/remove-nodes-dialog.html",controller:"RemoveNodesDialogCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel}}}}).result.then((function(t){const n=p.instant("cluster_management.cluster_page.remove_nodes_loader");e.setLoader(!0,n);const o=t.map(e=>e.address);f.removeNodesFromCluster(o).then(()=>{L(p.instant("cluster_management.cluster_page.notifications.remove_nodes_success"))}).catch(e=>{const t=p.instant("cluster_management.cluster_page.notifications.remove_nodes_fail");$(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),_(!0)})}))},(e.loader=!0,e.getCurrentNodeStatus().then(()=>e.getClusterConfiguration()).then(()=>e.getClusterStatus()).finally(()=>{e.setLoader(!1)})).finally(()=>{const t=u((function(){_()}),1e3);e.$on("$destroy",(function(){u.cancel(t)}))});const v=angular.element(i),S=function(){e.childContext.resize()};v.bind("resize",S);const E=function(t){const n=t.target,o=document.getElementById("nodeTooltip");e.selectedNode&&o!==n&&!o.contains(n)&&e.childContext.selectNode(null)};v.bind("mousedown",E),e.$on("$destroy",(function(){v.unbind("resize",S),v.unbind("mousedown",E)}))}s.$inject=["$scope","$http","$q","toastr","$repositories","$modal","$sce","$window","$interval","ModalService","$timeout","ClusterRestService","$location","$translate","RemoteLocationsService"];const a=function(){const e=document.getElementById("advancedOptions");if(e){const t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"fa fa-angle-down"}return"fa fa-angle-right"};function l(e,t,n,o,r,s,l,c,i){e.pageTitle=s.instant("cluster_management.cluster_page.create_page_title"),e.autofocusId="autofocus",e.errors=[],e.clusterConfiguration={electionMinTimeout:2e4,electionRangeTimeout:1e4,heartbeatInterval:2e3,messageSizeKB:64,verificationTimeout:1500,nodes:[]},e.locations=l.clusterModel.locations.filter(e=>!e.isLocal),e.selectedLocations=l.clusterModel.locations.filter(e=>e.isLocal),e.loader=!1,e.getAdvancedOptionsClass=a,e.createCluster=function(){return e.setLoader(!0,s.instant("cluster_management.cluster_page.creating_cluster_loader")),e.clusterConfiguration.nodes=e.selectedLocations.map(e=>e.rpcAddress),o.createCluster(e.clusterConfiguration).then(()=>{r.success(s.instant("cluster_management.cluster_page.notifications.create_success")),t.close()}).catch((function(t){!function(t,n){delete e.preconditionErrors,r.error(s.instant("cluster_management.cluster_page.notifications.create_failed")),e.errors.splice(0),412===n?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===n?e.errors.push(...t):409===n&&e.errors.push(t)}(t.data,t.status)})).finally(()=>e.setLoader(!1))},e.isClusterConfigurationValid=()=>{const t=!e.clusterConfigurationForm.$invalid,n=e.selectedLocations&&e.selectedLocations.length>=2;return t&&n},e.setLoader=function(t,o){n.cancel(e.loaderTimeout),t?e.loaderTimeout=n((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.addNodeToList=function(t){t.rpcAddress&&(e.selectedLocations.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,n){n.isLocal||(e.selectedLocations.splice(t,1),e.locations.push(n))},e.addLocation=function(){i.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){e.isClusterConfigurationValid()?e.createCluster():r.warning(s.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}function c(e,t){e.forceDelete=!1,e.ok=function(){t.close(e.forceDelete)},e.cancel=function(){t.dismiss("cancel")}}function i(e,t,n,o,r){return{addLocation:function(){let e;return n.open({templateUrl:"js/angular/templates/modal/add-location.html",windowClass:"addLocationDialog",controller:"AddLocationFromClusterCtrl"}).result.then(n=>(e=n,e.isLocal=!1,e.endpoint=e.uri,function(e){let n;return o.addLocation(e).catch(e=>{const n=getError(e.data,e.status);return t.error(n,r.instant("common.error")),!1}).then(e=>!!e&&s()).then(t=>{if(!1!==t)return n=t.find(t=>t.endpoint===e.uri),n})}(e)))},getLocationsWithRpcAddresses:s};function s(){return o.getLocations().then((function(e){return e.data.map(e=>({isLocal:e.local,endpoint:e.uri,rpcAddress:e.rpcAddress||"",error:e.errorMsg}))})).catch((function(e){const n=getError(e.data,e.status);t.error(n,r.instant("common.error"))})).then(e=>{if(e)return function(e){const t=e.filter(e=>!e.isLocal&&!e.error).map(e=>function(e){return o.getLocationRpcAddress(e.endpoint)}(e).then(t=>(e.rpcAddress=t.data,e.isAvailable=!0,e)).catch(t=>{e.isAvailable=!1,e.error=getError(t.data,t.status)}));return Promise.allSettled(t).then(()=>e)}(e)})}}function u(e,t,n,o,r){e.newLocation={uri:"",authType:"signature",username:"",password:"",active:!1},e.docBase=g(o),e.isValidLocation=function(){return(e.newLocation.uri.length<6||0===e.newLocation.uri.indexOf("http:")||0===e.newLocation.uri.indexOf("https:"))&&e.newLocation.uri.indexOf("/repositories")<=-1},e.ok=function(){e.newLocation?t.close(e.newLocation):n.error(r.instant("location.cannot.be.empty.error"))},e.cancel=function(){t.dismiss("cancel")}}function d(e,t,n,o,r,s,a){e.pageTitle=s.instant("cluster_management.cluster_page.edit_page_title"),e.errors=[],e.clusterConfiguration=angular.copy(a.clusterConfiguration),e.loader=!1,e.updateCluster=function(){return e.setLoader(!0,s.instant("cluster_management.cluster_page.updating_cluster_loader")),o.updateCluster(e.clusterConfiguration).then(()=>{r.success(s.instant("cluster_management.cluster_page.notifications.update_success")),t.close()}).catch((function(t){!function(t,n){delete e.preconditionErrors,r.error(s.instant("cluster_management.cluster_page.notifications.update_failed")),e.errors.splice(0),409===n||"string"==typeof t?e.errors.push(t):412===n?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===n&&e.errors.push(...t)}(t.data,t.status)})).finally(()=>e.setLoader(!1))},e.isClusterConfigurationValid=()=>!e.clusterConfigurationForm.$invalid,e.setLoader=function(t,o){n.cancel(e.loaderTimeout),t?e.loaderTimeout=n((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.ok=function(){e.isClusterConfigurationValid()?e.updateCluster():r.warning(s.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}l.$inject=["$scope","$modalInstance","$timeout","ClusterRestService","toastr","$translate","data","$modal","RemoteLocationsService"],c.$inject=["$scope","$modalInstance"],i.$inject=["$http","toastr","$modal","LocationsRestService","$translate"],u.$inject=["$scope","$modalInstance","toastr","productInfo","$translate"],d.$inject=["$scope","$modalInstance","$timeout","ClusterRestService","toastr","$translate","data"];const g=function(e){return"https://graphdb.ontotext.com/documentation/"+e.productShortVersion};function f(e,t,n,o,r){const s=angular.copy(n.clusterConfiguration),a=angular.copy(n.clusterModel);e.nodes=[],e.clusterNodes=a.locations.filter(e=>s.nodes.includes(e.rpcAddress)),e.locations=a.locations.filter(t=>!e.clusterNodes.includes(t)),e.locations.forEach(e=>e.isNew=!0),e.addNodeToList=function(t){t.rpcAddress&&(e.nodes.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,n){e.nodes.splice(t,1),e.locations.push(n)},e.addLocation=function(){r.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){t.close(e.nodes)},e.cancel=function(){t.dismiss("cancel")}}function m(e,t,n){const o=angular.copy(n.clusterModel);e.clusterNodes=o.nodes,e.clusterNodes.forEach(e=>e.shouldRemove=!1),e.nodesToRemoveCount=0,e.leftNodesLessThanTwo=!1,e.toggleNode=function(t,n){n.shouldRemove=!n.shouldRemove,n.shouldRemove?e.nodesToRemoveCount++:e.nodesToRemoveCount--,e.leftNodesLessThanTwo=e.clusterNodes.length-e.nodesToRemoveCount<2},e.ok=function(){const n=e.clusterNodes.filter(e=>e.shouldRemove);t.close(n)},e.cancel=function(){t.dismiss("cancel")}}f.$inject=["$scope","$modalInstance","data","$modal","RemoteLocationsService"],m.$inject=["$scope","$modalInstance","data"]},54:function(e,t){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",n),n.$inject=["$http"];function n(e){return{getClusterConfig:function(){return e.get("rest/cluster/config")},createCluster:function(t){return e.post("rest/cluster/config",t)},updateCluster:function(t){t.nodes&&delete t.nodes;return e.patch("rest/cluster/config",t)},deleteCluster:function(t){const n=$.param({force:t});return e.delete("rest/cluster/config?"+n)},addNodesToCluster:function(t){return e.post("rest/cluster/config/node",{nodes:t})},removeNodesFromCluster:function(t){return e.delete("rest/cluster/config/node",{data:{nodes:t},headers:{"Content-Type":"application/json"}})},getClusterStatus:function(){return e.get("rest/cluster/group/status")},getNodeStatus:function(){return e.get("rest/cluster/node/status")}}}}}]);
|
|
2
|
-
//# sourceMappingURL=3.
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[3,101],{45:function(e,t,n){"use strict";n.r(t),n.d(t,"NodeState",(function(){return o})),n.d(t,"LinkState",(function(){return r}));n(4),n(54);angular.module("graphdb.framework.clustermanagement.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.repositories.service","graphdb.framework.rest.cluster.service","toastr","pageslide-directive"]).controller("ClusterManagementCtrl",s).controller("CreateClusterCtrl",l).controller("DeleteClusterCtrl",c).controller("EditClusterCtrl",d).controller("AddLocationFromClusterCtrl",u).controller("AddNodesDialogCtrl",f).controller("RemoveNodesDialogCtrl",m).factory("RemoteLocationsService",i);const o={LEADER:"LEADER",FOLLOWER:"FOLLOWER",CANDIDATE:"CANDIDATE",OUT_OF_SYNC:"OUT_OF_SYNC",NO_CONNECTION:"NO_CONNECTION",READ_ONLY:"READ_ONLY",RESTRICTED:"RESTRICTED",NO_CLUSTER:"NO_CLUSTER",DELETED:"DELETED"},r={IN_SYNC:"IN_SYNC",OUT_OF_SYNC:"OUT_OF_SYNC",SYNCING:"SYNCING",NO_CONNECTION:"NO_CONNECTION"};function s(e,t,n,s,a,l,c,i,u,d,g,f,m,p,C){let h;function _(t){h||(h=e.getClusterStatus().then(()=>{if(t||!e.clusterConfiguration)return e.getClusterConfiguration()}).then(()=>{if(!e.currentNode||e.leaderChanged)return e.getCurrentNodeStatus()}).finally(()=>{h=null,e.childContext.redraw()}))}function N(){return C.getLocationsWithRpcAddresses().then(t=>{const n=t.find(e=>e.isLocal);n&&(n.endpoint=e.currentNode.endpoint,n.rpcAddress=e.currentNode.address),e.clusterModel.locations=t})}function L(t){s.success(t),e.getClusterConfiguration()}function $(e,t,n){let o=e.message||e;400===t&&Array.isArray(e)?o=e.reduce((e,t)=>e+`<div>${t}</div>`,""):412===t&&(o=Object.keys(e).reduce((t,n)=>t+`<div>${n} - ${e[n]}</div>`,"")),s.error(o,n,{allowHtml:!0})}e.loader=!0,e.isLeader=!1,e.currentNode=null,e.clusterModel={},e.NodeState=o,e.leaderChanged=!1,e.currentLeader=null,e.childContext={},e.shouldShowClusterSettingsPanel=!1,e.onopen=e.onclose=()=>angular.noop(),e.toggleSidePanel=()=>{e.shouldShowClusterSettingsPanel=!e.shouldShowClusterSettingsPanel},e.toggleLegend=()=>{e.childContext.toggleLegend&&e.childContext.toggleLegend()},e.setLoader=function(t,n){g.cancel(e.loaderTimeout),t?(e.loaderMessage=n,e.loaderTimeout=g((function(){e.loader=t}),50)):e.loader=!1},e.childContext.selectNode=function(t){e.selectedNode!==t?e.selectedNode=t:e.selectedNode=null,e.$apply()},e.getLoaderMessage=function(){return e.loaderMessage||p.instant("common.loading")},e.getClusterConfiguration=()=>f.getClusterConfig().then(t=>{if(e.clusterConfiguration=t.data,!e.currentNode)return e.getCurrentNodeStatus()}).catch(()=>{e.clusterConfiguration=null}),e.getClusterStatus=function(){return f.getClusterStatus().then((function(t){const n=t.data.slice(),s=n.find(e=>e.nodeState===o.LEADER);var a,l;a=e.currentLeader,(l=s)&&a&&a.address===l.address||(e.currentLeader=s,e.leaderChanged=!0),e.currentNode=n.find(t=>t.address===e.currentNode.address);const c=[];s&&Object.keys(s.syncStatus).forEach(e=>{const t=s.syncStatus[e];t!==r.NO_CONNECTION&&c.push({id:`${s.address}-${e}`,source:s.address,target:e,status:t})}),e.clusterModel.hasCluster=!0,e.clusterModel.nodes=n,e.clusterModel.links=c})).catch((function(t){404===t.status&&(e.clusterModel.hasCluster=!1,e.clusterModel.nodes=[],e.clusterModel.links=[],e.clusterConfiguration=null)}))},e.showCreateClusterDialog=function(){l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-create-dialog.html",controller:"CreateClusterCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel}}}}).result.finally((function(){N(),_(!0)}))},e.showDeleteDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then((function(t){const n=p.instant("cluster_management.delete_cluster_dialog.loader_message");e.setLoader(!0,n),f.deleteCluster(t).then(t=>{if(Object.values(t.data).every(e=>e===o.DELETED)){const e=p.instant("cluster_management.delete_cluster_dialog.notifications.success_delete");s.success(e)}else{const e=p.instant("cluster_management.delete_cluster_dialog.notifications.success_delete_partial"),n=Object.keys(t.data).reduce((e,n)=>e+`<div>${n} - ${t.data[n]}</div>`,"");s.success(n,e,{allowHtml:!0})}e.getClusterConfiguration()}).catch(e=>{const t=p.instant("cluster_management.delete_cluster_dialog.notifications.fail_delete"),n=Object.keys(e.data).reduce((t,n)=>t+`<div>${n} - ${e.data[n]}</div>`,"");s.error(n,t,{allowHtml:!0})}).finally(()=>{e.setLoader(!1),_(!0)})}))},e.showEditConfigurationDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:function(){return{clusterConfiguration:e.clusterConfiguration}}}}).result.finally((function(){_(!0)}))},e.getCurrentNodeStatus=()=>f.getNodeStatus().then(t=>{e.leaderChanged=!1,e.currentNode=t.data}).catch(t=>{e.currentNode=t.data,e.clusterModel.hasCluster=!1}).then(()=>N()),e.showAddNodeToClusterDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/add-nodes-dialog.html",controller:"AddNodesDialogCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel,clusterConfiguration:e.clusterConfiguration}}}}).result.then((function(t){const n=p.instant("cluster_management.cluster_page.add_nodes_loader");e.setLoader(!0,n);const o=t.map(e=>e.rpcAddress);f.addNodesToCluster(o).then(()=>{L(p.instant("cluster_management.cluster_page.notifications.add_nodes_success"))}).catch(e=>{const t=p.instant("cluster_management.cluster_page.notifications.add_nodes_fail");$(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),_(!0)})})).finally(()=>N())},e.showRemoveNodesFromClusterDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/remove-nodes-dialog.html",controller:"RemoveNodesDialogCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel}}}}).result.then((function(t){const n=p.instant("cluster_management.cluster_page.remove_nodes_loader");e.setLoader(!0,n);const o=t.map(e=>e.address);f.removeNodesFromCluster(o).then(()=>{L(p.instant("cluster_management.cluster_page.notifications.remove_nodes_success"))}).catch(e=>{const t=p.instant("cluster_management.cluster_page.notifications.remove_nodes_fail");$(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),_(!0)})}))},(e.loader=!0,e.getCurrentNodeStatus().then(()=>e.getClusterConfiguration()).then(()=>e.getClusterStatus()).finally(()=>{e.setLoader(!1)})).finally(()=>{const t=u((function(){_()}),1e3);e.$on("$destroy",(function(){u.cancel(t)}))});const v=angular.element(i),S=function(){e.childContext.resize()};v.bind("resize",S);const E=function(t){const n=t.target,o=document.getElementById("nodeTooltip");e.selectedNode&&o!==n&&!o.contains(n)&&e.childContext.selectNode(null)};v.bind("mousedown",E),e.$on("$destroy",(function(){v.unbind("resize",S),v.unbind("mousedown",E)}))}s.$inject=["$scope","$http","$q","toastr","$repositories","$modal","$sce","$window","$interval","ModalService","$timeout","ClusterRestService","$location","$translate","RemoteLocationsService"];const a=function(){const e=document.getElementById("advancedOptions");if(e){const t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"fa fa-angle-down"}return"fa fa-angle-right"};function l(e,t,n,o,r,s,l,c,i){e.pageTitle=s.instant("cluster_management.cluster_page.create_page_title"),e.autofocusId="autofocus",e.errors=[],e.clusterConfiguration={electionMinTimeout:2e4,electionRangeTimeout:1e4,heartbeatInterval:2e3,messageSizeKB:64,verificationTimeout:1500,nodes:[]},e.locations=l.clusterModel.locations.filter(e=>!e.isLocal),e.selectedLocations=l.clusterModel.locations.filter(e=>e.isLocal),e.loader=!1,e.getAdvancedOptionsClass=a,e.createCluster=function(){return e.setLoader(!0,s.instant("cluster_management.cluster_page.creating_cluster_loader")),e.clusterConfiguration.nodes=e.selectedLocations.map(e=>e.rpcAddress),o.createCluster(e.clusterConfiguration).then(()=>{r.success(s.instant("cluster_management.cluster_page.notifications.create_success")),t.close()}).catch((function(t){!function(t,n){delete e.preconditionErrors,r.error(s.instant("cluster_management.cluster_page.notifications.create_failed")),e.errors.splice(0),412===n?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===n?e.errors.push(...t):409===n&&e.errors.push(t)}(t.data,t.status)})).finally(()=>e.setLoader(!1))},e.isClusterConfigurationValid=()=>{const t=!e.clusterConfigurationForm.$invalid,n=e.selectedLocations&&e.selectedLocations.length>=2;return t&&n},e.setLoader=function(t,o){n.cancel(e.loaderTimeout),t?e.loaderTimeout=n((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.addNodeToList=function(t){t.rpcAddress&&(e.selectedLocations.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,n){n.isLocal||(e.selectedLocations.splice(t,1),e.locations.push(n))},e.addLocation=function(){i.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){e.isClusterConfigurationValid()?e.createCluster():r.warning(s.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}function c(e,t){e.forceDelete=!1,e.ok=function(){t.close(e.forceDelete)},e.cancel=function(){t.dismiss("cancel")}}function i(e,t,n,o,r){return{addLocation:function(){let e;return n.open({templateUrl:"js/angular/templates/modal/add-location.html",windowClass:"addLocationDialog",controller:"AddLocationFromClusterCtrl"}).result.then(n=>(e=n,e.isLocal=!1,e.endpoint=e.uri,function(e){let n;return o.addLocation(e).catch(e=>{const n=getError(e.data,e.status);return t.error(n,r.instant("common.error")),!1}).then(e=>!!e&&s()).then(t=>{if(!1!==t)return n=t.find(t=>t.endpoint===e.uri),n})}(e)))},getLocationsWithRpcAddresses:s};function s(){return o.getLocations().then((function(e){return e.data.map(e=>({isLocal:e.local,endpoint:e.uri,rpcAddress:e.rpcAddress||"",error:e.errorMsg}))})).catch((function(e){const n=getError(e.data,e.status);t.error(n,r.instant("common.error"))})).then(e=>{if(e)return function(e){const t=e.filter(e=>!e.isLocal&&!e.error).map(e=>function(e){return o.getLocationRpcAddress(e.endpoint)}(e).then(t=>(e.rpcAddress=t.data,e.isAvailable=!0,e)).catch(t=>{e.isAvailable=!1,e.error=getError(t.data,t.status)}));return Promise.allSettled(t).then(()=>e)}(e)})}}function u(e,t,n,o,r){e.newLocation={uri:"",authType:"signature",username:"",password:"",active:!1},e.docBase=g(o),e.isValidLocation=function(){return(e.newLocation.uri.length<6||0===e.newLocation.uri.indexOf("http:")||0===e.newLocation.uri.indexOf("https:"))&&e.newLocation.uri.indexOf("/repositories")<=-1},e.ok=function(){e.newLocation?t.close(e.newLocation):n.error(r.instant("location.cannot.be.empty.error"))},e.cancel=function(){t.dismiss("cancel")}}function d(e,t,n,o,r,s,a){e.pageTitle=s.instant("cluster_management.cluster_page.edit_page_title"),e.errors=[],e.clusterConfiguration=angular.copy(a.clusterConfiguration),e.loader=!1,e.updateCluster=function(){return e.setLoader(!0,s.instant("cluster_management.cluster_page.updating_cluster_loader")),o.updateCluster(e.clusterConfiguration).then(()=>{r.success(s.instant("cluster_management.cluster_page.notifications.update_success")),t.close()}).catch((function(t){!function(t,n){delete e.preconditionErrors,r.error(s.instant("cluster_management.cluster_page.notifications.update_failed")),e.errors.splice(0),409===n||"string"==typeof t?e.errors.push(t):412===n?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===n&&e.errors.push(...t)}(t.data,t.status)})).finally(()=>e.setLoader(!1))},e.isClusterConfigurationValid=()=>!e.clusterConfigurationForm.$invalid,e.setLoader=function(t,o){n.cancel(e.loaderTimeout),t?e.loaderTimeout=n((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.ok=function(){e.isClusterConfigurationValid()?e.updateCluster():r.warning(s.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}l.$inject=["$scope","$modalInstance","$timeout","ClusterRestService","toastr","$translate","data","$modal","RemoteLocationsService"],c.$inject=["$scope","$modalInstance"],i.$inject=["$http","toastr","$modal","LocationsRestService","$translate"],u.$inject=["$scope","$modalInstance","toastr","productInfo","$translate"],d.$inject=["$scope","$modalInstance","$timeout","ClusterRestService","toastr","$translate","data"];const g=function(e){return"https://graphdb.ontotext.com/documentation/"+e.productShortVersion};function f(e,t,n,o,r){const s=angular.copy(n.clusterConfiguration),a=angular.copy(n.clusterModel);e.nodes=[],e.clusterNodes=a.nodes.map(e=>({rpcAddress:e.address,endpoint:e.endpoint})),e.locations=a.locations.filter(e=>!s.nodes.includes(e.rpcAddress)),e.locations.forEach(e=>e.isNew=!0),e.addNodeToList=function(t){t.rpcAddress&&(e.nodes.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,n){e.nodes.splice(t,1),e.locations.push(n)},e.addLocation=function(){r.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){t.close(e.nodes)},e.cancel=function(){t.dismiss("cancel")}}function m(e,t,n){const o=angular.copy(n.clusterModel);e.clusterNodes=o.nodes,e.clusterNodes.forEach(e=>e.shouldRemove=!1),e.nodesToRemoveCount=0,e.leftNodesLessThanTwo=!1,e.toggleNode=function(t,n){n.shouldRemove=!n.shouldRemove,n.shouldRemove?e.nodesToRemoveCount++:e.nodesToRemoveCount--,e.leftNodesLessThanTwo=e.clusterNodes.length-e.nodesToRemoveCount<2},e.ok=function(){const n=e.clusterNodes.filter(e=>e.shouldRemove);t.close(n)},e.cancel=function(){t.dismiss("cancel")}}f.$inject=["$scope","$modalInstance","data","$modal","RemoteLocationsService"],m.$inject=["$scope","$modalInstance","data"]},54:function(e,t){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",n),n.$inject=["$http"];function n(e){return{getClusterConfig:function(){return e.get("rest/cluster/config")},createCluster:function(t){return e.post("rest/cluster/config",t)},updateCluster:function(t){t.nodes&&delete t.nodes;return e.patch("rest/cluster/config",t)},deleteCluster:function(t){const n=$.param({force:t});return e.delete("rest/cluster/config?"+n)},addNodesToCluster:function(t){return e.post("rest/cluster/config/node",{nodes:t})},removeNodesFromCluster:function(t){return e.delete("rest/cluster/config/node",{data:{nodes:t},headers:{"Content-Type":"application/json"}})},getClusterStatus:function(){return e.get("rest/cluster/group/status")},getNodeStatus:function(){return e.get("rest/cluster/node/status")}}}}}]);
|
|
2
|
+
//# sourceMappingURL=3.0a892888d711fa9009b7.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack:///./src/js/angular/clustermanagement/controllers.js","webpack:///./src/js/angular/rest/cluster.rest.service.js"],"names":["angular","module","controller","ClusterManagementCtrl","CreateClusterCtrl","DeleteClusterCtrl","EditClusterCtrl","AddLocationFromClusterCtrl","AddNodesDialogCtrl","RemoveNodesDialogCtrl","factory","RemoteLocationsService","NodeState","LEADER","FOLLOWER","CANDIDATE","OUT_OF_SYNC","NO_CONNECTION","READ_ONLY","RESTRICTED","NO_CLUSTER","DELETED","LinkState","IN_SYNC","SYNCING","$scope","$http","$q","toastr","$repositories","$modal","$sce","$window","$interval","ModalService","$timeout","ClusterRestService","$location","$translate","updateRequest","updateCluster","force","getClusterStatus","then","clusterConfiguration","getClusterConfiguration","currentNode","leaderChanged","getCurrentNodeStatus","finally","childContext","redraw","getLocationsWithRpcAddresses","locations","localNode","find","location","isLocal","endpoint","rpcAddress","address","clusterModel","onAddRemoveSuccess","message","success","handleAddRemoveErrors","data","status","title","failMessage","Array","isArray","reduce","acc","error","Object","keys","key","allowHtml","loader","isLeader","currentLeader","shouldShowClusterSettingsPanel","onopen","onclose","noop","toggleSidePanel","toggleLegend","setLoader","cancel","loaderTimeout","loaderMessage","selectNode","node","selectedNode","$apply","getLoaderMessage","instant","getClusterConfig","response","catch","nodes","slice","leader","nodeState","newLeader","links","syncStatus","forEach","push","id","source","target","hasCluster","showCreateClusterDialog","open","templateUrl","size","resolve","result","showDeleteDialog","forceDelete","deleteCluster","values","every","successMessage","failedNodesList","showEditConfigurationDialog","getNodeStatus","showAddNodeToClusterDialog","nodesRpcAddress","map","addNodesToCluster","failMessageTitle","showRemoveNodesFromClusterDialog","removeNodesFromCluster","timer","$on","w","element","resize","bind","mousedown","event","nodeTooltipElement","document","getElementById","contains","unbind","$inject","getAdvancedOptionsClass","optionsModule","isAriaExpanded","getAttribute","$modalInstance","pageTitle","autofocusId","errors","electionMinTimeout","electionRangeTimeout","heartbeatInterval","messageSizeKB","verificationTimeout","filter","selectedLocations","createCluster","close","preconditionErrors","splice","handleErrors","isClusterConfigurationValid","isFormValid","clusterConfigurationForm","$invalid","nodesListValid","length","addNodeToList","loc","removeNodeFromList","index","addLocation","newLocation","ok","warning","dismiss","LocationsRestService","windowClass","dataAddLocation","uri","locationData","msg","getError","locationAdded","addLocationHttp","getLocations","local","errorMsg","locationsArray","rpcAddressFetchers","getLocationRpcAddress","isAvailable","Promise","allSettled","getRemoteLocationsRpcAddresses","productInfo","docBase","getDocBase","isValidLocation","indexOf","copy","productShortVersion","clusterNodes","includes","isNew","shouldRemove","nodesToRemoveCount","leftNodesLessThanTwo","toggleNode","nodesToRemove","get","groupConfiguration","post","patch","$","param","delete","nodesArray","headers"],"mappings":"6FAAA,sGAYAA,QACKC,OAAO,kDAVI,CACZ,eACA,+CACA,8CACA,yCACA,SACA,wBAKCC,WAAW,wBAAyBC,GACpCD,WAAW,oBAAqBE,GAChCF,WAAW,oBAAqBG,GAChCH,WAAW,kBAAmBI,GAC9BJ,WAAW,6BAA8BK,GACzCL,WAAW,qBAAsBM,GACjCN,WAAW,wBAAyBO,GACpCC,QAAQ,yBAA0BC,GAEhC,MAAMC,EAAY,CACrBC,OAAQ,SACRC,SAAU,WACVC,UAAW,YACXC,YAAa,cACbC,cAAe,gBACfC,UAAW,YACXC,WAAY,aACZC,WAAY,aACZC,QAAS,WAEAC,EAAY,CACrBC,QAAS,UACTP,YAAa,cACbQ,QAAS,UACTP,cAAe,iBAMnB,SAASd,EAAsBsB,EAAQC,EAAOC,EAAIC,EAAQC,EAAeC,EAAQC,EAC7EC,EAASC,EAAWC,EAAcC,EAAUC,EAAoBC,EAAWC,EAAY3B,GAgEvF,IAAI4B,EACJ,SAASC,EAAcC,GACfF,IAIJA,EAAgBd,EAAOiB,mBAClBC,KAAK,KACF,GAAIF,IAAUhB,EAAOmB,qBACjB,OAAOnB,E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AAkB,S,iBCpyB7DrJ,QACKC,OAAO,yCAA0C,IACjDS,QAAQ,qBAAsB0B,GAEnCA,EAAmBiH,QAAU,CAAC,SAI9B,SAASjH,EAAmBV,GACxB,MAAO,CACHwE,iBAUJ,WACI,OAAOxE,EAAMiM,IAAI,wBAVjBtD,cAaJ,SAAuBuD,GACnB,OAAOlM,EAAMmM,KAAK,sBAAoCD,IAbtDpL,cAgBJ,SAAuBoL,GACfA,EAAmBvH,cACZuH,EAAmBvH,MAE9B,OAAO3E,EAAMoM,MAAM,sBAAoCF,IAnBvDlG,cAsBJ,SAAuBD,GACnB,MAAMvD,EAAO6J,EAAEC,MAAM,CACjBvL,MAAOgF,IAEX,OAAO/F,EAAMuM,OAAO,uBAAoC/J,IAzBxDkE,kBA4BJ,SAA2B8F,GACvB,OAAOxM,EAAMmM,KAAK,2BAAyC,CAACxH,MAAO6H,KA5BnE3F,uBA+BJ,SAAgC2F,GAC5B,OAAOxM,EAAMuM,OAAO,2BAAyC,CAAC/J,KAAM,CAACmC,MAAO6H,GAAaC,QAAS,CAAC,eAAgB,uBA/BnHzL,iBAkCJ,WACI,OAAOhB,EAAMiM,IAAI,8BAlCjB3F,cAqCJ,WACI,OAAOtG,EAAMiM,IAAI","file":"3.0a892888d711fa9009b7.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/rest/cluster.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.cluster.service',\n 'toastr',\n 'pageslide-directive'\n];\n\nangular\n .module('graphdb.framework.clustermanagement.controllers', modules)\n .controller('ClusterManagementCtrl', ClusterManagementCtrl)\n .controller('CreateClusterCtrl', CreateClusterCtrl)\n .controller('DeleteClusterCtrl', DeleteClusterCtrl)\n .controller('EditClusterCtrl', EditClusterCtrl)\n .controller('AddLocationFromClusterCtrl', AddLocationFromClusterCtrl)\n .controller('AddNodesDialogCtrl', AddNodesDialogCtrl)\n .controller('RemoveNodesDialogCtrl', RemoveNodesDialogCtrl)\n .factory('RemoteLocationsService', RemoteLocationsService);\n\nexport const NodeState = {\n LEADER: 'LEADER',\n FOLLOWER: 'FOLLOWER',\n CANDIDATE: 'CANDIDATE',\n OUT_OF_SYNC: 'OUT_OF_SYNC',\n NO_CONNECTION: 'NO_CONNECTION',\n READ_ONLY: 'READ_ONLY',\n RESTRICTED: 'RESTRICTED',\n NO_CLUSTER: 'NO_CLUSTER',\n DELETED: 'DELETED'\n};\nexport const LinkState = {\n IN_SYNC: 'IN_SYNC',\n OUT_OF_SYNC: 'OUT_OF_SYNC',\n SYNCING: 'SYNCING',\n NO_CONNECTION: 'NO_CONNECTION'\n};\n\nClusterManagementCtrl.$inject = ['$scope', '$http', '$q', 'toastr', '$repositories', '$modal', '$sce',\n '$window', '$interval', 'ModalService', '$timeout', 'ClusterRestService', '$location', '$translate', 'RemoteLocationsService'];\n\nfunction ClusterManagementCtrl($scope, $http, $q, toastr, $repositories, $modal, $sce,\n $window, $interval, ModalService, $timeout, ClusterRestService, $location, $translate, RemoteLocationsService) {\n $scope.loader = true;\n $scope.isLeader = false;\n $scope.currentNode = null;\n $scope.clusterModel = {};\n $scope.NodeState = NodeState;\n $scope.leaderChanged = false;\n $scope.currentLeader = null;\n\n // Holds child context\n $scope.childContext = {};\n\n $scope.shouldShowClusterSettingsPanel = false;\n $scope.onopen = $scope.onclose = () => angular.noop();\n\n $scope.toggleSidePanel = () => {\n $scope.shouldShowClusterSettingsPanel = !$scope.shouldShowClusterSettingsPanel;\n };\n\n $scope.toggleLegend = () => {\n if ($scope.childContext.toggleLegend) {\n $scope.childContext.toggleLegend();\n }\n };\n\n // TODO: Similar function is declared multiple times in different components. Find out how to avoid it!\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderMessage = message;\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n }, 50);\n } else {\n $scope.loader = false;\n }\n };\n\n function selectNode(node) {\n if ($scope.selectedNode !== node) {\n $scope.selectedNode = node;\n } else {\n $scope.selectedNode = null;\n }\n $scope.$apply();\n }\n\n $scope.childContext.selectNode = selectNode;\n\n function initialize() {\n $scope.loader = true;\n\n return $scope.getCurrentNodeStatus()\n .then(() => {\n return $scope.getClusterConfiguration();\n })\n .then(() => {\n return $scope.getClusterStatus();\n })\n .finally(() => {\n $scope.setLoader(false);\n });\n }\n\n let updateRequest;\n function updateCluster(force) {\n if (updateRequest) {\n return;\n }\n\n updateRequest = $scope.getClusterStatus()\n .then(() => {\n if (force || !$scope.clusterConfiguration) {\n return $scope.getClusterConfiguration();\n }\n })\n .then(() => {\n if (!$scope.currentNode || $scope.leaderChanged) {\n return $scope.getCurrentNodeStatus();\n }\n })\n .finally(() => {\n updateRequest = null;\n $scope.childContext.redraw();\n });\n }\n\n $scope.getLoaderMessage = function () {\n return $scope.loaderMessage || $translate.instant('common.loading');\n };\n\n $scope.getClusterConfiguration = () => {\n return ClusterRestService.getClusterConfig()\n .then((response) => {\n $scope.clusterConfiguration = response.data;\n if (!$scope.currentNode) {\n return $scope.getCurrentNodeStatus();\n }\n })\n .catch(() => {\n $scope.clusterConfiguration = null;\n });\n };\n\n function isLeaderChanged(currentLeader, newLeader) {\n if (!newLeader) {\n // If election is in place and there is no leader yet, consider it as leader change\n return true;\n }\n return !currentLeader || currentLeader.address !== newLeader.address;\n }\n\n $scope.getClusterStatus = function () {\n return ClusterRestService.getClusterStatus()\n .then(function (response) {\n const nodes = response.data.slice();\n const leader = nodes.find((node) => node.nodeState === NodeState.LEADER);\n\n if (isLeaderChanged($scope.currentLeader, leader)) {\n $scope.currentLeader = leader;\n $scope.leaderChanged = true;\n }\n $scope.currentNode = nodes.find((node) => node.address === $scope.currentNode.address);\n\n const links = [];\n if (leader) {\n Object.keys(leader.syncStatus).forEach((node) => {\n const status = leader.syncStatus[node];\n if (status !== LinkState.NO_CONNECTION) {\n links.push({\n id: `${leader.address}-${node}`,\n source: leader.address,\n target: node,\n status\n });\n }\n });\n }\n $scope.clusterModel.hasCluster = true;\n $scope.clusterModel.nodes = nodes;\n $scope.clusterModel.links = links;\n })\n .catch(function (error) {\n if (error.status === 404) {\n $scope.clusterModel.hasCluster = false;\n $scope.clusterModel.nodes = [];\n $scope.clusterModel.links = [];\n $scope.clusterConfiguration = null;\n }\n });\n };\n\n $scope.showCreateClusterDialog = function () {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/cluster-create-dialog.html',\n controller: 'CreateClusterCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterModel: $scope.clusterModel\n };\n }\n }\n });\n\n modalInstance.result.finally(function () {\n getLocationsWithRpcAddresses();\n updateCluster(true);\n });\n };\n\n $scope.showDeleteDialog = () => {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html',\n controller: 'DeleteClusterCtrl'\n });\n\n modalInstance.result.then(function (forceDelete) {\n const loaderMessage = $translate.instant('cluster_management.delete_cluster_dialog.loader_message');\n $scope.setLoader(true, loaderMessage);\n ClusterRestService.deleteCluster(forceDelete)\n .then((response) => {\n const allNodesDeleted = Object.values(response.data).every((nodeState) => nodeState === NodeState.DELETED);\n if (allNodesDeleted) {\n const successMessage = $translate.instant('cluster_management.delete_cluster_dialog.notifications.success_delete');\n toastr.success(successMessage);\n } else {\n const successMessage = $translate.instant(\n 'cluster_management.delete_cluster_dialog.notifications.success_delete_partial');\n const failedNodesList = Object.keys(response.data)\n .reduce((message, key) => message += `<div>${key} - ${response.data[key]}</div>`, '');\n toastr.success(failedNodesList, successMessage, {allowHtml: true});\n }\n $scope.getClusterConfiguration();\n })\n .catch((error) => {\n const failMessage = $translate.instant('cluster_management.delete_cluster_dialog.notifications.fail_delete');\n const failedNodesList = Object.keys(error.data)\n .reduce((message, key) => message += `<div>${key} - ${error.data[key]}</div>`, '');\n toastr.error(failedNodesList, failMessage, {allowHtml: true});\n })\n .finally(() => {\n $scope.setLoader(false);\n updateCluster(true);\n });\n });\n };\n\n $scope.showEditConfigurationDialog = () => {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html',\n controller: 'EditClusterCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterConfiguration: $scope.clusterConfiguration\n };\n }\n }\n });\n\n modalInstance.result.finally(function () {\n updateCluster(true);\n });\n };\n\n $scope.getCurrentNodeStatus = () => {\n return ClusterRestService.getNodeStatus()\n .then((response) => {\n $scope.leaderChanged = false;\n $scope.currentNode = response.data;\n })\n .catch((error) => {\n $scope.currentNode = error.data;\n $scope.clusterModel.hasCluster = false;\n })\n .then(() => getLocationsWithRpcAddresses());\n };\n\n function getLocationsWithRpcAddresses() {\n return RemoteLocationsService.getLocationsWithRpcAddresses()\n .then((locations) => {\n const localNode = locations.find((location) => location.isLocal);\n if (localNode) {\n localNode.endpoint = $scope.currentNode.endpoint;\n localNode.rpcAddress = $scope.currentNode.address;\n }\n $scope.clusterModel.locations = locations;\n });\n }\n\n $scope.showAddNodeToClusterDialog = () => {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/add-nodes-dialog.html',\n controller: 'AddNodesDialogCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterModel: $scope.clusterModel,\n clusterConfiguration: $scope.clusterConfiguration\n };\n }\n }\n });\n\n modalInstance.result.then(function (nodes) {\n const loaderMessage = $translate.instant('cluster_management.cluster_page.add_nodes_loader');\n $scope.setLoader(true, loaderMessage);\n\n const nodesRpcAddress = nodes.map((node) => node.rpcAddress);\n ClusterRestService.addNodesToCluster(nodesRpcAddress)\n .then(() => {\n const successMessage = $translate.instant(\n 'cluster_management.cluster_page.notifications.add_nodes_success');\n onAddRemoveSuccess(successMessage);\n })\n .catch((error) => {\n const failMessageTitle = $translate.instant('cluster_management.cluster_page.notifications.add_nodes_fail');\n handleAddRemoveErrors(error.data, error.status, failMessageTitle);\n })\n .finally(() => {\n $scope.setLoader(false);\n updateCluster(true);\n });\n })\n .finally(() => getLocationsWithRpcAddresses());\n };\n\n $scope.showRemoveNodesFromClusterDialog = () => {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/remove-nodes-dialog.html',\n controller: 'RemoveNodesDialogCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterModel: $scope.clusterModel\n };\n }\n }\n });\n\n modalInstance.result.then(function (nodes) {\n const loaderMessage = $translate.instant('cluster_management.cluster_page.remove_nodes_loader');\n $scope.setLoader(true, loaderMessage);\n\n const nodesRpcAddress = nodes.map((node) => node.address);\n ClusterRestService.removeNodesFromCluster(nodesRpcAddress)\n .then(() => {\n const successMessage = $translate.instant('cluster_management.cluster_page.notifications.remove_nodes_success');\n onAddRemoveSuccess(successMessage);\n })\n .catch((error) => {\n const failMessageTitle = $translate.instant('cluster_management.cluster_page.notifications.remove_nodes_fail');\n handleAddRemoveErrors(error.data, error.status, failMessageTitle);\n })\n .finally(() => {\n $scope.setLoader(false);\n updateCluster(true);\n });\n });\n };\n\n function onAddRemoveSuccess(message) {\n toastr.success(message);\n $scope.getClusterConfiguration();\n }\n\n function handleAddRemoveErrors(data, status, title) {\n let failMessage = data.message || data;\n\n if (status === 400 && Array.isArray(data)) {\n failMessage = data.reduce((acc, error) => acc += `<div>${error}</div>`, '');\n } else if (status === 412) {\n failMessage = Object.keys(data)\n .reduce((message, key) => message += `<div>${key} - ${data[key]}</div>`, '');\n }\n toastr.error(failMessage, title, {allowHtml: true});\n }\n\n initialize()\n .finally(() => {\n const timer = $interval(function () {\n updateCluster();\n }, 1000);\n\n $scope.$on(\"$destroy\", function () {\n $interval.cancel(timer);\n });\n });\n\n // track window resizing and window mousedown\n const w = angular.element($window);\n const resize = function () {\n $scope.childContext.resize();\n };\n w.bind('resize', resize);\n\n const mousedown = function (event) {\n const target = event.target;\n const nodeTooltipElement = document.getElementById('nodeTooltip');\n if ($scope.selectedNode && nodeTooltipElement !== target && !nodeTooltipElement.contains(target)) {\n $scope.childContext.selectNode(null);\n }\n };\n w.bind('mousedown', mousedown);\n $scope.$on('$destroy', function () {\n w.unbind('resize', resize);\n w.unbind('mousedown', mousedown);\n });\n}\n\nconst getAdvancedOptionsClass = function () {\n const optionsModule = document.getElementById('advancedOptions');\n\n if (optionsModule) {\n const isAriaExpanded = optionsModule.getAttribute('aria-expanded');\n if (isAriaExpanded && isAriaExpanded === 'true') {\n return 'fa fa-angle-down';\n }\n }\n return 'fa fa-angle-right';\n};\n\nCreateClusterCtrl.$inject = ['$scope', '$modalInstance', '$timeout', 'ClusterRestService', 'toastr', '$translate', 'data', '$modal',\n 'RemoteLocationsService'];\n\nfunction CreateClusterCtrl($scope, $modalInstance, $timeout, ClusterRestService, toastr, $translate, data, $modal, RemoteLocationsService) {\n $scope.pageTitle = $translate.instant('cluster_management.cluster_page.create_page_title');\n $scope.autofocusId = 'autofocus';\n $scope.errors = [];\n $scope.clusterConfiguration = {\n electionMinTimeout: 20000,\n electionRangeTimeout: 10000,\n heartbeatInterval: 2000,\n messageSizeKB: 64,\n verificationTimeout: 1500,\n nodes: []\n };\n\n $scope.locations = data.clusterModel.locations.filter((location) => !location.isLocal);\n $scope.selectedLocations = data.clusterModel.locations.filter((location) => location.isLocal);\n\n $scope.loader = false;\n\n $scope.getAdvancedOptionsClass = getAdvancedOptionsClass;\n\n $scope.createCluster = function () {\n $scope.setLoader(true, $translate.instant('cluster_management.cluster_page.creating_cluster_loader'));\n $scope.clusterConfiguration.nodes = $scope.selectedLocations.map((node) => node.rpcAddress);\n return ClusterRestService.createCluster($scope.clusterConfiguration)\n .then(() => {\n toastr.success($translate.instant('cluster_management.cluster_page.notifications.create_success'));\n $modalInstance.close();\n })\n .catch(function (error) {\n handleErrors(error.data, error.status);\n })\n .finally(() => $scope.setLoader(false));\n };\n\n function handleErrors(data, status) {\n delete $scope.preconditionErrors;\n toastr.error($translate.instant('cluster_management.cluster_page.notifications.create_failed'));\n $scope.errors.splice(0);\n if (status === 412) {\n $scope.preconditionErrors = Object.keys(data).map((key) => `${key} - ${data[key]}`);\n } else if (status === 400) {\n $scope.errors.push(...data);\n } else if (status === 409) {\n $scope.errors.push(data);\n }\n }\n\n $scope.isClusterConfigurationValid = () => {\n const isFormValid = !$scope.clusterConfigurationForm.$invalid;\n const nodesListValid = $scope.selectedLocations && $scope.selectedLocations.length >= 2;\n return isFormValid && nodesListValid;\n };\n\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.addNodeToList = function (location) {\n if (!location.rpcAddress) {\n return;\n }\n $scope.selectedLocations.push(location);\n $scope.locations = $scope.locations.filter((loc) => loc.endpoint !== location.endpoint);\n };\n\n $scope.removeNodeFromList = function (index, node) {\n if (node.isLocal) {\n return;\n }\n $scope.selectedLocations.splice(index, 1);\n $scope.locations.push(node);\n };\n\n $scope.addLocation = function () {\n RemoteLocationsService.addLocation()\n .then((newLocation) => {\n if (newLocation) {\n $scope.locations.push(newLocation);\n }\n });\n };\n\n $scope.ok = function () {\n if (!$scope.isClusterConfigurationValid()) {\n toastr.warning($translate.instant('cluster_management.cluster_page.notifications.form_invalid'));\n return;\n }\n $scope.createCluster();\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nDeleteClusterCtrl.$inject = ['$scope', '$modalInstance'];\n\nfunction DeleteClusterCtrl($scope, $modalInstance) {\n $scope.forceDelete = false;\n\n $scope.ok = function () {\n $modalInstance.close($scope.forceDelete);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nRemoteLocationsService.$inject = ['$http', 'toastr', '$modal', 'LocationsRestService', '$translate'];\n\nfunction RemoteLocationsService($http, toastr, $modal, LocationsRestService, $translate) {\n return {\n addLocation: addLocation,\n getLocationsWithRpcAddresses: getLocationsWithRpcAddresses\n };\n\n function getLocationsWithRpcAddresses() {\n return getLocations()\n .then((locations) => {\n if (locations) {\n return getRemoteLocationsRpcAddresses(locations);\n }\n });\n }\n\n /**\n * Sets multiple remote locations' rpc addresses. Skips local location and locations with errors\n * @param {any[]} locationsArray\n * @return {Promise<[]>} locationArray with filled rpc addresses\n */\n function getRemoteLocationsRpcAddresses(locationsArray) {\n const rpcAddressFetchers = locationsArray.filter((location) => !location.isLocal && !location.error).map((location) => {\n return getLocationRpcAddress(location)\n .then((response) => {\n location.rpcAddress = response.data;\n location.isAvailable = true;\n return location;\n })\n .catch((error) => {\n location.isAvailable = false;\n location.error = getError(error.data, error.status);\n });\n });\n return Promise.allSettled(rpcAddressFetchers).then(() => locationsArray);\n }\n\n /**\n * Fetch locations and map them to a location model\n *\n * @return {*} all remote locations mapped to a location model\n */\n function getLocations() {\n return LocationsRestService.getLocations()\n .then(function (response) {\n return response.data.map((loc) => {\n return {\n isLocal: loc.local,\n endpoint: loc.uri,\n rpcAddress: loc.rpcAddress || '',\n error: loc.errorMsg\n };\n });\n })\n .catch(function (error) {\n const msg = getError(error.data, error.status);\n toastr.error(msg, $translate.instant('common.error'));\n });\n }\n\n /**\n * Fetch rpc address of a remote location\n * @param {*} location the remote location\n * @return {Promise<String>} the rpc address of the location\n */\n function getLocationRpcAddress(location) {\n return LocationsRestService.getLocationRpcAddress(location.endpoint);\n\n }\n\n function addLocation() {\n let newLocation;\n return $modal.open({\n templateUrl: 'js/angular/templates/modal/add-location.html',\n windowClass: 'addLocationDialog',\n controller: 'AddLocationFromClusterCtrl'\n }).result\n .then((dataAddLocation) => {\n newLocation = dataAddLocation;\n newLocation.isLocal = false;\n newLocation.endpoint = newLocation.uri;\n return addLocationHttp(newLocation);\n });\n }\n\n function addLocationHttp(locationData) {\n let newLocation;\n return LocationsRestService.addLocation(locationData)\n .catch((error) => {\n const msg = getError(error.data, error.status);\n toastr.error(msg, $translate.instant('common.error'));\n return false;\n })\n .then((locationAdded) => {\n if (locationAdded) {\n return getLocationsWithRpcAddresses();\n }\n return false;\n })\n .then((locations) => {\n if (locations === false) {\n return;\n }\n newLocation = locations.find((location) => location.endpoint === locationData.uri);\n return newLocation;\n });\n }\n}\n\nAddLocationFromClusterCtrl.$inject = ['$scope', '$modalInstance', 'toastr', 'productInfo', '$translate'];\n\nfunction AddLocationFromClusterCtrl($scope, $modalInstance, toastr, productInfo, $translate) {\n //TODO: This, along with the view are duplicated from repositories page. Must be extracted for re-usability.\n $scope.newLocation = {\n 'uri': '',\n 'authType': 'signature',\n 'username': '',\n 'password': '',\n 'active': false\n };\n $scope.docBase = getDocBase(productInfo);\n\n $scope.isValidLocation = function () {\n return ($scope.newLocation.uri.length < 6 ||\n $scope.newLocation.uri.indexOf('http:') === 0 || $scope.newLocation.uri.indexOf('https:') === 0)\n && $scope.newLocation.uri.indexOf('/repositories') <= -1;\n };\n\n $scope.ok = function () {\n if (!$scope.newLocation) {\n toastr.error($translate.instant('location.cannot.be.empty.error'));\n return;\n }\n $modalInstance.close($scope.newLocation);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nEditClusterCtrl.$inject = ['$scope', '$modalInstance', '$timeout', 'ClusterRestService', 'toastr', '$translate', 'data'];\n\nfunction EditClusterCtrl($scope, $modalInstance, $timeout, ClusterRestService, toastr, $translate, data) {\n $scope.pageTitle = $translate.instant('cluster_management.cluster_page.edit_page_title');\n $scope.errors = [];\n $scope.clusterConfiguration = angular.copy(data.clusterConfiguration);\n $scope.loader = false;\n\n $scope.updateCluster = function () {\n $scope.setLoader(true, $translate.instant('cluster_management.cluster_page.updating_cluster_loader'));\n return ClusterRestService.updateCluster($scope.clusterConfiguration)\n .then(() => {\n toastr.success($translate.instant('cluster_management.cluster_page.notifications.update_success'));\n $modalInstance.close();\n })\n .catch(function (response) {\n handleErrors(response.data, response.status);\n })\n .finally(() => $scope.setLoader(false));\n };\n\n function handleErrors(data, status) {\n delete $scope.preconditionErrors;\n toastr.error($translate.instant('cluster_management.cluster_page.notifications.update_failed'));\n $scope.errors.splice(0);\n\n if (status === 409 || typeof data === 'string') {\n $scope.errors.push(data);\n } else if (status === 412) {\n $scope.preconditionErrors = Object.keys(data).map((key) => `${key} - ${data[key]}`);\n } else if (status === 400) {\n $scope.errors.push(...data);\n }\n }\n\n $scope.isClusterConfigurationValid = () => {\n return !$scope.clusterConfigurationForm.$invalid;\n };\n\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.ok = function () {\n if (!$scope.isClusterConfigurationValid()) {\n toastr.warning($translate.instant('cluster_management.cluster_page.notifications.form_invalid'));\n return;\n }\n $scope.updateCluster();\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nconst getDocBase = function (productInfo) {\n return `https://graphdb.ontotext.com/documentation/${productInfo.productShortVersion}`;\n};\n\nAddNodesDialogCtrl.$inject = ['$scope', '$modalInstance', 'data', '$modal', 'RemoteLocationsService'];\n\nfunction AddNodesDialogCtrl($scope, $modalInstance, data, $modal, RemoteLocationsService) {\n const clusterConfiguration = angular.copy(data.clusterConfiguration);\n const clusterModel = angular.copy(data.clusterModel);\n $scope.nodes = [];\n\n $scope.clusterNodes = clusterModel.nodes.map((node) => ({rpcAddress: node.address, endpoint: node.endpoint}));\n $scope.locations = clusterModel.locations.filter((location) => !clusterConfiguration.nodes.includes(location.rpcAddress));\n $scope.locations.forEach((location) => location.isNew = true);\n\n $scope.addNodeToList = function (location) {\n if (!location.rpcAddress) {\n return;\n }\n $scope.nodes.push(location);\n $scope.locations = $scope.locations.filter((loc) => loc.endpoint !== location.endpoint);\n };\n\n $scope.removeNodeFromList = function (index, node) {\n $scope.nodes.splice(index, 1);\n $scope.locations.push(node);\n };\n\n $scope.addLocation = function () {\n RemoteLocationsService.addLocation()\n .then((newLocation) => {\n if (newLocation) {\n $scope.locations.push(newLocation);\n }\n });\n };\n\n $scope.ok = function () {\n $modalInstance.close($scope.nodes);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nRemoveNodesDialogCtrl.$inject = ['$scope', '$modalInstance', 'data'];\n\nfunction RemoveNodesDialogCtrl($scope, $modalInstance, data) {\n const clusterModel = angular.copy(data.clusterModel);\n\n $scope.clusterNodes = clusterModel.nodes;\n $scope.clusterNodes.forEach((node) => node.shouldRemove = false);\n $scope.nodesToRemoveCount = 0;\n $scope.leftNodesLessThanTwo = false;\n\n $scope.toggleNode = function (index, node) {\n node.shouldRemove = !node.shouldRemove;\n if (node.shouldRemove) {\n $scope.nodesToRemoveCount++;\n } else {\n $scope.nodesToRemoveCount--;\n }\n $scope.leftNodesLessThanTwo = $scope.clusterNodes.length - $scope.nodesToRemoveCount < 2;\n };\n\n $scope.ok = function () {\n const nodesToRemove = $scope.clusterNodes.filter((node) => node.shouldRemove);\n $modalInstance.close(nodesToRemove);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n","angular\n .module('graphdb.framework.rest.cluster.service', [])\n .factory('ClusterRestService', ClusterRestService);\n\nClusterRestService.$inject = ['$http'];\n\nconst CLUSTER_GROUP_ENDPOINT = 'rest/cluster';\n\nfunction ClusterRestService($http) {\n return {\n getClusterConfig,\n createCluster,\n updateCluster,\n deleteCluster,\n addNodesToCluster,\n removeNodesFromCluster,\n getClusterStatus,\n getNodeStatus\n };\n\n function getClusterConfig() {\n return $http.get(`${CLUSTER_GROUP_ENDPOINT}/config`);\n }\n\n function createCluster(groupConfiguration) {\n return $http.post(`${CLUSTER_GROUP_ENDPOINT}/config`, groupConfiguration);\n }\n\n function updateCluster(groupConfiguration) {\n if (groupConfiguration.nodes) {\n delete groupConfiguration.nodes;\n }\n return $http.patch(`${CLUSTER_GROUP_ENDPOINT}/config`, groupConfiguration);\n }\n\n function deleteCluster(forceDelete) {\n const data = $.param({\n force: forceDelete\n });\n return $http.delete(`${CLUSTER_GROUP_ENDPOINT}/config?${data}`);\n }\n\n function addNodesToCluster(nodesArray) {\n return $http.post(`${CLUSTER_GROUP_ENDPOINT}/config/node`, {nodes: nodesArray});\n }\n\n function removeNodesFromCluster(nodesArray) {\n return $http.delete(`${CLUSTER_GROUP_ENDPOINT}/config/node`, {data: {nodes: nodesArray}, headers: {'Content-Type': 'application/json'}});\n }\n\n function getClusterStatus() {\n return $http.get(`${CLUSTER_GROUP_ENDPOINT}/group/status`);\n }\n\n function getNodeStatus() {\n return $http.get(`${CLUSTER_GROUP_ENDPOINT}/node/status`);\n }\n}\n"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{242:function(t,e,r){"use strict";var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click={delayDblClick:function(){var t=d3.dispatch("click","dblclick");return d3.rebind((function(e){var r,a=null;e.on("mousedown",(function(){r=d3.mouse(document.body),new Date})),e.on("mouseup",(function(e){var n,o;n=r,o=d3.mouse(document.body),Math.sqrt(Math.pow(n[0]-o[0],2),Math.pow(n[1]-o[1],2))>5||(a?(window.clearTimeout(a),a=null,t.dblclick(e)):a=window.setTimeout((d3.event,function(){t.click(e),a=null}),250))}))}),t,"on")}},e.a=a},243:function(t,e,r){"use strict";var a=a||{};a.Export={getCSSRules:function(t){var e=$('link[href="'+t+'"]')[0].sheet.rules,r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(){var t=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(t)))}},e.a=a},71:function(t,e,r){"use strict";r.r(e);var a=r(243),n=r(242);r(5);function o(t,e,r,o,s,i,c,l,d,u,p,f,g){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))};var p=d3.layout.force().size([1200,600]).charge(-900),h=p.drag().on("dragstart",(function(t){d3.select(this).classed("selected",t.selected=!0)})),y=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),x=y.append("defs");x.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=a.a.Export.getCSSRules("css/domain-range-graph.css?v=2.1.0");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.a.Export.generateBase64ImageSource();d3.select(this).attr({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})}));var m=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");m.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var v=16+1200/18/2.5,k=v+1200/90;m.append("circle").attr({class:"legend-class-node",cx:(16+v)/2,cy:30,r:1200/18/4.5});m.append("text").attr({x:k,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");m.append("circle").attr({class:"legend-object-node",cx:(16+v)/2,cy:70,r:1200/110/1.25});m.append("text").attr({x:k,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");m.append("circle").attr({class:"legend-datatype-node",cx:(16+v)/2,cy:70+1200/45,r:1200/110/2});m.append("text").attr({x:k,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");m.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:v,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");m.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:v,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");m.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:v,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),m.append("text").attr({x:k,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var b=y,w=s.search().uri,E=s.search().name,N=s.search().collapsed;o.getDomainRangeData(w,N).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+E+" failed!")})),$(window).on("popstate",(function(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:w,name:E,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=angular.copy(u.domainRangeGraphData);p.nodes(r.nodes).links(r.links);var a=b.selectAll(".link").data(r.links).enter().append("g");function o(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var i,c,d=0;a.each((function(t){if(t.objectPropNodeClassUri!==w)i=a.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(t){switch(t.propertyType){case"objectLeft":t.targetRadius=1200/18;break;case"objectRight":t.targetRadius=1200/110;break;case"datatype":t.targetRadius=1200/110/2;break;default:t.targetRadius=0}var e=d3.select(this);t.targetNodeEdgeCount>1?o(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=t.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var y={};function x(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function m(t){x(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",x)}));var v=a.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===w?"loop-link-property-name":"property-name"})).attr("dx",(function(t){return 1200/18/2*("objectLeft"===t.propertyType?1:-1)})).style("text-anchor",(function(t){return"objectLeft"===t.propertyType?"end":"start"})).style("font-size",1200/90).text((function(t){return t.targetNodeEdgeCount>1?t.targetNodeEdgeCount+" predicates":t.name}));v.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",m):r.on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.uri),"_blank")}))}));var k=a.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==w?"link-background":"loop-link-background"})).attr("width",(function(t){return t.calculatedWidth=this.previousSibling.getBBox().width,t.calculatedWidth+4})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+2})).attr("transform",(function(t){var e=2-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(2+t.calculatedHeight/2)+")"})).on("click",(function(t){d3.event.stopPropagation()})),N=b.selectAll(".node").data(r.nodes).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==w})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attr({class:"datatype-node",r:1200/110/2}):e.attr({class:"object-prop-node",r:1200/110})})).call(h);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",e,r)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==w})).append("text").attr("class",(function(t){return t.classPosition+"-class-label"})).style("font-size",1200/90).text((function(t){return t.objectPropClassName})).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.objectPropClassUri),"_blank")}));var C=N.select("text");b.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return n.a.Text.calcFontSize(E,1200/18)})).text(E).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(w),"_blank")}))}));var T=b.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),_=d3.selectAll(".loop-link-property-name");if(v=d3.selectAll(".property-name"),!angular.isUndefined(c)){var M=[];L.each((function(t,e){d3.select(this);M.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}p.on("tick",(function(t){var e=8*t.alpha;function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var a=[];L.each((function(n,o){a.push(n),o<g?function(a,n){var o=$.grep(M,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.attr({transform:"rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(t){var e;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=t,e=this.getComputedTextLength()})).on("click",m),d3.select(".view-more-preds-rect").attr("height",e+4)}(a)}i.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.targetX})).attr("y2",(function(t){return t.targetY})).each((function(t){!function(t){"objectLeft"===t.propertyType?(t.source.x-=8*e,t.source.y-=e/9):(t.target.x+=8*e,t.target.y-=e/9)}(t);var r=Math.atan2(t.target.y-t.source.y,t.target.x-t.source.x);t.targetX=t.target.x-Math.cos(r)*t.targetRadius,t.targetY=t.target.y-Math.sin(r)*t.targetRadius})),R.each((function(t){"main"!==t.classPosition||angular.isUndefined(c)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(M,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attr({x:o,y:s}).moveToFront()}_.each((function(t,r){var a=d3.select(this),n=_.size()-g;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<g?e(a,r):a.remove())}))}(t),r(t)),t.objectPropClassUri!==w&&d3.select(this).attr("cx",(function(t){return"main"===t.classPosition?function(t){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(t){return Math.log(t)/Math.LN10});var e=A.attr("cx")-600,r=.5*Math.log10(Math.abs(e));return t.x+=e>0?-r:r,t.x}(t):t.x})).attr("cy",(function(t){return t.y}))})),T.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),k.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),v.attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),C.attr("x",(function(t){return"right"===t.classPosition?t.x+1200/110*1.2:t.x-1200/110*1.2})).attr("y",(function(t){return t.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--onto-orange)").constant("ONTO_GREEN","var(--onto-green)").constant("ONTO_BLUE","var(--onto-blue)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{242:function(t,e,r){"use strict";var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click={delayDblClick:function(){var t=d3.dispatch("click","dblclick");return d3.rebind((function(e){var r,a=null;e.on("mousedown",(function(){r=d3.mouse(document.body),new Date})),e.on("mouseup",(function(e){var n,o;n=r,o=d3.mouse(document.body),Math.sqrt(Math.pow(n[0]-o[0],2),Math.pow(n[1]-o[1],2))>5||(a?(window.clearTimeout(a),a=null,t.dblclick(e)):a=window.setTimeout((d3.event,function(){t.click(e),a=null}),250))}))}),t,"on")}},e.a=a},243:function(t,e,r){"use strict";var a=a||{};a.Export={getCSSRules:function(t){var e=$('link[href="'+t+'"]')[0].sheet.rules,r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(){var t=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(t)))}},e.a=a},71:function(t,e,r){"use strict";r.r(e);var a=r(243),n=r(242);r(5);function o(t,e,r,o,s,i,c,l,d,u,p,f,g){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))};var p=d3.layout.force().size([1200,600]).charge(-900),h=p.drag().on("dragstart",(function(t){d3.select(this).classed("selected",t.selected=!0)})),y=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),x=y.append("defs");x.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=a.a.Export.getCSSRules("css/domain-range-graph.css?v=2.1.1-TR2");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.a.Export.generateBase64ImageSource();d3.select(this).attr({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})}));var m=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");m.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var v=16+1200/18/2.5,k=v+1200/90;m.append("circle").attr({class:"legend-class-node",cx:(16+v)/2,cy:30,r:1200/18/4.5});m.append("text").attr({x:k,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");m.append("circle").attr({class:"legend-object-node",cx:(16+v)/2,cy:70,r:1200/110/1.25});m.append("text").attr({x:k,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");m.append("circle").attr({class:"legend-datatype-node",cx:(16+v)/2,cy:70+1200/45,r:1200/110/2});m.append("text").attr({x:k,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");m.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:v,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");m.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:v,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");m.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:v,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),m.append("text").attr({x:k,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var b=y,w=s.search().uri,E=s.search().name,N=s.search().collapsed;o.getDomainRangeData(w,N).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+E+" failed!")})),$(window).on("popstate",(function(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:w,name:E,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=angular.copy(u.domainRangeGraphData);p.nodes(r.nodes).links(r.links);var a=b.selectAll(".link").data(r.links).enter().append("g");function o(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var i,c,d=0;a.each((function(t){if(t.objectPropNodeClassUri!==w)i=a.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(t){switch(t.propertyType){case"objectLeft":t.targetRadius=1200/18;break;case"objectRight":t.targetRadius=1200/110;break;case"datatype":t.targetRadius=1200/110/2;break;default:t.targetRadius=0}var e=d3.select(this);t.targetNodeEdgeCount>1?o(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=t.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var y={};function x(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function m(t){x(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",x)}));var v=a.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===w?"loop-link-property-name":"property-name"})).attr("dx",(function(t){return 1200/18/2*("objectLeft"===t.propertyType?1:-1)})).style("text-anchor",(function(t){return"objectLeft"===t.propertyType?"end":"start"})).style("font-size",1200/90).text((function(t){return t.targetNodeEdgeCount>1?t.targetNodeEdgeCount+" predicates":t.name}));v.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",m):r.on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.uri),"_blank")}))}));var k=a.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==w?"link-background":"loop-link-background"})).attr("width",(function(t){return t.calculatedWidth=this.previousSibling.getBBox().width,t.calculatedWidth+4})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+2})).attr("transform",(function(t){var e=2-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(2+t.calculatedHeight/2)+")"})).on("click",(function(t){d3.event.stopPropagation()})),N=b.selectAll(".node").data(r.nodes).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==w})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attr({class:"datatype-node",r:1200/110/2}):e.attr({class:"object-prop-node",r:1200/110})})).call(h);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",e,r)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==w})).append("text").attr("class",(function(t){return t.classPosition+"-class-label"})).style("font-size",1200/90).text((function(t){return t.objectPropClassName})).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.objectPropClassUri),"_blank")}));var C=N.select("text");b.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return n.a.Text.calcFontSize(E,1200/18)})).text(E).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(w),"_blank")}))}));var T=b.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),_=d3.selectAll(".loop-link-property-name");if(v=d3.selectAll(".property-name"),!angular.isUndefined(c)){var M=[];L.each((function(t,e){d3.select(this);M.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}p.on("tick",(function(t){var e=8*t.alpha;function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var a=[];L.each((function(n,o){a.push(n),o<g?function(a,n){var o=$.grep(M,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.attr({transform:"rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(t){var e;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=t,e=this.getComputedTextLength()})).on("click",m),d3.select(".view-more-preds-rect").attr("height",e+4)}(a)}i.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.targetX})).attr("y2",(function(t){return t.targetY})).each((function(t){!function(t){"objectLeft"===t.propertyType?(t.source.x-=8*e,t.source.y-=e/9):(t.target.x+=8*e,t.target.y-=e/9)}(t);var r=Math.atan2(t.target.y-t.source.y,t.target.x-t.source.x);t.targetX=t.target.x-Math.cos(r)*t.targetRadius,t.targetY=t.target.y-Math.sin(r)*t.targetRadius})),R.each((function(t){"main"!==t.classPosition||angular.isUndefined(c)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(M,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attr({x:o,y:s}).moveToFront()}_.each((function(t,r){var a=d3.select(this),n=_.size()-g;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<g?e(a,r):a.remove())}))}(t),r(t)),t.objectPropClassUri!==w&&d3.select(this).attr("cx",(function(t){return"main"===t.classPosition?function(t){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(t){return Math.log(t)/Math.LN10});var e=A.attr("cx")-600,r=.5*Math.log10(Math.abs(e));return t.x+=e>0?-r:r,t.x}(t):t.x})).attr("cy",(function(t){return t.y}))})),T.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),k.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),v.attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),C.attr("x",(function(t){return"right"===t.classPosition?t.x+1200/110*1.2:t.x-1200/110*1.2})).attr("y",(function(t){return t.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--onto-orange)").constant("ONTO_GREEN","var(--onto-green)").constant("ONTO_BLUE","var(--onto-blue)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]}}]);
|
|
2
2
|
//# sourceMappingURL=30.4b987e71408e0643680a.bundle.js.map
|