graphdb-workbench 2.1.0 → 2.1.1-TR2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/{10.018ca946a702a519142b.bundle.js → 10.5c9aa6773dd62b4ed854.bundle.js} +2 -2
  2. package/dist/10.5c9aa6773dd62b4ed854.bundle.js.map +1 -0
  3. package/dist/{11.52641542d9a31c527b7c.bundle.js → 11.8983e1d1c930328e9b0d.bundle.js} +2 -2
  4. package/dist/11.8983e1d1c930328e9b0d.bundle.js.map +1 -0
  5. package/dist/135.c1de0deb98c8a45a4b21.bundle.js +1 -1
  6. package/dist/135.c1de0deb98c8a45a4b21.bundle.js.map +1 -1
  7. package/dist/{15.510970e84b3d1a7768c2.bundle.js → 15.9ce4fa5c14638d63736a.bundle.js} +2 -2
  8. package/dist/{15.510970e84b3d1a7768c2.bundle.js.map → 15.9ce4fa5c14638d63736a.bundle.js.map} +1 -1
  9. package/dist/162.7c19d57c3792c9ca08d0.bundle.js +2 -0
  10. package/dist/162.7c19d57c3792c9ca08d0.bundle.js.map +1 -0
  11. package/dist/18.201bf87e7629b325646c.bundle.js +1 -1
  12. package/dist/18.201bf87e7629b325646c.bundle.js.map +1 -1
  13. package/dist/25.42f3d944b5ec15e01ceb.bundle.js +2 -0
  14. package/dist/25.42f3d944b5ec15e01ceb.bundle.js.map +1 -0
  15. package/dist/{3.1b96b660b1d11c328e50.bundle.js → 3.0a892888d711fa9009b7.bundle.js} +2 -2
  16. package/dist/3.0a892888d711fa9009b7.bundle.js.map +1 -0
  17. package/dist/30.4b987e71408e0643680a.bundle.js +1 -1
  18. package/dist/30.4b987e71408e0643680a.bundle.js.map +1 -1
  19. package/dist/31.5af5b75cd1ac5d00370e.bundle.js +1 -1
  20. package/dist/31.5af5b75cd1ac5d00370e.bundle.js.map +1 -1
  21. package/dist/36.618ccd9d5a8d4d11cb47.bundle.js +2 -0
  22. package/dist/36.618ccd9d5a8d4d11cb47.bundle.js.map +1 -0
  23. package/dist/39.88a2db4f9ab5946bf2cd.bundle.js +2 -0
  24. package/dist/39.88a2db4f9ab5946bf2cd.bundle.js.map +1 -0
  25. package/dist/55.5b44653775bb1592cb26.bundle.js +2 -0
  26. package/dist/55.5b44653775bb1592cb26.bundle.js.map +1 -0
  27. package/dist/83.73515cde0a2215275d32.bundle.js +1 -1
  28. package/dist/83.73515cde0a2215275d32.bundle.js.map +1 -1
  29. package/dist/93.d4fb5fe720a8d95b2b37.bundle.js +2 -0
  30. package/dist/93.d4fb5fe720a8d95b2b37.bundle.js.map +1 -0
  31. package/dist/{bundle.2b813785fc0b4f08d48c.bundle.js → bundle.d68a2441048bc7e965e6.bundle.js} +3 -3
  32. package/dist/bundle.d68a2441048bc7e965e6.bundle.js.map +1 -0
  33. package/dist/index.html +3 -3
  34. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  35. package/dist/js/angular/security/templates/user.html +4 -2
  36. package/dist/pages/autocomplete.html +1 -1
  37. package/dist/pages/choose-repository-type.html +1 -1
  38. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  39. package/dist/pages/create-index.html +4 -4
  40. package/dist/pages/dependencies.html +1 -1
  41. package/dist/pages/domainRangeInfo.html +2 -2
  42. package/dist/pages/edit.html +1 -1
  43. package/dist/pages/explore.html +1 -1
  44. package/dist/pages/export.html +1 -1
  45. package/dist/pages/find.html +1 -1
  46. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  47. package/dist/pages/graphs-visualizations.html +7 -7
  48. package/dist/pages/guides.html +1 -1
  49. package/dist/pages/import.html +1 -1
  50. package/dist/pages/jdbc-create.html +5 -5
  51. package/dist/pages/monitor/queries.html +2 -3
  52. package/dist/pages/monitor/resources.html +2 -2
  53. package/dist/pages/namespaces.html +2 -2
  54. package/dist/pages/plugins.html +1 -1
  55. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  56. package/dist/pages/rdfrank.html +2 -2
  57. package/dist/pages/repositories.html +2 -2
  58. package/dist/pages/repository.html +2 -2
  59. package/dist/pages/similarity-indexes.html +1 -1
  60. package/dist/pages/sparql-template-create.html +5 -5
  61. package/dist/pages/sparql.html +3 -3
  62. package/dist/pages/webapi.html +2 -2
  63. package/dist/res/swagger/index.html +27 -27
  64. package/package.json +1 -1
  65. package/dist/10.018ca946a702a519142b.bundle.js.map +0 -1
  66. package/dist/11.52641542d9a31c527b7c.bundle.js.map +0 -1
  67. package/dist/162.611f7dba5a7f2ab9fa7b.bundle.js +0 -2
  68. package/dist/162.611f7dba5a7f2ab9fa7b.bundle.js.map +0 -1
  69. package/dist/25.9c19fb9c35fcd792dff5.bundle.js +0 -2
  70. package/dist/25.9c19fb9c35fcd792dff5.bundle.js.map +0 -1
  71. package/dist/3.1b96b660b1d11c328e50.bundle.js.map +0 -1
  72. package/dist/36.991eae8184e7b5fa5cbf.bundle.js +0 -2
  73. package/dist/36.991eae8184e7b5fa5cbf.bundle.js.map +0 -1
  74. package/dist/39.3f07a4be36e81e42c86e.bundle.js +0 -2
  75. package/dist/39.3f07a4be36e81e42c86e.bundle.js.map +0 -1
  76. package/dist/55.975653547fd9764a2a71.bundle.js +0 -2
  77. package/dist/55.975653547fd9764a2a71.bundle.js.map +0 -1
  78. package/dist/93.5f0ae85fb24657fd13c5.bundle.js +0 -2
  79. package/dist/93.5f0ae85fb24657fd13c5.bundle.js.map +0 -1
  80. package/dist/bundle.2b813785fc0b4f08d48c.bundle.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/clustermanagement/controllers.js","webpack:///./src/js/angular/rest/cluster.rest.service.js"],"names":["angular","module","controller","ClusterManagementCtrl","CreateClusterCtrl","DeleteClusterCtrl","EditClusterCtrl","AddLocationFromClusterCtrl","AddNodesDialogCtrl","RemoveNodesDialogCtrl","factory","RemoteLocationsService","NodeState","LEADER","FOLLOWER","CANDIDATE","OUT_OF_SYNC","NO_CONNECTION","READ_ONLY","RESTRICTED","NO_CLUSTER","DELETED","LinkState","IN_SYNC","SYNCING","$scope","$http","$q","toastr","$repositories","$modal","$sce","$window","$interval","ModalService","$timeout","ClusterRestService","$location","$translate","updateRequest","updateCluster","force","getClusterStatus","then","clusterConfiguration","getClusterConfiguration","currentNode","leaderChanged","getCurrentNodeStatus","finally","childContext","redraw","getLocationsWithRpcAddresses","locations","localNode","find","location","isLocal","endpoint","rpcAddress","address","clusterModel","onAddRemoveSuccess","message","success","handleAddRemoveErrors","data","status","title","failMessage","Array","isArray","reduce","acc","error","Object","keys","key","allowHtml","loader","isLeader","currentLeader","shouldShowClusterSettingsPanel","onopen","onclose","noop","toggleSidePanel","toggleLegend","setLoader","cancel","loaderTimeout","loaderMessage","selectNode","node","selectedNode","$apply","getLoaderMessage","instant","getClusterConfig","response","catch","nodes","slice","leader","nodeState","newLeader","links","syncStatus","forEach","push","id","source","target","hasCluster","showCreateClusterDialog","open","templateUrl","size","resolve","result","showDeleteDialog","forceDelete","deleteCluster","values","every","successMessage","failedNodesList","showEditConfigurationDialog","getNodeStatus","showAddNodeToClusterDialog","nodesRpcAddress","map","addNodesToCluster","failMessageTitle","showRemoveNodesFromClusterDialog","removeNodesFromCluster","timer","$on","w","element","resize","bind","mousedown","event","nodeTooltipElement","document","getElementById","contains","unbind","$inject","getAdvancedOptionsClass","optionsModule","isAriaExpanded","getAttribute","$modalInstance","pageTitle","autofocusId","errors","electionMinTimeout","electionRangeTimeout","heartbeatInterval","messageSizeKB","verificationTimeout","filter","selectedLocations","createCluster","close","preconditionErrors","splice","handleErrors","isClusterConfigurationValid","isFormValid","clusterConfigurationForm","$invalid","nodesListValid","length","addNodeToList","loc","removeNodeFromList","index","addLocation","newLocation","ok","warning","dismiss","LocationsRestService","windowClass","dataAddLocation","uri","locationData","msg","getError","locationAdded","addLocationHttp","getLocations","local","errorMsg","locationsArray","rpcAddressFetchers","getLocationRpcAddress","isAvailable","Promise","allSettled","getRemoteLocationsRpcAddresses","productInfo","docBase","getDocBase","isValidLocation","indexOf","copy","productShortVersion","clusterNodes","includes","isNew","shouldRemove","nodesToRemoveCount","leftNodesLessThanTwo","toggleNode","nodesToRemove","get","groupConfiguration","post","patch","$","param","delete","nodesArray","headers"],"mappings":"6FAAA,sGAYAA,QACKC,OAAO,kDAVI,CACZ,eACA,+CACA,8CACA,yCACA,SACA,wBAKCC,WAAW,wBAAyBC,GACpCD,WAAW,oBAAqBE,GAChCF,WAAW,oBAAqBG,GAChCH,WAAW,kBAAmBI,GAC9BJ,WAAW,6BAA8BK,GACzCL,WAAW,qBAAsBM,GACjCN,WAAW,wBAAyBO,GACpCC,QAAQ,yBAA0BC,GAEhC,MAAMC,EAAY,CACrBC,OAAQ,SACRC,SAAU,WACVC,UAAW,YACXC,YAAa,cACbC,cAAe,gBACfC,UAAW,YACXC,WAAY,aACZC,WAAY,aACZC,QAAS,WAEAC,EAAY,CACrBC,QAAS,UACTP,YAAa,cACbQ,QAAS,UACTP,cAAe,iBAMnB,SAASd,EAAsBsB,EAAQC,EAAOC,EAAIC,EAAQC,EAAeC,EAAQC,EAC7EC,EAASC,EAAWC,EAAcC,EAAUC,EAAoBC,EAAWC,EAAY3B,GAgEvF,IAAI4B,EACJ,SAASC,EAAcC,GACfF,IAIJA,EAAgBd,EAAOiB,mBAClBC,KAAK,KACF,GAAIF,IAAUhB,EAAOmB,qBACjB,OAAOnB,EAAOoB,4BAGrBF,KAAK,KACF,IAAKlB,EAAOqB,aAAerB,EAAOsB,cAC9B,OAAOtB,EAAOuB,yBAGrBC,QAAQ,KACLV,EAAgB,KAChBd,EAAOyB,aAAaC,YA8JhC,SAASC,IACL,OAAOzC,EAAuByC,+BACzBT,KAAMU,IACH,MAAMC,EAAYD,EAAUE,KAAMC,GAAaA,EAASC,SACpDH,IACAA,EAAUI,SAAWjC,EAAOqB,YAAYY,SACxCJ,EAAUK,WAAalC,EAAOqB,YAAYc,SAE9CnC,EAAOoC,aAAaR,UAAYA,IA6E5C,SAASS,EAAmBC,GACx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AEC,MAAM,CACjBvL,MAAOgF,IAEX,OAAO/F,EAAMuM,OAAO,uBAAoC/J,IAzBxDkE,kBA4BJ,SAA2B8F,GACvB,OAAOxM,EAAMmM,KAAK,2BAAyC,CAACxH,MAAO6H,KA5BnE3F,uBA+BJ,SAAgC2F,GAC5B,OAAOxM,EAAMuM,OAAO,2BAAyC,CAAC/J,KAAM,CAACmC,MAAO6H,GAAaC,QAAS,CAAC,eAAgB,uBA/BnHzL,iBAkCJ,WACI,OAAOhB,EAAMiM,IAAI,8BAlCjB3F,cAqCJ,WACI,OAAOtG,EAAMiM,IAAI","file":"3.1b96b660b1d11c328e50.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":""}
@@ -1,2 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[36,122],{38:function(e,n){function t(e,n){return{showToastMessageWithDelay:function(t){return new Promise(r=>{e.success(n.instant(t)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]},69:function(e,n,t){"use strict";t.r(n);t(38),t(5);function r(e,n,t,r,o,i,a,u,s,c,d,g,f,l,p,w,y){var m;e.page=1,e.totalPages=5,e.helpHidden=1===p.get(w.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(n){void 0===n&&(n=p.get(w.HIDE_GRAPH_CONFIG_HELP)),1!==n?(p.set(w.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(p.set(w.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(n,t){e.newConfig.startIRI=n,e.newConfig.startIRILabel=t,m=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(n){return!e.isDefaultGraph(n)},e.getSampleName=function(e,n){const t=e[n+"Description"];return t||(e.id?"Copy of "+e.name:e.name)};const C=g.configName;function h(e){r.warning(e)}function Q(n){let t;return"query"===n.startMode&&1===e.page?t=n.startGraphQuery:2===e.page?t=n.expandQuery:3===e.page?t=n.resourceQuery:4===e.page?t=n.predicateLabelQuery:5===e.page&&(t=n.resourcePropertiesQuery),angular.isDefined(t)?t:""}function b(){function i(){e.getAutocompletePromise=d.checkAutocompleteStatus()}c.getGraphConfigSamples().success((function(n){e.samples=_.filter(n,(function(n){return!n.id||e.newConfig.id!==n.id||(e.revertConfig=n,!1)}))})).error((function(e){r.error(getError(e),y.instant("graphexplore.error.graph.configs"))})),e.createGraphConfig=function(){c.createGraphConfig(e.newConfig).success((async function(){await f.showToastMessageWithDelay("graphexplore.saved.new.config"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),y.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){c.updateGraphConfig(e.newConfig).success((async function(){await f.showToastMessageWithDelay("graphexplore.saved.config"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),y.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){i()})),i(),e.getNamespacesPromise=l.getNamespaces(e.getActiveRepository());const a=function(e,n,t,r,o,i){n?c.validateQuery(n,t,r,o,i).success((function(){e()})).error((function(e){h(getError(e))})):e()};function u(){s()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function s(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(n){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?a(n,e.newConfig.startGraphQuery,"graph"):n():h(y.instant("graphexplore.provide.query")):h(y.instant("graphexplore.select.start.node")):2===e.page?a(n,e.newConfig.expandQuery,"construct",["node"]):3===e.page?a(n,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?a(n,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&a(n,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(n){e.page!==n&&e.validateCurrentPage((function(){e.showEditor(),e.page=n,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),s()&&(m=!1)},e.goToNextPage=function(){u(),m&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){u(),s()&&!m||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):h(y.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const n=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=n:2===e.page?e.newConfig.expandQuery=n:3===e.page?e.newConfig.resourceQuery=n:4===e.page?e.newConfig.predicateLabelQuery=n:5===e.page&&(e.newConfig.resourcePropertiesQuery=n)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const n=Q(e.revertConfig),t=window.editor.getValue().trim();e.queryEditorIsDirty=n!==t}},e.updateEditor=function(){n((function(){e.currentQuery.query=Q(e.newConfig),o.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,D(e.currentQuery.id),E(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(Q(e.revertConfig))},e.$watch("newConfig.startMode",(function(t){"query"===t&&n((function(){e.updateEditor()}),0)})),e.$watch("page",(function(t){("query"===e.newConfig.startMode||t>1)&&n((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},C?(e.isUpdate=!0,c.getConfig(C).success((function(n){e.newConfig=n,b()})).error((function(e){r.error(getError(e),y.instant("created.connector",{name:C}))}))):(e.isUpdate=!1,b());const T={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[T],e.saveTab=function(n){const t=function(n){for(let t=0;t<e.tabsData.length;t++){if(e.tabsData[t].id===n)return t}}(n);if(void 0===t)return{};const r=e.tabsData[t];return e.saveQueryToLocal(r),r},e.loadTab=D,e.addNewTab=function(e,n,t){},e.runQuery=q,e.getNamespaces=I,e.changePagination=function(){q(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=R,e.getExistingTabId=P,e.querySelected=function(n){const t=P(n);e.toggleSampleQueries(),angular.isDefined(t)?E(t):e.addNewTab(null,n.name,n.body)},e.saveQueryToLocal=v,e.setLoader=M,e.getLoaderMessage=function(){const n=(Date.now()-e.queryStartTime)/1e3,t=e.getHumanReadableSeconds(n);let r="";r=e.progressMessage?e.progressMessage+"... "+t:y.instant("common.running.operation",{timeHuman:t});e.extraMessage&&n>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=S,e.changeViewMode=function(t){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,S(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),n((function(){D(t),E(t)}),100)},e.showHideEditor=x,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0;e.getActiveRepository();function v(e){}function M(n,t,r){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=n,n?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=t,e.extraMessage=r,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",o.removeClass("hide")),null===e.$$phase&&e.$apply()}function S(t){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const o=t;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 t;t=n(o?function(){e.fixSizesOnHorizontalViewModeSwitch(o)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){n.cancel(t)}))}window.yasr&&window.yasr.container&&n((function(){window.yasr.container.resize()}),100)}function x(){S(!0)}function E(e){n((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function q(n,t){e.executedQueryTab=e.currentQuery,t&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()?r.warning(y.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=t,e.queryIsRunning||(n?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),M(!0,y.instant("evaluating.query.msg")),window.editor.query())):r.warning(y.instant("cannot.execute.update.error"))}function I(){M(!0,y.instant("common.refreshing.namespaces"),y.instant("common.extra.message")),l.getRepositoryNamespaces().success((function(n){const t={};n.results.bindings.forEach((function(e){t[e.prefix.value]=e.namespace.value})),e.namespaces=t})).error((function(n){e.repositoryError=getError(n)})).finally((function(){M(!1)}))}function R(){u.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){let n=getError(e);return r.error(n,y.instant("common.add.known.prefixes.error")),!0}))}function P(n){let t=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===n.name&&e.query===n.body)return t=e.id,e})),t}e.orientationViewMode||x(),e.getActiveRepository()&&I(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){n((function(){R()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery}));function D(t){e.tabsData=[e.currentQuery];let r=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),n((function(){e.currentTabConfig={},e.currentTabConfig.queryType=r.queryType,e.currentTabConfig.resultsCount=r.resultsCount,e.currentTabConfig.offset=r.offset,e.currentTabConfig.allResultsCount=r.allResultsCount,e.currentTabConfig.page=r.page,e.currentTabConfig.pageSize=r.pageSize,e.currentTabConfig.timeFinished=r.timeFinished,e.currentTabConfig.timeTook=r.timeTook,e.currentTabConfig.sizeDelta=r.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function H(e){return $(e).attr("data-id")}e.$on("tabAction",(function(n,t){t.relatedTarget&&e.saveTab(H(t.relatedTarget)),e.loadTab(H(t.target))})),e.$on("deleteAllexeptSelected",(function(n,t){e.tabsData=t,e.tabs=t})),e.currentQuery=angular.copy(T),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]}}]);
2
- //# sourceMappingURL=36.991eae8184e7b5fa5cbf.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/utils/notifications.js","webpack:///./src/js/angular/graphexplore/controllers/graphs-config.controller.js"],"names":["Notifications","toastr","$translate","showToastMessageWithDelay","message","Promise","r","success","instant","setTimeout","angular","module","factory","$inject","GraphConfigCtrl","$scope","$timeout","$location","$repositories","$modal","ModalService","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","selectedFixedNodeChanged","page","totalPages","helpHidden","get","HIDE_GRAPH_CONFIG_HELP","toggleHelp","value","undefined","set","fixedVisualCallback","uri","label","newConfig","startIRI","startIRILabel","isDefaultGraph","sample","name","isUserGraph","getSampleName","property","extra","id","configName","showInvalidMsg","warning","getQueryForCurrentPage","config","query","startMode","startGraphQuery","expandQuery","resourceQuery","predicateLabelQuery","resourcePropertiesQuery","isDefined","initForConfig","checkAutocompleteStatus","getAutocompletePromise","getGraphConfigSamples","data","samples","_","filter","s","revertConfig","error","getError","createGraphConfig","async","url","updateGraphConfig","$on","getNamespacesPromise","getNamespaces","getActiveRepository","validateQueryWithCallback","successCallback","queryType","params","all","oneOf","validateQuery","broadcastAddStartFixedNodeEvent","checkPageAndMode","$broadcast","validateCurrentPage","updateModel","goToPage","nextPage","showEditor","notoolbar","goToPreviousPage","goToNextPage","saveGraphConfig","startQueryIncludeInferred","currentQuery","inference","startQuerySameAs","sameAs","isUpdate","window","editor","getValue","trim","setQuery","setValue","updateDirty","q1","q2","queryEditorIsDirty","updateEditor","isActiveRepoOntopType","nocount","loadTab","selectTab","xhr","abort","viewMode","showPreview","outputType","runQuery","revertEditor","$watch","shared","encodeQuery","encodeURIComponent","getConfig","defaultTabConfig","resetCurrentTabConfig","currentTabConfig","pageSize","allResultsCount","resultsCount","queryExists","tabsData","tabs","saveTab","idx","i","length","findTabIndexByID","tab","saveQueryToLocal","addNewTab","callback","tabName","savedQuery","changePagination","explainRequested","toggleSampleQueries","addKnownPrefixes","getExistingTabId","querySelected","tabId","body","setLoader","getLoaderMessage","timeSeconds","Date","now","queryStartTime","timeHuman","getHumanReadableSeconds","progressMessage","extraMessage","fixSizesOnHorizontalViewModeSwitch","changeViewMode","tabID","orientationViewMode","$","remove","showHideEditor","focusQueryEditor","element","document","find","is","focus","currentQueryTab","isRunning","yasrInnerContainer","getElementById","queryIsRunning","countTimeouted","addClass","removeClass","$$phase","$apply","verticalViewParam","visibleWindowHeight","innerHeight","documentElement","clientHeight","verticalView","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","timer","cancel","yasr","container","resize","changePage","explain","executedQueryTab","getQueryType","getQueryMode","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","e","prefix","namespace","namespaces","repositoryError","finally","JSON","stringify","msg","existingTabId","item","on","$watchCollection","offset","timeFinished","timeTook","sizeDelta","css","getQueryID","attr","tabEvent","relatedTarget","target","copy","showSampleQueries","sampleQueries","getResultsDescription","getUpdateDescription","getStaleWarningMessage","controller"],"mappings":"+EAMA,SAASA,EAAcC,EAAQC,GAC3B,MAAO,CACHC,0BASJ,SAAmCC,GAC/B,OAAO,IAAIC,QAASC,IAChBL,EAAOM,QAAQL,EAAWM,QAAQJ,IAClCK,WAAWH,EAAG,SApB1BI,QACKC,OAAO,wCAAyC,IAChDC,QAAQ,gBAAiBZ,GAE9BA,EAAca,QAAU,CAAC,SAAU,e,gCCJnC,kBAYA,SAASC,EAAgBC,EAAQC,EAAUC,EAAWhB,EAAQiB,EAAeC,EAAQC,EAAcC,EAAmBC,EAASC,EAAwBC,EAAyBC,EAAczB,EAAe0B,EAA8BC,EAAqBC,EAAQ1B,GAoBpQ,IAAI2B,EAlBJd,EAAOe,KAAO,EACdf,EAAOgB,WAAa,EAEpBhB,EAAOiB,WAAwE,IAA3DL,EAAoBM,IAAIL,EAAOM,wBAEnDnB,EAAOoB,WAAa,SAAUC,QACZC,IAAVD,IACAA,EAAQT,EAAoBM,IAAIL,EAAOM,yBAE7B,IAAVE,GACAT,EAAoBW,IAAIV,EAAOM,uBAAwB,GACvDnB,EAAOiB,YAAa,IAEpBL,EAAoBW,IAAIV,EAAOM,uBAAwB,GACvDnB,EAAOiB,YAAa,IAK5BjB,EAAOwB,oBAAsB,SAAUC,EAAKC,GACxC1B,EAAO2B,UAAUC,SAAWH,EAC5BzB,EAAO2B,UAAUE,cAAgBH,EACjCZ,GAA2B,GAG/Bd,EAAO8B,eAAiB,SAAUC,GAC9B,MAAwB,YAAhBA,E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OA,KAIlBnI,EAAO2F,aAAehG,QAAQkP,KAAKlH,GAEnC3H,EAAO8O,mBAAoB,EAC3B9O,EAAO8I,WAAa,GACpB9I,EAAO+O,cAAgB,GAEvB/O,EAAOgP,sBAAwB,aAG/BhP,EAAOiP,qBAAuB,aAG9BjP,EAAOkP,uBAAyB,aA/sBpCvP,QACKC,OAAO,6DAA8D,CAClE,wCACA,gDAEHuP,WAAW,kBAAmBpP,GAEnCA,EAAgBD,QAAU,CAAC,SAAU,WAAY,YAAa,SAAU,gBAAiB,SAAU,eAAgB,oBAAqB,UAAW,yBAA0B,0BAA2B,eAAgB,gBAAiB,+BAAgC,sBAAuB,SAAU","file":"36.991eae8184e7b5fa5cbf.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 200);\n });\n }\n}\n","import 'angular/utils/notifications';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.graphexplore.controllers.graphviz.config', [\n 'graphdb.framework.utils.notifications',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .controller('GraphConfigCtrl', GraphConfigCtrl);\n\nGraphConfigCtrl.$inject = ['$scope', '$timeout', '$location', 'toastr', '$repositories', '$modal', 'ModalService', 'SparqlRestService', '$filter', 'GraphConfigRestService', 'AutocompleteRestService', '$routeParams', 'Notifications', 'RDF4JRepositoriesRestService', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction GraphConfigCtrl($scope, $timeout, $location, toastr, $repositories, $modal, ModalService, SparqlRestService, $filter, GraphConfigRestService, AutocompleteRestService, $routeParams, Notifications, RDF4JRepositoriesRestService, LocalStorageAdapter, LSKeys, $translate) {\n\n $scope.page = 1;\n $scope.totalPages = 5;\n\n $scope.helpHidden = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP) === 1;\n\n $scope.toggleHelp = function (value) {\n if (value === undefined) {\n value = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP);\n }\n if (value !== 1) {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 1);\n $scope.helpHidden = true;\n } else {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 0);\n $scope.helpHidden = false;\n }\n };\n\n var selectedFixedNodeChanged;\n $scope.fixedVisualCallback = function (uri, label) {\n $scope.newConfig.startIRI = uri;\n $scope.newConfig.startIRILabel = label;\n selectedFixedNodeChanged = true;\n };\n\n $scope.isDefaultGraph = function (sample) {\n return (sample.name === 'Minimal' || sample.name === 'Advanced');\n };\n\n $scope.isUserGraph = function (sample) {\n return !$scope.isDefaultGraph(sample);\n };\n\n $scope.getSampleName = function (sample, property) {\n const extra = sample[property + 'Description'];\n if (extra) {\n // Sample has description, use it\n return extra;\n } else {\n // Sample is a copy of existing config, prepend Copy of to name\n return sample.id ? 'Copy of ' + sample.name : sample.name;\n }\n };\n\n const getGraphConfigSamples = function () {\n GraphConfigRestService.getGraphConfigSamples()\n .success(function (data) {\n $scope.samples = _.filter(data, function (s) {\n // Skip the currently edited config from samples and store it into a revert variable\n if (!s.id || $scope.newConfig.id !== s.id) {\n return true;\n } else {\n $scope.revertConfig = s;\n return false;\n }\n });\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.graph.configs'));\n });\n };\n\n const configName = $routeParams.configName;\n $scope.newConfig = {startQueryIncludeInferred: true, startQuerySameAs: true};\n $scope.newConfig.startMode = 'search';\n $scope.isUpdate = false;\n $scope.shared = false;\n\n $scope.encodeQuery = function (query) {\n return encodeURIComponent(query);\n };\n\n function showInvalidMsg(message) {\n toastr.warning(message);\n }\n\n if (configName) {\n $scope.isUpdate = true;\n GraphConfigRestService.getConfig(configName)\n .success(function (data) {\n $scope.newConfig = data;\n initForConfig();\n })\n .error(function (data) {\n toastr.error(getError(data), $translate.instant('created.connector', {name: configName}));\n });\n } else {\n $scope.isUpdate = false;\n initForConfig();\n }\n\n function getQueryForCurrentPage(config) {\n let query;\n\n if (config.startMode === 'query' && $scope.page === 1) {\n query = config.startGraphQuery;\n } else if ($scope.page === 2) {\n query = config.expandQuery;\n } else if ($scope.page === 3) {\n query = config.resourceQuery;\n } else if ($scope.page === 4) {\n query = config.predicateLabelQuery;\n } else if ($scope.page === 5) {\n query = config.resourcePropertiesQuery;\n }\n\n return angular.isDefined(query) ? query : '';\n }\n\n function initForConfig() {\n getGraphConfigSamples();\n $scope.createGraphConfig = function () {\n GraphConfigRestService.createGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('graphexplore.saved.new.config');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.could.not.create'));\n });\n };\n\n $scope.updateGraphConfig = function () {\n GraphConfigRestService.updateGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('graphexplore.saved.config');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.could.not.save'));\n });\n };\n\n function checkAutocompleteStatus() {\n $scope.getAutocompletePromise = AutocompleteRestService.checkAutocompleteStatus();\n }\n\n $scope.$on('autocompleteStatus', function() {\n checkAutocompleteStatus();\n });\n\n checkAutocompleteStatus();\n $scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository());\n\n const validateQueryWithCallback = function (successCallback, query, queryType, params, all, oneOf) {\n if (!query) {\n successCallback();\n } else {\n GraphConfigRestService.validateQuery(query, queryType, params, all, oneOf)\n .success(function () {\n successCallback();\n }).error(function (data) {\n showInvalidMsg(getError(data));\n });\n }\n };\n\n $scope.validateCurrentPage = function (successCallback) {\n $scope.updateModel();\n\n if ($scope.page === 1) {\n if ($scope.newConfig.startMode === 'node' && !$scope.newConfig.startIRI) {\n showInvalidMsg($translate.instant('graphexplore.select.start.node'));\n } else if ($scope.newConfig.startMode === 'query' && !$scope.newConfig.startGraphQuery) {\n showInvalidMsg($translate.instant('graphexplore.provide.query'));\n } else if ($scope.newConfig.startMode === 'query') {\n validateQueryWithCallback(successCallback, $scope.newConfig.startGraphQuery, 'graph')\n } else {\n successCallback();\n }\n } else if ($scope.page === 2) {\n validateQueryWithCallback(successCallback, $scope.newConfig.expandQuery, 'construct', ['node'])\n } else if ($scope.page === 3) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourceQuery, 'tuple', ['node'], [], ['type', 'label', 'comment', 'rank']);\n } else if ($scope.page === 4) {\n validateQueryWithCallback(successCallback, $scope.newConfig.predicateLabelQuery, 'tuple', ['edge'], ['label']);\n } else if ($scope.page === 5) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourcePropertiesQuery, 'tuple', ['node'], ['property', 'value']);\n }\n };\n\n $scope.goToPage = function (nextPage) {\n if ($scope.page === nextPage) {\n // already there\n return;\n }\n\n $scope.validateCurrentPage(function () {\n $scope.showEditor();\n $scope.page = nextPage;\n $scope.notoolbar = $scope.page !== 1;\n });\n };\n\n $scope.goToPreviousPage = function () {\n if ($scope.page > 1) {\n $scope.goToPage($scope.page - 1);\n }\n\n if (checkPageAndMode()) {\n selectedFixedNodeChanged = false;\n }\n };\n\n $scope.goToNextPage = function () {\n broadcastAddStartFixedNodeEvent();\n if (selectedFixedNodeChanged) {\n $scope.goToPage($scope.page + 1);\n }\n };\n\n function broadcastAddStartFixedNodeEvent() {\n if (checkPageAndMode()) {\n $scope.$broadcast('addStartFixedNodeAutomatically', {startIRI: $scope.newConfig.startIRI});\n }\n }\n\n function checkPageAndMode() {\n return $scope.page === 1 && $scope.newConfig.startMode === 'node';\n }\n\n $scope.saveGraphConfig = function () {\n broadcastAddStartFixedNodeEvent();\n\n if (checkPageAndMode() && !selectedFixedNodeChanged) {\n return;\n }\n\n $scope.newConfig.startQueryIncludeInferred = $scope.currentQuery.inference;\n $scope.newConfig.startQuerySameAs = $scope.currentQuery.sameAs;\n\n $scope.validateCurrentPage(function () {\n if (!$scope.newConfig.name) {\n showInvalidMsg($translate.instant('graphexplore.provide.config.name'));\n return;\n }\n $scope.isUpdate ? $scope.updateGraphConfig($scope.newConfig) : $scope.createGraphConfig($scope.newConfig);\n });\n };\n\n $scope.updateModel = function () {\n const query = window.editor.getValue().trim();\n if ($scope.newConfig.startMode === 'query' && $scope.page === 1) {\n $scope.newConfig.startGraphQuery = query;\n } else if ($scope.page === 2) {\n $scope.newConfig.expandQuery = query;\n } else if ($scope.page === 3) {\n $scope.newConfig.resourceQuery = query;\n } else if ($scope.page === 4) {\n $scope.newConfig.predicateLabelQuery = query;\n } else if ($scope.page === 5) {\n $scope.newConfig.resourcePropertiesQuery = query;\n }\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n $scope.updateDirty = function () {\n if ($scope.revertConfig) {\n const q1 = getQueryForCurrentPage($scope.revertConfig);\n const q2 = window.editor.getValue().trim();\n $scope.queryEditorIsDirty = q1 !== q2;\n }\n };\n\n // Updates the position of the query editor to match the current div placeholder\n // and sets the editor's query to the relevant query from the model.\n $scope.updateEditor = function () {\n $timeout(function () {\n $scope.currentQuery.query = getQueryForCurrentPage($scope.newConfig);\n // // Check for ontop repository and override nocount property (it's default value is false)\n if ($repositories.isActiveRepoOntopType()) {\n $scope.nocount = true;\n }\n $scope.currentQuery.inference = $scope.newConfig.startQueryIncludeInferred;\n $scope.currentQuery.sameAs = $scope.newConfig.startQuerySameAs;\n loadTab($scope.currentQuery.id);\n selectTab($scope.currentQuery.id);\n }, 100);\n\n };\n\n $scope.showEditor = function () {\n if (window.editor && window.editor.xhr) {\n window.editor.xhr.abort();\n }\n $scope.viewMode = 'yasr';\n };\n\n $scope.showPreview = function () {\n // For some reason YASR gets confused and sets this to rawResponse\n // if we execute a CONSTRUCT and then a SELECT. This makes sure it's always table.\n $scope.currentQuery.outputType = 'table';\n $scope.runQuery();\n };\n\n $scope.revertEditor = function () {\n $scope.setQuery(getQueryForCurrentPage($scope.revertConfig));\n };\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('newConfig.startMode', function (value) {\n if (value === 'query') {\n $timeout(function () {\n $scope.updateEditor();\n }, 0);\n }\n });\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('page', function (value) {\n if ($scope.newConfig.startMode === 'query' || value > 1) {\n $timeout(function () {\n $scope.showEditor();\n $scope.updateEditor();\n }, 0);\n }\n });\n }\n\n // DOWN HERE WE KEEP EVERYTHING PURELY QUERY EDITOR (MOSTLY BORROWED FROM query-editor.controller.js)\n // But Why? Can't we reuse it instead of borrow?\n\n const defaultTabConfig = {\n id: '1',\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: $scope.newConfig.startQueryIncludeInferred,\n sameAs: $scope.newConfig.startQuerySameAs\n };\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 100, // page limit 100 as this is only used for preview\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = true;\n\n // start of repository actions\n let backendRepositoryID = $scope.getActiveRepository();\n\n function saveQueryToLocal(currentQueryTab) {\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = $translate.instant('common.running.operation', {timeHuman: timeHuman});\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n }\n\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalViewParam) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n const codemirrorWrapperSelector = '.CodeMirror-wrap';\n const verticalView = verticalViewParam;\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector(codemirrorWrapperSelector)) {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView)\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n } else {\n $scope.noPadding = {};\n document.querySelector(codemirrorWrapperSelector).style.height = '';\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode(tabID) {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n fixSizesOnHorizontalViewModeSwitch();\n $('.dataTables_filter').remove();\n $('.resultsTable').remove();\n $timeout(function () {\n loadTab(tabID);\n selectTab(tabID);\n }, 100);\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(':focus')) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n // end of query editor results orientation operations\n\n function deleteCachedSparqlResults() {\n }\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery;\n if (explain && !(window.editor.getQueryType() === 'SELECT' || window.editor.getQueryType() === 'CONSTRUCT')) {\n toastr.warning($translate.instant('query.editor.warning.msg'));\n return;\n }\n\n if (window.editor.getQueryMode() === 'update') {\n toastr.warning($translate.instant('cannot.execute.update.error'));\n return;\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n // Hides the editor and shows the yasr results\n $scope.viewMode = 'editor';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch()\n }\n\n setLoader(true, $translate.instant('evaluating.query.msg'));\n window.editor.query();\n }\n }\n\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n if ($scope.getActiveRepository()) {\n getNamespaces();\n }\n\n $scope.$on('$destroy', function () {\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n }\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n let msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n angular.forEach($scope.tabsData, function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n\n return existingTabId;\n }\n\n // end of query operations\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n $scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function () {\n saveQueryToLocal($scope.currentQuery);\n });\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n let maxID = 1;\n\n function addNewTab(callback, tabName, savedQuery) {\n }\n\n function loadTab(id) {\n $scope.tabsData = [$scope.currentQuery];\n\n let tab = $scope.currentQuery;\n\n if ($scope.currentQuery.query == null || $scope.currentQuery.query === '') {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query);\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n //Remove padding of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n $scope.loadTab(getQueryID(tabEvent.target));\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = angular.copy(defaultTabConfig);\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n\n $scope.getResultsDescription = function () {\n };\n\n $scope.getUpdateDescription = function () {\n };\n\n $scope.getStaleWarningMessage = function () {\n }\n\n}\n"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[39,93],{133:function(e,n,o){"use strict";o.r(n);o(4),o(11),o(85);angular.module("graphdb.framework.jmx.queries",["toastr","ui.bootstrap","graphdb.framework.jmx.queries.controllers","graphdb.framework.core.directives"])},85:function(e,n,o){"use strict";o.r(n);o(4),o(14);const t=angular.module("graphdb.framework.jmx.queries.controllers",["ui.bootstrap","toastr","graphdb.framework.rest.monitoring.service"]);t.controller("QueriesCtrl",["$scope","$modal","toastr","$interval","$repositories","$jwtAuth","ModalService","MonitoringRestService","$translate",function(e,n,o,t,r,i,s,c,a){e.loader=!0,e.stringLimit=500,e.expanded={},e.error="";const u=document.createElement("a");e.parseNode=function(e){if(null==e)return null;let n="local";if(e.indexOf("://localhost:")<0&&e.indexOf("://localhost/")<0){u.href=e;let o=u.hostname;(function(e){const n=e.split(".");for(let e=0,o=0;e<n.length;e++)if(parseInt(n[e],10)>=0&&parseInt(n[e],10)<=255?o++:o=0,4===o)return!0;return!1})(u.hostname)||(o=u.hostname.split(".")[0]),n=o+":"+u.port}const o=e.match(/\/repositories\/([^\/]+)#(\d+)/);return[o[2],n,o[1]]},e.getQueries=function(){e.getQueriesRunning||e.paused||e.error||!r.getActiveRepository()||(e.getQueriesRunning=!0,c.monitorQuery().success((function(n){const o=n;e.noQueries=0===o.length,e.queries={};for(let n=0;n<o.length;n++)o[n].parsedNode=e.parseNode(o[n].node),e.queries[o[n].trackId]=o[n];e.noActiveRepository=!1,e.loader=!1,e.getQueriesRunning=!1})).error((function(n){e.error=getError(n),e.loader=!1,e.getQueriesRunning=!1})))};const l=t((function(){r.isActiveRepoOntopType()||e.getQueries()}),1e3);e.$on("$destroy",(function(){t.cancel(l)})),e.deleteQueryHttp=function(n){e.loader=!0,c.deleteQuery(n).success((function(){o.success(a.instant("abort.request.sent.msg")),e.loader=!1})).error((function(n){const t=getError(n);o.error(t,a.instant("common.error")),e.loader=!1}))},e.abortQuery=function(n){s.openSimpleModal({title:a.instant("confirm.abort"),message:a.instant("confirm.abort.warning.msg"),warning:!0}).result.then((function(){e.deleteQueryHttp(n)}))},e.downloadQuery=function(e){const n="query_"+e+".rq";let o="rest/monitor/query/download?queryId="+encodeURIComponent(e)+"&repository="+encodeURIComponent(r.getActiveRepository())+"&filename="+encodeURIComponent(n);i.isAuthenticated()&&(o=o+"&authToken="+encodeURIComponent(i.getAuthToken())),window.open(o,"_blank")},e.toggleQueryExpanded=function(n){e.expanded[n]=!e.expanded[n]}}]),t.controller("DeleteQueryCtrl",["$scope","$modalInstance",function(e,n){e.ok=function(){n.close()},e.cancel=function(){n.dismiss("cancel")}}])}}]);
2
- //# sourceMappingURL=39.3f07a4be36e81e42c86e.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/queries/app.js","webpack:///./src/js/angular/queries/controllers.js"],"names":["angular","module","queriesCtrl","controller","$scope","$modal","toastr","$interval","$repositories","$jwtAuth","ModalService","MonitoringRestService","$translate","loader","stringLimit","expanded","error","parser","document","createElement","parseNode","node","shortUrl","indexOf","href","hostname","ip","blocks","split","i","sequence","length","parseInt","containsIPV4","port","match","getQueries","getQueriesRunning","paused","getActiveRepository","monitorQuery","success","data","newQueries","noQueries","queries","parsedNode","trackId","noActiveRepository","getError","timer","isActiveRepoOntopType","$on","cancel","deleteQueryHttp","queryId","deleteQuery","instant","msg","abortQuery","openSimpleModal","title","message","warning","result","then","downloadQuery","filename","link","encodeURIComponent","isAuthenticated","getAuthToken","window","open","toggleQueryExpanded","$modalInstance","ok","close","dismiss"],"mappings":"8FAAA,wBAWAA,QAAQC,OAAO,gCAPC,CACZ,SACA,eACA,4CACA,uC,gCCRJ,kBAGA,MAAMC,EAAcF,QAAQC,OAAO,4CAA6C,CAC5E,eACA,SACA,8CAGJC,EAAYC,WAAW,cAAe,CAAC,SAAU,SAAU,SAAU,YAAa,gBAAiB,WAAY,eAAgB,wBAAyB,aACpJ,SAAUC,EAAQC,EAAQC,EAAQC,EAAWC,EAAeC,EAAUC,EAAcC,EAAuBC,GAEvGR,EAAOS,QAAS,EAChBT,EAAOU,YAAc,IACrBV,EAAOW,SAAW,GAClBX,EAAOY,MAAQ,GAiBf,MAAMC,EAASC,SAASC,cAAc,KAItCf,EAAOgB,UAAY,SAAUC,GACzB,GAAY,MAARA,EACA,OAAO,KAGX,IAAIC,EAAW,QACf,GAAID,EAAKE,QAAQ,iBAAmB,GAAKF,EAAKE,QAAQ,iBAAmB,EAAG,CACxEN,EAAOO,KAAOH,EACd,IAAII,EAAWR,EAAOQ,UA3B9B,SAAsBC,GAClB,MAAMC,EAASD,EAAGE,MAAM,KACxB,IAAK,IAAIC,EAAI,EAAGC,EAAW,EAAGD,EAAIF,EAAOI,OAAQF,IAM7C,GALIG,SAASL,EAAOE,GAAI,KAAO,GAAKG,SAASL,EAAOE,GAAI,KAAO,IAC3DC,IAEAA,EAAW,EAEE,IAAbA,EACA,OAAO,EAGf,OAAO,GAgBEG,CAAahB,EAAOQ,YACrBA,EAAWR,EAAOQ,SAASG,MAAM,KAAK,IAE1CN,EAAWG,EAAW,IAAMR,EAAOiB,KAEvC,MAAMC,EAAQd,EAAKc,MAAM,kCAEzB,MAAO,CAACA,EAAM,GAAIb,EAAUa,EAAM,KAGtC/B,EAAOgC,WAAa,WAGZhC,EAAOiC,mBA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Bd,GACjE,eAAiBc,mBAAmB7D,EAAc+B,uBAClD,aAAe8B,mBAAmBF,GACpC1D,EAAS6D,oBACTF,EAAOA,EAAO,cAAgBC,mBAAmB5D,EAAS8D,iBAG9DC,OAAOC,KAAKL,EAAM,WAGtBhE,EAAOsE,oBAAsB,SAAUnB,GACnCnD,EAAOW,SAASwC,IAAYnD,EAAOW,SAASwC,OAKxDrD,EAAYC,WAAW,kBAAmB,CAAC,SAAU,iBAAkB,SAAUC,EAAQuE,GAErFvE,EAAOwE,GAAK,WACRD,EAAeE,SAGnBzE,EAAOiD,OAAS,WACZsB,EAAeG,QAAQ","file":"39.3f07a4be36e81e42c86e.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/queries/controllers';\n\nconst modules = [\n 'toastr',\n 'ui.bootstrap',\n 'graphdb.framework.jmx.queries.controllers',\n 'graphdb.framework.core.directives'\n];\n\nangular.module('graphdb.framework.jmx.queries', modules);\n","import 'angular/core/services';\nimport 'angular/rest/monitoring.rest.service';\n\nconst queriesCtrl = angular.module('graphdb.framework.jmx.queries.controllers', [\n 'ui.bootstrap',\n 'toastr',\n 'graphdb.framework.rest.monitoring.service'\n]);\n\nqueriesCtrl.controller('QueriesCtrl', ['$scope', '$modal', 'toastr', '$interval', '$repositories', '$jwtAuth', 'ModalService', 'MonitoringRestService', '$translate',\n function ($scope, $modal, toastr, $interval, $repositories, $jwtAuth, ModalService, MonitoringRestService, $translate) {\n\n $scope.loader = true;\n $scope.stringLimit = 500;\n $scope.expanded = {};\n $scope.error = '';\n\n function containsIPV4(ip) {\n const blocks = ip.split('.');\n for (let i = 0, sequence = 0; i < blocks.length; i++) {\n if (parseInt(blocks[i], 10) >= 0 && parseInt(blocks[i], 10) <= 255) {\n sequence++;\n } else {\n sequence = 0;\n }\n if (sequence === 4) {\n return true;\n }\n }\n return false;\n }\n\n const parser = document.createElement('a');\n\n // Parses a node of the kind http://host.example.com:7200/repositories/repo#NN,\n // where NN is the track ID into an array [NN, host:7200, repo].\n $scope.parseNode = function (node) {\n if (node == null) {\n return null;\n }\n\n let shortUrl = 'local';\n if (node.indexOf('://localhost:') < 0 && node.indexOf('://localhost/') < 0) {\n parser.href = node;\n let hostname = parser.hostname;\n if (!containsIPV4(parser.hostname)) {\n hostname = parser.hostname.split('.')[0];\n }\n shortUrl = hostname + ':' + parser.port;\n }\n const match = node.match(/\\/repositories\\/([^\\/]+)#(\\d+)/); // eslint-disable-line no-useless-escape\n\n return [match[2], shortUrl, match[1]];\n };\n\n $scope.getQueries = function () {\n // Skip execution if already getting from previous call, if paused, if jolokia returned an error,\n // or if no repository is available\n if ($scope.getQueriesRunning || $scope.paused || $scope.error || !$repositories.getActiveRepository()) {\n return;\n }\n\n $scope.getQueriesRunning = true;\n MonitoringRestService.monitorQuery().success(function (data) {\n const newQueries = data;\n $scope.noQueries = newQueries.length === 0;\n\n // Converts array to object. Angular seems to handle updates on objects better, i.e.\n // it doesn't recreate DOM elements for queries that are already displayed.\n $scope.queries = {};\n for (let i = 0; i < newQueries.length; i++) {\n newQueries[i].parsedNode = $scope.parseNode(newQueries[i].node);\n $scope.queries[newQueries[i].trackId] = newQueries[i];\n }\n\n $scope.noActiveRepository = false;\n $scope.loader = false;\n $scope.getQueriesRunning = false;\n }).error(function (data) {\n $scope.error = getError(data);\n $scope.loader = false;\n $scope.getQueriesRunning = false;\n });\n };\n\n const timer = $interval(function () {\n // Don't call getQueries for Ontop type repository\n if ($repositories.isActiveRepoOntopType()) {\n return;\n }\n $scope.getQueries();\n }, 1000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel(timer);\n });\n\n $scope.deleteQueryHttp = function (queryId) {\n\n $scope.loader = true;\n MonitoringRestService.deleteQuery(queryId).success(function () {\n toastr.success($translate.instant('abort.request.sent.msg'));\n $scope.loader = false;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n\n $scope.loader = false;\n });\n };\n\n $scope.abortQuery = function (queryId) {\n ModalService.openSimpleModal({\n title: $translate.instant('confirm.abort'),\n message: $translate.instant('confirm.abort.warning.msg'),\n warning: true\n }).result.then(function () {\n $scope.deleteQueryHttp(queryId);\n });\n };\n\n $scope.downloadQuery = function (queryId) {\n const filename = 'query_' + queryId + '.rq';\n let link = 'rest/monitor/query/download?queryId=' + encodeURIComponent(queryId)\n + '&repository=' + encodeURIComponent($repositories.getActiveRepository())\n + '&filename=' + encodeURIComponent(filename);\n if ($jwtAuth.isAuthenticated()) {\n link = link + '&authToken=' + encodeURIComponent($jwtAuth.getAuthToken());\n }\n\n window.open(link, '_blank');\n };\n\n $scope.toggleQueryExpanded = function (queryId) {\n $scope.expanded[queryId] = !$scope.expanded[queryId];\n };\n }]);\n\n\nqueriesCtrl.controller('DeleteQueryCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance) {\n\n $scope.ok = function () {\n $modalInstance.close();\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}]);\n"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[55],{57:function(e,t){function a(){return{transformToTrig:function(e){let t="";const a={};for(let t=0;t<e.length;t++){const l=e[t];if(void 0===l.context?l.context="":l.context=_.trim(l.context),angular.isUndefined(a[l.context])){const e=[];e.push(l),a[l.context]=e}else a[l.context].push(l)}const l=Object.keys(a);for(let e=0;e<l.length;e++){const n=l[e];t+=""===n?"\n{":"\n<"+n+"> {";const w=a[n];for(let e=0;e<w.length;e++){const a=w[e];t+="\n\t<"+a.subject+"> <"+a.predicate+"> ","uri"===a.object.type?t+="<"+a.object.value+"> .":t+='"'+a.object.value+'"'+(a.object.datatype?"^^<"+a.object.datatype+">":a.object.lang?"@"+a.object.lang:"")+" ."}t+="\n}"}return t},buildStatements:function(e,t){const a=[];if(!_.isEmpty(e.data)){const l=e.data[t],n=Object.keys(l);for(let e=0;e<n.length;e++){const w=n[e],o=l[w];for(let e=0;e<o.length;e++){const l=o[e];for(let e=0;e<l.graphs.length;e++){let n=l.graphs[e];"http://www.ontotext.com/explicit"===n&&(n=""),l.lang&&(l.datatype=""),l.datatype||(l.datatype=""),a.push({subject:t,predicate:w,object:{value:l.value,type:l.type,datatype:l.datatype,lang:l.lang},context:n})}}}}return a},getDatatypeOptions:function(){return[{value:"",label:"string"},{value:"http://www.w3.org/2001/XMLSchema#boolean",label:"boolean"},{value:"http://www.w3.org/2001/XMLSchema#decimal",label:"decimal"},{value:"http://www.w3.org/2001/XMLSchema#integer",label:"integer"},{value:"http://www.w3.org/2001/XMLSchema#double",label:"double"},{value:"http://www.w3.org/2001/XMLSchema#float",label:"float"},{value:"http://www.w3.org/2001/XMLSchema#date",label:"date"},{value:"http://www.w3.org/2001/XMLSchema#time",label:"time"},{value:"http://www.w3.org/2001/XMLSchema#dateTime",label:"date time"},{value:"http://www.w3.org/2001/XMLSchema#byte",label:"byte"},{value:"http://www.w3.org/2001/XMLSchema#short",label:"short"},{value:"http://www.w3.org/2001/XMLSchema#int",label:"int"},{value:"http://www.w3.org/2001/XMLSchema#long",label:"long"},{value:"http://www.w3.org/2001/XMLSchema#unsignedByte",label:"unsigned byte"},{value:"http://www.w3.org/2001/XMLSchema#unsignedShort",label:"unsigned short"},{value:"http://www.w3.org/2001/XMLSchema#unsignedInt",label:"unsigned int"},{value:"http://www.w3.org/2001/XMLSchema#unsignedLong",label:"unsigned long"},{value:"http://www.w3.org/2001/XMLSchema#positoveInteger",label:"positive integer"},{value:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",label:"non-negative integer"},{value:"http://www.w3.org/2001/XMLSchema#negativeInteger",label:"negative integer"},{value:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",label:"non-positive integer"},{value:"http://www.w3.org/2001/XMLSchema#gYear",label:"gYear"},{value:"http://www.w3.org/2001/XMLSchema#gMonth",label:"gMonth"},{value:"http://www.w3.org/2001/XMLSchema#gDay",label:"gDay"},{value:"http://www.w3.org/2001/XMLSchema#gYearMonth",label:"gYearMonth"},{value:"http://www.w3.org/2001/XMLSchema#gMonthDay",label:"gMonthDay"},{value:"http://www.w3.org/2001/XMLSchema#duration",label:"duration"},{value:"http://www.w3.org/2001/XMLSchema#hexBinary",label:"hex binary"},{value:"http://www.w3.org/2001/XMLSchema#base64Binary",label:"base64 binary"}]}}}angular.module("graphdb.framework.explore.services",[]).factory("StatementsService",a),a.$inject=[]}}]);
2
- //# sourceMappingURL=55.975653547fd9764a2a71.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/explore/statements.service.js"],"names":["StatementsService","transformToTrig","statements","data","contexts","i","length","statement","undefined","context","_","trim","angular","isUndefined","cstatement","push","ckeys","Object","keys","key","value","j","subject","predicate","object","type","datatype","lang","buildStatements","res","uri","isEmpty","graph","predicates","objects","k","graphs","getDatatypeOptions","label","module","factory","$inject"],"mappings":"2EAMA,SAASA,IAoLL,MAAO,CACHC,gBApLJ,SAAyBC,GACrB,IAAIC,EAAO,GACX,MAAMC,EAAW,GAEjB,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAWI,OAAQD,IAAK,CACxC,MAAME,EAAYL,EAAWG,GAM7B,QAL0BG,IAAtBD,EAAUE,QACVF,EAAUE,QAAU,GAEpBF,EAAUE,QAAUC,EAAEC,KAAKJ,EAAUE,SAErCG,QAAQC,YAAYT,EAASG,EAAUE,UAAW,CAClD,MAAMK,EAAa,GACnBA,EAAWC,KAAKR,GAChBH,EAASG,EAAUE,SAAWK,OAE9BV,EAASG,EAAUE,SAASM,KAAKR,GAIzC,MAAMS,EAAQC,OAAOC,KAAKd,GAC1B,IAAK,IAAIC,EAAI,EAAGA,EAAIW,EAAMV,OAAQD,IAAK,CACnC,MAAMc,EAAMH,EAAMX,GAEdF,GADQ,KAARgB,EACQ,MAEA,MAAQA,EAAM,MAG1B,MAAMC,EAAQhB,EAASe,GACvB,IAAK,IAAIE,EAAI,EAAGA,EAAID,EAAMd,OAAQe,IAAK,CACnC,MAAMd,EA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AAO,WACR,CACClB,MAAO,2CACPkB,MAAO,WACR,CACClB,MAAO,0CACPkB,MAAO,UACR,CACClB,MAAO,yCACPkB,MAAO,SACR,CACClB,MAAO,wCACPkB,MAAO,QACR,CACClB,MAAO,wCACPkB,MAAO,QACR,CACClB,MAAO,4CACPkB,MAAO,aACR,CACClB,MAAO,wCACPkB,MAAO,QACR,CACClB,MAAO,yCACPkB,MAAO,SACR,CACClB,MAAO,uCACPkB,MAAO,OACR,CACClB,MAAO,wCACPkB,MAAO,QACR,CACClB,MAAO,gDACPkB,MAAO,iBACR,CACClB,MAAO,iDACPkB,MAAO,kBACR,CACClB,MAAO,+CACPkB,MAAO,gBACR,CACClB,MAAO,gDACPkB,MAAO,iBACR,CACClB,MAAO,mDACPkB,MAAO,oBACR,CACClB,MAAO,sDACPkB,MAAO,wBACR,CACClB,MAAO,mDACPkB,MAAO,oBACR,CACClB,MAAO,sDACPkB,MAAO,wBACR,CACClB,MAAO,yCACPkB,MAAO,SACR,CACClB,MAAO,0CACPkB,MAAO,UACR,CACClB,MAAO,wCACPkB,MAAO,QACR,CACClB,MAAO,8CACPkB,MAAO,cACR,CACClB,MAAO,6CACPkB,MAAO,aACR,CACClB,MAAO,4CACPkB,MAAO,YACR,CACClB,MAAO,6CACPkB,MAAO,cACR,CACClB,MAAO,gDACPkB,MAAO,oBArLvB1B,QACK2B,OAAO,qCAAsC,IAC7CC,QAAQ,oBAAqBxC,GAElCA,EAAkByC,QAAU","file":"55.975653547fd9764a2a71.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.explore.services', [])\n .factory('StatementsService', StatementsService);\n\nStatementsService.$inject = [];\n\nfunction StatementsService() {\n function transformToTrig(statements) {\n let data = '';\n const contexts = {};\n\n for (let i = 0; i < statements.length; i++) {\n const statement = statements[i];\n if (statement.context === undefined) {\n statement.context = '';\n } else {\n statement.context = _.trim(statement.context);\n }\n if (angular.isUndefined(contexts[statement.context])) {\n const cstatement = [];\n cstatement.push(statement);\n contexts[statement.context] = cstatement;\n } else {\n contexts[statement.context].push(statement);\n }\n }\n\n const ckeys = Object.keys(contexts);\n for (let i = 0; i < ckeys.length; i++) {\n const key = ckeys[i];\n if (key === '') {\n data += '\\n{';\n } else {\n data += '\\n<' + key + '> {';\n }\n\n const value = contexts[key];\n for (let j = 0; j < value.length; j++) {\n const statement = value[j];\n data += '\\n\\t<' + statement.subject + '> <' + statement.predicate + '> ';\n if (statement.object.type === 'uri') {\n data += '<' + statement.object.value + '> .';\n } else {\n data += '\"' + statement.object.value + '\"' + (statement.object.datatype ? '^^<' + statement.object.datatype + '>' : (statement.object.lang ? '@' + statement.object.lang : '')) + ' .';\n }\n }\n\n data += '\\n}';\n }\n\n return data;\n }\n\n function buildStatements(res, uri) {\n const statements = [];\n if (!_.isEmpty(res.data)) {\n const graph = res.data[uri];\n const predicates = Object.keys(graph);\n for (let i = 0; i < predicates.length; i++) {\n const predicate = predicates[i];\n const objects = graph[predicate];\n for (let j = 0; j < objects.length; j++) {\n const object = objects[j];\n for (let k = 0; k < object.graphs.length; k++) {\n let context = object.graphs[k];\n if (context === 'http://www.ontotext.com/explicit') {\n // Statements in the default context are special\n context = '';\n }\n if (object.lang) {\n object.datatype = '';\n }\n if (!object.datatype) {\n object.datatype = '';\n }\n statements.push({\n subject: uri,\n predicate: predicate,\n object: {\n value: object.value,\n type: object.type,\n datatype: object.datatype,\n lang: object.lang\n },\n context: context\n });\n }\n }\n }\n }\n return statements;\n }\n\n function getDatatypeOptions() {\n return [\n {\n value: '',\n label: 'string'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#boolean',\n label: 'boolean'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#decimal',\n label: 'decimal'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#integer',\n label: 'integer'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#double',\n label: 'double'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#float',\n label: 'float'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#date',\n label: 'date'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#time',\n label: 'time'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#dateTime',\n label: 'date time'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#byte',\n label: 'byte'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#short',\n label: 'short'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#int',\n label: 'int'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#long',\n label: 'long'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#unsignedByte',\n label: 'unsigned byte'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#unsignedShort',\n label: 'unsigned short'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#unsignedInt',\n label: 'unsigned int'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#unsignedLong',\n label: 'unsigned long'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#positoveInteger',\n label: 'positive integer'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#nonNegativeInteger',\n label: 'non-negative integer'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#negativeInteger',\n label: 'negative integer'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#nonPositiveInteger',\n label: 'non-positive integer'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#gYear',\n label: 'gYear'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#gMonth',\n label: 'gMonth'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#gDay',\n label: 'gDay'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#gYearMonth',\n label: 'gYearMonth'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#gMonthDay',\n label: 'gMonthDay'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#duration',\n label: 'duration'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#hexBinary',\n label: 'hex binary'\n }, {\n value: 'http://www.w3.org/2001/XMLSchema#base64Binary',\n label: 'base64 binary'\n }\n ];\n }\n\n return {\n transformToTrig: transformToTrig,\n buildStatements: buildStatements,\n getDatatypeOptions: getDatatypeOptions\n };\n}\n"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[93],{85:function(e,n,t){"use strict";t.r(n);t(4),t(14);const o=angular.module("graphdb.framework.jmx.queries.controllers",["ui.bootstrap","toastr","graphdb.framework.rest.monitoring.service"]);o.controller("QueriesCtrl",["$scope","$modal","toastr","$interval","$repositories","$jwtAuth","ModalService","MonitoringRestService","$translate",function(e,n,t,o,r,i,s,c,u){e.loader=!0,e.stringLimit=500,e.expanded={},e.error="";const a=document.createElement("a");e.parseNode=function(e){if(null==e)return null;let n="local";if(e.indexOf("://localhost:")<0&&e.indexOf("://localhost/")<0){a.href=e;let t=a.hostname;(function(e){const n=e.split(".");for(let e=0,t=0;e<n.length;e++)if(parseInt(n[e],10)>=0&&parseInt(n[e],10)<=255?t++:t=0,4===t)return!0;return!1})(a.hostname)||(t=a.hostname.split(".")[0]),n=t+":"+a.port}const t=e.match(/\/repositories\/([^\/]+)#(\d+)/);return[t[2],n,t[1]]},e.getQueries=function(){e.getQueriesRunning||e.paused||e.error||!r.getActiveRepository()||(e.getQueriesRunning=!0,c.monitorQuery().success((function(n){const t=n;e.noQueries=0===t.length,e.queries={};for(let n=0;n<t.length;n++)t[n].parsedNode=e.parseNode(t[n].node),e.queries[t[n].trackId]=t[n];e.noActiveRepository=!1,e.loader=!1,e.getQueriesRunning=!1})).error((function(n){e.error=getError(n),e.loader=!1,e.getQueriesRunning=!1})))};const l=o((function(){r.isActiveRepoOntopType()||e.getQueries()}),1e3);e.$on("$destroy",(function(){o.cancel(l)})),e.deleteQueryHttp=function(n){e.loader=!0,c.deleteQuery(n).success((function(){t.success(u.instant("abort.request.sent.msg")),e.loader=!1})).error((function(n){const o=getError(n);t.error(o,u.instant("common.error")),e.loader=!1}))},e.abortQuery=function(n){s.openSimpleModal({title:u.instant("confirm.abort"),message:u.instant("confirm.abort.warning.msg"),warning:!0}).result.then((function(){e.deleteQueryHttp(n)}))},e.downloadQuery=function(e){const n="query_"+e+".rq";let t="rest/monitor/query/download?queryId="+encodeURIComponent(e)+"&repository="+encodeURIComponent(r.getActiveRepository())+"&filename="+encodeURIComponent(n);i.isAuthenticated()&&(t=t+"&authToken="+encodeURIComponent(i.getAuthToken())),window.open(t,"_blank")},e.toggleQueryExpanded=function(n){e.expanded[n]=!e.expanded[n]}}]),o.controller("DeleteQueryCtrl",["$scope","$modalInstance",function(e,n){e.ok=function(){n.close()},e.cancel=function(){n.dismiss("cancel")}}])}}]);
2
- //# sourceMappingURL=93.5f0ae85fb24657fd13c5.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/queries/controllers.js"],"names":["queriesCtrl","angular","module","controller","$scope","$modal","toastr","$interval","$repositories","$jwtAuth","ModalService","MonitoringRestService","$translate","loader","stringLimit","expanded","error","parser","document","createElement","parseNode","node","shortUrl","indexOf","href","hostname","ip","blocks","split","i","sequence","length","parseInt","containsIPV4","port","match","getQueries","getQueriesRunning","paused","getActiveRepository","monitorQuery","success","data","newQueries","noQueries","queries","parsedNode","trackId","noActiveRepository","getError","timer","isActiveRepoOntopType","$on","cancel","deleteQueryHttp","queryId","deleteQuery","instant","msg","abortQuery","openSimpleModal","title","message","warning","result","then","downloadQuery","filename","link","encodeURIComponent","isAuthenticated","getAuthToken","window","open","toggleQueryExpanded","$modalInstance","ok","close","dismiss"],"mappings":"0FAAA,kBAGA,MAAMA,EAAcC,QAAQC,OAAO,4CAA6C,CAC5E,eACA,SACA,8CAGJF,EAAYG,WAAW,cAAe,CAAC,SAAU,SAAU,SAAU,YAAa,gBAAiB,WAAY,eAAgB,wBAAyB,aACpJ,SAAUC,EAAQC,EAAQC,EAAQC,EAAWC,EAAeC,EAAUC,EAAcC,EAAuBC,GAEvGR,EAAOS,QAAS,EAChBT,EAAOU,YAAc,IACrBV,EAAOW,SAAW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C,EAAOS,QAAS,EAChBT,EAAOiC,mBAAoB,OAInC,MAAMa,EAAQ3C,GAAU,WAEhBC,EAAc2C,yBAGlB/C,EAAOgC,eACR,KAEHhC,EAAOgD,IAAI,YAAY,WACnB7C,EAAU8C,OAAOH,MAGrB9C,EAAOkD,gBAAkB,SAAUC,GAE/BnD,EAAOS,QAAS,EAChBF,EAAsB6C,YAAYD,GAASd,SAAQ,WAC/CnC,EAAOmC,QAAQ7B,EAAW6C,QAAQ,2BAClCrD,EAAOS,QAAS,KACjBG,OAAM,SAAU0B,GACf,MAAMgB,EAAMT,SAASP,GACrBpC,EAAOU,MAAM0C,EAAK9C,EAAW6C,QAAQ,iBAErCrD,EAAOS,QAAS,MAIxBT,EAAOuD,WAAa,SAAUJ,GAC1B7C,EAAakD,gBAAgB,CACzBC,MAAOjD,EAAW6C,QAAQ,iBAC1BK,QAASlD,EAAW6C,QAAQ,6BAC5BM,SAAS,IACVC,OAAOC,MAAK,WACX7D,EAAOkD,gBAAgBC,OAI/BnD,EAAO8D,cAAgB,SAAUX,GAC7B,MAAMY,EAAW,SAAWZ,EAAU,MACtC,IAAIa,EAAO,uCAAyCC,mBAAmBd,GACjE,eAAiBc,mBAAmB7D,EAAc+B,uBAClD,aAAe8B,mBAAmBF,GACpC1D,EAAS6D,oBACTF,EAAOA,EAAO,cAAgBC,mBAAmB5D,EAAS8D,iBAG9DC,OAAOC,KAAKL,EAAM,WAGtBhE,EAAOsE,oBAAsB,SAAUnB,GACnCnD,EAAOW,SAASwC,IAAYnD,EAAOW,SAASwC,OAKxDvD,EAAYG,WAAW,kBAAmB,CAAC,SAAU,iBAAkB,SAAUC,EAAQuE,GAErFvE,EAAOwE,GAAK,WACRD,EAAeE,SAGnBzE,EAAOiD,OAAS,WACZsB,EAAeG,QAAQ","file":"93.5f0ae85fb24657fd13c5.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/rest/monitoring.rest.service';\n\nconst queriesCtrl = angular.module('graphdb.framework.jmx.queries.controllers', [\n 'ui.bootstrap',\n 'toastr',\n 'graphdb.framework.rest.monitoring.service'\n]);\n\nqueriesCtrl.controller('QueriesCtrl', ['$scope', '$modal', 'toastr', '$interval', '$repositories', '$jwtAuth', 'ModalService', 'MonitoringRestService', '$translate',\n function ($scope, $modal, toastr, $interval, $repositories, $jwtAuth, ModalService, MonitoringRestService, $translate) {\n\n $scope.loader = true;\n $scope.stringLimit = 500;\n $scope.expanded = {};\n $scope.error = '';\n\n function containsIPV4(ip) {\n const blocks = ip.split('.');\n for (let i = 0, sequence = 0; i < blocks.length; i++) {\n if (parseInt(blocks[i], 10) >= 0 && parseInt(blocks[i], 10) <= 255) {\n sequence++;\n } else {\n sequence = 0;\n }\n if (sequence === 4) {\n return true;\n }\n }\n return false;\n }\n\n const parser = document.createElement('a');\n\n // Parses a node of the kind http://host.example.com:7200/repositories/repo#NN,\n // where NN is the track ID into an array [NN, host:7200, repo].\n $scope.parseNode = function (node) {\n if (node == null) {\n return null;\n }\n\n let shortUrl = 'local';\n if (node.indexOf('://localhost:') < 0 && node.indexOf('://localhost/') < 0) {\n parser.href = node;\n let hostname = parser.hostname;\n if (!containsIPV4(parser.hostname)) {\n hostname = parser.hostname.split('.')[0];\n }\n shortUrl = hostname + ':' + parser.port;\n }\n const match = node.match(/\\/repositories\\/([^\\/]+)#(\\d+)/); // eslint-disable-line no-useless-escape\n\n return [match[2], shortUrl, match[1]];\n };\n\n $scope.getQueries = function () {\n // Skip execution if already getting from previous call, if paused, if jolokia returned an error,\n // or if no repository is available\n if ($scope.getQueriesRunning || $scope.paused || $scope.error || !$repositories.getActiveRepository()) {\n return;\n }\n\n $scope.getQueriesRunning = true;\n MonitoringRestService.monitorQuery().success(function (data) {\n const newQueries = data;\n $scope.noQueries = newQueries.length === 0;\n\n // Converts array to object. Angular seems to handle updates on objects better, i.e.\n // it doesn't recreate DOM elements for queries that are already displayed.\n $scope.queries = {};\n for (let i = 0; i < newQueries.length; i++) {\n newQueries[i].parsedNode = $scope.parseNode(newQueries[i].node);\n $scope.queries[newQueries[i].trackId] = newQueries[i];\n }\n\n $scope.noActiveRepository = false;\n $scope.loader = false;\n $scope.getQueriesRunning = false;\n }).error(function (data) {\n $scope.error = getError(data);\n $scope.loader = false;\n $scope.getQueriesRunning = false;\n });\n };\n\n const timer = $interval(function () {\n // Don't call getQueries for Ontop type repository\n if ($repositories.isActiveRepoOntopType()) {\n return;\n }\n $scope.getQueries();\n }, 1000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel(timer);\n });\n\n $scope.deleteQueryHttp = function (queryId) {\n\n $scope.loader = true;\n MonitoringRestService.deleteQuery(queryId).success(function () {\n toastr.success($translate.instant('abort.request.sent.msg'));\n $scope.loader = false;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n\n $scope.loader = false;\n });\n };\n\n $scope.abortQuery = function (queryId) {\n ModalService.openSimpleModal({\n title: $translate.instant('confirm.abort'),\n message: $translate.instant('confirm.abort.warning.msg'),\n warning: true\n }).result.then(function () {\n $scope.deleteQueryHttp(queryId);\n });\n };\n\n $scope.downloadQuery = function (queryId) {\n const filename = 'query_' + queryId + '.rq';\n let link = 'rest/monitor/query/download?queryId=' + encodeURIComponent(queryId)\n + '&repository=' + encodeURIComponent($repositories.getActiveRepository())\n + '&filename=' + encodeURIComponent(filename);\n if ($jwtAuth.isAuthenticated()) {\n link = link + '&authToken=' + encodeURIComponent($jwtAuth.getAuthToken());\n }\n\n window.open(link, '_blank');\n };\n\n $scope.toggleQueryExpanded = function (queryId) {\n $scope.expanded[queryId] = !$scope.expanded[queryId];\n };\n }]);\n\n\nqueriesCtrl.controller('DeleteQueryCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance) {\n\n $scope.ok = function () {\n $modalInstance.close();\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}]);\n"],"sourceRoot":""}