graphdb-workbench 2.0.0-M3-RC3 → 2.0.0-RC2

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.
Files changed (180) hide show
  1. package/dist/{10.91f8aa0494201bb12b25.bundle.js → 10.eab0a417fa2f2831905e.bundle.js} +2 -2
  2. package/dist/10.eab0a417fa2f2831905e.bundle.js.map +1 -0
  3. package/dist/{104.42f8ece72006965c902d.bundle.js → 104.7e16b2863108db706fe7.bundle.js} +2 -2
  4. package/dist/104.7e16b2863108db706fe7.bundle.js.map +1 -0
  5. package/dist/{11.32f5a72d66bb699e9e8b.bundle.js → 11.3957302d7a301df30dd1.bundle.js} +2 -2
  6. package/dist/11.3957302d7a301df30dd1.bundle.js.map +1 -0
  7. package/dist/111.ceb781497f3c5dfd1446.bundle.js +2 -0
  8. package/dist/111.ceb781497f3c5dfd1446.bundle.js.map +1 -0
  9. package/dist/112.e34c26d9d3b4b6deae17.bundle.js +2 -0
  10. package/dist/112.e34c26d9d3b4b6deae17.bundle.js.map +1 -0
  11. package/dist/113.733877f9f73d3283f528.bundle.js +2 -0
  12. package/dist/113.733877f9f73d3283f528.bundle.js.map +1 -0
  13. package/dist/114.0e270e77a2a557167988.bundle.js +2 -0
  14. package/dist/114.0e270e77a2a557167988.bundle.js.map +1 -0
  15. package/dist/115.732830fed3ff34691def.bundle.js +2 -0
  16. package/dist/115.732830fed3ff34691def.bundle.js.map +1 -0
  17. package/dist/116.7e8b202c5d712bddaaec.bundle.js +2 -0
  18. package/dist/116.7e8b202c5d712bddaaec.bundle.js.map +1 -0
  19. package/dist/119.2d6b15bc87de2533599c.bundle.js +2 -0
  20. package/dist/119.2d6b15bc87de2533599c.bundle.js.map +1 -0
  21. package/dist/120.80843604737b7c260788.bundle.js +1 -1
  22. package/dist/120.80843604737b7c260788.bundle.js.map +1 -1
  23. package/dist/123.51ad0d8338eda5a93b06.bundle.js +2 -0
  24. package/dist/123.51ad0d8338eda5a93b06.bundle.js.map +1 -0
  25. package/dist/{128.ce61f3a6925ddbc8f612.bundle.js → 128.7dae6369a26090e10276.bundle.js} +2 -2
  26. package/dist/{128.ce61f3a6925ddbc8f612.bundle.js.map → 128.7dae6369a26090e10276.bundle.js.map} +1 -1
  27. package/dist/130.ecb7509cb6324abf4071.bundle.js +2 -0
  28. package/dist/130.ecb7509cb6324abf4071.bundle.js.map +1 -0
  29. package/dist/138.5375ebd499e5c4977038.bundle.js +2 -0
  30. package/dist/138.5375ebd499e5c4977038.bundle.js.map +1 -0
  31. package/dist/149.7089a654a1902207a2c8.bundle.js +2 -0
  32. package/dist/149.7089a654a1902207a2c8.bundle.js.map +1 -0
  33. package/dist/{151.2dae840b241433fbe1d8.bundle.js → 151.2104ac0782ac43e2e7d2.bundle.js} +2 -2
  34. package/dist/{151.2dae840b241433fbe1d8.bundle.js.map → 151.2104ac0782ac43e2e7d2.bundle.js.map} +1 -1
  35. package/dist/152.78baa98e298c18358c55.bundle.js +2 -0
  36. package/dist/152.78baa98e298c18358c55.bundle.js.map +1 -0
  37. package/dist/153.fd957ea6d6ea34d3feb2.bundle.js +2 -0
  38. package/dist/153.fd957ea6d6ea34d3feb2.bundle.js.map +1 -0
  39. package/dist/18.44723ea06155c72f46ae.bundle.js +1 -1
  40. package/dist/18.44723ea06155c72f46ae.bundle.js.map +1 -1
  41. package/dist/{2.3a65d34c46b96a708181.bundle.js → 2.6e340067f6eae14345cd.bundle.js} +2 -2
  42. package/dist/2.6e340067f6eae14345cd.bundle.js.map +1 -0
  43. package/dist/21.64fbe234fee75c83dda3.bundle.js +2 -0
  44. package/dist/21.64fbe234fee75c83dda3.bundle.js.map +1 -0
  45. package/dist/{23.9d969421ffc11412b35a.bundle.js → 23.acf56e52417b0fbca9f4.bundle.js} +2 -2
  46. package/dist/23.acf56e52417b0fbca9f4.bundle.js.map +1 -0
  47. package/dist/25.9e0925889b3a3f79c7fe.bundle.js +2 -0
  48. package/dist/25.9e0925889b3a3f79c7fe.bundle.js.map +1 -0
  49. package/dist/27.a53481ccfa58fbd0c801.bundle.js +2 -0
  50. package/dist/27.a53481ccfa58fbd0c801.bundle.js.map +1 -0
  51. package/dist/29.9bdb27c21d6eacac1341.bundle.js +1 -1
  52. package/dist/29.9bdb27c21d6eacac1341.bundle.js.map +1 -1
  53. package/dist/3.a1815b0ddb1630938d40.bundle.js +2 -0
  54. package/dist/3.a1815b0ddb1630938d40.bundle.js.map +1 -0
  55. package/dist/30.34b74ada583b1b0af913.bundle.js +2 -0
  56. package/dist/30.34b74ada583b1b0af913.bundle.js.map +1 -0
  57. package/dist/{44.dbb910f04027f51eeedd.bundle.js → 44.082e83be1a2eda5f197b.bundle.js} +2 -2
  58. package/dist/44.082e83be1a2eda5f197b.bundle.js.map +1 -0
  59. package/dist/48.f047a5ea62690543f8ad.bundle.js +2 -0
  60. package/dist/48.f047a5ea62690543f8ad.bundle.js.map +1 -0
  61. package/dist/5.1e4e7e36d894360b8d8f.bundle.js +2 -0
  62. package/dist/5.1e4e7e36d894360b8d8f.bundle.js.map +1 -0
  63. package/dist/67.3f75109fb8b71d88f6c7.bundle.js +2 -0
  64. package/dist/67.3f75109fb8b71d88f6c7.bundle.js.map +1 -0
  65. package/dist/68.e25480b7770a679a9654.bundle.js +1 -1
  66. package/dist/68.e25480b7770a679a9654.bundle.js.map +1 -1
  67. package/dist/8.5abe78e9d72cdbc2607f.bundle.js +3 -0
  68. package/dist/8.5abe78e9d72cdbc2607f.bundle.js.map +1 -0
  69. package/dist/{bundle.e65c5ca8080546fe24d7.bundle.js → bundle.7e4f5efd9843ba4c4905.bundle.js} +3 -3
  70. package/dist/bundle.7e4f5efd9843ba4c4905.bundle.js.map +1 -0
  71. package/dist/css/bootstrap-graphdb-theme.css +21 -3
  72. package/dist/css/clustermanagement.css +14 -1
  73. package/dist/css/fonts/icons.eot +0 -0
  74. package/dist/css/fonts/icons.svg +1 -0
  75. package/dist/css/fonts/icons.ttf +0 -0
  76. package/dist/css/fonts/icons.woff +0 -0
  77. package/dist/font/{icons.b601f6618abd131665211ff4ec9ad6b2.eot → icons.23e96f215ba03e98233de883d2c30b60.eot} +0 -0
  78. package/dist/img/{icons.6466330b5ada72a12e1aa10044720eec.svg → icons.ab6168834b8775f511d09c8fad540b27.svg} +1 -0
  79. package/dist/index.html +5 -5
  80. package/dist/js/angular/autocomplete/templates/modal/add-label.html +9 -8
  81. package/dist/js/angular/clustermanagement/templates/modal/add-nodes-dialog.html +17 -19
  82. package/dist/js/angular/clustermanagement/templates/modal/cluster-create-dialog.html +20 -21
  83. package/dist/js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html +8 -9
  84. package/dist/js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html +9 -8
  85. package/dist/js/angular/clustermanagement/templates/modal/remove-nodes-dialog.html +18 -19
  86. package/dist/js/angular/core/directives/queryeditor/templates/query-sample.html +10 -10
  87. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  88. package/dist/js/angular/core/templates/modal/copy-to-clipboard-modal.html +9 -10
  89. package/dist/js/angular/externalsync/templates/deleteConnector.html +4 -4
  90. package/dist/js/angular/graphexplore/templates/modal/save-graph.html +9 -10
  91. package/dist/js/angular/import/templates/settingsModal.html +231 -231
  92. package/dist/js/angular/settings/modal/location-settings.html +15 -16
  93. package/dist/js/angular/templates/modal/add-fedx-remote-repo.html +17 -15
  94. package/dist/js/angular/templates/modal/add-location.html +15 -15
  95. package/dist/js/angular/templates/modal/edit-location.html +8 -8
  96. package/dist/main.12e572893a7926387b80.css +1 -0
  97. package/dist/pages/autocomplete.html +1 -1
  98. package/dist/pages/choose-repository-type.html +1 -1
  99. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  100. package/dist/pages/create-index.html +5 -5
  101. package/dist/pages/createConnector.html +134 -137
  102. package/dist/pages/dependencies.html +1 -1
  103. package/dist/pages/domainRangeInfo.html +2 -2
  104. package/dist/pages/edit.html +1 -1
  105. package/dist/pages/explore.html +1 -1
  106. package/dist/pages/export.html +1 -1
  107. package/dist/pages/find.html +1 -1
  108. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  109. package/dist/pages/graphs-visualizations.html +7 -7
  110. package/dist/pages/home.html +1 -1
  111. package/dist/pages/import.html +1 -1
  112. package/dist/pages/jdbc-create.html +5 -5
  113. package/dist/pages/monitor/queries.html +1 -1
  114. package/dist/pages/monitor/resources.html +2 -2
  115. package/dist/pages/namespaces.html +2 -2
  116. package/dist/pages/plugins.html +1 -1
  117. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  118. package/dist/pages/rdfrank.html +2 -2
  119. package/dist/pages/repositories.html +2 -2
  120. package/dist/pages/repository.html +2 -2
  121. package/dist/pages/similarity-indexes.html +3 -3
  122. package/dist/pages/sparql-template-create.html +5 -5
  123. package/dist/pages/sparql.html +3 -3
  124. package/dist/pages/webapi.html +2 -2
  125. package/dist/plugins.js +3 -12
  126. package/dist/res/swagger/fonts/icons.woff +0 -0
  127. package/dist/res/swagger/index.html +27 -27
  128. package/package.json +1 -1
  129. package/dist/10.91f8aa0494201bb12b25.bundle.js.map +0 -1
  130. package/dist/104.42f8ece72006965c902d.bundle.js.map +0 -1
  131. package/dist/11.32f5a72d66bb699e9e8b.bundle.js.map +0 -1
  132. package/dist/111.a360abaec5e5926aae34.bundle.js +0 -2
  133. package/dist/111.a360abaec5e5926aae34.bundle.js.map +0 -1
  134. package/dist/112.83afabc13f11ea9e326e.bundle.js +0 -2
  135. package/dist/112.83afabc13f11ea9e326e.bundle.js.map +0 -1
  136. package/dist/113.9f4c896b53aa300a5f38.bundle.js +0 -2
  137. package/dist/113.9f4c896b53aa300a5f38.bundle.js.map +0 -1
  138. package/dist/114.afa49d7867c1ce3b08c2.bundle.js +0 -2
  139. package/dist/114.afa49d7867c1ce3b08c2.bundle.js.map +0 -1
  140. package/dist/115.bbf8829ee8f466f85862.bundle.js +0 -2
  141. package/dist/115.bbf8829ee8f466f85862.bundle.js.map +0 -1
  142. package/dist/116.a4460f77635888e013b1.bundle.js +0 -2
  143. package/dist/116.a4460f77635888e013b1.bundle.js.map +0 -1
  144. package/dist/119.e60f7d27cb5876b3a601.bundle.js +0 -2
  145. package/dist/119.e60f7d27cb5876b3a601.bundle.js.map +0 -1
  146. package/dist/123.207528c97d229de16991.bundle.js +0 -2
  147. package/dist/123.207528c97d229de16991.bundle.js.map +0 -1
  148. package/dist/130.c2f5c98e78bd22743ee4.bundle.js +0 -2
  149. package/dist/130.c2f5c98e78bd22743ee4.bundle.js.map +0 -1
  150. package/dist/138.84fb24a9535f4d6d8c59.bundle.js +0 -2
  151. package/dist/138.84fb24a9535f4d6d8c59.bundle.js.map +0 -1
  152. package/dist/149.8ca7b7242b61bd7a8363.bundle.js +0 -2
  153. package/dist/149.8ca7b7242b61bd7a8363.bundle.js.map +0 -1
  154. package/dist/152.bd0fd3cba70a2e267646.bundle.js +0 -2
  155. package/dist/152.bd0fd3cba70a2e267646.bundle.js.map +0 -1
  156. package/dist/153.9272a2423ac2aa6a148b.bundle.js +0 -2
  157. package/dist/153.9272a2423ac2aa6a148b.bundle.js.map +0 -1
  158. package/dist/2.3a65d34c46b96a708181.bundle.js.map +0 -1
  159. package/dist/21.111cc98aaf2436b81eea.bundle.js +0 -2
  160. package/dist/21.111cc98aaf2436b81eea.bundle.js.map +0 -1
  161. package/dist/23.9d969421ffc11412b35a.bundle.js.map +0 -1
  162. package/dist/25.fffc5233e718b047a34f.bundle.js +0 -2
  163. package/dist/25.fffc5233e718b047a34f.bundle.js.map +0 -1
  164. package/dist/27.357929bef6f5df788b8e.bundle.js +0 -2
  165. package/dist/27.357929bef6f5df788b8e.bundle.js.map +0 -1
  166. package/dist/3.36fe2e671f737648a477.bundle.js +0 -2
  167. package/dist/3.36fe2e671f737648a477.bundle.js.map +0 -1
  168. package/dist/30.e2cd19e99cf6ecdad6ac.bundle.js +0 -2
  169. package/dist/30.e2cd19e99cf6ecdad6ac.bundle.js.map +0 -1
  170. package/dist/44.dbb910f04027f51eeedd.bundle.js.map +0 -1
  171. package/dist/48.d1b4cfee2f0e084c1d73.bundle.js +0 -2
  172. package/dist/48.d1b4cfee2f0e084c1d73.bundle.js.map +0 -1
  173. package/dist/5.e112b0d6e101e0766cda.bundle.js +0 -2
  174. package/dist/5.e112b0d6e101e0766cda.bundle.js.map +0 -1
  175. package/dist/67.62375b1b4925fff2fe7c.bundle.js +0 -2
  176. package/dist/67.62375b1b4925fff2fe7c.bundle.js.map +0 -1
  177. package/dist/8.7f3059d43e0db8ff7dd5.bundle.js +0 -3
  178. package/dist/8.7f3059d43e0db8ff7dd5.bundle.js.map +0 -1
  179. package/dist/bundle.e65c5ca8080546fe24d7.bundle.js.map +0 -1
  180. package/dist/main.b9612509bb46028befd2.css +0 -1
@@ -0,0 +1,2 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[3,86],{40:function(e,t,n){"use strict";n.r(t),n.d(t,"NodeState",(function(){return o})),n.d(t,"LinkState",(function(){return r}));n(3),n(50);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"]},50:function(e,t){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",o),o.$inject=["$http"];const n="rest/cluster";function o(e){return{getClusterConfig:function(){return e.get(`${n}/config`)},createCluster:function(t){return e.post(`${n}/config`,t)},updateCluster:function(t){t.nodes&&delete t.nodes;return e.patch(`${n}/config`,t)},deleteCluster:function(t){const o=$.param({force:t});return e.delete(`${n}/config?${o}`)},addNodesToCluster:function(t){return e.post(`${n}/config/node`,{nodes:t})},removeNodesFromCluster:function(t){return e.delete(`${n}/config/node`,{data:{nodes:t},headers:{"Content-Type":"application/json"}})},getClusterStatus:function(){return e.get(`${n}/group/status`)},getNodeStatus:function(){return e.get(`${n}/node/status`)}}}}}]);
2
+ //# sourceMappingURL=3.a1815b0ddb1630938d40.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","CLUSTER_GROUP_ENDPOINT","get","groupConfiguration","post","patch","$","param","delete","nodesArray","headers"],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2B+F,GACvB,OAAOzM,EAAMoM,KAAK,GAAGH,gBAAsC,CAACtH,MAAO8H,KA5BnE5F,uBA+BJ,SAAgC4F,GAC5B,OAAOzM,EAAMwM,OAAO,GAAGP,gBAAsC,CAACzJ,KAAM,CAACmC,MAAO8H,GAAaC,QAAS,CAAC,eAAgB,uBA/BnH1L,iBAkCJ,WACI,OAAOhB,EAAMkM,IAAI,GAAGD,mBAlCpB3F,cAqCJ,WACI,OAAOtG,EAAMkM,IAAI,GAAGD","file":"3.a1815b0ddb1630938d40.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.locations.filter((location) => clusterConfiguration.nodes.includes(location.rpcAddress));\n $scope.locations = clusterModel.locations.filter((location) => !$scope.clusterNodes.includes(location));\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":""}
@@ -0,0 +1,2 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[30,67,68],{104:function(t,e,r){"use strict";r.r(e);r(3),r(9),r(73),r(74),r(8),r(30),r(31);angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.directives","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives"])},73:function(t,e,r){"use strict";r.r(e);r(3),r(11);const n="UPLOADING",i="PENDING",a="ERROR",s="DONE",o="NONE",l=angular.module("graphdb.framework.impex.import.controllers",["ui.bootstrap","toastr","graphdb.framework.core.services.repositories","graphdb.framework.utils.uriutils"]);l.controller("CommonCtrl",["$scope","$http","toastr","$interval","$repositories","$modal","$filter","$jwtAuth","$location","$translate","LicenseRestService",function(t,e,r,n,i,o,l,c,u,p,f){t.files=[],t.fileChecked={},t.checkAll=!1,t.popoverTemplateUrl="settingsPopoverTemplate.html",t.fileQuery="",t.getAppData=function(){f.getInfo().success((function(e){t.appData={},t.appData.properties={};for(let r=0;r<e.length;r++)t.appData.properties[e[r].key]={source:e[r].source,value:e[r].value};t.maxUploadFileSizeMB=t.appData.properties["graphdb.workbench.maxUploadSize"].value/1048576})).error((function(t){const e=getError(t);r.error(e,p.instant("common.error"))}))},t.getAppData(),t.fileFormats=["ttl","ttls","rdf","rj","n3","nt","nq","trig","trigs","trix","brf","owl","jsonld"];{const e=_.map(t.fileFormats,(function(t){return"."+t+".gz"})),r=_.map(t.fileFormats,(function(t){return"."+t}));t.fileFormatsExtended=_.reduce(_.union(e,r,[".zip"]),(function(t,e){return t+", "+e})),t.fileFormatsHuman=_.reduce(r,(function(t,e){return t+" "+e}))+p.instant("import.gz.zip"),t.textFileFormatsHuman=_.reduce(_.filter(r,(function(t){return".brf"!==t})),(function(t,e){return t+" "+e}))}t.updateListHttp=function(n){e({method:"GET",url:t.getBaseUrl()}).success((function(e){0===t.files.length||n?(t.files=e,_.forEach(t.files,(function(e){e.type||(e.type=t.defaultType)})),t.rebatch()):t.files.forEach((function(r){const n=_.find(e,_.matches({name:r.name}));r.status&&n&&_.assign(r,n),r.type||(r.type=t.defaultType)})),n&&"user"===t.viewType&&(t.files=_.filter(t.files,(function(t){return void 0!==t.status}))),t.showClearStatuses=_.filter(t.files,(function(t){return t.status===s||t.status===a})).length>0,t.savedSettings=_.mapKeys(_.filter(t.files,"parserSettings"),"name"),t.loader=!1})).error((function(e){r.warning(p.instant("import.error.could.not.get.files",{data:getError(e)})),t.loader=!1}))},t.$watch((function(){return $(t.tabId).is(":visible")}),(function(){$(t.tabId).is(":visible")&&(t.updateListHttp(!1),u.hash(t.viewType))})),t.updateList=function(e){t.canWriteActiveRepo()&&$(t.tabId).is(":visible")&&t.updateListHttp(e)},t.init=function(){t.setRestricted(),t.isRestricted||(t.updateList(!0),t.getSettings())},t.$on("repositoryIsSet",t.init),t.pullList=function(){const e=n((function(){t.updating||t.updateList(!1)}),4e3);t.$on("$destroy",(function(){n.cancel(e)}))},t.getVisibleFiles=function(){return l("filter")(t.files,{name:t.fileQuery,type:t.getTypeFilter()})},t.getTypeFilter=function(){return"server"!==t.viewType||"file"!==t.showItems&&"directory"!==t.showItems?"":t.showItems},t.selectAllFiles=function(){t.getVisibleFiles().forEach((function(e){t.fileChecked[e.name]=t.checkAll&&t.importable(e)}))},t.getSettingsFor=function(e,r){return r||_.isEmpty(e)||_.isEmpty(t.savedSettings[e])?angular.copy(t.defaultSettings):t.savedSettings[e]},t.setSettingsFor=function(e,r){t.settingsFor=e,t.settings=t.getSettingsFor(e,r),o.open({templateUrl:"js/angular/import/templates/settingsModal.html",controller:"SettingsModalCtrl",resolve:{settings:function(){return angular.copy(t.settings)},hasParserSettings:t.isLocalLocation,defaultSettings:function(){return t.defaultSettings},isMultiple:function(){return!e}},size:"lg"}).result.then((function(e){t.settings=e,""===t.settingsFor?t.importSelected():t.importFile(t.settingsFor,!0)}),(function(e){t.settings=e}))},t.updateImport=function(e,r){t.settingsFor=e,t.settings=t.getSettingsFor(e,r),t.importFile(e,!1)},t.stopImport=function(n){e({method:"DELETE",url:t.getBaseUrl(),params:{name:n.name,type:n.type}}).success((function(){t.updateList()})).error((function(t){r.warning(p.instant("import.error.could.not.stop",{data:getError(t)}))}))},t.importable=function(){return!0},t.hasImportable=function(){return _.filter(t.files,(function(e){return t.importable(e)})).length>0},t.showTable=function(){const e=t.files.length>0&&("user"===t.viewType||"server"===t.viewType);return t.checkAll&&t.switchBatch(!0),e},t.switchBatch=function(e){e?t.selectAllFiles():t.checkAll&&(t.checkAll=!1),t.batch=_.map(_.filter(t.files,(function(e){return t.fileChecked[e.name]&&t.importable(e)})),"name").length>0},t.rebatch=function(){const e={};t.batch=!1,_.each(t.files,(function(r){e[r.name]=t.fileChecked[r.name],t.batch|=t.fileChecked[r.name]})),t.batch||(t.checkAll=!1),t.fileChecked=e},t.getSelectedFiles=function(){return _.map(_.filter(t.getVisibleFiles(),(function(e){return t.fileChecked[e.name]&&t.importable(e)})),"name")},t.importSelected=function(e){const r=t.getSelectedFiles(),n=function(){const i=r.shift();i&&(e&&(t.settings=t.getSettingsFor(i)),t.importFile(i,!0,n))};n()};const m=function(n,i){e({method:"DELETE",url:t.getBaseUrl()+"/status",params:{remove:i},data:n,headers:{"Content-type":"application/json;charset=utf-8"}}).success((function(){t.updateList(!0)})).error((function(t){r.warning(p.instant("import.error.could.not.clear",{data:getError(t)}))}))};t.resetStatus=function(t){m(t,!1)},t.resetStatusSelected=function(){t.resetStatus(t.getSelectedFiles())},t.removeEntry=function(t){m(t,!0)},t.removeEntrySelected=function(){t.removeEntry(t.getSelectedFiles())},t.isLocalLocation=function(){const t=i.getActiveLocation();return t&&t.local},t.filterSettings=function(e){let r=_.omitBy(t.savedSettings[e],_.isNull);return r=_.omit(r,["repoLocationHash","status","message","name","data","type","format","fileNames","$$hashKey"]),_.map(_.keys(r),(function(t){return[t,r[t]]}))},t.getSettings=function(){t.canWriteActiveRepo()&&e({method:"GET",url:"rest/repositories/"+i.getActiveRepository()+"/import/settings/default"}).success((function(e){t.defaultSettings=e})).error((function(t){r.warning(p.instant("import.error.default.settings",{data:getError(t)}))}))},t.getBaseUrl=function(){return"rest/repositories/"+i.getActiveRepository()+"/import/"+t.viewUrl},t.pritifySettings=function(t){return JSON.stringify(t,null," ")},t.toTitleCase=function(t){return t?_.upperFirst(t.toLowerCase()):t}}]),l.controller("ImportCtrl",["$scope","$http","toastr","$controller",function(t,e,r,n){t.loader=!0,angular.extend(this,n("CommonCtrl",{$scope:t})),t.viewUrl="server",t.defaultType="server",t.tabId="#import-server",t.showItems="all",t.pullList();const i=function(n,i){t.canWriteActiveRepo()&&e({method:"POST",url:t.getBaseUrl(),data:{importSettings:i?null:t.settings,fileNames:n}}).success((function(){t.updateList(),t.batch=!1,t.fileChecked={}})).error((function(t){r.error($translate.instant("import.could.not.send.file",{data:getError(t)}))}))};t.importSelected=function(e){const r=t.getSelectedFiles();i(r,e)},t.importFile=function(t){i([t])},t.init()}]),l.controller("UploadCtrl",["$scope","Upload","$http","toastr","$controller","$modal","$translate",function(t,e,r,s,l,c,u){t.loader=!0,angular.extend(this,l("CommonCtrl",{$scope:t})),t.viewUrl="upload",t.defaultType="file",t.tabId="#import-user",t.pullList(),t.currentFiles=[],t.importable=function(){return!0},t.fileSelected=function(t,e,r,n,i){i.length>0&&i.forEach((function(t){s.warning(u.instant("import.large.file",{name:t.name,size:Math.floor(t.size/1048576)}))}))},t.$watchCollection("currentFiles",(function(){t.currentFiles&&t.currentFiles.forEach((function(e){if("bz2"===e.name.substr(e.name.lastIndexOf(".")+1)){const r=t.currentFiles.indexOf(e);r>-1&&t.currentFiles.splice(r,1),s.error(u.instant("import.could.not.upload",{name:e.name}))}})),t.files=_.uniqBy(_.union(_.map(t.currentFiles,(function(t){return{name:t.name,type:"file",file:t}})),t.files),(function(t){return t.name})),t.savedSettings=_.mapKeys(_.filter(t.files,"parserSettings"),"name"),_.each(t.currentFiles,(function(e){t.updateImport(e.name)}))})),t.importFile=function(o,l,c){const p=_.findIndex(t.files,{name:o});if(p<0)s.warning(u.instant("import.no.such.file",{name:o}));else{const o=t.files[p];if("text"===o.type)t.settings.name=o.name,t.settings.type=o.type,t.settings.data=o.data,t.settings.format=o.format,o.status=i,r({method:"POST",url:t.getBaseUrl()+(l?"":"/update")+"/text",data:t.settings}).success((function(){t.updateList()})).error((function(t){s.error(u.instant("import.could.not.send.data",{data:getError(t)})),o.status=a,o.message=getError(t)})).finally(c||function(){});else if("url"===o.type)t.settings.name=o.name,t.settings.type=o.type,t.settings.data=o.data,t.settings.format=o.format,o.status=i,r({method:"POST",url:t.getBaseUrl()+(l?"":"/update")+"/url",data:t.settings}).success((function(){t.updateList()})).error((function(t){s.error(u.instant("import.could.not.send.url",{data:getError(t)}))})).finally(c||function(){});else{let r;t.settings.name=o.name,r=o.file?{file:o.file,importSettings:e.jsonBlob(t.settings)}:{importSettings:e.jsonBlob(t.settings)},e.upload({url:t.getBaseUrl()+(l?"":"/update")+"/file",data:r}).progress((function(t){if(o.file?(o.file=null,o.status=n):o.status!==n&&(o.status=i),o.status===n){const e=parseInt(100*t.loaded/t.total);o.message=e+"% uploaded"}})).success((function(){t.updateList()})).error((function(t){s.error(u.instant("import.could.not.upload.file",{data:getError(t)})),o.status=a,o.message=getError(t)})).finally(c||function(){})}}},t.updateTextImport=function(e){t.updating=!0,r({method:"POST",url:t.getBaseUrl()+"/update/text",data:e}).success((function(t){})).error((function(t){s.error(u.instant("import.could.not.update.text",{data:getError(t)}))})).finally((function(){t.updating=!1}))},t.pastedDataIdx=1;const p=function(){const t=new Date;return t.getFullYear()+"-"+_.padStart(t.getMonth()+1,2,"0")+"-"+_.padStart(t.getDate(),2,"0")+" "+_.padStart(t.getHours(),2,"0")+":"+_.padStart(t.getMinutes(),2,"0")+":"+_.padStart(t.getSeconds(),2,"0")+"."+_.padStart(t.getMilliseconds(),3,"0")};t.pasteData=function(e){e&&e.data,c.open({templateUrl:"js/angular/import/templates/textSnippet.html",controller:"TextCtrl",resolve:{text:function(){return e?e.data:""},format:function(){return e?e.format:"text/turtle"}}}).result.then((function(r){e?(e.data===r.text&&e.format===r.format||e.status===o||(e.status=o,e.message=u.instant("import.text.snippet.not.imported")),e.data=r.text,e.format=r.format,t.updateTextImport(e)):(e={type:"text",name:"Text snippet "+p(),format:r.format,data:r.text},t.files.unshift(e),t.updateImport(e.name)),r.startImport&&t.setSettingsFor(e.name)}))},t.rdfDataFromURL=function(){c.open({templateUrl:"js/angular/import/templates/urlImport.html",controller:"UrlCtrl",scope:t}).result.then((function(e){const r=_.find(t.files,{type:"url",name:e.url});r?r.format=e.format:t.files.unshift({type:"url",name:e.url,format:e.format,data:e.url}),t.updateImport(e.url,!0),e.startImport&&t.setSettingsFor(e.url,!0)}))},t.init()}]),l.controller("UrlCtrl",["$scope","$modalInstance","toastr",function(t,e){t.importFormat={name:"Auto",type:""},t.startImport=!0,t.cancel=function(){e.dismiss()},t.ok=function(){e.close({url:t.dataUrl,format:t.importFormat.type,startImport:t.startImport})}}]),l.controller("TextCtrl",["$scope","$modalInstance","text","format",function(t,e,r,n){t.importFormats=[{name:"RDF/JSON",type:"application/rdf+json"},{name:"JSON-LD",type:"application/ld+json"},{name:"RDF/XML",type:"application/rdf+xml"},{name:"N3",type:"text/rdf+n3"},{name:"N-Triples",type:"text/plain"},{name:"N-Quads",type:"text/x-nquads"},{name:"Turtle",type:"text/turtle"},{name:"Turtle*",type:"application/x-turtlestar"},{name:"TriX",type:"application/trix"},{name:"TriG",type:"application/x-trig"},{name:"TriG*",type:"application/x-trigstar"}],t.rdfText=r,t.importFormat=_.find(t.importFormats,{type:n}),t.startImport=!0,t.setFormat=function(e){t.importFormat=e},t.cancel=function(){e.dismiss()},t.ok=function(){e.close({text:t.rdfText,format:t.importFormat.type,startImport:t.startImport})}}]),l.controller("TabCtrl",["$scope","$location",function(t,e){t.viewType=e.hash(),"user"!==t.viewType&&"server"!==t.viewType&&(t.viewType="user"),t.isCollapsed=!1,"user"===t.viewType?t.templateUrl="js/angular/import/templates/uploadInfo.html":t.templateUrl="js/angular/import/templates/importInfo.html",t.changeHelpTemplate=function(e){t.templateUrl="js/angular/import/templates/"+e},t.commonUrl="js/angular/import/templates/commonInfo.html"}]),l.controller("SettingsModalCtrl",["$scope","$modalInstance","toastr","UriUtils","settings","hasParserSettings","defaultSettings","isMultiple","$translate",function(t,e,r,n,i,a,s,o,l){t.hasError=function(t,e){return _.find(t,(function(t){return e===t.$name}))},t.settings=i,t.hasParserSettings=a,t.settings.context?"default"===t.settings.context?(t.target="default",t.settings.context=""):t.target="named":t.target="data",t.isMultiple=o,t.enableReplace=!(!t.settings.replaceGraphs||!t.settings.replaceGraphs.length);const c=function(){"default"===t.target?t.settings.context="default":"data"===t.target&&(t.settings.context=""),t.enableReplace?"default"!==t.target&&"named"!==t.target||(t.settings.replaceGraphs=[t.settings.context]):t.settings.replaceGraphs=[]};t.ok=function(){t.settingsForm.replaceGraph.$setValidity("replaceGraph",!0),t.settingsForm.$valid&&(c(),e.close(t.settings))},t.cancel=function(){c(),e.dismiss(t.settings)},t.reset=function(){t.settings=angular.copy(s),t.target="data"},t.addReplaceGraph=function(e){let i=!0;"default"!==e&&(i=n.isValidIri(e)),t.settingsForm.replaceGraph.$setTouched(),t.settingsForm.replaceGraph.$setValidity("replaceGraph",i),t.settingsForm.replaceGraph.$valid&&(t.settings.replaceGraphs=t.settings.replaceGraphs||[],-1===_.indexOf(t.settings.replaceGraphs,e)?(t.replaceGraph="",t.settings.replaceGraphs.push(e)):r.warning(l.instant("import.graph.already.in.list")))},t.checkEnterReplaceGraph=function(e,r){13===e.keyCode&&(e.preventDefault(),t.addReplaceGraph(r))},t.showAdvancedSettings=!1,t.switchParserSettings=function(){t.showAdvancedSettings=!t.showAdvancedSettings}}])},74:function(t,e,r){"use strict";r.r(e);r(3),r(11);const n=angular.module("graphdb.framework.impex.import.directives",["graphdb.framework.utils.uriutils"]);n.directive("validateUri",["UriUtils",function(t){return{restrict:"A",require:"ngModel",link:function(e,r,n,i){i.$parsers.unshift((function(r){let n=!0;return"named"===e.target&&(n=t.isValidIri(r)),i.$setValidity("validateUri",n),r}))}}}]),n.directive("filesTable",(function(){return{restrict:"A",templateUrl:"js/angular/import/templates/filesTable.html"}})),n.directive("filesOntoLoader",(function(){return{link:function(t,e,r){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+r.size+'" height="'+r.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.0.0-RC2">{{\'common.loading\' | translate}}</object>')}))}}}))}}]);
2
+ //# sourceMappingURL=30.34b74ada583b1b0af913.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///./src/js/angular/import/app.js","webpack:///./src/js/angular/import/controllers.js","webpack:///./src/js/angular/import/directives.js"],"names":["angular","module","FILE_STATUS","importCtrl","controller","$scope","$http","toastr","$interval","$repositories","$modal","$filter","$jwtAuth","$location","$translate","LicenseRestService","files","fileChecked","checkAll","popoverTemplateUrl","fileQuery","getAppData","getInfo","success","data","appData","properties","i","length","key","source","value","maxUploadFileSizeMB","error","msg","getError","instant","fileFormats","gzs","_","map","f","basics","fileFormatsExtended","reduce","union","el","all","fileFormatsHuman","textFileFormatsHuman","filter","updateListHttp","force","method","url","getBaseUrl","forEach","type","defaultType","rebatch","remoteStatus","find","matches","name","status","assign","viewType","undefined","showClearStatuses","file","savedSettings","mapKeys","loader","warning","$watch","$","tabId","is","hash","updateList","canWriteActiveRepo","init","setRestricted","isRestricted","getSettings","$on","pullList","timer","updating","cancel","getVisibleFiles","getTypeFilter","showItems","selectAllFiles","importable","getSettingsFor","fileName","withDefaultSettings","isEmpty","copy","defaultSettings","setSettingsFor","settingsFor","settings","open","templateUrl","resolve","hasParserSettings","isLocalLocation","isMultiple","size","result","then","importSelected","importFile","updateImport","stopImport","params","hasImportable","showTable","switchBatch","batch","newFileChecked","each","getSelectedFiles","overrideSettings","selectedFileNames","importNext","shift","resetStatusOrRemoveEntry","names","remove","headers","resetStatus","resetStatusSelected","removeEntry","removeEntrySelected","location","getActiveLocation","local","filterSettings","filtered","omitBy","isNull","omit","keys","getActiveRepository","viewUrl","pritifySettings","JSON","stringify","toTitleCase","s","upperFirst","toLowerCase","$controller","extend","this","importServerFiles","importSettings","fileNames","Upload","currentFiles","fileSelected","$files","$file","$newFiles","$duplicateFiles","$invalidFiles","Math","floor","$watchCollection","substr","lastIndexOf","fileIdx","indexOf","splice","uniqBy","startImport","nextCallback","fileIndex","findIndex","format","message","finally","jsonBlob","upload","progress","evt","progressPercentage","parseInt","loaded","total","updateTextImport","pastedDataIdx","formattedDate","date","Date","getFullYear","padStart","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","pasteData","text","unshift","rdfDataFromURL","scope","existing","$modalInstance","importFormat","dismiss","ok","close","dataUrl","importFormats","rdfText","setFormat","isCollapsed","changeHelpTemplate","templateFile","commonUrl","UriUtils","hasError","input","o","context","target","enableReplace","replaceGraphs","fixSettings","settingsForm","replaceGraph","$setValidity","$valid","reset","addReplaceGraph","graph","valid","isValidIri","$setTouched","push","checkEnterReplaceGraph","event","keyCode","preventDefault","showAdvancedSettings","switchParserSettings","importDirectives","directive","restrict","require","link","element","attr","ctrl","$parsers","has","append"],"mappings":"iGAAA,8CAmBAA,QAAQC,OAAO,iCAXC,CACZ,SACA,UACA,eACA,eACA,4CACA,6CACA,+CACA,uC,gCChBJ,kBAGA,MAAMC,EACW,YADXA,EAES,UAFTA,EAGO,QAHPA,EAIM,OAJNA,EAKM,OAUNC,EAAaH,QAAQC,OAAO,6CAPlB,CACZ,eACA,SACA,+CACA,qCAKJE,EAAWC,WAAW,aAAc,CAAC,SAAU,QAAS,SAAU,YAAa,gBAAiB,SAAU,UAAW,WAAY,YAAa,aAAc,qBACxJ,SAAUC,EAAQC,EAAOC,EAAQC,EAAWC,EAAeC,EAAQC,EAASC,EAAUC,EAAWC,EAAYC,GACzGV,EAAOW,MAAQ,GACfX,E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ND,EAAME,iBAENnP,EAAO0O,gBAAgBC,KAI/B3O,EAAOoP,sBAAuB,EAC9BpP,EAAOqP,qBAAuB,WAC1BrP,EAAOoP,sBAAwBpP,EAAOoP,0B,gCCjyB9C,kBAGA,MAAME,EAAmB3P,QAAQC,OAAO,4CAA6C,CACjF,qCAGJ0P,EAAiBC,UAAU,cAAe,CAAC,WAAY,SAAU3B,GAC7D,MAAO,CACH4B,SAAU,IACVC,QAAS,UACTC,KAAM,SAAU7C,EAAO8C,EAASC,EAAMC,GAClCA,EAAKC,SAASnD,SAAQ,SAAUjL,GAC5B,IAAIkN,GAAQ,EAQZ,MANqB,UAAjB/B,EAAMoB,SACNW,EAAQhB,EAASiB,WAAWnN,IAGhCmO,EAAKtB,aAAa,cAAeK,GAE1BlN,UAMvB4N,EAAiBC,UAAU,cAAc,WACrC,MAAO,CACHC,SAAU,IACVpJ,YAAa,kDAIrBkJ,EAAiBC,UAAU,mBAAmB,WAC1C,MAAO,CACHG,KAAM,SAAU7C,EAAO8C,EAASC,GAC5B/C,EAAMxI,OAAO,eAAe,WACE,cAAtBwI,EAAM7I,KAAKL,QAAgD,cAAtBkJ,EAAM7I,KAAKL,SAC3CW,EAAEqL,GAASI,IAAI,UAAUxO,OAAS,GACnC+C,EAAEqL,GAASK,OAAO,kBAAoBJ,EAAKnJ,KAAO,aAAemJ,EAAKnJ,KAAO","file":"30.34b74ada583b1b0af913.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers';\nimport 'angular/import/directives';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.directives',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.core.directives'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","import 'angular/core/services';\nimport 'angular/utils/uri-utils';\n\nconst FILE_STATUS = {\n 'UPLOADING': 'UPLOADING',\n 'PENDING': 'PENDING',\n 'ERROR': 'ERROR',\n 'DONE': 'DONE',\n 'NONE': 'NONE'\n};\n\nconst modules = [\n 'ui.bootstrap',\n 'toastr',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.utils.uriutils'\n];\n\nconst importCtrl = angular.module('graphdb.framework.impex.import.controllers', modules);\n\nimportCtrl.controller('CommonCtrl', ['$scope', '$http', 'toastr', '$interval', '$repositories', '$modal', '$filter', '$jwtAuth', '$location', '$translate', 'LicenseRestService',\n function ($scope, $http, toastr, $interval, $repositories, $modal, $filter, $jwtAuth, $location, $translate, LicenseRestService) {\n $scope.files = [];\n $scope.fileChecked = {};\n $scope.checkAll = false;\n $scope.popoverTemplateUrl = 'settingsPopoverTemplate.html';\n $scope.fileQuery = '';\n\n $scope.getAppData = function () {\n LicenseRestService.getInfo().success(function (data) {\n $scope.appData = {};\n\n $scope.appData.properties = {};\n\n for (let i = 0; i < data.length; i++) {\n $scope.appData.properties[data[i].key] = {\n source: data[i].source,\n value: data[i].value\n };\n }\n $scope.maxUploadFileSizeMB = $scope.appData.properties['graphdb.workbench.maxUploadSize'].value / (1024 * 1024);\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n });\n };\n\n $scope.getAppData();\n\n $scope.fileFormats = ['ttl', 'ttls', 'rdf', 'rj', 'n3', 'nt', 'nq', 'trig', 'trigs', 'trix', 'brf', 'owl', 'jsonld'];\n\n {\n const gzs = _.map($scope.fileFormats, function (f) {\n return '.' + f + '.gz';\n });\n const basics = _.map($scope.fileFormats, function (f) {\n return '.' + f;\n });\n $scope.fileFormatsExtended = _.reduce(_.union(gzs, basics, ['.zip']), function (el, all) {\n return el + ', ' + all;\n });\n $scope.fileFormatsHuman = _.reduce(basics, function (el, all) {\n return el + ' ' + all;\n }) + $translate.instant('import.gz.zip');\n $scope.textFileFormatsHuman = _.reduce(_.filter(basics, function (el) {\n return el !== '.brf';\n }),\n function (el, all) {\n return el + ' ' + all;\n });\n }\n\n $scope.updateListHttp = function (force) {\n $http({\n method: 'GET',\n url: $scope.getBaseUrl()\n }).success(function (data) {\n if ($scope.files.length === 0 || force) {\n $scope.files = data;\n _.forEach($scope.files, function (f) {\n if (!f.type) {\n f.type = $scope.defaultType;\n }\n });\n $scope.rebatch();\n } else {\n $scope.files.forEach(function (f) {\n const remoteStatus = _.find(data, _.matches({'name': f.name}));\n if (f.status && remoteStatus) {\n _.assign(f, remoteStatus);\n }\n if (!f.type) {\n f.type = $scope.defaultType;\n }\n });\n }\n // Need new status here\n if (force && 'user' === $scope.viewType) {\n $scope.files = _.filter($scope.files, function (f) {\n return f.status !== undefined;\n });\n }\n $scope.showClearStatuses = _.filter($scope.files, function (file) {\n return file.status === FILE_STATUS.DONE || file.status === FILE_STATUS.ERROR;\n }).length > 0;\n\n $scope.savedSettings = _.mapKeys(_.filter($scope.files, 'parserSettings'), 'name');\n\n $scope.loader = false;\n }).error(function (data) {\n toastr.warning($translate.instant('import.error.could.not.get.files', {data: getError(data)}));\n $scope.loader = false;\n });\n };\n\n // update the list instantly when the tab is changed\n $scope.$watch(function () {\n return $($scope.tabId).is(':visible');\n }, function () {\n if ($($scope.tabId).is(':visible')) {\n $scope.updateListHttp(false);\n $location.hash($scope.viewType);\n }\n });\n\n $scope.updateList = function (force) {\n if (!$scope.canWriteActiveRepo()) {\n return;\n }\n\n if (!$($scope.tabId).is(':visible')) {\n return;\n }\n $scope.updateListHttp(force);\n };\n\n $scope.init = function () {\n // Update restricted on repositoryIsSet\n $scope.setRestricted();\n if ($scope.isRestricted) {\n return;\n }\n $scope.updateList(true);\n $scope.getSettings();\n };\n\n $scope.$on('repositoryIsSet', $scope.init);\n\n $scope.pullList = function () {\n const timer = $interval(function () {\n // Skip iteration if we are updating something\n if (!$scope.updating) {\n $scope.updateList(false);\n }\n }, 4000);\n $scope.$on('$destroy', function () {\n $interval.cancel(timer);\n });\n };\n\n $scope.getVisibleFiles = function () {\n return $filter('filter')($scope.files, {name: $scope.fileQuery, type: $scope.getTypeFilter()});\n };\n\n $scope.getTypeFilter = function () {\n if ($scope.viewType === 'server' && ($scope.showItems === 'file' || $scope.showItems === 'directory')) {\n return $scope.showItems;\n } else {\n return '';\n }\n };\n\n $scope.selectAllFiles = function () {\n $scope.getVisibleFiles().forEach(function (file) {\n $scope.fileChecked[file.name] = $scope.checkAll && $scope.importable(file);\n });\n };\n\n $scope.getSettingsFor = function (fileName, withDefaultSettings) {\n if (!withDefaultSettings && !_.isEmpty(fileName) && !_.isEmpty($scope.savedSettings[fileName])) {\n return $scope.savedSettings[fileName];\n } else {\n return angular.copy($scope.defaultSettings);\n }\n };\n\n $scope.setSettingsFor = function (fileName, withDefaultSettings) {\n $scope.settingsFor = fileName;\n $scope.settings = $scope.getSettingsFor(fileName, withDefaultSettings);\n\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/import/templates/settingsModal.html',\n controller: 'SettingsModalCtrl',\n resolve: {\n settings: function () {\n return angular.copy($scope.settings);\n },\n hasParserSettings: $scope.isLocalLocation,\n defaultSettings: function () {\n return $scope.defaultSettings;\n },\n isMultiple: function () {\n return !fileName;\n }\n },\n size: 'lg'\n });\n\n\n modalInstance.result.then(function (settings) {\n $scope.settings = settings;\n if ($scope.settingsFor === '') {\n $scope.importSelected();\n } else {\n $scope.importFile($scope.settingsFor, true);\n }\n\n }, function (settings) {\n $scope.settings = settings;\n });\n };\n\n $scope.updateImport = function (fileName, withDefaultSettings) {\n $scope.settingsFor = fileName;\n $scope.settings = $scope.getSettingsFor(fileName, withDefaultSettings);\n\n $scope.importFile(fileName, false);\n };\n\n $scope.stopImport = function (file) {\n $http({\n method: 'DELETE',\n url: $scope.getBaseUrl(),\n params: {name: file.name, type: file.type}\n }).success(function () {\n $scope.updateList();\n }).error(function (data) {\n toastr.warning($translate.instant('import.error.could.not.stop', {data: getError(data)}));\n });\n };\n\n $scope.importable = function () {\n return true;\n };\n\n $scope.hasImportable = function () {\n return _.filter($scope.files, function (f) {\n return $scope.importable(f);\n }).length > 0;\n };\n\n $scope.showTable = function () {\n const showTable = $scope.files.length > 0 && ('user' === $scope.viewType || 'server' === $scope.viewType);\n if ($scope.checkAll) {\n $scope.switchBatch(true);\n }\n return showTable;\n };\n\n $scope.switchBatch = function (all) {\n if (all) {\n $scope.selectAllFiles();\n } else {\n if ($scope.checkAll) {\n $scope.checkAll = false;\n }\n }\n $scope.batch = _.map(_.filter($scope.files, function (f) {\n return $scope.fileChecked[f.name] && $scope.importable(f);\n }), 'name').length > 0;\n };\n\n $scope.rebatch = function () {\n const newFileChecked = {};\n $scope.batch = false;\n _.each($scope.files, function (file) {\n newFileChecked[file.name] = $scope.fileChecked[file.name];\n $scope.batch |= $scope.fileChecked[file.name];\n });\n if (!$scope.batch) {\n $scope.checkAll = false;\n }\n $scope.fileChecked = newFileChecked;\n };\n\n $scope.getSelectedFiles = function () {\n return _.map(_.filter($scope.getVisibleFiles(), function (f) {\n return $scope.fileChecked[f.name] && $scope.importable(f);\n }), 'name');\n };\n\n $scope.importSelected = function (overrideSettings) {\n const selectedFileNames = $scope.getSelectedFiles();\n\n // Calls the REST API sequentially for the selected files\n const importNext = function () {\n const fileName = selectedFileNames.shift();\n if (fileName) {\n if (overrideSettings) {\n $scope.settings = $scope.getSettingsFor(fileName);\n }\n $scope.importFile(fileName, true, importNext);\n }\n };\n\n importNext();\n };\n\n const resetStatusOrRemoveEntry = function (names, remove) {\n $http({\n method: 'DELETE',\n url: $scope.getBaseUrl() + '/status',\n params: {remove: remove},\n data: names,\n headers: {'Content-type': 'application/json;charset=utf-8'}\n }).success(function () {\n $scope.updateList(true);\n }).error(function (data) {\n toastr.warning($translate.instant('import.error.could.not.clear', {data: getError(data)}));\n });\n };\n\n $scope.resetStatus = function (names) {\n resetStatusOrRemoveEntry(names, false);\n };\n\n $scope.resetStatusSelected = function () {\n $scope.resetStatus($scope.getSelectedFiles());\n };\n\n $scope.removeEntry = function (names) {\n resetStatusOrRemoveEntry(names, true);\n };\n\n $scope.removeEntrySelected = function () {\n $scope.removeEntry($scope.getSelectedFiles());\n };\n\n $scope.isLocalLocation = function () {\n const location = $repositories.getActiveLocation();\n return location && location.local;\n };\n // Settings\n\n $scope.filterSettings = function (fileName) {\n let filtered = _.omitBy($scope.savedSettings[fileName], _.isNull);\n filtered = _.omit(filtered, ['repoLocationHash', 'status', 'message', 'name', 'data', 'type', 'format', 'fileNames', '$$hashKey']);\n return _.map(_.keys(filtered), function (key) {\n return [key, filtered[key]];\n });\n };\n\n $scope.getSettings = function () {\n if (!$scope.canWriteActiveRepo()) {\n return;\n }\n\n $http({\n method: 'GET',\n url: 'rest/repositories/' + $repositories.getActiveRepository() + '/import/settings/default'\n }).success(function (data) {\n $scope.defaultSettings = data;\n }).error(function (data) {\n toastr.warning($translate.instant('import.error.default.settings', {data: getError(data)}));\n });\n };\n\n $scope.getBaseUrl = function () {\n return 'rest/repositories/' + $repositories.getActiveRepository() + '/import/' + $scope.viewUrl;\n };\n\n $scope.pritifySettings = function (settings) {\n return JSON.stringify(settings, null, ' ');\n };\n\n $scope.toTitleCase = function (s) {\n if (!s) {\n return s;\n }\n return _.upperFirst(s.toLowerCase());\n };\n }]);\n\nimportCtrl.controller('ImportCtrl', ['$scope', '$http', 'toastr', '$controller', function ($scope, $http, toastr, $controller) {\n $scope.loader = true;\n angular.extend(this, $controller('CommonCtrl', {$scope: $scope}));\n $scope.viewUrl = 'server';\n $scope.defaultType = 'server';\n $scope.tabId = '#import-server';\n $scope.showItems = 'all';\n\n $scope.pullList();\n\n const importServerFiles = function (selectedFileNames, overrideSettings) {\n if (!$scope.canWriteActiveRepo()) {\n return;\n }\n\n $http({\n method: 'POST',\n url: $scope.getBaseUrl(),\n data: {importSettings: overrideSettings ? null : $scope.settings, fileNames: selectedFileNames}\n }).success(function () {\n $scope.updateList();\n $scope.batch = false;\n $scope.fileChecked = {};\n }).error(function (data) {\n toastr.error($translate.instant('import.could.not.send.file', {data: getError(data)}));\n });\n };\n\n $scope.importSelected = function (overrideSettings) {\n const selectedFileNames = $scope.getSelectedFiles();\n importServerFiles(selectedFileNames, overrideSettings);\n };\n\n $scope.importFile = function (fileName) {\n importServerFiles([fileName]);\n };\n\n $scope.init();\n}]);\n\nimportCtrl.controller('UploadCtrl', ['$scope', 'Upload', '$http', 'toastr', '$controller', '$modal', '$translate', function ($scope, Upload, $http, toastr, $controller, $modal, $translate) {\n $scope.loader = true;\n angular.extend(this, $controller('CommonCtrl', {$scope: $scope}));\n $scope.viewUrl = 'upload';\n $scope.defaultType = 'file';\n $scope.tabId = '#import-user';\n\n $scope.pullList();\n\n $scope.currentFiles = [];\n\n $scope.importable = function () {\n return true;\n };\n\n $scope.fileSelected = function ($files, $file, $newFiles, $duplicateFiles, $invalidFiles) {\n if ($invalidFiles.length > 0) {\n $invalidFiles.forEach(function (f) {\n toastr.warning($translate.instant('import.large.file', {name: f.name, size: Math.floor(f.size / (1024 * 1024))}));\n });\n }\n };\n\n $scope.$watchCollection('currentFiles', function () {\n function disallowBZip2Files() {\n $scope.currentFiles.forEach(function (f) {\n if (f.name.substr(f.name.lastIndexOf('.') + 1) === 'bz2') {\n const fileIdx = $scope.currentFiles.indexOf(f);\n if (fileIdx > -1) {\n $scope.currentFiles.splice(fileIdx, 1);\n }\n toastr.error($translate.instant('import.could.not.upload', {name: f.name}));\n }\n });\n }\n\n if ($scope.currentFiles) {\n // RDF4J does not support decompressing .bz2 files so we want to reject importing them\n disallowBZip2Files();\n }\n $scope.files = _.uniqBy(\n _.union(\n _.map($scope.currentFiles, function (file) {\n return {name: file.name, type: 'file', file: file}\n }),\n $scope.files\n ),\n function (file) {\n return file.name;\n }\n );\n $scope.savedSettings = _.mapKeys(_.filter($scope.files, 'parserSettings'), 'name');\n _.each($scope.currentFiles, function (file) {\n $scope.updateImport(file.name);\n });\n });\n\n $scope.importFile = function (fileName, startImport, nextCallback) {\n const fileIndex = _.findIndex($scope.files, {name: fileName});\n if (fileIndex < 0) {\n toastr.warning($translate.instant('import.no.such.file', {name: fileName}));\n } else {\n const file = $scope.files[fileIndex];\n if (file.type === 'text') {\n // Import text snippet\n $scope.settings.name = file.name;\n $scope.settings.type = file.type;\n $scope.settings.data = file.data;\n $scope.settings.format = file.format;\n file.status = FILE_STATUS.PENDING;\n $http({\n method: 'POST',\n url: $scope.getBaseUrl() + (startImport ? '' : '/update') + '/text',\n data: $scope.settings\n }).success(function () {\n $scope.updateList();\n }).error(function (data) {\n toastr.error($translate.instant('import.could.not.send.data', {data: getError(data)}));\n file.status = FILE_STATUS.ERROR;\n file.message = getError(data);\n }).finally(nextCallback || function () {\n });\n } else if (file.type === 'url') {\n // Submit URL\n $scope.settings.name = file.name;\n $scope.settings.type = file.type;\n $scope.settings.data = file.data;\n $scope.settings.format = file.format;\n file.status = FILE_STATUS.PENDING;\n $http({\n method: 'POST',\n url: $scope.getBaseUrl() + (startImport ? '' : '/update') + '/url',\n data: $scope.settings\n }).success(function () {\n $scope.updateList();\n }).error(function (data) {\n toastr.error($translate.instant('import.could.not.send.url', {data: getError(data)}));\n }).finally(nextCallback || function () {\n });\n } else {\n // Upload real file\n $scope.settings.name = file.name;\n let data;\n if (file.file) {\n data = {file: file.file, importSettings: Upload.jsonBlob($scope.settings)};\n } else {\n data = {importSettings: Upload.jsonBlob($scope.settings)};\n }\n Upload.upload({\n url: $scope.getBaseUrl() + (startImport ? '' : '/update') + '/file',\n data: data\n }).progress(function (evt) {\n if (file.file) {\n file.file = null;\n file.status = FILE_STATUS.UPLOADING;\n } else if (file.status !== FILE_STATUS.UPLOADING) {\n file.status = FILE_STATUS.PENDING;\n }\n\n if (file.status === FILE_STATUS.UPLOADING) {\n const progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\n file.message = progressPercentage + '% uploaded';\n }\n }).success(function () {\n $scope.updateList();\n }).error(function (data) {\n toastr.error($translate.instant('import.could.not.upload.file', {data: getError(data)}));\n file.status = FILE_STATUS.ERROR;\n file.message = getError(data);\n }).finally(nextCallback || function () {\n });\n }\n }\n };\n\n $scope.updateTextImport = function (settings) {\n $scope.updating = true;\n $http({\n method: 'POST',\n url: $scope.getBaseUrl() + '/update/text',\n data: settings\n }).success(function (data) {\n }).error(function (data) {\n toastr.error($translate.instant('import.could.not.update.text', {data: getError(data)}));\n }).finally(function () {\n $scope.updating = false;\n });\n };\n\n $scope.pastedDataIdx = 1;\n\n const formattedDate = function () {\n const date = new Date();\n return date.getFullYear() + '-' + _.padStart(date.getMonth() + 1, 2, '0') + '-' + _.padStart(date.getDate(), 2, '0')\n + ' ' + _.padStart(date.getHours(), 2, '0') + ':' + _.padStart(date.getMinutes(), 2, '0') + ':' + _.padStart(date.getSeconds(), 2, '0')\n + '.' + _.padStart(date.getMilliseconds(), 3, '0');\n };\n\n $scope.pasteData = function (file) {\n const scope = {};\n if (file) {\n scope.rdfText = file.data;\n }\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/import/templates/textSnippet.html',\n controller: 'TextCtrl',\n resolve: {\n text: function () {\n return file ? file.data : '';\n },\n format: function () {\n return file ? file.format : 'text/turtle';\n }\n }\n });\n\n modalInstance.result.then(function (data) {\n if (file) {\n if ((file.data !== data.text || file.format !== data.format) && file.status !== FILE_STATUS.NONE) {\n file.status = FILE_STATUS.NONE;\n file.message = $translate.instant('import.text.snippet.not.imported');\n }\n file.data = data.text;\n file.format = data.format;\n $scope.updateTextImport(file);\n } else {\n file = {type: 'text', name: 'Text snippet ' + formattedDate(), format: data.format, data: data.text};\n $scope.files.unshift(file);\n $scope.updateImport(file.name);\n }\n if (data.startImport) {\n $scope.setSettingsFor(file.name);\n }\n });\n };\n\n $scope.rdfDataFromURL = function () {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/import/templates/urlImport.html',\n controller: 'UrlCtrl',\n scope: $scope\n });\n\n modalInstance.result.then(function (data) {\n // URL may already exist\n const existing = _.find($scope.files, {type: 'url', name: data.url});\n if (existing) {\n existing.format = data.format;\n } else {\n $scope.files.unshift({type: 'url', name: data.url, format: data.format, data: data.url});\n }\n $scope.updateImport(data.url, true);\n if (data.startImport) {\n $scope.setSettingsFor(data.url, true);\n }\n });\n };\n\n $scope.init();\n}]);\n\nimportCtrl.controller('UrlCtrl', ['$scope', '$modalInstance', 'toastr', function ($scope, $modalInstance) {\n $scope.importFormat = {name: 'Auto', type: ''};\n $scope.startImport = true;\n\n $scope.cancel = function () {\n $modalInstance.dismiss();\n };\n\n $scope.ok = function () {\n $modalInstance.close({\n url: $scope.dataUrl,\n format: $scope.importFormat.type,\n startImport: $scope.startImport\n });\n };\n}]);\n\nimportCtrl.controller('TextCtrl', ['$scope', '$modalInstance', 'text', 'format', function ($scope, $modalInstance, text, format) {\n $scope.importFormats = [\n {name: 'RDF/JSON', type: 'application/rdf+json'},\n {name: 'JSON-LD', type: 'application/ld+json'},\n {name: 'RDF/XML', type: 'application/rdf+xml'},\n {name: 'N3', type: 'text/rdf+n3'},\n {name: 'N-Triples', type: 'text/plain'},\n {name: 'N-Quads', type: 'text/x-nquads'},\n {name: 'Turtle', type: 'text/turtle'},\n {name: 'Turtle*', type: 'application/x-turtlestar'},\n {name: 'TriX', type: 'application/trix'},\n {name: 'TriG', type: 'application/x-trig'},\n {name: 'TriG*', type: 'application/x-trigstar'},\n ];\n\n $scope.rdfText = text;\n $scope.importFormat = _.find($scope.importFormats, {type: format});\n $scope.startImport = true;\n\n $scope.setFormat = function (format) {\n $scope.importFormat = format;\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss();\n };\n\n $scope.ok = function () {\n $modalInstance.close({\n text: $scope.rdfText,\n format: $scope.importFormat.type,\n startImport: $scope.startImport\n });\n };\n}]);\n\nimportCtrl.controller('TabCtrl', ['$scope', '$location', function ($scope, $location) {\n $scope.viewType = $location.hash();\n if ($scope.viewType !== 'user' && $scope.viewType !== 'server') {\n $scope.viewType = 'user';\n }\n $scope.isCollapsed = false;\n if ($scope.viewType === 'user') {\n $scope.templateUrl = 'js/angular/import/templates/uploadInfo.html';\n } else {\n $scope.templateUrl = 'js/angular/import/templates/importInfo.html';\n }\n $scope.changeHelpTemplate = function (templateFile) {\n $scope.templateUrl = 'js/angular/import/templates/' + templateFile;\n };\n $scope.commonUrl = 'js/angular/import/templates/commonInfo.html';\n}]);\n\nimportCtrl.controller('SettingsModalCtrl', ['$scope', '$modalInstance', 'toastr', 'UriUtils', 'settings', 'hasParserSettings', 'defaultSettings', 'isMultiple', '$translate',\n function ($scope, $modalInstance, toastr, UriUtils, settings, hasParserSettings, defaultSettings, isMultiple, $translate) {\n $scope.hasError = function (error, input) {\n return _.find(error, function (o) {\n return input === o['$name'];\n });\n };\n\n $scope.settings = settings;\n $scope.hasParserSettings = hasParserSettings;\n if ($scope.settings.context) {\n if ($scope.settings.context === 'default') {\n $scope.target = 'default';\n $scope.settings.context = '';\n } else {\n $scope.target = 'named';\n }\n } else {\n $scope.target = 'data';\n }\n $scope.isMultiple = isMultiple;\n $scope.enableReplace = !!($scope.settings.replaceGraphs && $scope.settings.replaceGraphs.length);\n\n const fixSettings = function () {\n if ($scope.target === 'default') {\n $scope.settings.context = 'default';\n } else if ($scope.target === 'data') {\n $scope.settings.context = '';\n }\n if ($scope.enableReplace) {\n if ($scope.target === 'default' || $scope.target === 'named') {\n $scope.settings.replaceGraphs = [$scope.settings.context];\n }\n } else {\n $scope.settings.replaceGraphs = [];\n }\n };\n\n $scope.ok = function () {\n // resets the validity of a field only used for temporary things\n $scope.settingsForm.replaceGraph.$setValidity('replaceGraph', true);\n\n if ($scope.settingsForm.$valid) {\n fixSettings();\n $modalInstance.close($scope.settings);\n }\n };\n\n $scope.cancel = function () {\n fixSettings();\n $modalInstance.dismiss($scope.settings);\n };\n\n $scope.reset = function () {\n $scope.settings = angular.copy(defaultSettings);\n $scope.target = 'data';\n };\n\n $scope.addReplaceGraph = function (graph) {\n let valid = true;\n if (graph !== 'default') {\n valid = UriUtils.isValidIri(graph);\n }\n $scope.settingsForm.replaceGraph.$setTouched();\n $scope.settingsForm.replaceGraph.$setValidity('replaceGraph', valid);\n\n if ($scope.settingsForm.replaceGraph.$valid) {\n $scope.settings.replaceGraphs = $scope.settings.replaceGraphs || [];\n if (_.indexOf($scope.settings.replaceGraphs, graph) === -1) {\n $scope.replaceGraph = '';\n $scope.settings.replaceGraphs.push(graph);\n } else {\n toastr.warning($translate.instant('import.graph.already.in.list'));\n }\n }\n };\n\n $scope.checkEnterReplaceGraph = function (event, graph) {\n if (event.keyCode === 13) {\n event.preventDefault();\n\n $scope.addReplaceGraph(graph);\n }\n };\n\n $scope.showAdvancedSettings = false;\n $scope.switchParserSettings = function () {\n $scope.showAdvancedSettings = !$scope.showAdvancedSettings;\n };\n}]);\n","import 'angular/core/services';\nimport 'angular/utils/uri-utils';\n\nconst importDirectives = angular.module('graphdb.framework.impex.import.directives', [\n 'graphdb.framework.utils.uriutils'\n]);\n\nimportDirectives.directive('validateUri', ['UriUtils', function (UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n let valid = true;\n\n if (scope.target === 'named') {\n valid = UriUtils.isValidIri(value);\n }\n\n ctrl.$setValidity('validateUri', valid);\n\n return value;\n });\n }\n };\n}]);\n\nimportDirectives.directive('filesTable', function () {\n return {\n restrict: 'A',\n templateUrl: 'js/angular/import/templates/filesTable.html'\n };\n});\n\nimportDirectives.directive('filesOntoLoader', function () {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=2.0.0-RC2\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n});\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[44],{44:function(t,e,n){"use strict";n.r(e),n.d(e,"clusterColors",(function(){return r})),n.d(e,"createClusterSvgElement",(function(){return a})),n.d(e,"createClusterZone",(function(){return s})),n.d(e,"setCreateClusterZone",(function(){return d})),n.d(e,"updateClusterZoneLabels",(function(){return c})),n.d(e,"moveElement",(function(){return l})),n.d(e,"createNodes",(function(){return u})),n.d(e,"updateNodes",(function(){return i})),n.d(e,"createLinks",(function(){return p})),n.d(e,"updateLinks",(function(){return S})),n.d(e,"setLinkColor",(function(){return N})),n.d(e,"setLinkStyle",(function(){return h})),n.d(e,"positionNodesOnClusterZone",(function(){return x}));var o=n(40);const r={ontoOrange:"var(--onto-orange)",ontoBlue:"var(--onto-blue)",ontoGreen:"var(--onto-green)",ontoGrey:"var(--onto-grey)"};function a(t){return d3.select(t).append("svg")}function s(t){const e=t.append("g");return e.append("circle").classed("cluster-zone",!0).style("fill","transparent").style("stroke-width","2"),e}function d(t,e,n){if(e.select(".cluster-zone").classed("no-cluster",!t),t)e.selectAll("#no-cluster-zone").remove();else{const t=e.append("g").attr("id","no-cluster-zone");t.append("text").attr("id","no-cluster-label").text(n.no_cluster_configured||"No cluster group configured").attr("y",-50).classed("h2",!0).style("text-anchor","middle"),t.append("text").attr("id","create-cluster-label").classed("h3",!0).text(n.create_cluster_btn||"Click here to create a cluster").style("text-anchor","middle"),t.append("text").attr("y",130).attr("class","icon-any repo").attr("fill",r.ontoOrange).style("text-anchor","middle").classed("settings-icon",!0).text("")}}function c(t,e,n){t||(e.select("#no-cluster-zone #no-cluster-label").text(n.no_cluster_configured),e.select("#no-cluster-zone #create-cluster-label").text(n.create_cluster_btn))}function l(t,e,n){t.attr("transform",()=>`translate(${e}, ${n})`)}function u(t,e,n){const o=t.enter().append("g").attr("id","node-group").classed("legend",n);!function(t,e){const n=Math.sqrt(3)/2,o=[[e+0,0],[e/2+0,e*n+0],[-e/2+0,e*n+0],[0-e,0],[-e/2+0,-e*n+0],[e/2+0,-e*n+0],[e+0,0],[e/2+0,e*n+0]];t.selectAll("path.area").data([o]).enter().append("path").attr("class","node member").attr("d",d3.svg.line())}(o,e),t.exit().remove(),o.append("text").attr("class","icon-any node-icon"),function(t,e,n){const o=t.append("g");n?o.append("foreignObject").attr("y",e).attr("x",-e).attr("width",2*e).attr("height",10).append("xhtml:div").attr("class","id id-host"):(o.append("rect").attr("class","id-host-background").attr("rx",6),o.append("text").attr("y",e+10).attr("class","id id-host").style("text-anchor","middle"))}(o,e,n)}function i(t){!function(t){t.select(".icon-any.node-icon").text(f)}(t),function(t){t.select(".node.member").classed("leader",t=>t.nodeState===o.NodeState.LEADER).classed("follower",t=>t.nodeState===o.NodeState.FOLLOWER).classed("candidate",t=>t.nodeState===o.NodeState.CANDIDATE).classed("other",t=>t.nodeState!==o.NodeState.LEADER&&t.nodeState!==o.NodeState.FOLLOWER&&t.nodeState!==o.NodeState.CANDIDATE)}(t),function(t){t.select(".id.id-host").each((function(t){t.labelNode=this})).text((function(t){return t.hostname})),t.select(".id-host-background").attr("width",(function(t){return d3.select(t.labelNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.labelNode).node().getBBox().height+2})).attr("x",(function(t){return d3.select(t.labelNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.labelNode).node().getBBox().y-1})).attr("fill","#EEEEEE")}(t)}function f(t){return t.nodeState===o.NodeState.LEADER?"":t.nodeState===o.NodeState.FOLLOWER?"":t.nodeState===o.NodeState.CANDIDATE?"":t.nodeState===o.NodeState.NO_CONNECTION?"":t.nodeState===o.NodeState.OUT_OF_SYNC?"":t.nodeState===o.NodeState.READ_ONLY?"":t.nodeState===o.NodeState.RESTRICTED?"":""}function p(t){t.enter().append("path").classed("link",!0),t.exit().remove()}function S(t,e){t.attr("stroke",N).style("stroke-dasharray",h).attr("d",t=>(function(t,e){const n=e.find(e=>e.address===t.source),o=e.find(e=>e.address===t.target),r=o.x-n.x,a=o.y-n.y,s=Math.sqrt(r*r+a*a),d=r/s,c=a/s,l=n.x+55*d,u=n.y+55*c,i=o.x-55*d,f=o.y-55*c;return"M"+l+","+u+"L"+i+","+f})(t,e))}function N(t){return t.status===o.LinkState.IN_SYNC||t.status===o.LinkState.SYNCING?r.ontoGreen:t.status===o.LinkState.OUT_OF_SYNC?r.ontoGrey:"none"}function h(t){return t.status===o.LinkState.OUT_OF_SYNC||t.status===o.LinkState.SYNCING?"10 10":"none"}function x(t,e,n,o){t.attr("transform",(r,a)=>{const s=2*Math.PI*a/t[0].length;var d=e+Math.cos(s)*o,c=n+Math.sin(s)*o;return r.x=d,r.y=c,`translate(${d}, ${c})`})}}}]);
2
- //# sourceMappingURL=44.dbb910f04027f51eeedd.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[44],{44:function(t,e,n){"use strict";n.r(e),n.d(e,"clusterColors",(function(){return r})),n.d(e,"createClusterSvgElement",(function(){return a})),n.d(e,"createClusterZone",(function(){return s})),n.d(e,"setCreateClusterZone",(function(){return d})),n.d(e,"updateClusterZoneLabels",(function(){return c})),n.d(e,"moveElement",(function(){return l})),n.d(e,"createNodes",(function(){return u})),n.d(e,"updateNodes",(function(){return i})),n.d(e,"createLinks",(function(){return p})),n.d(e,"updateLinks",(function(){return S})),n.d(e,"setLinkColor",(function(){return N})),n.d(e,"setLinkStyle",(function(){return h})),n.d(e,"positionNodesOnClusterZone",(function(){return x}));var o=n(40);const r={ontoOrange:"var(--onto-orange)",ontoBlue:"var(--onto-blue)",ontoGreen:"var(--onto-green)",ontoGrey:"var(--onto-grey)"};function a(t){return d3.select(t).append("svg")}function s(t){const e=t.append("g");return e.append("circle").classed("cluster-zone",!0).style("fill","transparent").style("stroke-width","2"),e}function d(t,e,n){if(e.select(".cluster-zone").classed("no-cluster",!t),t)e.selectAll("#no-cluster-zone").remove();else{const t=e.append("g").attr("id","no-cluster-zone");t.append("text").attr("id","no-cluster-label").text(n.no_cluster_configured||"No cluster group configured").attr("y",-50).classed("h2",!0).style("text-anchor","middle"),t.append("text").attr("id","create-cluster-label").classed("h3",!0).text(n.create_cluster_btn||"Click here to create a cluster").style("text-anchor","middle"),t.append("text").attr("y",130).attr("class","icon-any repo").attr("fill",r.ontoOrange).style("text-anchor","middle").classed("settings-icon",!0).text("")}}function c(t,e,n){t||(e.select("#no-cluster-zone #no-cluster-label").text(n.no_cluster_configured),e.select("#no-cluster-zone #create-cluster-label").text(n.create_cluster_btn))}function l(t,e,n){t.attr("transform",()=>`translate(${e}, ${n})`)}function u(t,e,n){const o=t.enter().append("g").attr("id","node-group").classed("legend",n);!function(t,e){const n=Math.sqrt(3)/2,o=[[e+0,0],[e/2+0,e*n+0],[-e/2+0,e*n+0],[0-e,0],[-e/2+0,-e*n+0],[e/2+0,-e*n+0],[e+0,0],[e/2+0,e*n+0]];t.selectAll("path.area").data([o]).enter().append("path").attr("class","node member").attr("d",d3.svg.line())}(o,e),t.exit().remove(),o.append("text").attr("class","icon-any node-icon"),function(t,e,n){const o=t.append("g");n?o.append("foreignObject").attr("y",e).attr("x",-e).attr("width",2*e).attr("height",10).attr("class","label-wrapper").append("xhtml:div").attr("class","id id-host"):(o.append("rect").attr("class","id-host-background").attr("rx",6),o.append("text").attr("y",e+10).attr("class","id id-host").style("text-anchor","middle"))}(o,e,n)}function i(t){!function(t){t.select(".icon-any.node-icon").text(f)}(t),function(t){t.select(".node.member").classed("leader",t=>t.nodeState===o.NodeState.LEADER).classed("follower",t=>t.nodeState===o.NodeState.FOLLOWER).classed("candidate",t=>t.nodeState===o.NodeState.CANDIDATE).classed("other",t=>t.nodeState!==o.NodeState.LEADER&&t.nodeState!==o.NodeState.FOLLOWER&&t.nodeState!==o.NodeState.CANDIDATE)}(t),function(t){t.select(".id.id-host").each((function(t){t.labelNode=this})).text((function(t){return t.hostname})),t.select(".id-host-background").attr("width",(function(t){return d3.select(t.labelNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.labelNode).node().getBBox().height+2})).attr("x",(function(t){return d3.select(t.labelNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.labelNode).node().getBBox().y-1})).attr("fill","#EEEEEE")}(t)}function f(t){return t.nodeState===o.NodeState.LEADER?"":t.nodeState===o.NodeState.FOLLOWER?"":t.nodeState===o.NodeState.CANDIDATE?"":t.nodeState===o.NodeState.NO_CONNECTION?"":t.nodeState===o.NodeState.OUT_OF_SYNC?"":t.nodeState===o.NodeState.READ_ONLY?"":t.nodeState===o.NodeState.RESTRICTED?"":""}function p(t){t.enter().append("path").classed("link",!0),t.exit().remove()}function S(t,e){t.attr("stroke",N).style("stroke-dasharray",h).attr("d",t=>(function(t,e){const n=e.find(e=>e.address===t.source),o=e.find(e=>e.address===t.target),r=o.x-n.x,a=o.y-n.y,s=Math.sqrt(r*r+a*a),d=r/s,c=a/s,l=n.x+55*d,u=n.y+55*c,i=o.x-55*d,f=o.y-55*c;return"M"+l+","+u+"L"+i+","+f})(t,e))}function N(t){return t.status===o.LinkState.IN_SYNC||t.status===o.LinkState.SYNCING?r.ontoGreen:t.status===o.LinkState.OUT_OF_SYNC?r.ontoGrey:"none"}function h(t){return t.status===o.LinkState.OUT_OF_SYNC||t.status===o.LinkState.SYNCING?"10 10":"none"}function x(t,e,n,o){t.attr("transform",(r,a)=>{const s=2*Math.PI*a/t[0].length;var d=e+Math.cos(s)*o,c=n+Math.sin(s)*o;return r.x=d,r.y=c,`translate(${d}, ${c})`})}}}]);
2
+ //# sourceMappingURL=44.082e83be1a2eda5f197b.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///./src/js/angular/clustermanagement/cluster-drawing.service.js"],"names":["clusterColors","ontoOrange","ontoBlue","ontoGreen","ontoGrey","createClusterSvgElement","element","d3","select","append","createClusterZone","parent","clusterZone","classed","style","setCreateClusterZone","hasCluster","translationsMap","selectAll","remove","textGroup","attr","text","no_cluster_configured","create_cluster_btn","updateClusterZoneLabels","moveElement","x","y","createNodes","nodesDataBinding","nodeRadius","isLegend","nodeGroup","enter","radius","_s32","Math","sqrt","points","data","svg","line","createHexagon","exit","nodeElements","nodeTextHost","addHostnameToNodes","updateNodes","nodes","getNodeIconType","updateNodesIcon","node","nodeState","LEADER","FOLLOWER","CANDIDATE","updateNodesClasses","each","d","labelNode","this","hostname","getBBox","width","height","updateNodesHostnameText","NO_CONNECTION","OUT_OF_SYNC","READ_ONLY","RESTRICTED","createLinks","linksDataBinding","updateLinks","setLinkColor","setLinkStyle","link","source","find","address","target","deltaX","deltaY","dist","normX","normY","sourceX","sourceY","targetX","targetY","getLinkCoordinates","status","IN_SYNC","SYNCING","positionNodesOnClusterZone","clusterZoneX","clusterZoneY","clusterZoneRadius","index","theta","PI","length","cos","sin"],"mappings":"0FAAA,yoBAEO,MAAMA,EAAgB,CACzBC,WAAY,qBACZC,SAAU,mBACVC,UAAW,oBACXC,SAAU,oBAGP,SAASC,EAAwBC,GACpC,OAAOC,GAAGC,OAAOF,GACZG,OAAO,OAGT,SAASC,EAAkBC,GAC9B,MAAMC,EAAcD,EAAOF,OAAO,KAMlC,OALAG,EACKH,OAAO,UACPI,QAAQ,gBAAgB,GACxBC,MAAM,OAAQ,eACdA,MAAM,eAAgB,KACpBF,EAGJ,SAASG,EAAqBC,EAAYJ,EAAaK,GAK1D,GAJAL,EACKJ,OAAO,iBACPK,QAAQ,cAAeG,GAExBA,EACAJ,EAAYM,UAAU,oBAAoBC,aACvC,CACH,MAAMC,EAAYR,EACbH,OAAO,KACPY,KAAK,KAAM,mBAChBD,EACKX,OAAO,QACPY,KAAK,KAAM,oBACXC,KAAKL,EAAgBM,uBAAyB,+BAC9CF,KAAK,KAAM,IACXR,QAAQ,MAAM,GACdC,MAAM,cAAe,UAC1BM,EAAUX,OAAO,QACZY,KAAK,KAAM,wBACXR,QAAQ,MAAM,GACdS,KAAKL,EAAgBO,oBAAsB,kCAC3CV,MAAM,cAAe,UAC1BM,EAAUX,OAAO,QACZY,KAAK,IAAK,KACVA,KAAK,QAAS,iBACdA,KAAK,OAAQrB,EAAcC,YAC3Ba,MAAM,cAAe,UACrBD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B,KAAK,YAAa,CAAC+B,EAAM8C,KAGtB,MAAMC,EAAQ,EAAI9D,KAAK+D,GAAKF,EAAQjD,EAAM,GAAGoD,OAC7C,IAAI1E,EAAIoE,EAAe1D,KAAKiE,IAAIH,GAASF,EACrCrE,EAAIoE,EAAe3D,KAAKkE,IAAIJ,GAASF,EAGzC,OAFA7C,EAAKzB,EAAIA,EACTyB,EAAKxB,EAAIA,EACF,aAAaD,MAAMC","file":"44.082e83be1a2eda5f197b.bundle.js","sourcesContent":["import {LinkState, NodeState} from \"./controllers\";\n\nexport const clusterColors = {\n ontoOrange: 'var(--onto-orange)',\n ontoBlue: 'var(--onto-blue)',\n ontoGreen: 'var(--onto-green)',\n ontoGrey: 'var(--onto-grey)'\n};\n\nexport function createClusterSvgElement(element) {\n return d3.select(element)\n .append('svg');\n}\n\nexport function createClusterZone(parent) {\n const clusterZone = parent.append('g');\n clusterZone\n .append(\"circle\")\n .classed('cluster-zone', true)\n .style('fill', 'transparent')\n .style('stroke-width', '2');\n return clusterZone;\n}\n\nexport function setCreateClusterZone(hasCluster, clusterZone, translationsMap) {\n clusterZone\n .select('.cluster-zone')\n .classed('no-cluster', !hasCluster);\n\n if (hasCluster) {\n clusterZone.selectAll('#no-cluster-zone').remove();\n } else {\n const textGroup = clusterZone\n .append('g')\n .attr(\"id\", \"no-cluster-zone\");\n textGroup\n .append('text')\n .attr('id', 'no-cluster-label')\n .text(translationsMap.no_cluster_configured || 'No cluster group configured')\n .attr('y', -50)\n .classed('h2', true)\n .style('text-anchor', \"middle\");\n textGroup.append('text')\n .attr('id', 'create-cluster-label')\n .classed('h3', true)\n .text(translationsMap.create_cluster_btn || 'Click here to create a cluster')\n .style('text-anchor', \"middle\");\n textGroup.append('text')\n .attr('y', 130)\n .attr('class', 'icon-any repo')\n .attr('fill', clusterColors.ontoOrange)\n .style('text-anchor', \"middle\")\n .classed('settings-icon', true)\n .text(\"\\ue92b\");\n }\n}\n\nexport function updateClusterZoneLabels(hasCluster, clusterZone, translationsMap) {\n if (hasCluster) {\n return;\n }\n clusterZone.select('#no-cluster-zone #no-cluster-label')\n .text(translationsMap.no_cluster_configured);\n clusterZone.select('#no-cluster-zone #create-cluster-label')\n .text(translationsMap.create_cluster_btn);\n}\n\nexport function moveElement(element, x, y) {\n element.attr('transform', () => {\n return `translate(${x}, ${y})`;\n });\n}\n\nexport function createNodes(nodesDataBinding, nodeRadius, isLegend) {\n const nodeGroup = nodesDataBinding.enter()\n .append('g')\n .attr('id', 'node-group')\n .classed('legend', isLegend);\n\n createHexagon(nodeGroup, nodeRadius);\n nodesDataBinding.exit().remove();\n\n nodeGroup\n .append('text')\n .attr('class', 'icon-any node-icon');\n\n addHostnameToNodes(nodeGroup, nodeRadius, isLegend);\n}\n\nfunction addHostnameToNodes(nodeElements, nodeRadius, isLegend) {\n const nodeTextHost = nodeElements.append('g');\n\n if (isLegend) {\n nodeTextHost.append('foreignObject')\n .attr('y', nodeRadius)\n .attr('x', -nodeRadius)\n .attr('width', nodeRadius * 2)\n .attr('height', 10)\n .attr('class', 'label-wrapper')\n .append('xhtml:div')\n .attr('class', 'id id-host');\n } else {\n nodeTextHost\n .append('rect')\n .attr('class', 'id-host-background')\n .attr('rx', 6);\n\n nodeTextHost\n .append('text')\n .attr('y', nodeRadius + 10)\n .attr('class', 'id id-host')\n .style('text-anchor', 'middle');\n }\n}\n\nexport function updateNodes(nodes) {\n updateNodesIcon(nodes);\n updateNodesClasses(nodes);\n updateNodesHostnameText(nodes);\n}\n\nfunction updateNodesClasses(nodes) {\n nodes\n .select('.node.member')\n .classed('leader', (node) => node.nodeState === NodeState.LEADER)\n .classed('follower', (node) => node.nodeState === NodeState.FOLLOWER)\n .classed('candidate', (node) => node.nodeState === NodeState.CANDIDATE)\n .classed('other', (node) => {\n return node.nodeState !== NodeState.LEADER &&\n node.nodeState !== NodeState.FOLLOWER &&\n node.nodeState !== NodeState.CANDIDATE;\n });\n}\n\nfunction updateNodesIcon(nodes) {\n nodes\n .select('.icon-any.node-icon')\n .text(getNodeIconType);\n}\n\nfunction getNodeIconType(node) {\n if (node.nodeState === NodeState.LEADER) {\n return '\\ue935';\n } else if (node.nodeState === NodeState.FOLLOWER) {\n return '\\ue963';\n } else if (node.nodeState === NodeState.CANDIDATE) {\n return '\\ue914';\n } else if (node.nodeState === NodeState.NO_CONNECTION) {\n return '\\ue931';\n } else if (node.nodeState === NodeState.OUT_OF_SYNC) {\n return '\\ue920';\n } else if (node.nodeState === NodeState.READ_ONLY) {\n return '\\ue95c';\n } else if (node.nodeState === NodeState.RESTRICTED) {\n return '\\ue933';\n }\n return '';\n}\n\nfunction updateNodesHostnameText(nodes) {\n nodes\n .select('.id.id-host')\n .each(function (d) {\n d.labelNode = this;\n })\n .text(function (d) {\n return d.hostname;\n });\n\n // Add padding styling to text background. left/right +5. top/bottom +1\n nodes\n .select('.id-host-background')\n .attr('width', function (d) {\n return d3.select(d.labelNode).node().getBBox().width + 10;\n })\n .attr('height', function (d) {\n return d3.select(d.labelNode).node().getBBox().height + 2;\n })\n .attr('x', function (d) {\n return d3.select(d.labelNode).node().getBBox().x - 5;\n })\n .attr('y', function (d) {\n return d3.select(d.labelNode).node().getBBox().y - 1;\n })\n .attr('fill', '#EEEEEE');\n}\n\nexport function createLinks(linksDataBinding) {\n linksDataBinding.enter()\n .append('path')\n .classed('link', true);\n\n linksDataBinding.exit().remove();\n}\n\nexport function updateLinks(linksDataBinding, nodes) {\n linksDataBinding\n .attr('stroke', setLinkColor)\n .style('stroke-dasharray', setLinkStyle)\n .attr('d', (link) => getLinkCoordinates(link, nodes));\n}\n\nexport function setLinkColor(link) {\n if (link.status === LinkState.IN_SYNC || link.status === LinkState.SYNCING) {\n return clusterColors.ontoGreen;\n } else if (link.status === LinkState.OUT_OF_SYNC) {\n return clusterColors.ontoGrey;\n }\n return 'none';\n}\n\nexport function setLinkStyle(link) {\n if (link.status === LinkState.OUT_OF_SYNC || link.status === LinkState.SYNCING) {\n return '10 10';\n }\n return 'none';\n}\n\nfunction getLinkCoordinates(link, nodes) {\n const source = nodes.find((node) => node.address === link.source);\n const target = nodes.find((node) => node.address === link.target);\n\n const deltaX = target.x - source.x;\n const deltaY = target.y - source.y;\n const dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const normX = deltaX / dist;\n const normY = deltaY / dist;\n\n // Padding from node center point\n const sourcePadding = 55;\n const targetPadding = 55;\n const sourceX = source.x + (sourcePadding * normX);\n const sourceY = source.y + (sourcePadding * normY);\n const targetX = target.x - (targetPadding * normX);\n const targetY = target.y - (targetPadding * normY);\n return 'M' + sourceX + ',' + sourceY + 'L' + targetX + ',' + targetY;\n}\n\nexport function positionNodesOnClusterZone(nodes, clusterZoneX, clusterZoneY, clusterZoneRadius) {\n nodes\n .attr('transform', (node, index) => {\n // Calculate initial positions for the new nodes based on\n // spreading them evenly on a circle around the center of the page.\n const theta = 2 * Math.PI * index / nodes[0].length;\n var x = clusterZoneX + Math.cos(theta) * clusterZoneRadius;\n var y = clusterZoneY + Math.sin(theta) * clusterZoneRadius;\n node.x = x;\n node.y = y;\n return `translate(${x}, ${y})`;\n });\n}\n\nfunction createHexagon(nodeGroup, radius) {\n const _s32 = (Math.sqrt(3) / 2);\n const xDiff = 0;\n const yDiff = 0;\n const points = [[radius + xDiff, yDiff], [radius / 2 + xDiff, radius * _s32 + yDiff], [-radius / 2 + xDiff, radius * _s32 + yDiff],\n [-radius + xDiff, yDiff],\n [-radius / 2 + xDiff, -radius * _s32 + yDiff], [radius / 2 + xDiff, -radius * _s32 + yDiff], [radius + xDiff, yDiff],\n [radius / 2 + xDiff, radius * _s32 + yDiff]];\n return nodeGroup\n .selectAll(\"path.area\")\n .data([points])\n .enter()\n .append(\"path\")\n .attr('class', 'node member')\n .attr(\"d\", d3.svg.line());\n}\n"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[48],{38:function(e,t,n){"use strict";n.r(t);n(4),n(15);var r=n(0);function i(e,t,n,i,o,a,s,u,c,d,l,g,y,f,p){const m={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let h,T;function w(t){!function(){if(i.isActiveRepoOntopType())return;const t=document.getElementById("sameAs");!t||e.currentQuery.inference||t.disabled?e.currentQuery.inference&&t.disabled&&(t.removeAttribute("disabled"),e.currentQuery.sameAs=h.appSettings.DEFAULT_SAMEAS):(t.disabled=!0,e.currentQuery.sameAs=!1)}(),e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,i.isActiveRepoOntopType()||(e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs))})),y.set(f.TABS_STATE,e.tabs)}function b(t,n,r,i){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,e.noLoaderTimer=i,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",e.noLoaderTimer=!1,e.currentTrackAlias=null,e.abortRequested=!1,o.removeClass("hide")),null===e.$$phase&&e.$apply()}function C(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(n?function(){e.fixSizesOnHorizontalViewModeSwitch(n)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function S(){C(!0)}function q(t,n){n.newRepo&&(e.tabsData=y.get(f.TABS_STATE),e.tabsData.forEach((function(e){e.yasrData=void 0,e.queryType=void 0,e.resultsCount=0,e.allResultsCount=0,e.sizeDelta=void 0})),y.set(f.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function E(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function v(r,o){if(e.executedQueryTab=e.currentQuery,o){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType())return void n.warning(p.instant("query.editor.warning.msg"));if(i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.warning.msg"))}if(e.explainRequested=o,!e.queryIsRunning){if(r?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.update.warning.msg"));if(b(!0,"update"===e.lastRunQueryMode?p.instant("query.editor.executing.update"):p.instant("query.editor.evaluating.query")),"none"!==e.viewMode){e.viewMode="none",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch();const n=t(window.editor.query,500);e.$on("$destroy",(function(){t.cancel(n)}))}else window.editor.query()}}function Q(){e.showSampleQueries=!e.showSampleQueries,e.showSampleQueries?s.getSavedQueries().success((function(t){e.sampleQueries=t,$("#sampleQueriesCollapse").collapse("show").width("300px")})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.get.saved.queries.error"))})):$("#sampleQueriesCollapse").collapse("hide")}function M(t){let n=void 0;return e.tabsData.forEach((function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function A(t){return function(n,r,i){e.savedQuery={name:n,query:r||window.editor.getValue(),shared:i},$(t).modal("show")}}function D(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}e.getPrincipal=function(){return d.getPrincipal().then(t=>{h=t,function(e,t){m.inference=t.appSettings.DEFAULT_INFERENCE,m.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=y.get(f.TABS_STATE)||[m],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){w(n.currentQuery)})),e.$on("repositoryIsSet",q)}(e,h)})},e.getPrincipal(),this.hint=document.createElement("span"),this.hint.innerHTML=p.instant("query.editor.autocomplete.hint"),this.hint.style.fontSize="12px",this.hint.style.color="gray",this.hint.style.backgroundColor="white",this.hint.style.position="absolute",this.hint.style.zIndex="3",this.hint.style.paddingLeft="12px",e.$watch((function(){return angular.element(".CodeMirror-hints").length}),e=>{if(e){const e=angular.element(".CodeMirror-hints")[0].getBoundingClientRect();document.body.appendChild(this.hint),this.hint.style.top=e.top-20+"px",this.hint.style.left=e.right-this.hint.offsetWidth-12+"px"}else this.hint&&this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint)}),e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:1e3,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.saveTab=function(t){const n=D(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=y.get(f.TABS_STATE)||[m];const r=D(n),o=e.tabsData[r];o.yasrData&&b(!0,p.instant("query.editor.render.results.msg"),null,!0);t((function(){""===e.currentQuery.query&&(e.currentQuery.query=" "),t((function(){window.editor.setValue(e.currentQuery.query),e.yasr.updateDownloadDropdown(),e.$broadcast("tabLoaded",e.currentQuery.id),e.yasr.options.output=o.outputType,o.yasrData&&(o.yasrData.customError?(e.yasr.results={getException:function(){return o.yasrData.customError}},b(!1)):t((function(){e.setYasrResponse(o.yasrData,o.textStatus,o.jqXhrOrErrorString),b(!1),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&t((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),0)}),0))}),0)}),0),y.set(f.TABS_STATE_CURRENT_ID,n),e.currentQuery=o,t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=o.queryType,e.currentTabConfig.resultsCount=o.resultsCount,e.currentTabConfig.offset=o.offset,e.currentTabConfig.allResultsCount=o.allResultsCount,e.currentTabConfig.allResultsCountExact=o.allResultsCountExact,e.currentTabConfig.page=o.page,e.currentTabConfig.pageSize=o.pageSize,e.currentTabConfig.timeFinished=o.timeFinished,e.currentTabConfig.timeTook=o.timeTook,e.currentTabConfig.sizeDelta=o.sizeDelta,e.currentTabConfig.customUpdateMessage=o.customUpdateMessage,e.currentTabConfig.errorMessage=o.errorMessage,e.currentTabConfig.warningMessage=o.warningMessage,e.$apply()}),0),$("#yasr").css("padding","0"),T||(T=setInterval(_,200));!function(){const t=i.isActiveRepoOntopType(),n=i.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t&&(t.disabled=!!e);n&&(n.disabled=!!e)})(t),e.nocount=!(!t&&!n)||!h.appSettings.EXECUTE_COUNT,t&&(e.currentQuery.inference=!0,e.currentQuery.sameAs=!0)}()},e.addNewTab=function(n,r,i){if(!z(!0))return;let o;o=r||i?{id:"1",name:r,query:i,inference:h.appSettings.DEFAULT_INFERENCE,sameAs:h.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:h.appSettings.DEFAULT_INFERENCE,sameAs:h.appSettings.DEFAULT_SAMEAS};x++;const a=""+x;e.tabsData=e.tabs;const s=o;s.id=a,e.tabsData.push(s),y.set(f.TABS_STATE_MAXID,x),y.set(f.TABS_STATE,e.tabsData);const u=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),E(a),n&&n.apply(this,u)}),0),e.tabs=e.tabsData},e.isTabChangeOk=z,e.runQuery=v,e.abortCurrentQuery=function(){g.abortQueryByAlias(e.currentTrackAlias).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.edit.saved.query",{name:t.name}),query:t,edit:!0,okButtonText:p.instant("common.save.btn")}}}}).result.then((function(r){const i={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?s.addNewSavedQuery(i).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))})):s.editSavedQuery(i).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success(p.instant("query.editor.edit.saved.query.success.msg",{name:t.name}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))}))}))},e.getNamespaces=function(){b(!0,p.instant("common.refreshing.namespaces"),p.instant("common.extra.message")),e.namespacesLoading=!0,l.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){b(!1),e.namespacesLoading=!1}))},e.changePagination=function(){v(!0,e.explainRequested)},e.toggleSampleQueries=Q,e.addKnownPrefixes=function(){s.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return n.error(t,p.instant("common.add.known.prefixes.error")),!0}))},e.getExistingTabId=M,e.querySelected=function(t){const n=M(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?E(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){a.openSimpleModal({title:p.instant("common.confirm"),message:p.instant("query.editor.delete.saved.query.warning.msg",{savedQueryName:t}),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){s.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success(p.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.delete.saved.query.error"))}))},e.saveQuery=function(t,n){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.create.saved.query.msg"),query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:p.instant("common.create.btn"),queryExists:n,existingQueryErrMsg:Object(r.decodeHTML)(p.instant("query.sample.existing.query.warning",{name:t.name}))}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){s.addNewSavedQuery(t).success((function(){n.success(p.instant("query.editor.save.saved.query.success.msg",{name:t.name}))})).error((function(r){let i=getError(r);if(n.error(i,p.instant("query.editor.create.saved.query.error")),i="Query '"+t.name+"' already exists!"){t.query=t.body;const n=!0;e.saveQuery(t,n)}}))},e.saveQueryToLocal=w,e.setLoader=b,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?p.instant("query.editor.progress.msg",{progressMessage:e.progressMessage,timeHuman:n}):p.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+=p.instant("query.editor.extra.msg",{extraMessage:e.extraMessage}));return r},e.fixSizesOnHorizontalViewModeSwitch=C,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,y.set(f.VIEW_MODE,e.orientationViewMode),C()},e.showHideEditor=S,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!y.get(f.VIEW_MODE)||"true"===y.get(f.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return i.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return i.getActiveRepository()},e.orientationViewMode||S(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs),clearInterval(T)})),e.$on("$destroy",(function(){clearInterval(T),window.editor=null,window.yasr=null})),$(document).mouseup((function(t){const n=$("#sampleQueriesCollapse");!n.is(t.target)&&0===n.has(t.target).length&&e.showSampleQueries&&Q()}));let x=y.get(f.TABS_STATE_MAXID)||1;function R(e){return $(e).attr("data-id")}function _(){if(e.currentTabConfig.resultsCount>=0){const e=$(".saveAsDropDown");e.length>0&&!window.editor.queryValid?yasr.header.find(".saveAsDropDown").remove():0===e.length&&window.editor.queryValid&&yasr.updateDownloadDropdown()}}function z(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info(p.instant("query.editor.new.tab.running.query.warning.msg")):n.info(p.instant("query.editor.tab.switching.running.query.warning.msg")),!1)}e.highlightNextTabChange=!1,e.$on("tabAction",(function(n,r){r.relatedTarget&&(t.cancel(r.relatedTarget.timer),$(r.relatedTarget).css("color",""),e.saveTab(R(r.relatedTarget))),e.loadTab(R(r.target));const i=["var(--onto-orange)","","var(--onto-orange)"],o=[400,400,400];if(e.highlightNextTabChange){e.highlightNextTabChange=!1;let n=0;$(r.target).css("color",i[n]);const a=function(){n++,n<i.length?($(r.target).css("color",i[n]),r.target.timer=t(a,o[n])):$(r.target).css("color","")};t(a,o[n])}})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery={},e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.editQueryModal=A("#editQueryContainer"),e.deleteQueryModal=A("#confirmDeleteContainer"),e.saveQueryModal=A("#saveQueryContainer"),e.getResultsDescription=function(){let t;if(0===e.currentTabConfig.resultsCount)t="No results.";else{const n=(e.currentTabConfig.page-1)*e.currentTabConfig.pageSize+Math.min(e.currentTabConfig.resultsCount,e.currentTabConfig.pageSize);t=p.instant("query.editor.showing.results.from.msg")+u("currency")(e.currentTabConfig.offset,"",0)+p.instant("query.editor.to")+u("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=p.instant(e.currentTabConfig.allResultsCountExact?"query.editor.of":"query.editor.of.at.least"),t+=u("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?p.instant(e.currentTabConfig.customUpdateMessage.msg,{name:e.currentTabConfig.customUpdateMessage.name}):void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?p.instant("yasr.removed.statements.result.msg",{sizeDelta:Math.abs(e.currentTabConfig.sizeDelta)}):e.currentTabConfig.sizeDelta>0?p.instant("yasr.added.statements.result.msg",{sizeDelta:e.currentTabConfig.sizeDelta}):p.instant("yasr.statements.no.change.msg")},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return p.instant("yasr.stale.result.msg",{secondsAgo:e.getHumanReadableSeconds(t)})};const N=function(){};angular.element(c).bind("resize",N),e.$on("$destroy",(function(){angular.element(c).unbind("resize",N)}))}function o(e,t,n,r){n.queryExists&&(e.queryExists=!0),e.query=angular.copy(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.existingQueryErrMsg=r.trustAsHtml(n.existingQueryErrMsg),e.ok=function(){e.form.$valid&&t.close(e.query)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.core.directives.queryeditor.controllers",["graphdb.framework.utils.localstorageadapter","graphdb.framework.rest.sparql.service"]).controller("QueryEditorCtrl",i).controller("QuerySampleModalCtrl",o),i.$inject=["$scope","$timeout","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate"],o.$inject=["$scope","$modalInstance","data","$sce"]}}]);
2
+ //# sourceMappingURL=48.f047a5ea62690543f8ad.bundle.js.map