graphdb-workbench 3.4.0-TR3 → 3.4.0-TR5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/19057.a52dd7b0e356e884a792.bundle.js +3 -0
- package/dist/19057.a52dd7b0e356e884a792.bundle.js.map +1 -0
- package/dist/23236.1490d29a6e40f437885b.bundle.js +2 -0
- package/dist/23236.1490d29a6e40f437885b.bundle.js.map +1 -0
- package/dist/24125.0fd6b7797f2630fe59c6.bundle.js +2 -0
- package/dist/24125.0fd6b7797f2630fe59c6.bundle.js.map +1 -0
- package/dist/24690.79fd696f08f3ebbb1c6f.bundle.js +2 -0
- package/dist/24690.79fd696f08f3ebbb1c6f.bundle.js.map +1 -0
- package/dist/{3395.8452312923e6a77d2ffd.bundle.js → 3395.8dfba5922c8aad6d860c.bundle.js} +2 -2
- package/dist/3395.8dfba5922c8aad6d860c.bundle.js.map +1 -0
- package/dist/34985.8ef74b317fc8bff7e8e1.bundle.js +2 -0
- package/dist/34985.8ef74b317fc8bff7e8e1.bundle.js.map +1 -0
- package/dist/50244.69475a004173b61902a8.bundle.js +2 -0
- package/dist/50244.69475a004173b61902a8.bundle.js.map +1 -0
- package/dist/60447.4fd8b4ce9b95b98deade.bundle.js +2 -0
- package/dist/60447.4fd8b4ce9b95b98deade.bundle.js.map +1 -0
- package/dist/63842.68a1c5451a236b8ede97.bundle.js +2 -0
- package/dist/63842.68a1c5451a236b8ede97.bundle.js.map +1 -0
- package/dist/{64709.9f6594f730a4b54d6fc9.bundle.js → 64709.93e616541b4b18e88892.bundle.js} +2 -2
- package/dist/{64709.9f6594f730a4b54d6fc9.bundle.js.map → 64709.93e616541b4b18e88892.bundle.js.map} +1 -1
- package/dist/{65677.038185dcd07233e07f52.bundle.js → 65677.77bf484a0da0eec48f0b.bundle.js} +2 -2
- package/dist/{65677.038185dcd07233e07f52.bundle.js.map → 65677.77bf484a0da0eec48f0b.bundle.js.map} +1 -1
- package/dist/66574.cae68c94f87ba873b322.bundle.js +2 -0
- package/dist/66574.cae68c94f87ba873b322.bundle.js.map +1 -0
- package/dist/{80933.ef5e85af9b19067ee89b.bundle.js → 80933.ddbcb2688f7d93009c04.bundle.js} +2 -2
- package/dist/{80933.ef5e85af9b19067ee89b.bundle.js.map → 80933.ddbcb2688f7d93009c04.bundle.js.map} +1 -1
- package/dist/{82917.e537e5e649be4a5a0e20.bundle.js → 82917.e234e043395ff0b7d48f.bundle.js} +2 -2
- package/dist/82917.e234e043395ff0b7d48f.bundle.js.map +1 -0
- package/dist/{86099.acb890d2b6e1d841c4c3.bundle.js → 86099.0abe4f96d87490fe332e.bundle.js} +2 -2
- package/dist/{86099.acb890d2b6e1d841c4c3.bundle.js.map → 86099.0abe4f96d87490fe332e.bundle.js.map} +1 -1
- package/dist/{90418.0a737513ff59bfee423a.bundle.js → 90418.ee1af575862a64c12457.bundle.js} +2 -2
- package/dist/90418.ee1af575862a64c12457.bundle.js.map +1 -0
- package/dist/{96972.896f91c5874df70d14bb.bundle.js → 96972.fc25a13bb1bc69ad785c.bundle.js} +2 -2
- package/dist/96972.fc25a13bb1bc69ad785c.bundle.js.map +1 -0
- package/dist/9923.74654347e1812dd0f90a.bundle.js +3 -0
- package/dist/9923.74654347e1812dd0f90a.bundle.js.map +1 -0
- package/dist/api/models/application-settings/application-settings.d.ts +8 -1
- package/dist/api/models/application-settings/test/application-settings.spec.d.ts +1 -0
- package/dist/api/ontotext-workbench-api.js +1 -1
- package/dist/api/ontotext-workbench-api.js.map +1 -1
- package/dist/api/services/application-settings/application-settings-storage.service.d.ts +6 -0
- package/dist/api/services/runtime-configuration/runtime-configuration-context.service.d.ts +20 -0
- package/dist/api/services/theme/theme.service.d.ts +14 -3
- package/dist/css/explore.css +1 -1
- package/dist/css/lib/ontotext-yasgui-web-component.css +1 -1
- package/dist/css/user.css +1 -1
- package/dist/i18n/locale-en.json +4 -1
- package/dist/i18n/locale-fr.json +6 -3
- package/dist/index.html +9 -9
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
- package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +13 -16
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
- package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/{legacyWorkbench.77dd92ce99a75c4ee674.js → legacyWorkbench.cb08fa647eed6afe60e8.js} +3 -3
- package/dist/{legacyWorkbench.77dd92ce99a75c4ee674.js.map → legacyWorkbench.cb08fa647eed6afe60e8.js.map} +1 -1
- package/dist/{main.6db145d35852092cde59.js → main.1198f08d1cc597b94cbc.js} +3 -3
- package/dist/main.1198f08d1cc597b94cbc.js.map +1 -0
- package/dist/pages/aclmanagement.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +5 -3
- package/dist/pages/dependencies.html +3 -3
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +72 -75
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/home.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/jdbc.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/sparql-templates.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +11 -11
- package/dist/shared-components/cjs/onto-graph-explore-split-button.cjs.entry.js +1 -1
- package/dist/shared-components/collection/components/onto-graph-explore-split-button/onto-graph-explore-split-button.js +1 -1
- package/dist/shared-components/esm/onto-graph-explore-split-button.entry.js +1 -1
- package/dist/shared-components/shared-components/p-cd5cc683.entry.js +1 -0
- package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/19057.c644732712725c1a6d3d.bundle.js +0 -3
- package/dist/19057.c644732712725c1a6d3d.bundle.js.map +0 -1
- package/dist/23236.36dabf6a87d61107178d.bundle.js +0 -2
- package/dist/23236.36dabf6a87d61107178d.bundle.js.map +0 -1
- package/dist/24125.fc41760fdae44b0480c8.bundle.js +0 -2
- package/dist/24125.fc41760fdae44b0480c8.bundle.js.map +0 -1
- package/dist/24690.d4ed1c24eded4eb0da85.bundle.js +0 -2
- package/dist/24690.d4ed1c24eded4eb0da85.bundle.js.map +0 -1
- package/dist/3395.8452312923e6a77d2ffd.bundle.js.map +0 -1
- package/dist/34985.a6b52e4b364c7efd3046.bundle.js +0 -2
- package/dist/34985.a6b52e4b364c7efd3046.bundle.js.map +0 -1
- package/dist/50244.35b37c35412261341adb.bundle.js +0 -2
- package/dist/50244.35b37c35412261341adb.bundle.js.map +0 -1
- package/dist/60447.fd8b44d92859a3481ad7.bundle.js +0 -2
- package/dist/60447.fd8b44d92859a3481ad7.bundle.js.map +0 -1
- package/dist/63842.e62b43ae192a642531c6.bundle.js +0 -2
- package/dist/63842.e62b43ae192a642531c6.bundle.js.map +0 -1
- package/dist/66574.8591bdbb6983d8d07c04.bundle.js +0 -2
- package/dist/66574.8591bdbb6983d8d07c04.bundle.js.map +0 -1
- package/dist/82917.e537e5e649be4a5a0e20.bundle.js.map +0 -1
- package/dist/90418.0a737513ff59bfee423a.bundle.js.map +0 -1
- package/dist/96972.896f91c5874df70d14bb.bundle.js.map +0 -1
- package/dist/9923.6963c46c47330a6ba2d0.bundle.js +0 -3
- package/dist/9923.6963c46c47330a6ba2d0.bundle.js.map +0 -1
- package/dist/main.6db145d35852092cde59.js.map +0 -1
- package/dist/shared-components/shared-components/p-1b143527.entry.js +0 -1
- /package/dist/{19057.c644732712725c1a6d3d.bundle.js.LICENSE.txt → 19057.a52dd7b0e356e884a792.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{9923.6963c46c47330a6ba2d0.bundle.js.LICENSE.txt → 9923.74654347e1812dd0f90a.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{legacyWorkbench.77dd92ce99a75c4ee674.js.LICENSE.txt → legacyWorkbench.cb08fa647eed6afe60e8.js.LICENSE.txt} +0 -0
- /package/dist/{main.6db145d35852092cde59.js.LICENSE.txt → main.1198f08d1cc597b94cbc.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"23236.1490d29a6e40f437885b.bundle.js","mappings":"oMAMA,MAAMA,EAAK,CAACC,O,SAAMA,QAOlB,SAASC,EAAcC,EAAYC,EAA2BC,EAAYC,GACtE,MAAO,CACHC,SAAU,IACVC,YAAa,6DACbC,MAAO,CAAC,EACRC,KAAOC,IAKHA,EAAOC,YAAa,EAMpB,MAAMC,EAAgB,GACtB,IAAIC,EACAC,EACAC,EAMJL,EAAOM,aAAe,KAClBN,EAAOC,YAAcD,EAAOC,WAC5BE,EAAYI,QAAQ,gBAAiBP,EAAOC,aAOhD,MAAMO,EAAOA,KACT,MAAMC,EAAyBhB,EAA0BiB,4BACzDC,EAAkBF,GAClBG,IACAC,EAAcV,GACdW,IACAC,IACAC,IACAC,KAGEJ,EAAiBV,IACnBe,EAASf,EAAa,qEACtB,MAAMgB,EAAiBhB,EAClBiB,UAAU,eACVC,KAAKC,EAAAA,EAA6BC,kBACjCC,EAAsBC,EAAAA,GAAgBN,EAAgBG,EAAAA,EAA6BI,gBAAgB,GACzGD,EAAAA,GAAgBD,GAEhBA,EACKG,KAAK,YAAa,SAASC,EAAGC,GAE3B,OADAb,IACO,aAAaM,EAAAA,EAA6BQ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CLhB,MAAMjF,EAAY,CACrBC,OAAQ,SACRC,SAAU,WACVC,UAAW,YACXlF,YAAa,cACbiH,cAAe,gBACfC,UAAW,YACXC,WAAY,aACZ8C,WAAY,cAGHvD,EAAgB,CACzBC,mBAAoB,qBACpBC,qBAAsB,uBACtBzJ,mBAAoB,qBACpB0J,kBAAmB,oBACnBC,kBAAmB,oBACnBC,iBAAkB,mBAClBC,mCAAoC,sCAG3B9J,EAAY,CACrB4C,QAAS,UACTE,YAAa,cACbD,QAAS,UACTkH,cAAe,gBAEf9J,mBAAoB,sBAGX+M,EAAgB,CACzBC,aAAc,eACdC,eAAgB,iB","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/clustermanagement/directives/cluster-legend.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/clustermanagement/services/cluster-drawing.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/clustermanagement/cluster-management-constants.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/clustermanagement/node-state.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/clustermanagement/states.js"],"sourcesContent":["import {CLUSTER_MANAGEMENT_CONSTANTS} from \"../../models/clustermanagement/cluster-management-constants\";\nimport * as CDS from \"../services/cluster-drawing.service\";\nimport {LinkState} from \"../../models/clustermanagement/states\";\nimport {ARROW_CONFIG} from \"../services/cluster-drawing.service\";\nimport {select} from 'd3';\n\nconst d3 = {select};\nconst modules = [];\nangular.module('graphdb.framework.clustermanagement.directives.cluster-legend', modules)\n .directive('clusterLegend', clusterLegend);\n\nclusterLegend.$inject = ['$rootScope', 'ClusterViewContextService', '$translate', '$document'];\n\nfunction clusterLegend($rootScope, ClusterViewContextService, $translate, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/clustermanagement/templates/cluster-legend.html',\n scope: {},\n link: ($scope) => {\n // =========================\n // Public variables\n // =========================\n\n $scope.hideLegend = true;\n\n // =========================\n // Private variables\n // =========================\n\n const subscriptions = [];\n let legendGroup;\n let legendHeight;\n let legendWidth;\n\n // =========================\n // Public functions\n // =========================\n\n $scope.toggleLegend = () => {\n $scope.hideLegend = !$scope.hideLegend;\n legendGroup.classed('hidden-legend', $scope.hideLegend);\n };\n\n // =========================\n // Private functions\n // =========================\n\n const init = () => {\n const clusterViewD3Container = ClusterViewContextService.getClusterViewD3Container();\n createLegendGroup(clusterViewD3Container);\n createLegendBackground();\n addNodeStates(legendGroup);\n addSyncStatus();\n addLinks();\n updateLegendDimensions();\n updateLegendBackground();\n };\n\n const addNodeStates = (legendGroup) => {\n addTitle(legendGroup, 'cluster_management.cluster_graphical_view.legend_title_node_state');\n const legendNodeData = legendGroup\n .selectAll('.node-group')\n .data(CLUSTER_MANAGEMENT_CONSTANTS.getLegendNodes());\n const legendNodesElements = CDS.createNodes(legendNodeData, CLUSTER_MANAGEMENT_CONSTANTS.SVG_NODE_WIDTH, true);\n CDS.updateNodes(legendNodesElements);\n const LABEL_Y_POSITION = 3;\n legendNodesElements\n .attr('transform', function(d, i) {\n updateLegendDimensions();\n return `translate(${CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_PADDING_LEFT}, ${legendHeight + CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_PADDING_TOP})`;\n })\n .append('text')\n .classed('links-statuses', true)\n .style('font-weight', CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_FONT_WEIGHT)\n .attr('x', CLUSTER_MANAGEMENT_CONSTANTS.PADDING_LEFT + CLUSTER_MANAGEMENT_CONSTANTS.SVG_NODE_WIDTH)\n .attr('y', LABEL_Y_POSITION)\n .text(function(d) {\n // eslint-disable-next-line no-invalid-this\n return translateAndSubscribe(this, 'cluster_management.cluster_graphical_view.' + d.customText);\n });\n };\n\n const addSyncStatus = () => {\n addTitle(legendGroup, 'cluster_management.cluster_graphical_view.legend_title_sync_status');\n const syncStatusesGroups = legendGroup.selectAll('.sync-statuses-group')\n .data(CLUSTER_MANAGEMENT_CONSTANTS.getSyncStatuses())\n .enter()\n .append('g')\n .attr('class', 'sync-statuses-group');\n\n const rowY = new Map();\n\n syncStatusesGroups\n .append('text')\n .attr('class', (d) => `sync-status ${d.classes}`)\n .attr('x', CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_PADDING_LEFT - 10)\n .attr('y', function(d, index) {\n const rowTop = index * (20 + CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_PADDING_TOP) + legendHeight + CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEMS_PADDING_TOP;\n rowY.set(index, rowTop);\n return rowTop;\n })\n .text(function(d) {\n return d.icon;\n });\n\n const labelOffsetY = (CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_ICON_FONT_SIZE - CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_FONT_SIZE) / 2;\n syncStatusesGroups\n .append('text')\n .style('font-weight', CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_FONT_WEIGHT)\n .text(function(d) {\n // eslint-disable-next-line no-invalid-this\n return translateAndSubscribe(this, 'cluster_management.cluster_graphical_view.' + d.labelKey);\n })\n .attr('x', CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_PADDING_LEFT + CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_FONT_SIZE)\n .attr('y', function(d, index) {\n return rowY.get(index) - labelOffsetY;\n })\n .classed('links-statuses', true);\n };\n\n const addLinks = () => {\n addTitle(legendGroup, 'cluster_management.cluster_graphical_view.legend_title_link_states');\n const linkStatesGroup = legendGroup.selectAll('.link-states-group')\n .data(CLUSTER_MANAGEMENT_CONSTANTS.getLegendLinks())\n .enter()\n .append('g')\n .attr('class', 'link-state');\n\n // map vertical positions of each link in order to be able to draw labels next to the links\n const rowY = new Map();\n\n linkStatesGroup\n .append('path')\n .classed('link', true)\n .attr('stroke-dasharray', CDS.setLinkStyle)\n .attr('stroke', CDS.setLinkColor)\n .attr('d', (link, index) => {\n const y = index * (CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_FONT_SIZE + CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_PADDING_TOP) + legendHeight + CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEMS_PADDING_TOP;\n const lineWidth = legendWidth / 2;\n rowY.set(index, y);\n let line;\n if (link.status === LinkState.RECEIVING_SNAPSHOT) {\n const lineMidPoint = lineWidth / 2;\n // In order to draw an arrowhead in the middle of a line, the line needs to be composed by\n // two segments, otherwise the arrowhead won't show up.\n line = `M${CLUSTER_MANAGEMENT_CONSTANTS.PADDING_LEFT} ${y} L${lineMidPoint} ${y} L${lineWidth} ${y}`;\n } else {\n line = `M${CLUSTER_MANAGEMENT_CONSTANTS.PADDING_LEFT} ${y} ${lineWidth} ${y}`;\n }\n return line;\n })\n .style(\"marker-mid\", (link) => CDS.setArrowLink(link, ARROW_CONFIG.SMALL));\n\n linkStatesGroup\n .append('text')\n .style('font-size', CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_FONT_SIZE)\n .style('line-height', CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_LINE_HEIGHT)\n .style('font-weight', CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_FONT_WEIGHT)\n .text(function(d) {\n // eslint-disable-next-line no-invalid-this\n return translateAndSubscribe(this, 'cluster_management.cluster_graphical_view.' + d.linkTypeKey);\n })\n .attr('x', legendWidth/2 + CLUSTER_MANAGEMENT_CONSTANTS.LEGEND_ITEM_PADDING_LEFT)\n .attr('y', function(d, index) {\n return rowY.get(index) + 4;\n })\n .classed('links-statuses', true);\n\n // Add icon on OUT_OF_SYNC legend link\n CDS.updateLegendLinkIcons(linkStatesGroup, legendWidth);\n };\n\n /**\n * Creates main legend container with rectangle that defines width, height and corner radius of legend.\n * @param {*} clusterViewD3Container - main container where legend have to live.\n */\n const createLegendGroup = (clusterViewD3Container) => {\n legendGroup = clusterViewD3Container.append('g')\n .classed('hidden-legend', $scope.hideLegend)\n .classed('cluster-legend-group', true);\n };\n\n const createLegendBackground = () => {\n legendGroup.append('rect')\n .attr('class', 'legend-background');\n };\n\n const updateLegendDimensions = () => {\n legendGroup\n .call((d) => {\n legendHeight = d.node().getBBox().height;\n });\n legendWidth = getMaxWidthOfChildren(legendGroup) + 30;\n };\n\n const updateLegendBackground = () => {\n const maxWidth = getMaxWidthOfChildren(legendGroup);\n legendGroup.select('.legend-background')\n .attr('height', legendHeight + CLUSTER_MANAGEMENT_CONSTANTS.PADDING_TOP * 3)\n .attr('width', maxWidth + CLUSTER_MANAGEMENT_CONSTANTS.BACKGROUND_PADDING)\n .attr('rx', '6');\n };\n\n const getMaxWidthOfChildren = (parent) => {\n let maxWidth = 0;\n\n parent.selectAll(':not(.legend-background)').each(function() {\n // eslint-disable-next-line no-invalid-this\n const bbox = this.getBBox();\n maxWidth = Math.max(maxWidth, bbox.width);\n });\n\n return maxWidth;\n };\n\n /**\n * Adds title to <code>legendGroup</code>.\n * @param {*} legendGroup - the root group tag (<g>) of legend.\n * @param {string} labelKey\n *\n * @return {*}\n */\n const addTitle = (legendGroup, labelKey) => {\n return legendGroup\n .append('text')\n .attr('class', 'legend-title')\n .attr('x', CLUSTER_MANAGEMENT_CONSTANTS.PADDING_LEFT)\n .style('font-size', CLUSTER_MANAGEMENT_CONSTANTS.TITLE_FONT_SIZE)\n .style('font-weight', CLUSTER_MANAGEMENT_CONSTANTS.TITLE_FONT_WEIGHT)\n .style('line-height', CLUSTER_MANAGEMENT_CONSTANTS.TITLE_LINE_HEIGHT)\n .text(function() {\n // eslint-disable-next-line no-invalid-this\n return translateAndSubscribe(this, labelKey);\n })\n .attr('y', () => {\n updateLegendDimensions();\n return legendHeight + CLUSTER_MANAGEMENT_CONSTANTS.TITLE_PADDING_TOP;\n });\n };\n\n const translateAndSubscribe = (domElement, labelKey) => {\n subscriptions.push($rootScope.$on('$translateChangeSuccess', () => {\n d3.select(domElement).text($translate.instant(labelKey));\n updateLegendBackground();\n }));\n\n return $translate.instant(labelKey);\n };\n\n const removeAllListeners = () => {\n $document.off('keydown', onKeyDown);\n subscriptions.forEach((subscription) => subscription());\n };\n\n const closeDialog = () => {\n $scope.hideLegend = true;\n legendGroup.classed('hidden-legend', $scope.hideLegend);\n };\n\n const onKeyDown = (event) => {\n if (event.key === 'Escape') {\n closeDialog();\n }\n };\n\n // =========================\n // Subscriptions functions\n // =========================\n $document.on('keydown', onKeyDown);\n subscriptions.push(ClusterViewContextService.onClusterViewD3ContainerUpdated(init));\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllListeners);\n\n init();\n },\n };\n}\n","import {LinkState, NodeState, RecoveryState} from \"../../models/clustermanagement/states\";\nimport {isEmpty} from \"lodash\";\nimport {select, line} from 'd3';\n\nconst d3 = {\n line,\n select,\n};\n\nconst clusterColors = {\n ontoOrange: 'var(--gw-primary-base)',\n ontoBlue: 'var(--gw-foreground-on-surface-primary)',\n ontoGreen: 'var(--gw-tertiary-base)',\n ontoGrey: 'var(--gw-neutral-light)',\n};\n\nconst linkStateColors = {\n [LinkState.IN_SYNC]: clusterColors.ontoBlue,\n [LinkState.SYNCING]: clusterColors.ontoBlue,\n [LinkState.OUT_OF_SYNC]: clusterColors.ontoGrey,\n [LinkState.RECEIVING_SNAPSHOT]: clusterColors.ontoBlue,\n};\n\nconst linkStateStyle = {\n // solid line\n [LinkState.IN_SYNC]: 'none',\n // dashed line\n [LinkState.SYNCING]: '10 10',\n // dashed line\n [LinkState.OUT_OF_SYNC]: '10 10',\n // dashed line\n [LinkState.RECEIVING_SNAPSHOT]: '10 10',\n};\n\nconst font = {\n REMIXICON: 'REMIXICON',\n ICOMOON: 'ICOMOON',\n};\n\nconst shortMessageLimit = 40;\n\nfunction getLinkMidpoint(link, nodes) {\n const source = nodes.find((node) => node.address === link.source);\n const target = nodes.find((node) => node.address === link.target);\n const deltaX = target.x - source.x;\n const deltaY = target.y - source.y;\n const dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const normX = deltaX / dist;\n const normY = deltaY / dist;\n const sourcePadding = 55;\n const targetPadding = 55;\n const sourceX = source.x + (sourcePadding * normX);\n const sourceY = source.y + (sourcePadding * normY);\n const targetX = target.x - (targetPadding * normX);\n const targetY = target.y - (targetPadding * normY);\n return {\n x: (sourceX + targetX) / 2,\n y: (sourceY + targetY) / 2,\n };\n}\n\nfunction appendLinkIcon(parentGroup, iconType, iconCode, iconColor, iconSize) {\n // Circle background so the icon is readable over the dashed line\n parentGroup.append('circle')\n .attr('r', 12)\n .attr('fill', 'var(--gw-panel-background)');\n\n parentGroup.append('text')\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'central')\n .attr('class', iconType)\n .attr('fill', iconColor)\n .style('font-size', iconSize)\n .text(iconCode);\n}\n\nfunction appendOutOfSyncLinkIcon(group, iconSize) {\n appendLinkIcon(group, 'remixicon', '\\uf064', 'var(--gw-foreground-on-surface-secondary)', iconSize);\n}\n\nexport function updateLinkIcons(linksGroup, links, nodes) {\n const outOfSyncLinks = links.filter((link) => link.status === LinkState.OUT_OF_SYNC);\n\n const iconGroups = linksGroup.selectAll('.link-icon-group')\n .data(outOfSyncLinks, (link) => link.id);\n\n const entered = iconGroups.enter()\n .append('g')\n .classed('link-icon-group', true);\n\n appendOutOfSyncLinkIcon(entered, '20px');\n\n // Position both new and existing groups at the link midpoint\n entered.merge(iconGroups)\n .attr('transform', (link) => {\n const {x, y} = getLinkMidpoint(link, nodes);\n return `translate(${x}, ${y})`;\n });\n\n iconGroups.exit().remove();\n}\n\nexport function updateLegendLinkIcons(linkStatesGroup, legendWidth) {\n linkStatesGroup.selectAll('.link-icon-group').remove();\n\n linkStatesGroup.each(function(d) {\n if (d.status !== LinkState.OUT_OF_SYNC) {\n return;\n }\n // eslint-disable-next-line no-invalid-this\n const group = d3.select(this);\n const path = group.select('path.link');\n // Midpoint of the legend line: x is halfway along lineWidth, y is the line's y\n const pathEl = path.node();\n const totalLength = pathEl.getTotalLength();\n const midPoint = pathEl.getPointAtLength(totalLength / 2);\n\n const iconGroup = group.append('g')\n .classed('link-icon-group', true)\n .attr('transform', `translate(${midPoint.x}, ${midPoint.y})`);\n // remixicon refresh-line\n appendOutOfSyncLinkIcon(iconGroup, '18px');\n });\n}\n\nexport function createClusterSvgElement(element) {\n return d3.select(element)\n .append('svg')\n .classed('cluster-diagram', true);\n}\n\nexport function createClusterZone(parent) {\n const clusterZone = parent.append('g');\n clusterZone\n .append(\"circle\")\n .classed('cluster-zone', true)\n .style('fill', 'transparent')\n .style('stroke-width', '4');\n return clusterZone;\n}\n\nexport function setCreateClusterZone(hasCluster, clusterZone, translationsMap, hasAccess = false) {\n clusterZone\n .select('.cluster-zone')\n .classed('no-cluster', !hasCluster)\n .classed('has-access', hasAccess);\n\n if (hasCluster) {\n clusterZone.selectAll('#no-cluster-zone').remove();\n } else {\n const textGroup = clusterZone\n .append('g')\n .attr(\"id\", \"no-cluster-zone\");\n textGroup\n .append('text')\n .attr('id', 'no-cluster-label')\n .text(translationsMap.no_cluster_configured)\n .attr('y', -50)\n .classed('h2', true)\n .style('text-anchor', \"middle\");\n if (hasAccess) {\n textGroup.append('text')\n .attr('id', 'create-cluster-label')\n .classed('h3', true)\n .text(translationsMap.create_cluster_btn)\n .style('text-anchor', \"middle\");\n }\n textGroup.append('text')\n .attr('y', 130)\n .attr('class', 'icon-any repo')\n .attr('fill', clusterColors.ontoOrange)\n .style('text-anchor', \"middle\")\n .classed('settings-icon', true)\n .text(\"\\ue92b\");\n }\n}\n\nexport function updateClusterZoneLabels(hasCluster, clusterZone, translationsMap) {\n if (hasCluster) {\n return;\n }\n clusterZone.select('#no-cluster-zone #no-cluster-label')\n .text(translationsMap.no_cluster_configured);\n clusterZone.select('#no-cluster-zone #create-cluster-label')\n .text(translationsMap.create_cluster_btn);\n}\n\nexport function moveElement(element, x, y) {\n element.attr('transform', () => {\n return `translate(${x}, ${y})`;\n });\n}\n\nexport function createNodes(nodesDataBinding, nodeRadius, isLegend) {\n const nodeGroup = nodesDataBinding.enter()\n .append('g')\n .attr('id', 'node-group')\n .classed('legend', isLegend);\n\n const nodeUpdateElements = nodeGroup\n .merge(nodesDataBinding)\n .attr('id', 'node-group')\n .classed('legend', isLegend);\n\n createHexagon(nodeGroup, nodeRadius);\n nodesDataBinding.exit().remove();\n\n nodeGroup\n .append('text')\n .attr('class', 'icon-any node-icon');\n\n if (!isLegend) {\n addHostnameToNodes(nodeGroup, nodeRadius, isLegend);\n }\n return nodeUpdateElements;\n}\n\nfunction addHostnameToNodes(nodeElements, nodeRadius) {\n const nodeTextHost = nodeElements.append('g');\n\n nodeTextHost\n .append('rect')\n .attr('class', 'id-host-background')\n .attr('rx', 6);\n\n nodeTextHost\n .append('rect')\n .attr('class', 'node-info-background')\n .attr('rx', 6);\n\n nodeTextHost\n .append('text')\n .attr('y', nodeRadius + 25)\n .attr('class', 'id id-host');\n\n nodeTextHost\n .append('text')\n .attr('y', nodeRadius + 55)\n .attr('class', 'node-info-text');\n}\n\nexport function updateNodes(nodes) {\n updateNodesIcon(nodes);\n updateNodesClasses(nodes);\n updateNodesHostnameText(nodes);\n updateNodesInfoText(nodes);\n}\n\nfunction updateNodesClasses(nodes) {\n nodes\n .select('.node.member')\n .classed('leader', (node) => node.nodeState === NodeState.LEADER)\n .classed('follower', (node) => node.nodeState === NodeState.FOLLOWER)\n .classed('candidate', (node) => node.nodeState === NodeState.CANDIDATE)\n .classed('other', (node) => {\n return node.nodeState !== NodeState.LEADER &&\n node.nodeState !== NodeState.FOLLOWER &&\n node.nodeState !== NodeState.CANDIDATE;\n });\n}\n\nfunction updateNodesIcon(nodes) {\n nodes.select('.node-icon')\n .each(function(d) {\n const iconType = hasRecoveryState(d) ? getNodeInfoIconType(d) : getNodeIconType(d);\n // eslint-disable-next-line no-invalid-this\n d3.select(this)\n .classed('icon-any', iconType.font === font.ICOMOON)\n .classed('remixicon', iconType.font === font.REMIXICON)\n .text(iconType.icon);\n });\n}\n\nfunction hasRecoveryState(node) {\n return !isEmpty(node.recoveryStatus);\n}\n\nconst iconMap = {\n [RecoveryState.SEARCHING_FOR_NODE]: {icon: '\\uf045', font: font.REMIXICON}, //ri-question-line\n [RecoveryState.WAITING_FOR_SNAPSHOT]: {icon: '\\uf20f', font: font.REMIXICON}, //ri-time-line\n [RecoveryState.RECEIVING_SNAPSHOT]: {icon: '\\uec54', font: font.REMIXICON}, //ri-download-2-line\n [RecoveryState.APPLYING_SNAPSHOT]: {icon: '\\uec30', font: font.REMIXICON}, //ri-device-recover-line\n [RecoveryState.BUILDING_SNAPSHOT]: {icon: '\\uf3a7', font: font.REMIXICON}, //ri-archive-2-line\n [RecoveryState.SENDING_SNAPSHOT]: {icon: '\\uf24a', font: font.REMIXICON}, //ri-upload-2-line\n [RecoveryState.RECOVERY_OPERATION_FAILURE_WARNING]: {icon: '\\ue920', font: font.ICOMOON},\n};\n\nconst nodeStateIcons = {\n [NodeState.CANDIDATE]: {icon: '\\ue914', font: font.ICOMOON},\n [NodeState.NO_CONNECTION]: {icon: '\\ue931', font: font.ICOMOON},\n [NodeState.OUT_OF_SYNC]: {icon: '\\ue920', font: font.ICOMOON},\n [NodeState.READ_ONLY]: {icon: '\\ue95c', font: font.ICOMOON},\n [NodeState.RESTRICTED]: {icon: '\\ue933', font: font.ICOMOON},\n};\n\nfunction getNodeInfoIconType(node) {\n const status = node.recoveryStatus;\n\n if (!status || !status.state) {\n return {icon: '', font: ''};\n }\n\n return iconMap[status.state] || {icon: '', font: ''};\n}\n\nfunction getNodeIconType(node) {\n const iconType = nodeStateIcons[node.nodeState];\n return iconType ? iconType : {icon: '', font: ''};\n}\n\nfunction updateNodesInfoText(nodes) {\n let objectHeight;\n let objectWidth;\n // Set initial text element\n nodes.select('.node-info-text')\n .each(function(d) {\n // eslint-disable-next-line no-invalid-this\n d.infoNode = this;\n })\n .select(function() {\n // eslint-disable-next-line no-invalid-this\n return this.parentNode;\n })\n .append('foreignObject')\n .attr('width', function(d) {\n let shortMessage = '';\n if (!isEmpty(d.recoveryStatus)) {\n shortMessage = extractShortMessageFromNode(d);\n }\n const rect = calculateElementSizeByText(shortMessage);\n objectHeight = rect.height;\n objectWidth = rect.width;\n return objectWidth;\n })\n .attr('height', function(d) {\n return objectHeight;\n })\n .attr('x', function(d) {\n return -(objectWidth / 2);\n })\n .attr('y', function(d) {\n return 78;\n })\n .classed('hidden', function(d) {\n return isEmpty(d.recoveryStatus);\n })\n .style('font-size', '12px')\n .style('font-weight', '400')\n .style('text-align', 'center')\n .style('padding', '4px')\n .style('background', '#EEEEEE')\n .style('border-radius', '6px')\n .attr('class', 'node-info-fo')\n .append('xhtml:div')\n .html(function(d) {\n return extractShortMessageFromNode(d);\n });\n\n // Remove the original text elements, as they are now replaced by foreignObjects\n nodes.select('.node-info-text').remove();\n\n resizeLabelDynamic(nodes);\n}\n\nfunction extractShortMessageFromNode(node) {\n return node.recoveryStatus.message && node.recoveryStatus.message.length > shortMessageLimit ?\n node.recoveryStatus.message.substring(0, shortMessageLimit) + '...' : node.recoveryStatus.message || '';\n}\n\nfunction calculateElementSizeByText(text) {\n const tmp = document.createElement('div');\n tmp.innerHTML = text;\n tmp.style.padding = '4px';\n tmp.style.position = 'absolute';\n tmp.style.visibility = 'hidden';\n tmp.style.fontSize = '12px';\n tmp.style.fontWeight = '400';\n tmp.style.textAlign = 'center';\n tmp.style.height = 'auto';\n tmp.style.width = 'auto';\n tmp.style.whiteSpace = 'nowrap';\n\n document.body.appendChild(tmp);\n const rect = tmp.getBoundingClientRect();\n const height = rect.height;\n const width = rect.width;\n document.body.removeChild(tmp);\n\n return {height, width};\n}\n\nfunction addRecoveryLabelListeners(object, message, truncatedSize, displayMessage, fullSize) {\n object.on('mouseover.tooltip', () => {\n object\n .attr('width', fullSize.width)\n .attr('height', fullSize.height)\n .attr('x', -fullSize.width / 2)\n .html(`<div>${message}</div>`);\n });\n object.on('mouseout.tooltip', () => {\n object\n .attr('width', truncatedSize.width)\n .attr('height', truncatedSize.height)\n .attr('x', -truncatedSize.width / 2)\n .html(`<div>${displayMessage}</div>`);\n });\n}\n\nfunction resizeLabelDynamic(nodes) {\n nodes.select('.node-info-fo')\n .each(function(d) {\n // eslint-disable-next-line no-invalid-this\n const object = d3.select(this);\n if (isEmpty(d.recoveryStatus)) {\n object.attr('width', 0);\n return;\n }\n const shortMessage = extractShortMessageFromNode(d);\n const isShorten = d.recoveryStatus.message && d.recoveryStatus.message.length > shortMessageLimit && shortMessage !== d.recoveryStatus.message;\n const displayMessage = isShorten ? shortMessage : d.recoveryStatus.message;\n const truncatedSize = calculateElementSizeByText(shortMessage);\n const fullSize = calculateElementSizeByText(d.recoveryStatus.message);\n object.on('.tooltip', null);\n\n if (isShorten) {\n addRecoveryLabelListeners(object, d.recoveryStatus.message, truncatedSize, displayMessage, fullSize);\n }\n\n // Set initial size and text\n object\n .attr('width', truncatedSize.width)\n .attr('height', truncatedSize.height)\n .attr('x', -truncatedSize.width / 2)\n .html(`<div>${displayMessage}</div>`);\n });\n}\n\nfunction updateNodesHostnameText(nodes) {\n nodes\n .select('.id.id-host')\n .each(function(d) {\n // eslint-disable-next-line no-invalid-this\n d.labelNode = this;\n })\n .text(function(d) {\n return d.hostname;\n });\n\n // Add padding styling to text background. left/right/top/bottom +5\n nodes\n .select('.id-host-background')\n .attr('width', function(d) {\n return d3.select(d.labelNode).node().getBBox().width + 10;\n })\n .attr('height', function(d) {\n return d3.select(d.labelNode).node().getBBox().height + 10;\n })\n .attr('x', function(d) {\n return d3.select(d.labelNode).node().getBBox().x - 5;\n })\n .attr('y', function(d) {\n return d3.select(d.labelNode).node().getBBox().y - 5;\n });\n}\n\nexport function createLinks(linksDataBinding) {\n linksDataBinding.enter()\n .append('path')\n .classed('link', true);\n\n linksDataBinding.exit().remove();\n}\n\nexport function updateLinks(linksDataBinding, nodes) {\n linksDataBinding\n .attr('class', (link) => {\n // add the link id as a css class for testing purposes\n const idClass = link.id.replaceAll(':', '-');\n return `link ${idClass}`;\n })\n .attr('stroke', setLinkColor)\n .style('stroke-dasharray', setLinkStyle)\n .style(\"marker-mid\", (link) => setArrowLink(link, ARROW_CONFIG.BIG))\n .attr('d', (link) => getLinkCoordinates(link, nodes));\n}\n\nexport const ARROW_CONFIG = {\n SMALL: {name: 'small', size: 3},\n BIG: {name: 'big', size: 5},\n};\n\nexport function addArrowHead(svg, config) {\n svg.append(\"svg:defs\").append(\"svg:marker\")\n .attr(\"id\", `arrowhead_${config.name}`)\n .attr(\"viewBox\", `0 0 ${config.size * 2} ${config.size * 2}`)\n .attr(\"refX\", config.size)\n .attr(\"refY\", config.size)\n .attr(\"markerWidth\", config.size)\n .attr(\"markerHeight\", config.size)\n .attr(\"orient\", \"auto-start-reverse\")\n .append(\"path\")\n .attr(\"d\", `M 0 0 L ${config.size * 2} ${config.size} L 0 ${config.size * 2} z`)\n .style(\"fill\", clusterColors.ontoBlue);\n}\n\nexport function setArrowLink(link, config) {\n if (link.status === LinkState.RECEIVING_SNAPSHOT) {\n return `url(#arrowhead_${config.name})`;\n }\n}\n\nexport function setLinkColor(link) {\n const linkColor = linkStateColors[link.status];\n return linkColor || 'none';\n}\n\nexport function setLinkStyle(link) {\n const linkStyle = linkStateStyle[link.status];\n return linkStyle || 'none';\n}\n\nfunction getLinkCoordinates(link, nodes) {\n const source = nodes.find((node) => node.address === link.source);\n const target = nodes.find((node) => node.address === link.target);\n const deltaX = target.x - source.x;\n const deltaY = target.y - source.y;\n const dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const normX = deltaX / dist;\n const normY = deltaY / dist;\n const sourcePadding = 55;\n const targetPadding = 55;\n const sourceX = source.x + (sourcePadding * normX);\n const sourceY = source.y + (sourcePadding * normY);\n const targetX = target.x - (targetPadding * normX);\n const targetY = target.y - (targetPadding * normY);\n const {x: midpointX, y: midpointY} = getLinkMidpoint(link, nodes);\n return 'M' + sourceX + ',' + sourceY + 'L' + midpointX + ',' + midpointY +\n 'L' + targetX + ',' + targetY;\n}\n\nexport function positionNodesOnClusterZone(nodeElements, clusterZoneX, clusterZoneY, clusterZoneRadius) {\n nodeElements\n .attr('transform', (node, index) => {\n // Calculate initial positions for the new nodes based on\n // spreading them evenly on a circle around the center of the page.\n const theta = 2 * Math.PI * index / nodeElements.size();\n const x = clusterZoneX + Math.cos(theta) * clusterZoneRadius;\n const y = clusterZoneY + Math.sin(theta) * clusterZoneRadius;\n node.x = x;\n node.y = y;\n return `translate(${x}, ${y})`;\n });\n}\n\nexport function createHexagon(nodeGroup, radius) {\n const _s32 = (Math.sqrt(3) / 2);\n const xDiff = 0;\n const yDiff = 0;\n const points = [[radius + xDiff, yDiff], [radius / 2 + xDiff, radius * _s32 + yDiff], [-radius / 2 + xDiff, radius * _s32 + yDiff],\n [-radius + xDiff, yDiff],\n [-radius / 2 + xDiff, -radius * _s32 + yDiff], [radius / 2 + xDiff, -radius * _s32 + yDiff], [radius + xDiff, yDiff],\n [radius / 2 + xDiff, radius * _s32 + yDiff]];\n return nodeGroup\n .selectAll(\"path.area\")\n .data([points])\n .enter()\n .append(\"path\")\n .attr('class', 'node member')\n .attr(\"stroke-width\", \"10\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"d\", d3.line());\n}\n\nexport function removeEventListeners() {\n d3.select(document).selectAll('.node-info-fo').on('.tooltip', null);\n}\n","import {NodeState} from \"./node-state\";\nimport {LinkState} from \"./states\";\n\nconst CLUSTER_MANAGEMENT_CONSTANTS = (function () {\n const SVG_NODE_WIDTH = 15;\n\n const PADDING_LEFT = 12;\n const PADDING_TOP = 12;\n\n const TITLE_PADDING_TOP = 15;\n const TITLE_FONT_SIZE = 13;\n const TITLE_FONT_WEIGHT = 700;\n const TITLE_LINE_HEIGHT = 18;\n\n const LEGEND_ITEMS_PADDING_TOP = 40;\n const LEGEND_ITEM_PADDING_TOP = 8;\n const LEGEND_ITEM_ICON_FONT_SIZE = 15;\n const LEGEND_ITEM_FONT_SIZE = 11;\n const LEGEND_ITEM_FONT_WEIGHT = 400;\n const LEGEND_ITEM_LINE_HEIGHT = 13;\n const LEGEND_ITEM_PADDING_LEFT = PADDING_LEFT + SVG_NODE_WIDTH;\n\n const BACKGROUND_PADDING = PADDING_LEFT * 2;\n\n const getLegendNodes = function () {\n const legendNodes = [];\n legendNodes.push({nodeState: NodeState.LEADER, customText: 'node_state_leader'});\n legendNodes.push({nodeState: NodeState.FOLLOWER, customText: 'node_state_follower'});\n // the out of sync node in the leged should not have an icon\n legendNodes.push({nodeState: NodeState.OUT_OF_SYNC_BLANK, customText: 'node_state_out_of_sync'});\n legendNodes.forEach((node, index) => node.id = index);\n return legendNodes;\n };\n\n const getLegendLinks = function () {\n const links = [];\n links.push({status: LinkState.IN_SYNC, linkTypeKey: 'link_state_in_sync'});\n links.push({status: LinkState.SYNCING, linkTypeKey: 'link_state_syncing'});\n links.push({status: LinkState.OUT_OF_SYNC, linkTypeKey: 'link_state_out_of_sync'});\n links.push({status: LinkState.RECEIVING_SNAPSHOT, linkTypeKey: 'link_state_receiving_snapshot'});\n links.forEach((link, index) => link.id = index);\n return links;\n };\n\n const getSyncStatuses = () => {\n return [\n {\n labelKey: 'node_state_candidate',\n classes: 'remixicon',\n icon: '\\ueb81', //ri-checkbox-circle-line\n }, {\n labelKey: 'node_state_no_cluster',\n classes: 'remixicon',\n icon: '\\ueb99', //ri-close-line\n }, {\n labelKey: 'link_state_out_of_sync',\n classes: 'remixicon',\n icon: '\\uea21', //ri-alert-line\n }, {\n labelKey: 'node_state_no_connection',\n classes: 'remixicon',\n icon: '\\ueeb1', //ri-link-unlink\n }, {\n labelKey: 'node_state_read_only',\n classes: 'remixicon',\n icon: '\\uece2', //ri-file-forbid-line\n }, {\n labelKey: 'node_state_restricted',\n classes: 'remixicon',\n icon: '\\uee71', //ri-key-line\n }, {\n labelKey: 'recovery_state.searching_for_node',\n classes: 'remixicon',\n icon: '\\uf045', //ri-question-line\n }, {\n labelKey: 'recovery_state.waiting_for_snapshot',\n classes: 'remixicon',\n icon: '\\uf20f', //ri-time-line\n }, {\n labelKey: 'recovery_state.building_snapshot',\n classes: 'remixicon',\n icon: '\\uf3a7', //ri-archive-2-line\n }, {\n labelKey: 'recovery_state.sending_snapshot',\n classes: 'remixicon',\n icon: '\\uf24a', //ri-upload-2-line\n }, {\n labelKey: 'recovery_state.receiving_snapshot',\n classes: 'remixicon',\n icon: '\\uec54', //ri-download-2-line\n }, {\n labelKey: 'recovery_state.applying_snapshot',\n classes: 'remixicon',\n icon: '\\uec30', //ri-device-recover-line\n },\n ];\n };\n\n return {\n getLegendNodes,\n getSyncStatuses,\n getLegendLinks,\n SVG_NODE_WIDTH,\n PADDING_LEFT,\n PADDING_TOP,\n TITLE_PADDING_TOP,\n TITLE_FONT_SIZE,\n TITLE_FONT_WEIGHT,\n TITLE_LINE_HEIGHT,\n LEGEND_ITEM_FONT_SIZE,\n LEGEND_ITEM_ICON_FONT_SIZE,\n LEGEND_ITEM_FONT_WEIGHT,\n LEGEND_ITEM_LINE_HEIGHT,\n LEGEND_ITEM_PADDING_LEFT,\n LEGEND_ITEMS_PADDING_TOP,\n LEGEND_ITEM_PADDING_TOP,\n BACKGROUND_PADDING\n };\n})();\n\nexport {\n CLUSTER_MANAGEMENT_CONSTANTS\n};\n","export const NodeState = {\n LEADER: 'LEADER',\n FOLLOWER: 'FOLLOWER',\n CANDIDATE: 'CANDIDATE',\n // node without icon\n OUT_OF_SYNC_BLANK: 'OUT_OF_SYNC_BLANK'\n};\n","export 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};\n\nexport const RecoveryState = {\n SEARCHING_FOR_NODE: 'SEARCHING_FOR_NODE',\n WAITING_FOR_SNAPSHOT: 'WAITING_FOR_SNAPSHOT',\n RECEIVING_SNAPSHOT: 'RECEIVING_SNAPSHOT',\n APPLYING_SNAPSHOT: 'APPLYING_SNAPSHOT',\n BUILDING_SNAPSHOT: 'BUILDING_SNAPSHOT',\n SENDING_SNAPSHOT: 'SENDING_SNAPSHOT',\n RECOVERY_OPERATION_FAILURE_WARNING: 'RECOVERY_OPERATION_FAILURE_WARNING'\n};\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 // complimentary state, built based on the recovery state of two nodes when one is receiving snapshot to the other\n RECEIVING_SNAPSHOT: 'RECEIVING_SNAPSHOT'\n};\n\nexport const TopologyState = {\n PRIMARY_NODE: 'PRIMARY_NODE',\n SECONDARY_NODE: 'SECONDARY_NODE'\n};\n"],"names":["d3","select","clusterLegend","$rootScope","ClusterViewContextService","$translate","$document","restrict","templateUrl","scope","link","$scope","hideLegend","subscriptions","legendGroup","legendHeight","legendWidth","toggleLegend","classed","init","clusterViewD3Container","getClusterViewD3Container","createLegendGroup","createLegendBackground","addNodeStates","addSyncStatus","addLinks","updateLegendDimensions","updateLegendBackground","addTitle","legendNodeData","selectAll","data","CLUSTER_MANAGEMENT_CONSTANTS","getLegendNodes","legendNodesElements","CDS","SVG_NODE_WIDTH","attr","d","i","LEGEND_ITEM_PADDING_LEFT","LEGEND_ITEM_PADDING_TOP","append","style","LEGEND_ITEM_FONT_WEIGHT","PADDING_LEFT","text","translateAndSubscribe","this","customText","syncStatusesGroups","getSyncStatuses","enter","rowY","Map","classes","index","rowTop","LEGEND_ITEMS_PADDING_TOP","set","icon","labelOffsetY","LEGEND_ITEM_ICON_FONT_SIZE","LEGEND_ITEM_FONT_SIZE","labelKey","get","linkStatesGroup","getLegendLinks","y","lineWidth","line","status","LinkState","RECEIVING_SNAPSHOT","lineMidPoint","ARROW_CONFIG","SMALL","LEGEND_ITEM_LINE_HEIGHT","linkTypeKey","call","node","getBBox","height","getMaxWidthOfChildren","maxWidth","PADDING_TOP","BACKGROUND_PADDING","parent","each","bbox","Math","max","width","TITLE_FONT_SIZE","TITLE_FONT_WEIGHT","TITLE_LINE_HEIGHT","TITLE_PADDING_TOP","domElement","push","$on","instant","onKeyDown","event","key","on","onClusterViewD3ContainerUpdated","removeAllListeners","off","forEach","subscription","angular","module","directive","$inject","clusterColors","linkStateColors","IN_SYNC","SYNCING","OUT_OF_SYNC","linkStateStyle","font","getLinkMidpoint","nodes","source","find","address","target","deltaX","x","deltaY","dist","sqrt","normX","normY","sourceX","sourceY","appendOutOfSyncLinkIcon","group","iconSize","parentGroup","iconType","iconCode","iconColor","appendLinkIcon","updateLinkIcons","linksGroup","links","outOfSyncLinks","filter","iconGroups","id","entered","merge","exit","remove","updateLegendLinkIcons","pathEl","totalLength","getTotalLength","midPoint","getPointAtLength","createClusterSvgElement","element","createClusterZone","clusterZone","setCreateClusterZone","hasCluster","translationsMap","hasAccess","textGroup","no_cluster_configured","create_cluster_btn","updateClusterZoneLabels","moveElement","createNodes","nodesDataBinding","nodeRadius","isLegend","nodeGroup","nodeUpdateElements","radius","_s32","points","createHexagon","nodeElements","nodeTextHost","addHostnameToNodes","updateNodes","isEmpty","recoveryStatus","nodeStateIcons","nodeState","getNodeIconType","state","iconMap","getNodeInfoIconType","updateNodesIcon","NodeState","LEADER","FOLLOWER","CANDIDATE","updateNodesClasses","labelNode","hostname","updateNodesHostnameText","objectHeight","objectWidth","infoNode","parentNode","shortMessage","extractShortMessageFromNode","rect","calculateElementSizeByText","html","object","isShorten","message","length","displayMessage","truncatedSize","fullSize","addRecoveryLabelListeners","resizeLabelDynamic","updateNodesInfoText","RecoveryState","SEARCHING_FOR_NODE","WAITING_FOR_SNAPSHOT","APPLYING_SNAPSHOT","BUILDING_SNAPSHOT","SENDING_SNAPSHOT","RECOVERY_OPERATION_FAILURE_WARNING","NO_CONNECTION","READ_ONLY","RESTRICTED","substring","tmp","document","createElement","innerHTML","padding","position","visibility","fontSize","fontWeight","textAlign","whiteSpace","body","appendChild","getBoundingClientRect","removeChild","createLinks","linksDataBinding","updateLinks","replaceAll","setLinkColor","setLinkStyle","setArrowLink","BIG","targetX","targetY","midpointX","midpointY","getLinkCoordinates","name","size","addArrowHead","svg","config","positionNodesOnClusterZone","clusterZoneX","clusterZoneY","clusterZoneRadius","theta","PI","cos","sin","removeEventListeners","legendNodes","OUT_OF_SYNC_BLANK","NO_CLUSTER","TopologyState","PRIMARY_NODE","SECONDARY_NODE"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=24125;export const __webpack_esm_ids__=[24125,58325,80706];export const __webpack_esm_modules__={24125(t,e,n){n.d(e,{$$:()=>T,CQ:()=>w,D6:()=>Y,HF:()=>y,Iz:()=>D,J5:()=>g,Tk:()=>_,Wg:()=>G,Xl:()=>O,ZC:()=>v,_D:()=>L,cZ:()=>E,cy:()=>R,dB:()=>p,kI:()=>I,r_:()=>S,ss:()=>P,vx:()=>h});var r=n(58325),o=n(22723),s=n(44482);const a={line:s.line,select:s.select},i="var(--gw-foreground-on-surface-primary)",c={[r.gC.IN_SYNC]:i,[r.gC.SYNCING]:i,[r.gC.OUT_OF_SYNC]:"var(--gw-neutral-light)",[r.gC.RECEIVING_SNAPSHOT]:i},l={[r.gC.IN_SYNC]:"none",[r.gC.SYNCING]:"10 10",[r.gC.OUT_OF_SYNC]:"10 10",[r.gC.RECEIVING_SNAPSHOT]:"10 10"},d="REMIXICON",u="ICOMOON";function N(t,e){const n=e.find(e=>e.address===t.source),r=e.find(e=>e.address===t.target),o=r.x-n.x,s=r.y-n.y,a=Math.sqrt(o*o+s*s),i=o/a,c=s/a,l=n.x+55*i,d=n.y+55*c;return{x:(l+(r.x-55*i))/2,y:(d+(r.y-55*c))/2}}function f(t,e){!function(t,e,n,r,o){t.append("circle").attr("r",12).attr("fill","var(--gw-panel-background)"),t.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("class","remixicon").attr("fill","var(--gw-foreground-on-surface-secondary)").style("font-size",o).text("")}(t,0,0,0,e)}function _(t,e,n){const o=e.filter(t=>t.status===r.gC.OUT_OF_SYNC),s=t.selectAll(".link-icon-group").data(o,t=>t.id),a=s.enter().append("g").classed("link-icon-group",!0);f(a,"20px"),a.merge(s).attr("transform",t=>{const{x:e,y:r}=N(t,n);return`translate(${e}, ${r})`}),s.exit().remove()}function h(t,e){t.selectAll(".link-icon-group").remove(),t.each(function(t){if(t.status!==r.gC.OUT_OF_SYNC)return;const e=a.select(this),n=e.select("path.link").node(),o=n.getTotalLength(),s=n.getPointAtLength(o/2);f(e.append("g").classed("link-icon-group",!0).attr("transform",`translate(${s.x}, ${s.y})`),"18px")})}function g(t){return a.select(t).append("svg").classed("cluster-diagram",!0)}function p(t){const e=t.append("g");return e.append("circle").classed("cluster-zone",!0).style("fill","transparent").style("stroke-width","4"),e}function O(t,e,n,r=!1){if(e.select(".cluster-zone").classed("no-cluster",!t).classed("has-access",r),t)e.selectAll("#no-cluster-zone").remove();else{const t=e.append("g").attr("id","no-cluster-zone");t.append("text").attr("id","no-cluster-label").text(n.no_cluster_configured).attr("y",-50).classed("h2",!0).style("text-anchor","middle"),r&&t.append("text").attr("id","create-cluster-label").classed("h3",!0).text(n.create_cluster_btn).style("text-anchor","middle"),t.append("text").attr("y",130).attr("class","icon-any repo").attr("fill","var(--gw-primary-base)").style("text-anchor","middle").classed("settings-icon",!0).text("")}}function S(t,e,n){t||(e.select("#no-cluster-zone #no-cluster-label").text(n.no_cluster_configured),e.select("#no-cluster-zone #create-cluster-label").text(n.create_cluster_btn))}function E(t,e,n){t.attr("transform",()=>`translate(${e}, ${n})`)}function I(t,e,n){const r=t.enter().append("g").attr("id","node-group").classed("legend",n),o=r.merge(t).attr("id","node-group").classed("legend",n);return function(t,e){const n=Math.sqrt(3)/2,r=[[e+0,0],[e/2+0,e*n+0],[-e/2+0,e*n+0],[0-e,0],[-e/2+0,-e*n+0],[e/2+0,-e*n+0],[e+0,0],[e/2+0,e*n+0]];t.selectAll("path.area").data([r]).enter().append("path").attr("class","node member").attr("stroke-width","10").attr("stroke-linejoin","round").attr("d",a.line())}(r,e),t.exit().remove(),r.append("text").attr("class","icon-any node-icon"),n||function(t,e){const n=t.append("g");n.append("rect").attr("class","id-host-background").attr("rx",6),n.append("rect").attr("class","node-info-background").attr("rx",6),n.append("text").attr("y",e+25).attr("class","id id-host"),n.append("text").attr("y",e+55).attr("class","node-info-text")}(r,e),o}function y(t){!function(t){t.select(".node-icon").each(function(t){const e=(n=t,(0,o.isEmpty)(n.recoveryStatus)?function(t){return m[t.nodeState]||{icon:"",font:""}}(t):function(t){const e=t.recoveryStatus;return e&&e.state&&C[e.state]||{icon:"",font:""}}(t));var n;a.select(this).classed("icon-any",e.font===u).classed("remixicon",e.font===d).text(e.icon)})}(t),function(t){t.select(".node.member").classed("leader",t=>t.nodeState===r.UY.LEADER).classed("follower",t=>t.nodeState===r.UY.FOLLOWER).classed("candidate",t=>t.nodeState===r.UY.CANDIDATE).classed("other",t=>t.nodeState!==r.UY.LEADER&&t.nodeState!==r.UY.FOLLOWER&&t.nodeState!==r.UY.CANDIDATE)}(t),function(t){t.select(".id.id-host").each(function(t){t.labelNode=this}).text(function(t){return t.hostname}),t.select(".id-host-background").attr("width",function(t){return a.select(t.labelNode).node().getBBox().width+10}).attr("height",function(t){return a.select(t.labelNode).node().getBBox().height+10}).attr("x",function(t){return a.select(t.labelNode).node().getBBox().x-5}).attr("y",function(t){return a.select(t.labelNode).node().getBBox().y-5})}(t),function(t){let e,n;t.select(".node-info-text").each(function(t){t.infoNode=this}).select(function(){return this.parentNode}).append("foreignObject").attr("width",function(t){let r="";(0,o.isEmpty)(t.recoveryStatus)||(r=A(t));const s=x(r);return e=s.height,n=s.width,n}).attr("height",function(t){return e}).attr("x",function(t){return-n/2}).attr("y",function(t){return 78}).classed("hidden",function(t){return(0,o.isEmpty)(t.recoveryStatus)}).style("font-size","12px").style("font-weight","400").style("text-align","center").style("padding","4px").style("background","#EEEEEE").style("border-radius","6px").attr("class","node-info-fo").append("xhtml:div").html(function(t){return A(t)}),t.select(".node-info-text").remove(),function(t){t.select(".node-info-fo").each(function(t){const e=a.select(this);if((0,o.isEmpty)(t.recoveryStatus))return void e.attr("width",0);const n=A(t),r=t.recoveryStatus.message&&t.recoveryStatus.message.length>40&&n!==t.recoveryStatus.message,s=r?n:t.recoveryStatus.message,i=x(n),c=x(t.recoveryStatus.message);e.on(".tooltip",null),r&&function(t,e,n,r,o){t.on("mouseover.tooltip",()=>{t.attr("width",o.width).attr("height",o.height).attr("x",-o.width/2).html(`<div>${e}</div>`)}),t.on("mouseout.tooltip",()=>{t.attr("width",n.width).attr("height",n.height).attr("x",-n.width/2).html(`<div>${r}</div>`)})}(e,t.recoveryStatus.message,i,s,c),e.attr("width",i.width).attr("height",i.height).attr("x",-i.width/2).html(`<div>${s}</div>`)})}(t)}(t)}const C={[r.vQ.SEARCHING_FOR_NODE]:{icon:"",font:d},[r.vQ.WAITING_FOR_SNAPSHOT]:{icon:"",font:d},[r.vQ.RECEIVING_SNAPSHOT]:{icon:"",font:d},[r.vQ.APPLYING_SNAPSHOT]:{icon:"",font:d},[r.vQ.BUILDING_SNAPSHOT]:{icon:"",font:d},[r.vQ.SENDING_SNAPSHOT]:{icon:"",font:d},[r.vQ.RECOVERY_OPERATION_FAILURE_WARNING]:{icon:"",font:u}},m={[r.UY.CANDIDATE]:{icon:"",font:u},[r.UY.NO_CONNECTION]:{icon:"",font:u},[r.UY.OUT_OF_SYNC]:{icon:"",font:u},[r.UY.READ_ONLY]:{icon:"",font:u},[r.UY.RESTRICTED]:{icon:"",font:u}};function A(t){return t.recoveryStatus.message&&t.recoveryStatus.message.length>40?t.recoveryStatus.message.substring(0,40)+"...":t.recoveryStatus.message||""}function x(t){const e=document.createElement("div");e.innerHTML=t,e.style.padding="4px",e.style.position="absolute",e.style.visibility="hidden",e.style.fontSize="12px",e.style.fontWeight="400",e.style.textAlign="center",e.style.height="auto",e.style.width="auto",e.style.whiteSpace="nowrap",document.body.appendChild(e);const n=e.getBoundingClientRect(),r=n.height,o=n.width;return document.body.removeChild(e),{height:r,width:o}}function R(t){t.enter().append("path").classed("link",!0),t.exit().remove()}function T(t,e){t.attr("class",t=>`link ${t.id.replaceAll(":","-")}`).attr("stroke",L).style("stroke-dasharray",w).style("marker-mid",t=>D(t,v.BIG)).attr("d",t=>function(t,e){const n=e.find(e=>e.address===t.source),r=e.find(e=>e.address===t.target),o=r.x-n.x,s=r.y-n.y,a=Math.sqrt(o*o+s*s),i=o/a,c=s/a,l=n.x+55*i,d=n.y+55*c,u=r.x-55*i,f=r.y-55*c,{x:_,y:h}=N(t,e);return"M"+l+","+d+"L"+_+","+h+"L"+u+","+f}(t,e))}const v={SMALL:{name:"small",size:3},BIG:{name:"big",size:5}};function Y(t,e){t.append("svg:defs").append("svg:marker").attr("id",`arrowhead_${e.name}`).attr("viewBox",`0 0 ${2*e.size} ${2*e.size}`).attr("refX",e.size).attr("refY",e.size).attr("markerWidth",e.size).attr("markerHeight",e.size).attr("orient","auto-start-reverse").append("path").attr("d",`M 0 0 L ${2*e.size} ${e.size} L 0 ${2*e.size} z`).style("fill",i)}function D(t,e){if(t.status===r.gC.RECEIVING_SNAPSHOT)return`url(#arrowhead_${e.name})`}function L(t){return c[t.status]||"none"}function w(t){return l[t.status]||"none"}function P(t,e,n,r){t.attr("transform",(o,s)=>{const a=2*Math.PI*s/t.size(),i=e+Math.cos(a)*r,c=n+Math.sin(a)*r;return o.x=i,o.y=c,`translate(${i}, ${c})`})}function G(){a.select(document).selectAll(".node-info-fo").on(".tooltip",null)}},58325(t,e,n){n.d(e,{UY:()=>r,gC:()=>s,vQ:()=>o,zB:()=>a});const r={LEADER:"LEADER",FOLLOWER:"FOLLOWER",CANDIDATE:"CANDIDATE",OUT_OF_SYNC:"OUT_OF_SYNC",NO_CONNECTION:"NO_CONNECTION",READ_ONLY:"READ_ONLY",RESTRICTED:"RESTRICTED",NO_CLUSTER:"NO_CLUSTER"},o={SEARCHING_FOR_NODE:"SEARCHING_FOR_NODE",WAITING_FOR_SNAPSHOT:"WAITING_FOR_SNAPSHOT",RECEIVING_SNAPSHOT:"RECEIVING_SNAPSHOT",APPLYING_SNAPSHOT:"APPLYING_SNAPSHOT",BUILDING_SNAPSHOT:"BUILDING_SNAPSHOT",SENDING_SNAPSHOT:"SENDING_SNAPSHOT",RECOVERY_OPERATION_FAILURE_WARNING:"RECOVERY_OPERATION_FAILURE_WARNING"},s={IN_SYNC:"IN_SYNC",OUT_OF_SYNC:"OUT_OF_SYNC",SYNCING:"SYNCING",NO_CONNECTION:"NO_CONNECTION",RECEIVING_SNAPSHOT:"RECEIVING_SNAPSHOT"},a={PRIMARY_NODE:"PRIMARY_NODE",SECONDARY_NODE:"SECONDARY_NODE"}}};
|
|
2
|
+
//# sourceMappingURL=24125.0fd6b7797f2630fe59c6.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"24125.0fd6b7797f2630fe59c6.bundle.js","mappings":"8VAIA,MAAMA,EAAK,CACTC,KAAI,OACJC,OAAMA,EAAAA,QAGFC,EAEQ,0CAKRC,EAAkB,CACpB,CAACC,EAAAA,GAAUC,SAAUH,EACrB,CAACE,EAAAA,GAAUE,SAAUJ,EACrB,CAACE,EAAAA,GAAUG,aAND,0BAOV,CAACH,EAAAA,GAAUI,oBAAqBN,GAG9BO,EAAiB,CAEnB,CAACL,EAAAA,GAAUC,SAAU,OAErB,CAACD,EAAAA,GAAUE,SAAU,QAErB,CAACF,EAAAA,GAAUG,aAAc,QAEzB,CAACH,EAAAA,GAAUI,oBAAqB,SAG9BE,EACS,YADTA,EAEO,UAKb,SAASC,EAAgBC,EAAMC,GAC3B,MAAMC,EAASD,EAAME,KAAMC,GAASA,EAAKC,UAAYL,EAAKE,QACpDI,EAASL,EAAME,KAAMC,GAASA,EAAKC,UAAYL,EAAKM,QACpDC,EAASD,EAAOE,EAAIN,EAAOM,EAC3BC,EAASH,EAAOI,EAAIR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xD,EAAgB,CACzBC,mBAAoB,qBACpBC,qBAAsB,uBACtBpI,mBAAoB,qBACpBqI,kBAAmB,oBACnBC,kBAAmB,oBACnBC,iBAAkB,mBAClBC,mCAAoC,sCAG3B5I,EAAY,CACrBC,QAAS,UACTE,YAAa,cACbD,QAAS,UACT2I,cAAe,gBAEfzI,mBAAoB,sBAGX2L,EAAgB,CACzBC,aAAc,eACdC,eAAgB,iB","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/clustermanagement/services/cluster-drawing.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/clustermanagement/states.js"],"sourcesContent":["import {LinkState, NodeState, RecoveryState} from \"../../models/clustermanagement/states\";\nimport {isEmpty} from \"lodash\";\nimport {select, line} from 'd3';\n\nconst d3 = {\n line,\n select,\n};\n\nconst clusterColors = {\n ontoOrange: 'var(--gw-primary-base)',\n ontoBlue: 'var(--gw-foreground-on-surface-primary)',\n ontoGreen: 'var(--gw-tertiary-base)',\n ontoGrey: 'var(--gw-neutral-light)',\n};\n\nconst linkStateColors = {\n [LinkState.IN_SYNC]: clusterColors.ontoBlue,\n [LinkState.SYNCING]: clusterColors.ontoBlue,\n [LinkState.OUT_OF_SYNC]: clusterColors.ontoGrey,\n [LinkState.RECEIVING_SNAPSHOT]: clusterColors.ontoBlue,\n};\n\nconst linkStateStyle = {\n // solid line\n [LinkState.IN_SYNC]: 'none',\n // dashed line\n [LinkState.SYNCING]: '10 10',\n // dashed line\n [LinkState.OUT_OF_SYNC]: '10 10',\n // dashed line\n [LinkState.RECEIVING_SNAPSHOT]: '10 10',\n};\n\nconst font = {\n REMIXICON: 'REMIXICON',\n ICOMOON: 'ICOMOON',\n};\n\nconst shortMessageLimit = 40;\n\nfunction getLinkMidpoint(link, nodes) {\n const source = nodes.find((node) => node.address === link.source);\n const target = nodes.find((node) => node.address === link.target);\n const deltaX = target.x - source.x;\n const deltaY = target.y - source.y;\n const dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const normX = deltaX / dist;\n const normY = deltaY / dist;\n const sourcePadding = 55;\n const targetPadding = 55;\n const sourceX = source.x + (sourcePadding * normX);\n const sourceY = source.y + (sourcePadding * normY);\n const targetX = target.x - (targetPadding * normX);\n const targetY = target.y - (targetPadding * normY);\n return {\n x: (sourceX + targetX) / 2,\n y: (sourceY + targetY) / 2,\n };\n}\n\nfunction appendLinkIcon(parentGroup, iconType, iconCode, iconColor, iconSize) {\n // Circle background so the icon is readable over the dashed line\n parentGroup.append('circle')\n .attr('r', 12)\n .attr('fill', 'var(--gw-panel-background)');\n\n parentGroup.append('text')\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'central')\n .attr('class', iconType)\n .attr('fill', iconColor)\n .style('font-size', iconSize)\n .text(iconCode);\n}\n\nfunction appendOutOfSyncLinkIcon(group, iconSize) {\n appendLinkIcon(group, 'remixicon', '\\uf064', 'var(--gw-foreground-on-surface-secondary)', iconSize);\n}\n\nexport function updateLinkIcons(linksGroup, links, nodes) {\n const outOfSyncLinks = links.filter((link) => link.status === LinkState.OUT_OF_SYNC);\n\n const iconGroups = linksGroup.selectAll('.link-icon-group')\n .data(outOfSyncLinks, (link) => link.id);\n\n const entered = iconGroups.enter()\n .append('g')\n .classed('link-icon-group', true);\n\n appendOutOfSyncLinkIcon(entered, '20px');\n\n // Position both new and existing groups at the link midpoint\n entered.merge(iconGroups)\n .attr('transform', (link) => {\n const {x, y} = getLinkMidpoint(link, nodes);\n return `translate(${x}, ${y})`;\n });\n\n iconGroups.exit().remove();\n}\n\nexport function updateLegendLinkIcons(linkStatesGroup, legendWidth) {\n linkStatesGroup.selectAll('.link-icon-group').remove();\n\n linkStatesGroup.each(function(d) {\n if (d.status !== LinkState.OUT_OF_SYNC) {\n return;\n }\n // eslint-disable-next-line no-invalid-this\n const group = d3.select(this);\n const path = group.select('path.link');\n // Midpoint of the legend line: x is halfway along lineWidth, y is the line's y\n const pathEl = path.node();\n const totalLength = pathEl.getTotalLength();\n const midPoint = pathEl.getPointAtLength(totalLength / 2);\n\n const iconGroup = group.append('g')\n .classed('link-icon-group', true)\n .attr('transform', `translate(${midPoint.x}, ${midPoint.y})`);\n // remixicon refresh-line\n appendOutOfSyncLinkIcon(iconGroup, '18px');\n });\n}\n\nexport function createClusterSvgElement(element) {\n return d3.select(element)\n .append('svg')\n .classed('cluster-diagram', true);\n}\n\nexport function createClusterZone(parent) {\n const clusterZone = parent.append('g');\n clusterZone\n .append(\"circle\")\n .classed('cluster-zone', true)\n .style('fill', 'transparent')\n .style('stroke-width', '4');\n return clusterZone;\n}\n\nexport function setCreateClusterZone(hasCluster, clusterZone, translationsMap, hasAccess = false) {\n clusterZone\n .select('.cluster-zone')\n .classed('no-cluster', !hasCluster)\n .classed('has-access', hasAccess);\n\n if (hasCluster) {\n clusterZone.selectAll('#no-cluster-zone').remove();\n } else {\n const textGroup = clusterZone\n .append('g')\n .attr(\"id\", \"no-cluster-zone\");\n textGroup\n .append('text')\n .attr('id', 'no-cluster-label')\n .text(translationsMap.no_cluster_configured)\n .attr('y', -50)\n .classed('h2', true)\n .style('text-anchor', \"middle\");\n if (hasAccess) {\n textGroup.append('text')\n .attr('id', 'create-cluster-label')\n .classed('h3', true)\n .text(translationsMap.create_cluster_btn)\n .style('text-anchor', \"middle\");\n }\n textGroup.append('text')\n .attr('y', 130)\n .attr('class', 'icon-any repo')\n .attr('fill', clusterColors.ontoOrange)\n .style('text-anchor', \"middle\")\n .classed('settings-icon', true)\n .text(\"\\ue92b\");\n }\n}\n\nexport function updateClusterZoneLabels(hasCluster, clusterZone, translationsMap) {\n if (hasCluster) {\n return;\n }\n clusterZone.select('#no-cluster-zone #no-cluster-label')\n .text(translationsMap.no_cluster_configured);\n clusterZone.select('#no-cluster-zone #create-cluster-label')\n .text(translationsMap.create_cluster_btn);\n}\n\nexport function moveElement(element, x, y) {\n element.attr('transform', () => {\n return `translate(${x}, ${y})`;\n });\n}\n\nexport function createNodes(nodesDataBinding, nodeRadius, isLegend) {\n const nodeGroup = nodesDataBinding.enter()\n .append('g')\n .attr('id', 'node-group')\n .classed('legend', isLegend);\n\n const nodeUpdateElements = nodeGroup\n .merge(nodesDataBinding)\n .attr('id', 'node-group')\n .classed('legend', isLegend);\n\n createHexagon(nodeGroup, nodeRadius);\n nodesDataBinding.exit().remove();\n\n nodeGroup\n .append('text')\n .attr('class', 'icon-any node-icon');\n\n if (!isLegend) {\n addHostnameToNodes(nodeGroup, nodeRadius, isLegend);\n }\n return nodeUpdateElements;\n}\n\nfunction addHostnameToNodes(nodeElements, nodeRadius) {\n const nodeTextHost = nodeElements.append('g');\n\n nodeTextHost\n .append('rect')\n .attr('class', 'id-host-background')\n .attr('rx', 6);\n\n nodeTextHost\n .append('rect')\n .attr('class', 'node-info-background')\n .attr('rx', 6);\n\n nodeTextHost\n .append('text')\n .attr('y', nodeRadius + 25)\n .attr('class', 'id id-host');\n\n nodeTextHost\n .append('text')\n .attr('y', nodeRadius + 55)\n .attr('class', 'node-info-text');\n}\n\nexport function updateNodes(nodes) {\n updateNodesIcon(nodes);\n updateNodesClasses(nodes);\n updateNodesHostnameText(nodes);\n updateNodesInfoText(nodes);\n}\n\nfunction updateNodesClasses(nodes) {\n nodes\n .select('.node.member')\n .classed('leader', (node) => node.nodeState === NodeState.LEADER)\n .classed('follower', (node) => node.nodeState === NodeState.FOLLOWER)\n .classed('candidate', (node) => node.nodeState === NodeState.CANDIDATE)\n .classed('other', (node) => {\n return node.nodeState !== NodeState.LEADER &&\n node.nodeState !== NodeState.FOLLOWER &&\n node.nodeState !== NodeState.CANDIDATE;\n });\n}\n\nfunction updateNodesIcon(nodes) {\n nodes.select('.node-icon')\n .each(function(d) {\n const iconType = hasRecoveryState(d) ? getNodeInfoIconType(d) : getNodeIconType(d);\n // eslint-disable-next-line no-invalid-this\n d3.select(this)\n .classed('icon-any', iconType.font === font.ICOMOON)\n .classed('remixicon', iconType.font === font.REMIXICON)\n .text(iconType.icon);\n });\n}\n\nfunction hasRecoveryState(node) {\n return !isEmpty(node.recoveryStatus);\n}\n\nconst iconMap = {\n [RecoveryState.SEARCHING_FOR_NODE]: {icon: '\\uf045', font: font.REMIXICON}, //ri-question-line\n [RecoveryState.WAITING_FOR_SNAPSHOT]: {icon: '\\uf20f', font: font.REMIXICON}, //ri-time-line\n [RecoveryState.RECEIVING_SNAPSHOT]: {icon: '\\uec54', font: font.REMIXICON}, //ri-download-2-line\n [RecoveryState.APPLYING_SNAPSHOT]: {icon: '\\uec30', font: font.REMIXICON}, //ri-device-recover-line\n [RecoveryState.BUILDING_SNAPSHOT]: {icon: '\\uf3a7', font: font.REMIXICON}, //ri-archive-2-line\n [RecoveryState.SENDING_SNAPSHOT]: {icon: '\\uf24a', font: font.REMIXICON}, //ri-upload-2-line\n [RecoveryState.RECOVERY_OPERATION_FAILURE_WARNING]: {icon: '\\ue920', font: font.ICOMOON},\n};\n\nconst nodeStateIcons = {\n [NodeState.CANDIDATE]: {icon: '\\ue914', font: font.ICOMOON},\n [NodeState.NO_CONNECTION]: {icon: '\\ue931', font: font.ICOMOON},\n [NodeState.OUT_OF_SYNC]: {icon: '\\ue920', font: font.ICOMOON},\n [NodeState.READ_ONLY]: {icon: '\\ue95c', font: font.ICOMOON},\n [NodeState.RESTRICTED]: {icon: '\\ue933', font: font.ICOMOON},\n};\n\nfunction getNodeInfoIconType(node) {\n const status = node.recoveryStatus;\n\n if (!status || !status.state) {\n return {icon: '', font: ''};\n }\n\n return iconMap[status.state] || {icon: '', font: ''};\n}\n\nfunction getNodeIconType(node) {\n const iconType = nodeStateIcons[node.nodeState];\n return iconType ? iconType : {icon: '', font: ''};\n}\n\nfunction updateNodesInfoText(nodes) {\n let objectHeight;\n let objectWidth;\n // Set initial text element\n nodes.select('.node-info-text')\n .each(function(d) {\n // eslint-disable-next-line no-invalid-this\n d.infoNode = this;\n })\n .select(function() {\n // eslint-disable-next-line no-invalid-this\n return this.parentNode;\n })\n .append('foreignObject')\n .attr('width', function(d) {\n let shortMessage = '';\n if (!isEmpty(d.recoveryStatus)) {\n shortMessage = extractShortMessageFromNode(d);\n }\n const rect = calculateElementSizeByText(shortMessage);\n objectHeight = rect.height;\n objectWidth = rect.width;\n return objectWidth;\n })\n .attr('height', function(d) {\n return objectHeight;\n })\n .attr('x', function(d) {\n return -(objectWidth / 2);\n })\n .attr('y', function(d) {\n return 78;\n })\n .classed('hidden', function(d) {\n return isEmpty(d.recoveryStatus);\n })\n .style('font-size', '12px')\n .style('font-weight', '400')\n .style('text-align', 'center')\n .style('padding', '4px')\n .style('background', '#EEEEEE')\n .style('border-radius', '6px')\n .attr('class', 'node-info-fo')\n .append('xhtml:div')\n .html(function(d) {\n return extractShortMessageFromNode(d);\n });\n\n // Remove the original text elements, as they are now replaced by foreignObjects\n nodes.select('.node-info-text').remove();\n\n resizeLabelDynamic(nodes);\n}\n\nfunction extractShortMessageFromNode(node) {\n return node.recoveryStatus.message && node.recoveryStatus.message.length > shortMessageLimit ?\n node.recoveryStatus.message.substring(0, shortMessageLimit) + '...' : node.recoveryStatus.message || '';\n}\n\nfunction calculateElementSizeByText(text) {\n const tmp = document.createElement('div');\n tmp.innerHTML = text;\n tmp.style.padding = '4px';\n tmp.style.position = 'absolute';\n tmp.style.visibility = 'hidden';\n tmp.style.fontSize = '12px';\n tmp.style.fontWeight = '400';\n tmp.style.textAlign = 'center';\n tmp.style.height = 'auto';\n tmp.style.width = 'auto';\n tmp.style.whiteSpace = 'nowrap';\n\n document.body.appendChild(tmp);\n const rect = tmp.getBoundingClientRect();\n const height = rect.height;\n const width = rect.width;\n document.body.removeChild(tmp);\n\n return {height, width};\n}\n\nfunction addRecoveryLabelListeners(object, message, truncatedSize, displayMessage, fullSize) {\n object.on('mouseover.tooltip', () => {\n object\n .attr('width', fullSize.width)\n .attr('height', fullSize.height)\n .attr('x', -fullSize.width / 2)\n .html(`<div>${message}</div>`);\n });\n object.on('mouseout.tooltip', () => {\n object\n .attr('width', truncatedSize.width)\n .attr('height', truncatedSize.height)\n .attr('x', -truncatedSize.width / 2)\n .html(`<div>${displayMessage}</div>`);\n });\n}\n\nfunction resizeLabelDynamic(nodes) {\n nodes.select('.node-info-fo')\n .each(function(d) {\n // eslint-disable-next-line no-invalid-this\n const object = d3.select(this);\n if (isEmpty(d.recoveryStatus)) {\n object.attr('width', 0);\n return;\n }\n const shortMessage = extractShortMessageFromNode(d);\n const isShorten = d.recoveryStatus.message && d.recoveryStatus.message.length > shortMessageLimit && shortMessage !== d.recoveryStatus.message;\n const displayMessage = isShorten ? shortMessage : d.recoveryStatus.message;\n const truncatedSize = calculateElementSizeByText(shortMessage);\n const fullSize = calculateElementSizeByText(d.recoveryStatus.message);\n object.on('.tooltip', null);\n\n if (isShorten) {\n addRecoveryLabelListeners(object, d.recoveryStatus.message, truncatedSize, displayMessage, fullSize);\n }\n\n // Set initial size and text\n object\n .attr('width', truncatedSize.width)\n .attr('height', truncatedSize.height)\n .attr('x', -truncatedSize.width / 2)\n .html(`<div>${displayMessage}</div>`);\n });\n}\n\nfunction updateNodesHostnameText(nodes) {\n nodes\n .select('.id.id-host')\n .each(function(d) {\n // eslint-disable-next-line no-invalid-this\n d.labelNode = this;\n })\n .text(function(d) {\n return d.hostname;\n });\n\n // Add padding styling to text background. left/right/top/bottom +5\n nodes\n .select('.id-host-background')\n .attr('width', function(d) {\n return d3.select(d.labelNode).node().getBBox().width + 10;\n })\n .attr('height', function(d) {\n return d3.select(d.labelNode).node().getBBox().height + 10;\n })\n .attr('x', function(d) {\n return d3.select(d.labelNode).node().getBBox().x - 5;\n })\n .attr('y', function(d) {\n return d3.select(d.labelNode).node().getBBox().y - 5;\n });\n}\n\nexport function createLinks(linksDataBinding) {\n linksDataBinding.enter()\n .append('path')\n .classed('link', true);\n\n linksDataBinding.exit().remove();\n}\n\nexport function updateLinks(linksDataBinding, nodes) {\n linksDataBinding\n .attr('class', (link) => {\n // add the link id as a css class for testing purposes\n const idClass = link.id.replaceAll(':', '-');\n return `link ${idClass}`;\n })\n .attr('stroke', setLinkColor)\n .style('stroke-dasharray', setLinkStyle)\n .style(\"marker-mid\", (link) => setArrowLink(link, ARROW_CONFIG.BIG))\n .attr('d', (link) => getLinkCoordinates(link, nodes));\n}\n\nexport const ARROW_CONFIG = {\n SMALL: {name: 'small', size: 3},\n BIG: {name: 'big', size: 5},\n};\n\nexport function addArrowHead(svg, config) {\n svg.append(\"svg:defs\").append(\"svg:marker\")\n .attr(\"id\", `arrowhead_${config.name}`)\n .attr(\"viewBox\", `0 0 ${config.size * 2} ${config.size * 2}`)\n .attr(\"refX\", config.size)\n .attr(\"refY\", config.size)\n .attr(\"markerWidth\", config.size)\n .attr(\"markerHeight\", config.size)\n .attr(\"orient\", \"auto-start-reverse\")\n .append(\"path\")\n .attr(\"d\", `M 0 0 L ${config.size * 2} ${config.size} L 0 ${config.size * 2} z`)\n .style(\"fill\", clusterColors.ontoBlue);\n}\n\nexport function setArrowLink(link, config) {\n if (link.status === LinkState.RECEIVING_SNAPSHOT) {\n return `url(#arrowhead_${config.name})`;\n }\n}\n\nexport function setLinkColor(link) {\n const linkColor = linkStateColors[link.status];\n return linkColor || 'none';\n}\n\nexport function setLinkStyle(link) {\n const linkStyle = linkStateStyle[link.status];\n return linkStyle || 'none';\n}\n\nfunction getLinkCoordinates(link, nodes) {\n const source = nodes.find((node) => node.address === link.source);\n const target = nodes.find((node) => node.address === link.target);\n const deltaX = target.x - source.x;\n const deltaY = target.y - source.y;\n const dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const normX = deltaX / dist;\n const normY = deltaY / dist;\n const sourcePadding = 55;\n const targetPadding = 55;\n const sourceX = source.x + (sourcePadding * normX);\n const sourceY = source.y + (sourcePadding * normY);\n const targetX = target.x - (targetPadding * normX);\n const targetY = target.y - (targetPadding * normY);\n const {x: midpointX, y: midpointY} = getLinkMidpoint(link, nodes);\n return 'M' + sourceX + ',' + sourceY + 'L' + midpointX + ',' + midpointY +\n 'L' + targetX + ',' + targetY;\n}\n\nexport function positionNodesOnClusterZone(nodeElements, clusterZoneX, clusterZoneY, clusterZoneRadius) {\n nodeElements\n .attr('transform', (node, index) => {\n // Calculate initial positions for the new nodes based on\n // spreading them evenly on a circle around the center of the page.\n const theta = 2 * Math.PI * index / nodeElements.size();\n const x = clusterZoneX + Math.cos(theta) * clusterZoneRadius;\n const y = clusterZoneY + Math.sin(theta) * clusterZoneRadius;\n node.x = x;\n node.y = y;\n return `translate(${x}, ${y})`;\n });\n}\n\nexport function createHexagon(nodeGroup, radius) {\n const _s32 = (Math.sqrt(3) / 2);\n const xDiff = 0;\n const yDiff = 0;\n const points = [[radius + xDiff, yDiff], [radius / 2 + xDiff, radius * _s32 + yDiff], [-radius / 2 + xDiff, radius * _s32 + yDiff],\n [-radius + xDiff, yDiff],\n [-radius / 2 + xDiff, -radius * _s32 + yDiff], [radius / 2 + xDiff, -radius * _s32 + yDiff], [radius + xDiff, yDiff],\n [radius / 2 + xDiff, radius * _s32 + yDiff]];\n return nodeGroup\n .selectAll(\"path.area\")\n .data([points])\n .enter()\n .append(\"path\")\n .attr('class', 'node member')\n .attr(\"stroke-width\", \"10\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"d\", d3.line());\n}\n\nexport function removeEventListeners() {\n d3.select(document).selectAll('.node-info-fo').on('.tooltip', null);\n}\n","export 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};\n\nexport const RecoveryState = {\n SEARCHING_FOR_NODE: 'SEARCHING_FOR_NODE',\n WAITING_FOR_SNAPSHOT: 'WAITING_FOR_SNAPSHOT',\n RECEIVING_SNAPSHOT: 'RECEIVING_SNAPSHOT',\n APPLYING_SNAPSHOT: 'APPLYING_SNAPSHOT',\n BUILDING_SNAPSHOT: 'BUILDING_SNAPSHOT',\n SENDING_SNAPSHOT: 'SENDING_SNAPSHOT',\n RECOVERY_OPERATION_FAILURE_WARNING: 'RECOVERY_OPERATION_FAILURE_WARNING'\n};\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 // complimentary state, built based on the recovery state of two nodes when one is receiving snapshot to the other\n RECEIVING_SNAPSHOT: 'RECEIVING_SNAPSHOT'\n};\n\nexport const TopologyState = {\n PRIMARY_NODE: 'PRIMARY_NODE',\n SECONDARY_NODE: 'SECONDARY_NODE'\n};\n"],"names":["d3","line","select","clusterColors","linkStateColors","LinkState","IN_SYNC","SYNCING","OUT_OF_SYNC","RECEIVING_SNAPSHOT","linkStateStyle","font","getLinkMidpoint","link","nodes","source","find","node","address","target","deltaX","x","deltaY","y","dist","Math","sqrt","normX","normY","sourceX","sourceY","appendOutOfSyncLinkIcon","group","iconSize","parentGroup","iconType","iconCode","iconColor","append","attr","style","text","appendLinkIcon","updateLinkIcons","linksGroup","links","outOfSyncLinks","filter","status","iconGroups","selectAll","data","id","entered","enter","classed","merge","exit","remove","updateLegendLinkIcons","linkStatesGroup","legendWidth","each","d","this","pathEl","totalLength","getTotalLength","midPoint","getPointAtLength","createClusterSvgElement","element","createClusterZone","parent","clusterZone","setCreateClusterZone","hasCluster","translationsMap","hasAccess","textGroup","no_cluster_configured","create_cluster_btn","updateClusterZoneLabels","moveElement","createNodes","nodesDataBinding","nodeRadius","isLegend","nodeGroup","nodeUpdateElements","radius","_s32","points","createHexagon","nodeElements","nodeTextHost","addHostnameToNodes","updateNodes","isEmpty","recoveryStatus","nodeStateIcons","nodeState","icon","getNodeIconType","state","iconMap","getNodeInfoIconType","updateNodesIcon","NodeState","LEADER","FOLLOWER","CANDIDATE","updateNodesClasses","labelNode","hostname","getBBox","width","height","updateNodesHostnameText","objectHeight","objectWidth","infoNode","parentNode","shortMessage","extractShortMessageFromNode","rect","calculateElementSizeByText","html","object","isShorten","message","length","displayMessage","truncatedSize","fullSize","on","addRecoveryLabelListeners","resizeLabelDynamic","updateNodesInfoText","RecoveryState","SEARCHING_FOR_NODE","WAITING_FOR_SNAPSHOT","APPLYING_SNAPSHOT","BUILDING_SNAPSHOT","SENDING_SNAPSHOT","RECOVERY_OPERATION_FAILURE_WARNING","NO_CONNECTION","READ_ONLY","RESTRICTED","substring","tmp","document","createElement","innerHTML","padding","position","visibility","fontSize","fontWeight","textAlign","whiteSpace","body","appendChild","getBoundingClientRect","removeChild","createLinks","linksDataBinding","updateLinks","replaceAll","setLinkColor","setLinkStyle","setArrowLink","ARROW_CONFIG","BIG","targetX","targetY","midpointX","midpointY","getLinkCoordinates","SMALL","name","size","addArrowHead","svg","config","positionNodesOnClusterZone","clusterZoneX","clusterZoneY","clusterZoneRadius","index","theta","PI","cos","sin","removeEventListeners","NO_CLUSTER","TopologyState","PRIMARY_NODE","SECONDARY_NODE"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=24690;export const __webpack_esm_ids__=[16664,24690,40765,63146,90418,94608];export const __webpack_esm_modules__={90418(){function e(){return{restrict:"E",require:"ngModel",scope:{ngModel:"=",ngDisabled:"=",placeholder:"@"},templateUrl:"js/angular/core/templates/editable-content/editable-content.html",link:function(e,t,s,a){const n=t.find("div"),i=()=>{e.ngDisabled||e.$apply(()=>{n.html().length&&!n.text().trim().length&&n.empty(),a.$setViewValue(n[0].innerText)})};a.$render=()=>{n.html(a.$viewValue||"")};const r=e=>{e.preventDefault();const t=(e.originalEvent||e).clipboardData.getData("text/plain"),s=window.getSelection();if(!s.rangeCount)return;s.deleteFromDocument();const a=s.getRangeAt(0),n=document.createDocumentFragment(),r=t.split("\n");r.forEach((e,t)=>{n.appendChild(document.createTextNode(e)),t<r.length-1&&n.appendChild(document.createElement("br"))}),a.insertNode(n),s.collapseToEnd(),i()};e.$on("$destroy",()=>{n.off("blur keyup change input",i),n.off("paste",r)}),n.on("blur keyup change input",i),n.on("paste",r)}}}angular.module("graphdb.framework.core.directives.editable-content",[]).directive("editableContent",e),e.$inject=[]},94608(e,t,s){s.d(t,{T:()=>n,s:()=>i});var a=s(16664);class n{constructor(e,t){this._chatId=e,this._agentId=void 0,this._question=t,this._answers=[]}get chatId(){return this._chatId}set chatId(e){this._chatId=e}get agentId(){return this._agentId}set agentId(e){this._agentId=e}get question(){return this._question}set question(e){this._question=e}get answers(){return this._answers}set answers(e){this._answers=e}setQuestionMessage(e){this._question||(this._question=new a.Z({role:a.W.USER})),this._question.message=e}getQuestionMessage(){return this._question.message}toCreateChatRequestPayload(){return{agentId:this._agentId,question:this._question.message}}toAskRequestPayload(){return{conversationId:this._chatId,agentId:this._agentId,question:this._question.message,tzOffset:-(new Date).getTimezoneOffset()}}toExplainResponsePayload(e){return{conversationId:this._chatId,answerId:e}}}class i{constructor(e=[]){this._items=e}isEmpty(){return 0===this._items.length}appendItem(e){this._items.push(e)}get items(){return this._items}set items(e){this._items=e||[]}getLast(){if(!this.isEmpty())return this._items[this._items.length-1]}}},16664(e,t,s){s.d(t,{W:()=>n,Z:()=>a});class a{constructor(e){this._id=e.id,this._role=e.role,this._message=e.message,this._timestamp=1e3*e.timestamp,this.tokenUsageInfo=e.tokenUsageInfo,this._isTerminalState=e.isTerminalState,this._status=e.status}addToChatAnswer(e){e.messages=[this]}get id(){return this._id}set id(e){this._id=e}get role(){return this._role}set role(e){this._role=e}get message(){return this._message}set message(e){this._message=e}get timestamp(){return this._timestamp}set timestamp(e){this._timestamp=e}get isTerminalState(){return this._isTerminalState}set isTerminalState(e){this._isTerminalState=e}get status(){return this._status}set status(e){this._status=e}}const n={USER:"user",ASSISTANT:"assistant"}},40765(e,t,s){s.d(t,{eP:()=>i,iy:()=>a,kH:()=>r,zc:()=>n});class a{constructor(e={}){this._chatId=e.chatId,this._answerId=e.answerId,this._queryMethods=e.queryMethods,this._expanded=void 0===e.expanded||e.expanded}get chatId(){return this._chatId}set chatId(e){this._chatId=e}get answerId(){return this._answerId}set answerId(e){this._answerId=e}get queryMethods(){return this._queryMethods}set queryMethods(e){this._queryMethods=e}get expanded(){return this._expanded}set expanded(e){this._expanded=e}}class n{constructor(e=[]){this._items=e}get items(){return this._items}set items(e){this._items=e}}class i{constructor(e={}){this._name=e.name,this._rawQuery=e.rawQuery,this._query=e.query,this._queryType=e.queryType,this._errorMessage=e.errorOutput}get name(){return this._name}set name(e){this._name=e}get rawQuery(){return this._rawQuery}set rawQuery(e){this._rawQuery=e}get query(){return this._query}set query(e){this._query=e}get queryType(){return this._queryType}set queryType(e){this._queryType=e}get errorMessage(){return this._errorMessage}set errorMessage(e){this._errorMessage=e}}const r={SPARQL:"sparql",JSON:"json",OTHER:"other"}},542(e,t,s){s(79119),s(90418);var a=s(35197),n=s(16664),i=s(94608),r=s(22723),o=s(41767);function h(e,t,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:(e,h,c)=>{e.chat=void 0,e.selectedAgent=void 0,e.chatItem=void 0,e.askingChatItem=void 0,e.waitingForLastMessage=!1,e.loadingChat=!0,e.showCancelButton=!1,e.ask=()=>{e.chatItem.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(e.chatItem),e.chatItem.chatId?u(e.chatItem):d(),e.chatItem=l(),I(),_()},e.cancelPendingQuestion=()=>{e.showCancelButton=!1,s.emit(a.I.CANCEL_PENDING_QUESTION,e.chatItem)},e.regenerateQuestion=t=>{const s=l();s.setQuestionMessage(t.getQuestionMessage()),s.question.timestamp=Date.now(),e.askingChatItem=s,u(s),I()},e.isAskDisabled=()=>!(e.chatItem.question.message&&e.selectedAgent&&!e.selectedAgent.isDeleted&&!e.waitingForLastMessage&&!e.loadingChat&&!e.askingChatItem),e.onKeypressOnInput=t=>{e.askingChatItem||"Enter"!==t.key||t.shiftKey||t.ctrlKey||e.isAskDisabled()||(t.preventDefault(),e.ask())},e.onAskHowDeliveredAnswer=()=>{const s=l();s.setQuestionMessage(t.instant("ttyg.chat_panel.btn.derive_answer.label")),s.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(s),u(s),I()},e.getAgentName=e=>{const a=s.getAgent(e);return a?a.name:(0,o.Gz)(t.instant("ttyg.chat_panel.deleted_agent"))};const d=()=>{s.emit(a.I.CREATE_CHAT,e.chatItem)},u=e=>{s.emit(a.I.ASK_QUESTION,e)},g=(t,n)=>{e.waitingForLastMessage=t,e.showCancelButton=t,s.emit(a.I.ASK_QUESTION_STATE_CHANGED,{isAsking:t,chatId:n})},m=t=>{e.chatItem=(0,r.cloneDeep)(e.askingChatItem),e.askingChatItem=void 0,g(!1,t)},l=()=>{const t=new i.T;return t.question=new n.Z({role:n.W.USER}),e.chat&&(t.chatId=e.chat.id),e.selectedAgent&&(t.agentId=e.selectedAgent.id),t},_=()=>{setTimeout(()=>{const e=document.querySelector(".question-input");e&&e.focus()})},I=()=>{setTimeout(()=>{const e=h.find(".chat-details")[0];e&&(e.scrollTop=e.scrollHeight)})},p=()=>{e.chat=void 0,e.loadingChat=!1,e.chatItem=l(),e.askingChatItem=void 0,g(!1),_()},y=[e.$watchCollection("chat.chatHistory.items",I),s.onSelectedChatUpdated(t=>{if(e.chat=t,!e.chat||e.chat.isNew())return;e.loadingChat=!1;const a=e.chatItem.question.message;if(e.chatItem=l(),e.chatItem.question.message=a,e.askingChatItem=void 0,e.chat){const t=e.chat.chatHistory.getLast();t&&t.agentId&&s.selectAgent(s.getAgent(t.agentId))}_()}),s.onLastMessageReceived(e=>{g(!1,e.chatId)}),s.onSelectedAgentChanged(t=>{e.selectedAgent=t,e.selectedAgent&&e.chatItem&&(e.chatItem.agentId=e.selectedAgent.id),_()}),s.onSelectedChatChanged(t=>{t?(e.loadingChat=!t.isNew(),e.chatItem=l(),g(!1,t.id),_()):p()}),s.subscribe(a.I.LOAD_CHAT_FAILURE,()=>{e.loadingChat=!1,e.chatItem=l(),_()}),s.subscribe(a.I.ASK_QUESTION_FAILURE,m),s.subscribe(a.I.CREATE_CHAT_FAILURE,m),s.subscribe(a.I.DELETE_CHAT_SUCCESSFUL,t=>{e.chat&&t.id===e.chat.id&&p()}),s.subscribe(a.I.ASK_QUESTION_STARTING,e=>{g(!0,e)})];e.$on("$destroy",()=>{y.forEach(e=>e())}),e.chatItem=l(),_()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail","graphdb.framework.core.directives.editable-content"]).directive("chatPanel",h),h.$inject=["toastr","$translate","TTYGContextService"]}};
|
|
2
|
+
//# sourceMappingURL=24690.79fd696f08f3ebbb1c6f.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"24690.79fd696f08f3ebbb1c6f.bundle.js","mappings":"2JAoBA,SAASA,IACL,MAAO,CACHC,SAAU,IACVC,QAAS,UACTC,MAAO,CACHC,QAAS,IACTC,WAAY,IACZC,YAAa,KAEjBC,YAAa,mEACbC,KAAM,SAASL,EAAOM,EAASC,EAAOC,GAKlC,MAAMC,EAAcH,EAAQI,KAAK,OAU3BC,EAAmBA,KAChBX,EAAME,YACPF,EAAMY,OAAO,KACLH,EAAYI,OAAOC,SAAWL,EAAYM,OAAOC,OAAOF,QAExDL,EAAYQ,QAEhBT,EAAYU,cAAcT,EAAY,GAAGU,cAQrDX,EAAYY,QAAU,KAClBX,EAAYI,KAAKL,EAAYa,YAAc,KAU/C,MAAMC,EAAgBC,IAClBA,EAAMC,iBAEN,MAAMT,GAAQQ,EAAME,eAAiBF,GAAOG,cAAcC,QAAQ,cAC5DC,EAAYC,OAAOC,eAEzB,IAAKF,EAAUG,WAAY,OAE3BH,EAAUI,qBACV,MAAMC,EAAQL,EAAUM,WAAW,GAC7BC,EAAWC,SAASC,yBACpBC,EAAQvB,EAAKwB,MAAM,MAEzBD,EAAME,QAAQ,CAACC,EAAMC,KACjBP,EAASQ,YAAYP,SAASQ,eAAeH,IACzCC,EAAQJ,EAAMxB,OAAS,GACvBqB,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IAC3BuD,KAEAkC,MAuFJjD,EAAmB4D,UAAU1C,EAAAA,EAAc2C,kBArGrBC,KACtB7D,EAAOK,aAAc,EACrBL,EAAO9C,SAAW0D,IAClBE,MAmGAf,EAAmB4D,UAAU1C,EAAAA,EAAc6C,qBAAsBtB,GACjEzC,EAAmB4D,UAAU1C,EAAAA,EAAc8C,oBAAqBvB,GAChEzC,EAAmB4D,UAAU1C,EAAAA,EAAc+C,uBApExBC,IACfjE,EAAOC,MAAQgE,EAAY1G,KAAOyC,EAAOC,KAAK1C,IAC9CyF,MAmEJjD,EAAmB4D,UAAU1C,EAAAA,EAAciD,sBA/IjB/I,IAC1BkH,GAAe,EAAMlH,MAsJzB6E,EAAOvF,IAAI,WALkBC,KACzBuI,EAAchJ,QAASkK,GAAiBA,OArBxCnE,EAAO9C,SAAW0D,IAClBE,KAgChB,CAhVAjG,QACKC,OAAO,+CANI,CACZ,qDACA,uDAKCC,UAAU,YAAa6E,GAE5BA,EAAmB5E,QAAU,CAAC,SAAU,aAAc,qB","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/editable-content/editable-content.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-item.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-message.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/explain-response.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/chat-panel.directive.js"],"sourcesContent":["/**\n * @ngdoc directive\n * @name editableContent\n * @module graphdb.framework.core.directives.editable-content\n * @restrict E\n * @description\n * A reusable contenteditable directive bound to an ngModel. It allows editable plain-text input and supports disabling and placeholder text.\n *\n * @param {string} ngModel - The model to bind contenteditable input to.\n * @param {boolean=} ngDisabled - Disables the contenteditable field when true.\n * @param {string=} placeholder - Placeholder text to show when input is empty.\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.core.directives.editable-content', modules)\n .directive('editableContent', editableContent);\n\neditableContent.$inject = [];\n\nfunction editableContent() {\n return {\n restrict: 'E',\n require: 'ngModel',\n scope: {\n ngModel: '=',\n ngDisabled: '=',\n placeholder: '@',\n },\n templateUrl: 'js/angular/core/templates/editable-content/editable-content.html',\n link: function(scope, element, attrs, ngModelCtrl) {\n // =========================\n // Private variables\n // =========================\n\n const editableDiv = element.find('div');\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Updates the bound ngModel with the current contenteditable value.\n * Also clears invalid HTML when only whitespace remains.\n */\n const updateModelValue = () => {\n if (!scope.ngDisabled) {\n scope.$apply(() => {\n if (editableDiv.html().length && !editableDiv.text().trim().length) {\n // Fixes a problem with the placeholder when type some word and delete it.\n editableDiv.empty();\n }\n ngModelCtrl.$setViewValue(editableDiv[0].innerText);\n });\n }\n };\n\n /**\n * Renders the model value into the contenteditable element.\n */\n ngModelCtrl.$render = () => {\n editableDiv.html(ngModelCtrl.$viewValue || '');\n };\n\n /**\n * Handles paste events in the contenteditable element by inserting plain text only.\n * Prevents the default paste behavior and manually inserts the clipboard text as plain text,\n * preserving line breaks by converting them to <br> elements.\n *\n * @param {Event} event - The paste event object containing clipboard data.\n */\n const pasteHandler = (event) => {\n event.preventDefault();\n\n const text = (event.originalEvent || event).clipboardData.getData('text/plain');\n const selection = window.getSelection();\n\n if (!selection.rangeCount) return;\n\n selection.deleteFromDocument();\n const range = selection.getRangeAt(0);\n const fragment = document.createDocumentFragment();\n const lines = text.split('\\n');\n\n lines.forEach((line, index) => {\n fragment.appendChild(document.createTextNode(line));\n if (index < lines.length - 1) {\n fragment.appendChild(document.createElement('br'));\n }\n });\n\n range.insertNode(fragment);\n selection.collapseToEnd();\n updateModelValue();\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n /**\n * Unsubscribes from all watchers and event listeners to prevent memory leaks.\n */\n const removeAllSubscribers = () => {\n editableDiv.off('blur keyup change input', updateModelValue);\n editableDiv.off('paste', pasteHandler);\n };\n\n scope.$on('$destroy', removeAllSubscribers);\n editableDiv.on('blur keyup change input', updateModelValue);\n editableDiv.on('paste', pasteHandler);\n },\n };\n}\n","import {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"./chat-message\";\n\n/**\n *\n * Represents a model that holds a question and the answer of it in a chat.\n *\n */\nexport class ChatItemModel {\n\n /**\n * Creates an instance of ChatItemModel.\n *\n * @param {string} chatId - The unique identifier for the chat associated with this instance.\n * @param {ChatMessageModel} question - The message object representing the question.\n */\n constructor(chatId, question) {\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._chatId = chatId;\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._agentId = undefined;\n\n /**\n * @type {ChatMessageModel}\n * @private\n */\n this._question = question;\n\n /**\n *\n * @type {ChatMessageModel[] | undefined}\n * @private\n */\n this._answers = [];\n }\n\n get chatId() {\n return this._chatId;\n }\n\n set chatId(value) {\n this._chatId = value;\n }\n\n get agentId() {\n return this._agentId;\n }\n\n set agentId(value) {\n this._agentId = value;\n }\n\n get question() {\n return this._question;\n }\n\n set question(value) {\n this._question = value;\n }\n\n get answers() {\n return this._answers;\n }\n\n /**\n *\n * @param {ChatMessageModel[]} value\n */\n set answers(value) {\n this._answers = value;\n }\n\n /**\n * Sets the message for the user's question.\n *\n * @param {string} message - The message content for the user's question.\n */\n setQuestionMessage(message) {\n if (!this._question) {\n this._question = new ChatMessageModel({role: CHAT_MESSAGE_ROLE.USER});\n }\n this._question.message = message;\n }\n\n /**\n * Retrieves the message of the user's question.\n *\n * @return {string} - The message content of the user's question.\n */\n getQuestionMessage() {\n return this._question.message;\n }\n\n /**\n * Converts the instance to a create chat request payload.\n *\n * @return {{agentId: string, question: string}} An object representing the create request payload.\n */\n toCreateChatRequestPayload() {\n return {\n agentId: this._agentId,\n question: this._question.message\n };\n }\n\n /**\n * Converts the instance to an ask request payload.\n *\n * @return {{conversationId: string, agentId: string, question: string}} An object representing the ask request payload.\n */\n toAskRequestPayload() {\n return {\n conversationId: this._chatId,\n agentId: this._agentId,\n question: this._question.message,\n tzOffset: -new Date().getTimezoneOffset() // offsets are reversed here hence the minus\n };\n }\n\n toExplainResponsePayload(answerId) {\n return {\n conversationId: this._chatId,\n answerId\n };\n }\n}\n\nexport class ChatItemsListModel {\n\n /**\n * @param {ChatItemModel[]} items\n */\n constructor(items = []) {\n this._items = items;\n }\n\n isEmpty() {\n return this._items.length === 0;\n }\n\n /**\n * @param {ChatItemModel} chatItem\n */\n appendItem(chatItem) {\n this._items.push(chatItem);\n }\n\n get items() {\n return this._items;\n }\n\n set items(value) {\n this._items = value || [];\n }\n\n getLast() {\n if (!this.isEmpty()) {\n return this._items[this._items.length - 1];\n }\n }\n}\n","export class ChatMessageModel {\n constructor(data) {\n\n /**\n * @type {string}\n */\n this._id = data.id;\n\n /**\n * @type @type {string} - A value from {@link CHAT_MESSAGE_ROLE}, determining the owner of the message (e.g., user, assistant).\n */\n this._role = data.role;\n\n /**\n * @type {string}\n */\n this._message = data.message;\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp * 1000;\n\n /**\n * Holds information about the number of tokens used for this answer, including prompt and completion tokens.\n * It is applicable only to the assistant role ({@link CHAT_MESSAGE_ROLE#ASSISTANT}).\n *\n * @type {TokenUsageInfo}\n */\n this.tokenUsageInfo = data.tokenUsageInfo;\n\n /**\n * If the message was terminated via the Abort button\n * @type {boolean}\n */\n this._isTerminalState = data.isTerminalState;\n\n /**\n * Reason for cancellation.\n * @private {string}\n */\n this._status = data.status\n }\n\n /**\n * Updates the chatAnswer.messages array with this message instance.\n * @param {ChatAnswerModel} chatAnswer - The answer object containing the messages.\n */\n addToChatAnswer(chatAnswer) {\n chatAnswer.messages = [this];\n }\n\n get id() {\n return this._id;\n }\n\n set id(value) {\n this._id = value;\n }\n\n get role() {\n return this._role;\n }\n\n set role(value) {\n this._role = value;\n }\n\n get message() {\n return this._message;\n }\n\n set message(value) {\n this._message = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get isTerminalState() {\n return this._isTerminalState;\n }\n\n set isTerminalState(value) {\n this._isTerminalState = value;\n }\n\n get status() {\n return this._status;\n }\n\n set status(value) {\n this._status = value;\n }\n}\n\nexport const CHAT_MESSAGE_ROLE = {\n USER: 'user',\n ASSISTANT: 'assistant'\n};\n","export class ExplainResponseModel {\n constructor(data = {}) {\n\n /**\n * @type {string}\n */\n this._chatId = data.chatId;\n\n /**\n * @type {string}\n */\n this._answerId = data.answerId;\n\n /**\n * @type {ExplainQueryMethodsListModel}\n */\n this._queryMethods = data.queryMethods;\n\n this._expanded = data.expanded !== undefined ? data.expanded : true;\n }\n\n get chatId() {\n return this._chatId;\n }\n\n set chatId(value) {\n this._chatId = value;\n }\n\n get answerId() {\n return this._answerId;\n }\n\n set answerId(value) {\n this._answerId = value;\n }\n\n get queryMethods() {\n return this._queryMethods;\n }\n\n set queryMethods(value) {\n this._queryMethods = value;\n }\n\n get expanded() {\n return this._expanded;\n }\n\n set expanded(value) {\n this._expanded = value;\n }\n}\n\nexport class ExplainQueryMethodsListModel {\n constructor(data = []) {\n this._items = data;\n }\n\n get items() {\n return this._items;\n }\n\n set items(value) {\n this._items = value;\n }\n}\n\nexport class ExplainQueryMethodModel {\n constructor(data = {}) {\n /**\n * @type {ExtractionMethod.FTS_SEARCH | ExtractionMethod.RETRIEVAL | ExtractionMethod.SPARQL | ExtractionMethod.SIMILARITY}\n */\n this._name = data.name;\n\n /**\n * @type {string}\n */\n this._rawQuery = data.rawQuery;\n\n /**\n * @type {string}\n */\n this._query = data.query;\n\n /**\n * @Type {ExplainQueryType}\n * @private\n */\n this._queryType = data.queryType;\n\n /**\n * @type {string | null}\n * @private\n */\n this._errorMessage = data.errorOutput;\n }\n\n get name() {\n return this._name;\n }\n\n set name(value) {\n this._name = value;\n }\n\n get rawQuery() {\n return this._rawQuery;\n }\n\n set rawQuery(value) {\n this._rawQuery = value;\n }\n\n get query() {\n return this._query;\n }\n\n set query(value) {\n this._query = value;\n }\n\n get queryType() {\n return this._queryType;\n }\n\n set queryType(value) {\n this._queryType = value;\n }\n\n get errorMessage() {\n return this._errorMessage;\n }\n\n set errorMessage(value) {\n this._errorMessage = value;\n }\n}\n\nexport const ExplainQueryType = {\n SPARQL: 'sparql',\n JSON: 'json',\n OTHER: 'other'\n};\n","import './chat-item-detail.directive';\nimport 'angular/core/directives/editable-content/editable-content';\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"../../models/ttyg/chat-message\";\nimport {ChatItemModel} from \"../../models/ttyg/chat-item\";\nimport {cloneDeep} from \"lodash\";\nimport {decodeHTML} from \"../../../../app\";\n\nconst modules = [\n 'graphdb.framework.ttyg.directives.chat-item-detail',\n 'graphdb.framework.core.directives.editable-content',\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.chat-panel', modules)\n .directive('chatPanel', ChatPanelComponent);\n\nChatPanelComponent.$inject = ['toastr', '$translate', 'TTYGContextService'];\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.ttyg.directives.chat-panel:chatPanel\n * @restrict E\n * @description\n *\n * This directive represents a chat panel component that allows users to interact with a chat. It provides functionality for asking questions,\n * regenerating chat content, and other interactive features.\n *\n * It encapsulates the logic and presentation for displaying and managing chat-related interactions.\n *\n * @example\n * <chat-panel></chat-panel>\n */\nfunction ChatPanelComponent(toastr, $translate, TTYGContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/chat-panel.html',\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n\n /**\n * @type {ChatModel}\n */\n $scope.chat = undefined;\n\n /**\n * @type {AgentModel}\n */\n $scope.selectedAgent = undefined;\n\n /**\n * @type {ChatItemModel}\n */\n $scope.chatItem = undefined;\n\n /**\n * @type {ChatItemModel}\n */\n $scope.askingChatItem = undefined;\n\n /**\n * True while a question is being handled. It may involve multiple requests until it turns back to false.\n * @type {boolean}\n */\n $scope.waitingForLastMessage = false;\n\n /**\n * Flag that indicates that the chat is about to be changed.\n * @type {boolean}\n */\n $scope.loadingChat = true;\n\n $scope.showCancelButton = false;\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Handles the ask question action.\n */\n $scope.ask = () => {\n $scope.chatItem.question.timestamp = Date.now();\n $scope.askingChatItem = cloneDeep($scope.chatItem);\n if (!$scope.chatItem.chatId) {\n createNewChat();\n } else {\n askQuestion($scope.chatItem);\n }\n $scope.chatItem = getEmptyChatItem();\n scrollToBottom();\n focusQuestionInput();\n };\n\n\n /**\n * Cancels a pending question tied to the current scope.\n * Hides cancel button.\n */\n $scope.cancelPendingQuestion = () => {\n $scope.showCancelButton = false;\n TTYGContextService.emit(TTYGEventName.CANCEL_PENDING_QUESTION, $scope.chatItem);\n };\n\n /**\n * Regenerates the answer for the provided chat item.\n *\n * @param {ChatItemModel} chatItem - The chat item that contains the question to be regenerated.\n */\n $scope.regenerateQuestion = (chatItem) => {\n const regenerateChatItem = getEmptyChatItem();\n regenerateChatItem.setQuestionMessage(chatItem.getQuestionMessage());\n regenerateChatItem.question.timestamp = Date.now();\n $scope.askingChatItem = regenerateChatItem;\n askQuestion(regenerateChatItem);\n scrollToBottom();\n };\n\n /**\n * Determines whether the Ask button should be disabled based on the current state of the chat item,\n * selected agent, and ongoing operations.\n * @returns {boolean} True if the Ask button should be disabled, false otherwise.\n */\n $scope.isAskDisabled = () => {\n return !!(!$scope.chatItem.question.message\n || !$scope.selectedAgent\n || $scope.selectedAgent.isDeleted\n || $scope.waitingForLastMessage\n || $scope.loadingChat\n || $scope.askingChatItem);\n };\n\n /**\n * Handles pressing the Enter key in the question input.\n * Will not trigger if `Shift` or `Ctrl` keys are pressed, or if Ask button is disabled.\n *\n * @param {KeyboardEvent} $event - The keyboard event triggered by the user interaction.\n */\n $scope.onKeypressOnInput = ($event) => {\n if (!$scope.askingChatItem && $event.key === 'Enter' && !$event.shiftKey && !$event.ctrlKey) {\n if (!$scope.isAskDisabled()) {\n $event.preventDefault();\n $scope.ask();\n }\n }\n };\n\n $scope.onAskHowDeliveredAnswer = () => {\n const askHowDerivedAnswerChatItem = getEmptyChatItem();\n askHowDerivedAnswerChatItem.setQuestionMessage($translate.instant('ttyg.chat_panel.btn.derive_answer.label'));\n askHowDerivedAnswerChatItem.question.timestamp = Date.now();\n $scope.askingChatItem = cloneDeep(askHowDerivedAnswerChatItem);\n askQuestion(askHowDerivedAnswerChatItem);\n scrollToBottom();\n };\n\n /**\n * Finds out if agent with such id exists and returns its name or a default message for deleted agent.\n * @param {string} agentId\n * @return {string}\n */\n $scope.getAgentName = (agentId) => {\n const agent = TTYGContextService.getAgent(agentId);\n return agent ? agent.name : decodeHTML($translate.instant('ttyg.chat_panel.deleted_agent'));\n };\n\n // =========================\n // Private functions\n // =========================\n\n const createNewChat = () => {\n TTYGContextService.emit(TTYGEventName.CREATE_CHAT, $scope.chatItem);\n };\n\n const askQuestion = (chatItem) => {\n TTYGContextService.emit(TTYGEventName.ASK_QUESTION, chatItem);\n };\n\n const setAskingState = (isAsking, chatId) => {\n $scope.waitingForLastMessage = isAsking;\n $scope.showCancelButton = isAsking;\n TTYGContextService.emit(TTYGEventName.ASK_QUESTION_STATE_CHANGED, {isAsking, chatId});\n };\n\n const onAskQuestionStarted = (chatId) => {\n setAskingState(true, chatId);\n };\n\n /**\n * Handles the update of the selected chat.\n * @param {ChatModel} chat - the new selected chat.\n */\n const onSelectedChatUpdated = (chat) => {\n $scope.chat = chat;\n if (!$scope.chat || $scope.chat.isNew()) {\n // Do nothing if the chat is new and a question is currently being asked.\n return;\n }\n $scope.loadingChat = false;\n const message = $scope.chatItem.question.message;\n $scope.chatItem = getEmptyChatItem();\n $scope.chatItem.question.message = message;\n $scope.askingChatItem = undefined;\n if ($scope.chat) {\n // TODO: Why on earth this is here? The chat changed handler is in the ttyg.view. Why doesn't it handle this\n // but we need to go through 2 more events to achieve the same result?\n const lastChatItem = $scope.chat.chatHistory.getLast();\n if (lastChatItem && lastChatItem.agentId) {\n TTYGContextService.selectAgent(TTYGContextService.getAgent(lastChatItem.agentId));\n }\n }\n focusQuestionInput();\n };\n\n const onLastMessageReceived = (chat) => {\n setAskingState(false, chat.chatId);\n };\n\n /**\n * Handles the failure of loading the chat and the server returns 404. This might happen if the chat does\n * not exist anymore because it was deleted by another user for example.\n */\n const onLoadChatFailure = () => {\n $scope.loadingChat = false;\n $scope.chatItem = getEmptyChatItem();\n focusQuestionInput();\n };\n\n const onSelectedChatChanged = (chat) => {\n if (chat) {\n // Skip the loading indication if it is a new chat that hasn't received an answer yet.\n $scope.loadingChat = !chat.isNew();\n $scope.chatItem = getEmptyChatItem();\n setAskingState(false, chat.id);\n focusQuestionInput();\n } else {\n reset();\n }\n };\n\n const onQuestionFailure = (chatId) => {\n $scope.chatItem = cloneDeep($scope.askingChatItem);\n $scope.askingChatItem = undefined;\n setAskingState(false, chatId);\n };\n\n /**\n * Handles the change of the selected agent.\n * @param {AgentModel} agent - the new selected agent.\n */\n const onSelectedAgentChanged = (agent) => {\n $scope.selectedAgent = agent;\n if ($scope.selectedAgent && $scope.chatItem) {\n $scope.chatItem.agentId = $scope.selectedAgent.id;\n }\n focusQuestionInput();\n };\n\n const onChatDeleted = (deletedChat) => {\n if ($scope.chat && deletedChat.id === $scope.chat.id) {\n reset();\n }\n };\n\n const getEmptyChatItem = () => {\n const chatItem = new ChatItemModel();\n chatItem.question = new ChatMessageModel({role: CHAT_MESSAGE_ROLE.USER});\n\n if ($scope.chat) {\n chatItem.chatId = $scope.chat.id;\n }\n\n if ($scope.selectedAgent) {\n chatItem.agentId = $scope.selectedAgent.id;\n }\n\n return chatItem;\n };\n\n const focusQuestionInput = () => {\n // Moving focus to the end of the JS call stack with a timeout, because on first Agent select,\n // the dropdown .agent-option steals the focus, or the browser assigns it to the document <body>.\n setTimeout(() => {\n const inputElement = document.querySelector('.question-input');\n if (inputElement) {\n inputElement.focus();\n }\n });\n };\n\n const scrollToBottom = () => {\n // Call it in a timeout to ensure that Angular's digest cycle is finished and all elements are displayed.\n setTimeout(() => {\n const chatDetailsElement = element.find(\".chat-details\")[0];\n if (chatDetailsElement) {\n chatDetailsElement.scrollTop = chatDetailsElement.scrollHeight;\n }\n });\n };\n\n const reset = () => {\n $scope.chat = undefined;\n $scope.loadingChat = false;\n $scope.chatItem = getEmptyChatItem();\n $scope.askingChatItem = undefined;\n setAskingState(false);\n focusQuestionInput();\n };\n\n const init = () => {\n $scope.chatItem = getEmptyChatItem();\n focusQuestionInput();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [\n $scope.$watchCollection('chat.chatHistory.items', scrollToBottom),\n TTYGContextService.onSelectedChatUpdated(onSelectedChatUpdated),\n TTYGContextService.onLastMessageReceived(onLastMessageReceived),\n TTYGContextService.onSelectedAgentChanged(onSelectedAgentChanged),\n TTYGContextService.onSelectedChatChanged(onSelectedChatChanged),\n TTYGContextService.subscribe(TTYGEventName.LOAD_CHAT_FAILURE, onLoadChatFailure),\n TTYGContextService.subscribe(TTYGEventName.ASK_QUESTION_FAILURE, onQuestionFailure),\n TTYGContextService.subscribe(TTYGEventName.CREATE_CHAT_FAILURE, onQuestionFailure),\n TTYGContextService.subscribe(TTYGEventName.DELETE_CHAT_SUCCESSFUL, onChatDeleted),\n TTYGContextService.subscribe(TTYGEventName.ASK_QUESTION_STARTING, onAskQuestionStarted),\n ];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n init();\n },\n };\n}\n"],"names":["editableContent","restrict","require","scope","ngModel","ngDisabled","placeholder","templateUrl","link","element","attrs","ngModelCtrl","editableDiv","find","updateModelValue","$apply","html","length","text","trim","empty","$setViewValue","innerText","$render","$viewValue","pasteHandler","event","preventDefault","originalEvent","clipboardData","getData","selection","window","getSelection","rangeCount","deleteFromDocument","range","getRangeAt","fragment","document","createDocumentFragment","lines","split","forEach","line","index","appendChild","createTextNode","createElement","insertNode","collapseToEnd","$on","removeAllSubscribers","off","on","angular","module","directive","$inject","ChatItemModel","constructor","chatId","question","this","_chatId","_agentId","undefined","_question","_answers","value","agentId","answers","setQuestionMessage","message","ChatMessageModel","role","CHAT_MESSAGE_ROLE","USER","getQuestionMessage","toCreateChatRequestPayload","toAskRequestPayload","conversationId","tzOffset","Date","getTimezoneOffset","toExplainResponsePayload","answerId","ChatItemsListModel","items","_items","isEmpty","appendItem","chatItem","push","getLast","data","_id","id","_role","_message","_timestamp","timestamp","tokenUsageInfo","_isTerminalState","isTerminalState","_status","status","addToChatAnswer","chatAnswer","messages","ASSISTANT","ExplainResponseModel","_answerId","_queryMethods","queryMethods","_expanded","expanded","ExplainQueryMethodsListModel","ExplainQueryMethodModel","_name","name","_rawQuery","rawQuery","_query","query","_queryType","queryType","_errorMessage","errorOutput","errorMessage","ExplainQueryType","SPARQL","JSON","OTHER","ChatPanelComponent","toastr","$translate","TTYGContextService","$scope","chat","selectedAgent","askingChatItem","waitingForLastMessage","loadingChat","showCancelButton","ask","now","cloneDeep","askQuestion","createNewChat","getEmptyChatItem","scrollToBottom","focusQuestionInput","cancelPendingQuestion","emit","TTYGEventName","CANCEL_PENDING_QUESTION","regenerateQuestion","regenerateChatItem","isAskDisabled","isDeleted","onKeypressOnInput","$event","key","shiftKey","ctrlKey","onAskHowDeliveredAnswer","askHowDerivedAnswerChatItem","instant","getAgentName","agent","getAgent","decodeHTML","CREATE_CHAT","ASK_QUESTION","setAskingState","isAsking","ASK_QUESTION_STATE_CHANGED","onQuestionFailure","setTimeout","inputElement","querySelector","focus","chatDetailsElement","scrollTop","scrollHeight","reset","subscriptions","$watchCollection","onSelectedChatUpdated","isNew","lastChatItem","chatHistory","selectAgent","onLastMessageReceived","onSelectedAgentChanged","onSelectedChatChanged","subscribe","LOAD_CHAT_FAILURE","onLoadChatFailure","ASK_QUESTION_FAILURE","CREATE_CHAT_FAILURE","DELETE_CHAT_SUCCESSFUL","deletedChat","ASK_QUESTION_STARTING","subscription"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const __webpack_esm_id__=3395;export const __webpack_esm_ids__=[3395,4552,19146,33931,34e3,64073,67262,81417];export const __webpack_esm_modules__={3395(e,t,n){n(22742),n(33136),n(88986),n(96972),n(31415),n(64073),n(75752),n(11014),n(75890),n(67262),n(19146),angular.module("graphdb.framework.clustermanagement",["ngAnimate","toastr","graphdb.framework.clustermanagement.controllers.cluster-management","graphdb.framework.clustermanagement.directives.cluster-graphical-view","graphdb.framework.clustermanagement.directives.cluster-configuration","graphdb.framework.clustermanagement.directives.cluster-nodes-configuration","graphdb.framework.core.directives.validate-url","graphdb.framework.core.directives.validate-duplicate-url"])},31415(e,t,n){n(3686),n(34e3),n(85698),angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration",["graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-properties","graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-nodes","graphdb.framework.clustermanagement.directives.cluster-configuration.multi-region"]).directive("clusterConfiguration",o),o.$inject=["$jwtAuth","$uibModal","$translate","toastr","ClusterViewContextService"];const r={PROPERTIES:"properties",NODES:"nodes",MULTI_REGION:"multi_region"};function o(e,t,n,o,a){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-configuration.html",scope:{currentNode:"=",clusterModel:"=",clusterConfiguration:"="},link:e=>{const t=[];e.CONFIGURATION_TABS=r,e.activeTab=r.PROPERTIES,e.closeClusterConfigurationPanel=()=>{a.hideClusterConfigurationPanel()},e.switchTab=(t,n)=>{e.activeTab=n},e.$on("$destroy",function(){t.forEach(e=>e()),e.closeClusterConfigurationPanel()}),t.push(a.onShowClusterConfigurationPanel(t=>{t||(e.activeTab=r.PROPERTIES)}))}}}},34e3(){function e(){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-nodes.html",scope:{currentNode:"=",clusterModel:"="}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-nodes",[]).directive("clusterNodes",e),e.$inject=[]},3686(e,t,n){var r=n(14267),o=n(57154);function a(e,t){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-properties.html",scope:{currentNode:"=",clusterModel:"=",clusterConfiguration:"="},link:e=>{const n=(0,o.service)(o.AuthorizationService),a=(0,o.service)(o.AuthenticationService);e.isAdmin=!1,e.showEditConfigurationDialog=()=>{t.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:()=>({clusterConfiguration:e.clusterConfiguration})}}).result.finally(function(){e.$emit(r.pw,{force:!0})})},e.showDeleteDialog=()=>{t.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then(t=>{e.$emit(r.fe,{force:t})})},e.isAdmin=a.isAuthenticated()&&n.isAdmin()}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-properties",[]).directive("clusterProperties",a),a.$inject=["$jwtAuth","$uibModal"]},85698(e,t,n){n(4552),n(33931);var r=n(8981),o=n(58325),a=n(57154);const i={minLen:"3",maxLen:"255"};function s(e,t,n,s,c,l,u){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/multi-region.html",scope:{clusterModel:"=",clusterConfiguration:"="},link:e=>{const d=(0,a.service)(a.AuthorizationService),g=(0,a.service)(a.AuthenticationService),m=[];e.topology=void 0,e.TopologyState=o.zB,e.isAdmin=!1,e.addingTag=!1,e.loaderTimeout=void 0,e.secondaryTag=void 0,e.TagLengthConstraints=i,e.add=()=>{e.addingTag=!0},e.cancel=()=>{e.addingTag=!1},e.createTag=n=>{const r={tag:n};return h(!0),l.addCusterTag(r).then(()=>{s.success(t.instant("cluster_management.cluster_configuration_multi_region.created_tag",{tag:n}))}).catch(e=>{const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.creating"))}).finally(()=>{e.addingTag=!1,h(!1)})},e.deleteTag=e=>{c.openSimpleModal({title:t.instant("cluster_management.cluster_configuration_multi_region.confirm.delete",{tag:e}),message:t.instant("cluster_management.cluster_configuration_multi_region.confirm.warning"),warning:!0,backdrop:"static",stopPropagation:!0}).result.then(()=>(h(!0),l.deleteClusterTag(e))).then(()=>s.success(t.instant("cluster_management.cluster_configuration_multi_region.deleted_tag",{tag:e}))).catch(e=>{if("cancel"===e||"escape key press"===e)return;const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.deleting"))}).finally(()=>h(!1))},e.enableSecondaryMode=()=>{e.addingTag=!1;const n={title:t.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary"),message:t.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary_warning"),warning:!0,backdrop:"static",confirmButtonKey:"common.ok.btn",stopPropagation:!0};c.openSimpleModal(n).result.then(()=>p()).then(e=>(h(!0),l.enableSecondaryMode(e))).then(()=>s.success(t.instant("cluster_management.cluster_configuration_multi_region.secondary_enabled"))).catch(e=>{if("cancel"===e||"escape key press"===e)return;const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.secondary"))}).finally(()=>h(!1))},e.disableSecondaryMode=()=>{c.openSimpleModal({title:t.instant("cluster_management.cluster_configuration_multi_region.confirm.disable_secondary_mode"),message:t.instant("cluster_management.cluster_configuration_multi_region.confirm.disable_secondary_mode_warning"),warning:!0,backdrop:"static",stopPropagation:!0}).result.then(()=>(h(!0),l.disableSecondaryMode())).then(()=>s.success(t.instant("cluster_management.cluster_configuration_multi_region.disabled_secondary_mode"))).catch(e=>{if("cancel"===e||"escape key press"===e)return;const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>h(!1))};const p=()=>{const e={title:t.instant("cluster_management.cluster_configuration_multi_region.secondary_cluster_settings"),templateUrl:"js/angular/clustermanagement/templates/modal/secondary-mode-modal.html",controller:["$scope","$uibModalInstance","config",function(e,t,n){e.rpcAddress="",e.tag="",e.title=n.title,e.onClick=e=>e.stopPropagation(),e.ok=()=>{t.close({primaryNode:e.rpcAddress,tag:e.tag})},e.cancel=()=>{t.dismiss("cancel")}}],size:"lg",warning:!0,backdrop:"static"};return c.openCustomModal(e).result},f=n=>{h(!0),l.getClusterConfig().then(t=>{e.secondaryTag=r.v9.fromJSON(t.data).secondaryTag,(t=>{const n=t.nodes.find(e=>e.nodeState===o.UY.LEADER);e.topology=n.topologyStatus})(r.kY.fromJSON(n))}).catch(e=>{const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>h(!1))},h=(t,r)=>{n.cancel(e.loaderTimeout),t?(e.loaderMessage=r,e.loaderTimeout=n(()=>{e.loader=t},150)):e.loader=!1};e.$on("$destroy",function(){m.forEach(e=>e())}),e.isAdmin=g.isAuthenticated()&&d.isAdmin(),m.push(e.$watch("clusterModel",function(e,t){e!==t&&f(e)},!0)),m.push(u.onShowClusterConfigurationPanel(t=>{t||(e.addingTag=!1)})),f(e.clusterModel)}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.multi-region",["graphdb.framework.core.directives.ascii-validator","graphdb.framework.core.directives.length-validator"]).directive("multiRegion",s),s.$inject=["$jwtAuth","$translate","$timeout","toastr","ModalService","ClusterRestService","ClusterViewContextService"]},96972(e,t,n){n(38473),n(23236);var r=n(24125),o=n(22723),a=n(14267),i=n(44482),s=n(57154);const c={select:i.select};let l=240;const u={no_cluster_configured:"",create_cluster_btn:"",legend_node_state:"",legend_link_state:"",node_state_leader:"Leader",node_state_follower:"Follower",node_state_candidate:"Candidate",node_state_no_cluster:"No cluster",node_state_out_of_sync:"Out of sync",node_state_no_connection:"No connection",node_state_read_only:"Read only",node_state_restricted:"Restricted",link_state_in_sync:"In sync",link_state_syncing:"Syncing",link_state_out_of_sync:"Out of sync",recovery_state:{searching_for_node:"Searching for node",waiting_for_snapshot:"Waiting for snapshot from node",receiving_snapshot:"Receiving a snapshot from node",applying_snapshot:"Applying a snapshot",building_snapshot:"Building a snapshot for node",sending_snapshot:"Sending a snapshot to node",recovery_operation_failure_warning:"Node unable to recover. Action required"}},d={node_state:"legend_node_state",link_state:"legend_link_state"};angular.module("graphdb.framework.clustermanagement.directives.cluster-graphical-view",["graphdb.framework.utils.localstorageadapter","graphdb.framework.clustermanagement.directives.cluster-legend"]).directive("clusterGraphicalView",["$window","LocalStorageAdapter","LSKeys","UriUtils","$translate","$jwtAuth","$rootScope","ClusterViewContextService",function(e,t,n,i,g,m,p,f){return{restrict:"E",scope:{clusterModel:"="},link:function(m,h){const _=(0,s.service)(s.AuthorizationService),v=angular.element(e),w=[];let y,C,b,k,S,N=U(),M=P(),E=Math.min(N,M)/2-100,A=N/2,T=M/2;function x(){const e=f.getClusterViewD3Container();N=U(),M=P(),e.attr("width",N),e.attr("height",M),I()}function L(e,t=""){Object.keys(e).forEach(n=>{let r="";t&&(r+=t),r+=`.${n}`;const o=e[n];"string"==typeof o?e[n]=g.instant(`cluster_management.cluster_graphical_view${r}`):"object"==typeof o&&L(o,r)})}function U(){const r="collapsedMenu"===t.get(n.MENU_STATE);return l=r?70:240,Math.max(Math.floor(.95*(e.innerWidth-l)),600)}function P(){return Math.max(.95*(e.innerHeight-250),675)}function V(e){m.$emit(a.DP,e.target)}function I(){E=Math.min(N,M)/2-100,A=N/2,T=M/2,r.cZ(b,A,T),b.select(".cluster-zone").attr("r",E),C!==m.clusterModel.hasCluster&&(C=!!m.clusterModel.hasCluster,function(e){r.Xl(e,b,u,y),!e&&y&&b.on("mouseup",()=>{m.$emit(a.Yn)})}(C));const e=function(){const e=(0,o.cloneDeep)(m.clusterModel.nodes)||[];return e.forEach(e=>{if(e.hostname=i.shortenIri(e.endpoint),!(0,o.isEmpty)(e.recoveryStatus)){let t=`cluster_management.cluster_graphical_view.recovery_state.${e.recoveryStatus.state.toLowerCase()}`;e.recoveryStatus.affectedNodes&&e.recoveryStatus.affectedNodes.length>0&&(t+="_with_affected_node"),e.recoveryStatus.message=g.instant(t,{node:e.recoveryStatus.affectedNodes.join(", ")})}}),e}();!function(e){const t=k.selectAll("#node-group").data(e,e=>e.address),n=r.kI(t,45);n.on("click",(e,t)=>{m.$emit(a.vu,t);const n=c.select(".nodetooltip"),r=$(window).width();e.pageX<r/2?(n.style("left",e.pageX+"px"),n.style("right","")):(n.style("left",""),n.style("right",r-e.pageX+"px")),n.style("top",e.pageY-28+"px")}),r.HF(n),r.ss(n,A,T,E)}(e),function(e,t){const n=S.selectAll(".link").data(e,e=>e.id);r.cy(n),r.$$(n,t)}((0,o.cloneDeep)(m.clusterModel.links)||[],e)}m.width=function(){return N},m.height=function(){return M},m.$on("$destroy",function(){v.unbind("resize",x),v.unbind("mousedown",V),r.Wg(),w.forEach(e=>e())}),y=_.isAdmin(),v.bind("resize",x),v.bind("mousedown",V),w.push(p.$on("$translateChangeSuccess",function(){L(u),r.r_(C,b,u),Object.keys(d).forEach(e=>{c.select(`#${e}`).text(function(e){return u[d[e]]}(e))})})),w.push(m.$on(a.aV,function(){I()})),L(u),function(e){const t=r.J5(h[0]).attr("width",N).attr("height",M);b=r.dB(t,e),S=t.append("g").attr("id","links-group"),k=t.append("g").attr("id","nodes-group"),r.D6(t,r.ZC.BIG),r.D6(t,r.ZC.SMALL),f.updateClusterViewD3Container(t)}(!(!m.clusterModel.nodes||!m.clusterModel.nodes.length)),I()}}}])},64073(e,t,n){var r=n(8981);function o(e,t,n,o,a,i,s){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-nodes-configuration.html",link:n=>{const o=[];n.rowHeights={},n.editedNodeIndex=void 0,n.allSuggestions=[],n.loader=!1,n.errors=[],n.addNewLocation=!1,n.hasCluster=!1,n.addNode=()=>{n.addNewLocation=!0,n.newLocation=new r.aZ,t(function(){const e=document.querySelector("input[name='location']");e&&e.focus()},0)},n.filterSuggestions=e=>{const t=e.endpoint&&e.endpoint.toLowerCase();t?(n.suggestions=n.allSuggestions.filter(e=>e.toLowerCase().includes(t)),n.showDropdown=!0):(n.suggestions=[],n.showDropdown=!1)},n.selectSuggestion=(e,t)=>{e.endpoint=t,n.suggestions=[],n.showDropdown=!1},n.hideSuggestions=()=>{t(()=>{n.showDropdown=!1},200)},n.handleKeydown=function(e,t,r){"Enter"===e.key&&t?(e.preventDefault(),n.saveNode(r)):"Escape"===e.key&&n.cancel()},n.saveNode=e=>{const t=i.getAvailable(!0);var n,o;n=i.findByEndpoint(t,e)||new r.aZ(e),(o=i.getPendingReplace())?i.replace(o,n):i.addLocation(n),a()},n.deleteNode=(t,n)=>{s.openSimpleModal({title:e.instant("location.confirm.detach"),message:e.instant("location.confirm.detach.warning",{uri:n.endpoint}),warning:!0}).result.then(()=>{i.deleteFromCluster(n.item)})},n.replaceNode=(t,r)=>{s.openSimpleModal({title:e.instant("location.change.confirm"),message:e.instant("location.change.confirm.warning"),warning:!0}).result.then(()=>{i.setPendingReplace(r.item),n.editedNodeIndex=t})},n.isClusterConfigurationValid=()=>{const e=void 0===n.editedNodeIndex,t=!1===n.addNewLocation,r=i.hasValidNodesCount(),o=n.form.$valid;return e&&t&&r&&o},n.setLoader=(e,r)=>{t.cancel(n.loaderTimeout),e?n.loaderTimeout=t(()=>{n.loader=e,n.loaderMessage=r},300):n.loader=!1},n.getAdvancedOptionsClass=()=>{const e=document.getElementById("advancedOptions");if(e){const t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"ri-arrow-down-s-line"}return"ri-arrow-right-s-line"},n.cancel=()=>{n.editedNodeIndex=void 0,n.addNewLocation=!1,a(),i.emitUpdateClusterView()},n.restoreNode=e=>{i.restoreNode(e.item)};const a=()=>{i.setPendingReplace(void 0),n.editedNodeIndex=void 0,n.addNewLocation=!1},c=n.$watchGroup(["editedNodeIndex","addNewLocation","clusterConfiguration.electionMinTimeout","clusterConfiguration.electionRangeTimeout","clusterConfiguration.heartbeatInterval","clusterConfiguration.messageSizeKB","clusterConfiguration.verificationTimeout","clusterConfiguration.transactionLogMaximumSizeGB"],(e,t)=>{const r=n.isClusterConfigurationValid();i.updateClusterValidity(r)});o.push(c),o.push(i.onClusterViewChanged(e=>{n.hasCluster=i.hasCluster(),n.viewModel=i.getViewModel(),n.clusterNodesEndpoints=n.viewModel.map(e=>e.endpoint),n.clusterConfiguration=i.getClusterConfiguration(),n.allSuggestions=i.getAvailableNodeEndpoints(),n.canDeleteNode=i.canDeleteNode()})),n.$on("$destroy",()=>{o.forEach(e=>e())})}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-nodes-configuration",[]).directive("clusterNodesConfiguration",o),o.$inject=["$translate","$timeout","productInfo","toastr","RemoteLocationsService","ClusterContextService","ModalService"]},4552(){angular.module("graphdb.framework.core.directives.ascii-validator",[]).directive("asciiValidator",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){function o(e){const t=/^[\x21-\x7E]*$/.test(e);return r.$setValidity("asciiValidator",t),e}r.$parsers.push(o),r.$formatters.push(o)}}})},33931(){angular.module("graphdb.framework.core.directives.length-validator",[]).directive("lengthValidator",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){function o(e){const t=n.minLength?parseInt(n.minLength,10):0,o=n.maxLength?parseInt(n.maxLength,10):1/0,a=e&&e.length>=t&&e.length<=o;return r.$setValidity("lengthValidator",a),e}r.$parsers.push(o),r.$formatters.push(o)}}})},19146(){angular.module("graphdb.framework.core.directives.validate-duplicate-url",[]).directive("validateDuplicateUrl",function(){return{restrict:"A",require:"ngModel",scope:{excludedUrls:"="},link:function(e,t,n,r){r.$validators.duplicateUrl=function(t,n){return e.excludedUrls&&e.excludedUrls.includes(n)?(r.$setValidity("duplicateUrl",!1),!1):(r.$setValidity("duplicateUrl",!0),!0)}}}})},67262(e,t,n){var r=n(81417);angular.module("graphdb.framework.core.directives.validate-url",[]).directive("validateUrl",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,o){o.$validators.validUrl=function(e,t){if(o.$isEmpty(t))return"false"!==n.allowEmpty;if(!r.r.isValidUrl(t))return!1;if(n.exclude&&!r.r.doesNotContain(t,n.exclude))return!1;if(n.excludeProtocol){const e=n.excludeProtocol.split(",");if(!r.r.doesNotUseProtocol(t,e))return!1}return!0}}}})},81417(e,t,n){n.d(t,{r:()=>a});const r=/^(h|ht|htt|http|https|http:|https:|http:\/|https:\/|http:\/\/|https:\/\/|https?:\/\/[\S]*)$/i,o=/^(f|ft|ftp|ftps|ftp:|ftps:|ftp:\/|ftps:\/|ftp:\/\/|ftps:\/\/[\S]*)$/i;class a{static isValidUrl(e){return r.test(e)||o.test(e)}static doesNotContain(e,t){return!new RegExp(t).test(e)}static doesNotUseProtocol(e,t){return!new RegExp("^("+t.join("|")+")://","i").test(e)}}},11014(e,t,n){var r,o;r=[n(44482)],o=function(e){function t(e,t){return e.each(function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])})}function r(e,t){for(var n in t)e.attr(n,t[n]);return e}return void 0===e&&(e=n(44482)),e.selection.prototype.attrs=function(e){return("function"==typeof e?t:r)(this,e)},e.selection.prototype.moveToFront=function(){return this.each(function(){e.select(this.parentNode.appendChild(this))})},e.selection.prototype.moveToBack=function(){return this.each(function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)})},e}.apply(t,r),void 0===o||(e.exports=o)}};
|
|
2
|
-
//# sourceMappingURL=3395.
|
|
1
|
+
export const __webpack_esm_id__=3395;export const __webpack_esm_ids__=[3395,4552,19146,33931,34e3,64073,67262,81417];export const __webpack_esm_modules__={3395(e,t,n){n(22742),n(33136),n(88986),n(96972),n(31415),n(64073),n(75752),n(11014),n(75890),n(67262),n(19146),angular.module("graphdb.framework.clustermanagement",["ngAnimate","toastr","graphdb.framework.clustermanagement.controllers.cluster-management","graphdb.framework.clustermanagement.directives.cluster-graphical-view","graphdb.framework.clustermanagement.directives.cluster-configuration","graphdb.framework.clustermanagement.directives.cluster-nodes-configuration","graphdb.framework.core.directives.validate-url","graphdb.framework.core.directives.validate-duplicate-url"])},31415(e,t,n){n(3686),n(34e3),n(85698),angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration",["graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-properties","graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-nodes","graphdb.framework.clustermanagement.directives.cluster-configuration.multi-region"]).directive("clusterConfiguration",o),o.$inject=["$jwtAuth","$uibModal","$translate","toastr","ClusterViewContextService"];const r={PROPERTIES:"properties",NODES:"nodes",MULTI_REGION:"multi_region"};function o(e,t,n,o,a){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-configuration.html",scope:{currentNode:"=",clusterModel:"=",clusterConfiguration:"="},link:e=>{const t=[];e.CONFIGURATION_TABS=r,e.activeTab=r.PROPERTIES,e.closeClusterConfigurationPanel=()=>{a.hideClusterConfigurationPanel()},e.switchTab=(t,n)=>{e.activeTab=n},e.$on("$destroy",function(){t.forEach(e=>e()),e.closeClusterConfigurationPanel()}),t.push(a.onShowClusterConfigurationPanel(t=>{t||(e.activeTab=r.PROPERTIES)}))}}}},34e3(){function e(){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-nodes.html",scope:{currentNode:"=",clusterModel:"="}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-nodes",[]).directive("clusterNodes",e),e.$inject=[]},3686(e,t,n){var r=n(14267),o=n(57154);function a(e,t){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-properties.html",scope:{currentNode:"=",clusterModel:"=",clusterConfiguration:"="},link:e=>{const n=(0,o.service)(o.AuthorizationService),a=(0,o.service)(o.AuthenticationService);e.isAdmin=!1,e.showEditConfigurationDialog=()=>{t.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:()=>({clusterConfiguration:e.clusterConfiguration})}}).result.finally(function(){e.$emit(r.pw,{force:!0})})},e.showDeleteDialog=()=>{t.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then(t=>{e.$emit(r.fe,{force:t})})},e.isAdmin=a.isAuthenticated()&&n.isAdmin()}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-properties",[]).directive("clusterProperties",a),a.$inject=["$jwtAuth","$uibModal"]},85698(e,t,n){n(4552),n(33931);var r=n(8981),o=n(58325),a=n(57154);const i={minLen:"3",maxLen:"255"};function s(e,t,n,s,c,l,u){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/multi-region.html",scope:{clusterModel:"=",clusterConfiguration:"="},link:e=>{const d=(0,a.service)(a.AuthorizationService),g=(0,a.service)(a.AuthenticationService),m=[];e.topology=void 0,e.TopologyState=o.zB,e.isAdmin=!1,e.addingTag=!1,e.loaderTimeout=void 0,e.secondaryTag=void 0,e.TagLengthConstraints=i,e.add=()=>{e.addingTag=!0},e.cancel=()=>{e.addingTag=!1},e.createTag=n=>{const r={tag:n};return h(!0),l.addCusterTag(r).then(()=>{s.success(t.instant("cluster_management.cluster_configuration_multi_region.created_tag",{tag:n}))}).catch(e=>{const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.creating"))}).finally(()=>{e.addingTag=!1,h(!1)})},e.deleteTag=e=>{c.openSimpleModal({title:t.instant("cluster_management.cluster_configuration_multi_region.confirm.delete",{tag:e}),message:t.instant("cluster_management.cluster_configuration_multi_region.confirm.warning"),warning:!0,backdrop:"static",stopPropagation:!0}).result.then(()=>(h(!0),l.deleteClusterTag(e))).then(()=>s.success(t.instant("cluster_management.cluster_configuration_multi_region.deleted_tag",{tag:e}))).catch(e=>{if("cancel"===e||"escape key press"===e)return;const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.deleting"))}).finally(()=>h(!1))},e.enableSecondaryMode=()=>{e.addingTag=!1;const n={title:t.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary"),message:t.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary_warning"),warning:!0,backdrop:"static",confirmButtonKey:"common.ok.btn",stopPropagation:!0};c.openSimpleModal(n).result.then(()=>p()).then(e=>(h(!0),l.enableSecondaryMode(e))).then(()=>s.success(t.instant("cluster_management.cluster_configuration_multi_region.secondary_enabled"))).catch(e=>{if("cancel"===e||"escape key press"===e)return;const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.secondary"))}).finally(()=>h(!1))},e.disableSecondaryMode=()=>{c.openSimpleModal({title:t.instant("cluster_management.cluster_configuration_multi_region.confirm.disable_secondary_mode"),message:t.instant("cluster_management.cluster_configuration_multi_region.confirm.disable_secondary_mode_warning"),warning:!0,backdrop:"static",stopPropagation:!0}).result.then(()=>(h(!0),l.disableSecondaryMode())).then(()=>s.success(t.instant("cluster_management.cluster_configuration_multi_region.disabled_secondary_mode"))).catch(e=>{if("cancel"===e||"escape key press"===e)return;const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>h(!1))};const p=()=>{const e={title:t.instant("cluster_management.cluster_configuration_multi_region.secondary_cluster_settings"),templateUrl:"js/angular/clustermanagement/templates/modal/secondary-mode-modal.html",controller:["$scope","$uibModalInstance","config",function(e,t,n){e.rpcAddress="",e.tag="",e.title=n.title,e.onClick=e=>e.stopPropagation(),e.ok=()=>{t.close({primaryNode:e.rpcAddress,tag:e.tag})},e.cancel=()=>{t.dismiss("cancel")}}],size:"lg",warning:!0,backdrop:"static"};return c.openCustomModal(e).result},f=n=>{h(!0),l.getClusterConfig().then(t=>{e.secondaryTag=r.v9.fromJSON(t.data).secondaryTag,(t=>{const n=t.nodes.find(e=>e.nodeState===o.UY.LEADER);e.topology=n.topologyStatus})(r.kY.fromJSON(n))}).catch(e=>{const n=getError(e);s.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>h(!1))},h=(t,r)=>{n.cancel(e.loaderTimeout),t?(e.loaderMessage=r,e.loaderTimeout=n(()=>{e.loader=t},150)):e.loader=!1};e.$on("$destroy",function(){m.forEach(e=>e())}),e.isAdmin=g.isAuthenticated()&&d.isAdmin(),m.push(e.$watch("clusterModel",function(e,t){e!==t&&f(e)},!0)),m.push(u.onShowClusterConfigurationPanel(t=>{t||(e.addingTag=!1)})),f(e.clusterModel)}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.multi-region",["graphdb.framework.core.directives.ascii-validator","graphdb.framework.core.directives.length-validator"]).directive("multiRegion",s),s.$inject=["$jwtAuth","$translate","$timeout","toastr","ModalService","ClusterRestService","ClusterViewContextService"]},96972(e,t,n){n(38473),n(23236);var r=n(24125),o=n(22723),a=n(14267),i=n(44482),s=n(57154);const c={select:i.select};let l=240;const u={no_cluster_configured:"",create_cluster_btn:"",legend_node_state:"",legend_link_state:"",node_state_leader:"Leader",node_state_follower:"Follower",node_state_candidate:"Candidate",node_state_no_cluster:"No cluster",node_state_out_of_sync:"Out of sync",node_state_no_connection:"No connection",node_state_read_only:"Read only",node_state_restricted:"Restricted",link_state_in_sync:"In sync",link_state_syncing:"Syncing",link_state_out_of_sync:"Out of sync",recovery_state:{searching_for_node:"Searching for node",waiting_for_snapshot:"Waiting for snapshot from node",receiving_snapshot:"Receiving a snapshot from node",applying_snapshot:"Applying a snapshot",building_snapshot:"Building a snapshot for node",sending_snapshot:"Sending a snapshot to node",recovery_operation_failure_warning:"Node unable to recover. Action required"}},d={node_state:"legend_node_state",link_state:"legend_link_state"};angular.module("graphdb.framework.clustermanagement.directives.cluster-graphical-view",["graphdb.framework.utils.localstorageadapter","graphdb.framework.clustermanagement.directives.cluster-legend"]).directive("clusterGraphicalView",["$window","LocalStorageAdapter","LSKeys","UriUtils","$translate","$jwtAuth","$rootScope","ClusterViewContextService",function(e,t,n,i,g,m,p,f){return{restrict:"E",scope:{clusterModel:"="},link:function(m,h){const _=(0,s.service)(s.AuthorizationService),v=angular.element(e),w=[];let y,C,b,k,S,N=U(),M=P(),E=Math.min(N,M)/2-100,A=N/2,T=M/2;function x(){const e=f.getClusterViewD3Container();N=U(),M=P(),e.attr("width",N),e.attr("height",M),I()}function L(e,t=""){Object.keys(e).forEach(n=>{let r="";t&&(r+=t),r+=`.${n}`;const o=e[n];"string"==typeof o?e[n]=g.instant(`cluster_management.cluster_graphical_view${r}`):"object"==typeof o&&L(o,r)})}function U(){const r="collapsedMenu"===t.get(n.MENU_STATE);return l=r?70:240,Math.max(Math.floor(.95*(e.innerWidth-l)),600)}function P(){return Math.max(.95*(e.innerHeight-250),675)}function V(e){m.$emit(a.DP,e.target)}function I(){E=Math.min(N,M)/2-100,A=N/2,T=M/2,r.cZ(b,A,T),b.select(".cluster-zone").attr("r",E),C!==m.clusterModel.hasCluster&&(C=!!m.clusterModel.hasCluster,function(e){r.Xl(e,b,u,y),!e&&y&&b.on("mouseup",()=>{m.$emit(a.Yn)})}(C));const e=function(){const e=(0,o.cloneDeep)(m.clusterModel.nodes)||[];return e.forEach(e=>{if(e.hostname=i.shortenIri(e.endpoint),!(0,o.isEmpty)(e.recoveryStatus)){let t=`cluster_management.cluster_graphical_view.recovery_state.${e.recoveryStatus.state.toLowerCase()}`;e.recoveryStatus.affectedNodes&&e.recoveryStatus.affectedNodes.length>0&&(t+="_with_affected_node"),e.recoveryStatus.message=g.instant(t,{node:e.recoveryStatus.affectedNodes.join(", ")})}}),e}();!function(e){const t=k.selectAll("#node-group").data(e,e=>e.address),n=r.kI(t,45);n.on("click",(e,t)=>{m.$emit(a.vu,t);const n=c.select(".nodetooltip"),r=$(window).width();e.pageX<r/2?(n.style("left",e.pageX+"px"),n.style("right","")):(n.style("left",""),n.style("right",r-e.pageX+"px")),n.style("top",e.pageY-28+"px")}),r.HF(n),r.ss(n,A,T,E)}(e),function(e,t){const n=S.selectAll(".link").data(e,e=>e.id);r.cy(n),r.$$(n,t),r.Tk(S,e,t)}((0,o.cloneDeep)(m.clusterModel.links)||[],e)}m.width=function(){return N},m.height=function(){return M},m.$on("$destroy",function(){v.unbind("resize",x),v.unbind("mousedown",V),r.Wg(),w.forEach(e=>e())}),y=_.isAdmin(),v.bind("resize",x),v.bind("mousedown",V),w.push(p.$on("$translateChangeSuccess",function(){L(u),r.r_(C,b,u),Object.keys(d).forEach(e=>{c.select(`#${e}`).text(function(e){return u[d[e]]}(e))})})),w.push(m.$on(a.aV,function(){I()})),L(u),function(e){const t=r.J5(h[0]).attr("width",N).attr("height",M);b=r.dB(t,e),S=t.append("g").attr("id","links-group"),k=t.append("g").attr("id","nodes-group"),r.D6(t,r.ZC.BIG),r.D6(t,r.ZC.SMALL),f.updateClusterViewD3Container(t)}(!(!m.clusterModel.nodes||!m.clusterModel.nodes.length)),I()}}}])},64073(e,t,n){var r=n(8981);function o(e,t,n,o,a,i,s){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-nodes-configuration.html",link:n=>{const o=[];n.rowHeights={},n.editedNodeIndex=void 0,n.allSuggestions=[],n.loader=!1,n.errors=[],n.addNewLocation=!1,n.hasCluster=!1,n.addNode=()=>{n.addNewLocation=!0,n.newLocation=new r.aZ,t(function(){const e=document.querySelector("input[name='location']");e&&e.focus()},0)},n.filterSuggestions=e=>{const t=e.endpoint&&e.endpoint.toLowerCase();t?(n.suggestions=n.allSuggestions.filter(e=>e.toLowerCase().includes(t)),n.showDropdown=!0):(n.suggestions=[],n.showDropdown=!1)},n.selectSuggestion=(e,t)=>{e.endpoint=t,n.suggestions=[],n.showDropdown=!1},n.hideSuggestions=()=>{t(()=>{n.showDropdown=!1},200)},n.handleKeydown=function(e,t,r){"Enter"===e.key&&t?(e.preventDefault(),n.saveNode(r)):"Escape"===e.key&&n.cancel()},n.saveNode=e=>{const t=i.getAvailable(!0);var n,o;n=i.findByEndpoint(t,e)||new r.aZ(e),(o=i.getPendingReplace())?i.replace(o,n):i.addLocation(n),a()},n.deleteNode=(t,n)=>{s.openSimpleModal({title:e.instant("location.confirm.detach"),message:e.instant("location.confirm.detach.warning",{uri:n.endpoint}),warning:!0}).result.then(()=>{i.deleteFromCluster(n.item)})},n.replaceNode=(t,r)=>{s.openSimpleModal({title:e.instant("location.change.confirm"),message:e.instant("location.change.confirm.warning"),warning:!0}).result.then(()=>{i.setPendingReplace(r.item),n.editedNodeIndex=t})},n.isClusterConfigurationValid=()=>{const e=void 0===n.editedNodeIndex,t=!1===n.addNewLocation,r=i.hasValidNodesCount(),o=n.form.$valid;return e&&t&&r&&o},n.setLoader=(e,r)=>{t.cancel(n.loaderTimeout),e?n.loaderTimeout=t(()=>{n.loader=e,n.loaderMessage=r},300):n.loader=!1},n.getAdvancedOptionsClass=()=>{const e=document.getElementById("advancedOptions");if(e){const t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"ri-arrow-down-s-line"}return"ri-arrow-right-s-line"},n.cancel=()=>{n.editedNodeIndex=void 0,n.addNewLocation=!1,a(),i.emitUpdateClusterView()},n.restoreNode=e=>{i.restoreNode(e.item)};const a=()=>{i.setPendingReplace(void 0),n.editedNodeIndex=void 0,n.addNewLocation=!1},c=n.$watchGroup(["editedNodeIndex","addNewLocation","clusterConfiguration.electionMinTimeout","clusterConfiguration.electionRangeTimeout","clusterConfiguration.heartbeatInterval","clusterConfiguration.messageSizeKB","clusterConfiguration.verificationTimeout","clusterConfiguration.transactionLogMaximumSizeGB"],(e,t)=>{const r=n.isClusterConfigurationValid();i.updateClusterValidity(r)});o.push(c),o.push(i.onClusterViewChanged(e=>{n.hasCluster=i.hasCluster(),n.viewModel=i.getViewModel(),n.clusterNodesEndpoints=n.viewModel.map(e=>e.endpoint),n.clusterConfiguration=i.getClusterConfiguration(),n.allSuggestions=i.getAvailableNodeEndpoints(),n.canDeleteNode=i.canDeleteNode()})),n.$on("$destroy",()=>{o.forEach(e=>e())})}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-nodes-configuration",[]).directive("clusterNodesConfiguration",o),o.$inject=["$translate","$timeout","productInfo","toastr","RemoteLocationsService","ClusterContextService","ModalService"]},4552(){angular.module("graphdb.framework.core.directives.ascii-validator",[]).directive("asciiValidator",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){function o(e){const t=/^[\x21-\x7E]*$/.test(e);return r.$setValidity("asciiValidator",t),e}r.$parsers.push(o),r.$formatters.push(o)}}})},33931(){angular.module("graphdb.framework.core.directives.length-validator",[]).directive("lengthValidator",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){function o(e){const t=n.minLength?parseInt(n.minLength,10):0,o=n.maxLength?parseInt(n.maxLength,10):1/0,a=e&&e.length>=t&&e.length<=o;return r.$setValidity("lengthValidator",a),e}r.$parsers.push(o),r.$formatters.push(o)}}})},19146(){angular.module("graphdb.framework.core.directives.validate-duplicate-url",[]).directive("validateDuplicateUrl",function(){return{restrict:"A",require:"ngModel",scope:{excludedUrls:"="},link:function(e,t,n,r){r.$validators.duplicateUrl=function(t,n){return e.excludedUrls&&e.excludedUrls.includes(n)?(r.$setValidity("duplicateUrl",!1),!1):(r.$setValidity("duplicateUrl",!0),!0)}}}})},67262(e,t,n){var r=n(81417);angular.module("graphdb.framework.core.directives.validate-url",[]).directive("validateUrl",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,o){o.$validators.validUrl=function(e,t){if(o.$isEmpty(t))return"false"!==n.allowEmpty;if(!r.r.isValidUrl(t))return!1;if(n.exclude&&!r.r.doesNotContain(t,n.exclude))return!1;if(n.excludeProtocol){const e=n.excludeProtocol.split(",");if(!r.r.doesNotUseProtocol(t,e))return!1}return!0}}}})},81417(e,t,n){n.d(t,{r:()=>a});const r=/^(h|ht|htt|http|https|http:|https:|http:\/|https:\/|http:\/\/|https:\/\/|https?:\/\/[\S]*)$/i,o=/^(f|ft|ftp|ftps|ftp:|ftps:|ftp:\/|ftps:\/|ftp:\/\/|ftps:\/\/[\S]*)$/i;class a{static isValidUrl(e){return r.test(e)||o.test(e)}static doesNotContain(e,t){return!new RegExp(t).test(e)}static doesNotUseProtocol(e,t){return!new RegExp("^("+t.join("|")+")://","i").test(e)}}},11014(e,t,n){var r,o;r=[n(44482)],o=function(e){function t(e,t){return e.each(function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])})}function r(e,t){for(var n in t)e.attr(n,t[n]);return e}return void 0===e&&(e=n(44482)),e.selection.prototype.attrs=function(e){return("function"==typeof e?t:r)(this,e)},e.selection.prototype.moveToFront=function(){return this.each(function(){e.select(this.parentNode.appendChild(this))})},e.selection.prototype.moveToBack=function(){return this.each(function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)})},e}.apply(t,r),void 0===o||(e.exports=o)}};
|
|
2
|
+
//# sourceMappingURL=3395.8dfba5922c8aad6d860c.bundle.js.map
|