graphdb-workbench 2.8.0-RC2 → 2.8.0-RC3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/182.dfcc20ae89193db499d9.bundle.js +1 -1
- package/dist/22.673ef35a23421e7dffcb.bundle.js +1 -1
- package/dist/27.2e7f5c9f8f4a670b3984.bundle.js +1 -0
- package/dist/33.d4d571fa95fe4279e91a.bundle.js +1 -0
- package/dist/341.40c87b67067473b65948.bundle.js +1 -1
- package/dist/347.9da36037aa6cf847fca9.bundle.js +1 -1
- package/dist/350.98af5dc7b011f3bb0cea.bundle.js +1 -1
- package/dist/351.4b24b91033c1f2ff99bc.bundle.js +1 -1
- package/dist/352.95aa115bee7aac6ad664.bundle.js +1 -1
- package/dist/353.23320eb168ae4ae33394.bundle.js +1 -1
- package/dist/354.979dc4d4d8495191a364.bundle.js +1 -1
- package/dist/384.5538193bdeac0703bc47.bundle.js +1 -1
- package/dist/396.c5a25717c4fc949419a7.bundle.js +1 -1
- package/dist/397.33463b93b02b13a80453.bundle.js +1 -1
- package/dist/398.b83b6410f7cceec4fc3f.bundle.js +1 -1
- package/dist/399.0916866cffd7814843af.bundle.js +1 -1
- package/dist/400.1ce74b220dacdb1ab34c.bundle.js +1 -1
- package/dist/402.61aaab5f119f02d6a6c4.bundle.js +1 -1
- package/dist/403.203cccb77544e449317a.bundle.js +1 -1
- package/dist/404.b921697f6552cc581aac.bundle.js +1 -1
- package/dist/405.3e17362183cfe674af25.bundle.js +1 -1
- package/dist/41.edbd16a2fc60a997c1ee.bundle.js +1 -1
- package/dist/42.f76e5e500efcc079a9c7.bundle.js +1 -1
- package/dist/49.32ed550dc99d64e69f20.bundle.js +1 -0
- package/dist/59.69785f5f7ae1e65841ff.bundle.js +1 -1
- package/dist/70.4e944a1170802f15dc71.bundle.js +1 -1
- package/dist/{bundle.e3f61721b37f1e215ee4.bundle.js → bundle.debfe2fd949a59877cbe.bundle.js} +2 -2
- package/dist/index.html +3 -3
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.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/yasgui-component/templates/yasgui-component.html +1 -1
- 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/security/templates/user.html +1 -1
- 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 +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/license-checker.json +2 -2
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +8 -8
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.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/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +12 -12
- package/package.json +1 -1
- package/dist/27.0bef4e8a2036ac558363.bundle.js +0 -1
- package/dist/33.af2c6f75cf2552a3673a.bundle.js +0 -1
- package/dist/49.cb3092e45da0b746f614.bundle.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[27,92,132,138,141,144,323],{104:function(e,t,n){"use strict";n.r(t),n.d(t,"UrlUtils",(function(){return i}));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 i{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)}}},121:function(e,t,n){"use strict";n.r(t);var r=n(104);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.UrlUtils.isValidUrl(t))return!1;if(n.exclude&&!r.UrlUtils.doesNotContain(t,n.exclude))return!1;if(n.excludeProtocol){const e=n.excludeProtocol.split(",");if(!r.UrlUtils.doesNotUseProtocol(t,e))return!1}return!0}}}}))},122:function(e,t){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)}}}))},123:function(e,t){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,i=e&&e.length>=t&&e.length<=o;return r.$setValidity("lengthValidator",i),e}r.$parsers.push(o),r.$formatters.push(o)}}}))},145:function(e,t,n){"use strict";n.r(t);var r=n(96);function o(e,t){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-properties.html",scope:{currentNode:"=",clusterModel:"=",clusterConfiguration:"="},link:n=>{n.isAdmin=!1,n.showEditConfigurationDialog=()=>{t.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:()=>({clusterConfiguration:n.clusterConfiguration})}}).result.finally((function(){n.$emit(r.UPDATE_CLUSTER,{force:!0})}))},n.showDeleteDialog=()=>{t.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then(e=>{n.$emit(r.DELETE_CLUSTER,{force:e})})};n.isAdmin=e.isAuthenticated()&&e.isAdmin()}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-properties",[]).directive("clusterProperties",o),o.$inject=["$jwtAuth","$uibModal"]},146:function(e,t){function n(){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",n),n.$inject=[]},147:function(e,t,n){"use strict";n.r(t);n(122),n(123);var r=n(95),o=n(85);const i={minLen:"3",maxLen:"255"};function a(e,t,n,a,s,l,c){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/multi-region.html",scope:{clusterModel:"=",clusterConfiguration:"="},link:u=>{const d=[];u.topology=void 0,u.TopologyState=o.TopologyState,u.isAdmin=!1,u.addingTag=!1,u.loaderTimeout=void 0,u.secondaryTag=void 0,u.TagLengthConstraints=i,u.add=()=>{u.addingTag=!0},u.cancel=()=>{u.addingTag=!1},u.createTag=e=>{const n={tag:e};return p(!0),l.addCusterTag(n).then(()=>{a.success(t.instant("cluster_management.cluster_configuration_multi_region.created_tag",{tag:e}))}).catch(e=>{const n=getError(e);a.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.creating"))}).finally(()=>{u.addingTag=!1,p(!1)})},u.deleteTag=e=>{s.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(()=>(p(!0),l.deleteClusterTag(e))).then(()=>a.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);a.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.deleting"))}).finally(()=>p(!1))},u.enableSecondaryMode=()=>{u.addingTag=!1;const e={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};s.openSimpleModal(e).result.then(()=>g()).then(e=>(p(!0),l.enableSecondaryMode(e))).then(()=>a.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);a.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.secondary"))}).finally(()=>p(!1))},u.disableSecondaryMode=()=>{s.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(()=>(p(!0),l.disableSecondaryMode())).then(()=>a.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);a.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>p(!1))};const g=()=>{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: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 s.openCustomModal(e).result},m=e=>{p(!0),l.getClusterConfig().then(t=>{u.secondaryTag=r.ClusterConfiguration.fromJSON(t.data).secondaryTag,(e=>{const t=e.nodes.find(e=>e.nodeState===o.NodeState.LEADER);u.topology=t.topologyStatus})(r.ClusterModel.fromJSON(e))}).catch(e=>{const n=getError(e);a.error(n,t.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>p(!1))},f=e=>{e||(u.addingTag=!1)},p=(e,t)=>{n.cancel(u.loaderTimeout),e?(u.loaderMessage=t,u.loaderTimeout=n(()=>{u.loader=e},150)):u.loader=!1};u.$on("$destroy",(function(){d.forEach(e=>e())}));u.isAdmin=e.isAuthenticated()&&e.isAdmin(),d.push(u.$watch("clusterModel",(function(e,t){e!==t&&m(e)}),!0)),d.push(c.onShowClusterConfigurationPanel(f)),m(u.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",a),a.$inject=["$jwtAuth","$translate","$timeout","toastr","ModalService","ClusterRestService","ClusterViewContextService"]},208:function(e,t,n){"use strict";n.r(t);n(11),n(209);var r=n(113),o=n(31),i=n(96);let a=240;const s={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"}},l={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,c,u,d,g,m){return{restrict:"E",scope:{clusterModel:"="},link:function(f,p){const h=angular.element(e),_=[];let w,v,C,y,b,E=L(),S=U(),k=Math.min(E,S)/2-100,N=E/2,M=S/2;function T(){const e=m.getClusterViewD3Container();E=L(),S=U(),e.attr("width",E),e.attr("height",S),j()}function A(e,t=""){Object.keys(e).forEach(n=>{let r="";t&&(r+=t),r+="."+n;const o=e[n];"string"==typeof o?e[n]=u.instant("cluster_management.cluster_graphical_view"+r):"object"==typeof o&&A(o,r)})}function L(){const r="collapsedMenu"===t.get(n.MENU_STATE);return a=r?70:240,Math.max(Math.floor(.95*(e.innerWidth-a)),600)}function U(){return Math.max(.95*(e.innerHeight-250),675)}function x(){r.updateClusterZoneLabels(v,C,s),Object.keys(l).forEach(e=>{d3.select("#"+e).text(function(e){return s[l[e]]}(e))})}function R(){k=Math.min(E,S)/2-100,N=E/2,M=S/2,r.moveElement(C,N,M),C.select(".cluster-zone").attr("r",k)}function I(e){f.$emit(i.CLICK_IN_VIEW,e.target)}function j(){R(),v!==f.clusterModel.hasCluster&&(v=!!f.clusterModel.hasCluster,function(e){r.setCreateClusterZone(e,C,s,w),!e&&w&&C.on("mouseup",()=>{f.$emit(i.CREATE_CLUSTER)})}(v));const e=function(){const e=Object(o.cloneDeep)(f.clusterModel.nodes)||[];return e.forEach(e=>{if(e.hostname=c.shortenIri(e.endpoint),!Object(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=u.instant(t,{node:e.recoveryStatus.affectedNodes.join(", ")})}}),e}();!function(e){const t=y.selectAll("#node-group").data(e,e=>e.address),n=r.createNodes(t,45);n.on("click",(e,t)=>{f.$emit(i.NODE_SELECTED,t);const n=d3.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.updateNodes(n),r.positionNodesOnClusterZone(n,N,M,k)}(e);!function(e,t){const n=b.selectAll(".link").data(e,e=>e.id);r.createLinks(n),r.updateLinks(n,t)}(Object(o.cloneDeep)(f.clusterModel.links)||[],e)}f.width=function(){return E},f.height=function(){return S};f.$on("$destroy",(function(){h.unbind("resize",T),h.unbind("mousedown",I),r.removeEventListeners(),_.forEach(e=>e())})),w=d.isAdmin(),h.bind("resize",T),h.bind("mousedown",I),_.push(g.$on("$translateChangeSuccess",(function(){A(s),x()}))),_.push(f.$on(i.MODEL_UPDATED,(function(){j()}))),A(s),function(e){const t=r.createClusterSvgElement(p[0]).attr("width",E).attr("height",S);C=r.createClusterZone(t,e),b=t.append("g").attr("id","links-group"),y=t.append("g").attr("id","nodes-group"),r.addArrowHead(t,r.ARROW_CONFIG.BIG),r.addArrowHead(t,r.ARROW_CONFIG.SMALL),m.updateClusterViewD3Container(t)}(!(!f.clusterModel.nodes||!f.clusterModel.nodes.length)),j()}}}])},211:function(e,t,n){"use strict";n.r(t);n(145),n(146),n(147);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,i){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=()=>{i.hideClusterConfigurationPanel()},e.switchTab=(t,n)=>{e.activeTab=n};e.$on("$destroy",(function(){t.forEach(e=>e()),e.closeClusterConfigurationPanel()}));t.push(i.onShowClusterConfigurationPanel(t=>{t||(e.activeTab=r.PROPERTIES)}))}}}},212:function(e,t,n){"use strict";n.r(t);var r=n(95);function o(e,t,n,o,i,a,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.Location},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.saveNode=e=>{const t=a.getAvailable(!0);!function(e,t){t?a.replace(t,e):a.addLocation(e);i()}(a.findByEndpoint(t,e)||new r.Location(e),a.getPendingReplace())},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(()=>{a.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(()=>{a.setPendingReplace(r.item),n.editedNodeIndex=t})},n.isClusterConfigurationValid=()=>{const e=void 0===n.editedNodeIndex,t=!1===n.addNewLocation,r=a.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"fa fa-angle-down"}return"fa fa-angle-right"},n.cancel=()=>{n.editedNodeIndex=void 0,n.addNewLocation=!1,a.emitUpdateClusterView()},n.restoreNode=e=>{a.restoreNode(e.item)};const i=()=>{a.setPendingReplace(void 0),n.editedNodeIndex=void 0,n.addNewLocation=!1},l=n.$watchGroup(["editedNodeIndex","addNewLocation","clusterConfiguration.electionMinTimeout","clusterConfiguration.electionRangeTimeout","clusterConfiguration.heartbeatInterval","clusterConfiguration.messageSizeKB","clusterConfiguration.verificationTimeout","clusterConfiguration.transactionLogMaximumSizeGB"],(e,t)=>{const r=n.isClusterConfigurationValid();a.updateClusterValidity(r)});o.push(l),o.push(a.onClusterViewChanged(e=>{n.hasCluster=a.hasCluster(),n.viewModel=a.getViewModel(),n.clusterNodesEndpoints=n.viewModel.map(e=>e.endpoint),n.clusterConfiguration=a.getClusterConfiguration(),n.allSuggestions=a.getAvailableNodeEndpoints(),n.canDeleteNode=a.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"]},213:function(e,t){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)}}}}))},312:function(e,t,n){"use strict";n.r(t);n(7),n(32),n(299),n(208),n(211),n(212),n(33),n(519),n(297),n(121),n(213);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"])},519:function(e,t,n){var r,o;r=[n(527)],void 0===(o=function(){function e(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 t(e,t){for(var n in t)e.attr(n,t[n]);return e}return"undefined"==typeof d3&&(d3=n(527)),d3.selection.prototype.attrs=function(n){return("function"==typeof n?e:t)(this,n)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=o)}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[33,49,86,132,133,138,141,187,190,191],{122:function(t,e){angular.module("graphdb.framework.core.directives.ascii-validator",[]).directive("asciiValidator",(function(){return{restrict:"A",require:"ngModel",link:function(t,e,r,n){function i(t){const e=/^[\x21-\x7E]*$/.test(t);return n.$setValidity("asciiValidator",e),t}n.$parsers.push(i),n.$formatters.push(i)}}}))},123:function(t,e){angular.module("graphdb.framework.core.directives.length-validator",[]).directive("lengthValidator",(function(){return{restrict:"A",require:"ngModel",link:function(t,e,r,n){function i(t){const e=r.minLength?parseInt(r.minLength,10):0,i=r.maxLength?parseInt(r.maxLength,10):1/0,s=t&&t.length>=e&&t.length<=i;return n.$setValidity("lengthValidator",s),t}n.$parsers.push(i),n.$formatters.push(i)}}}))},145:function(t,e,r){"use strict";r.r(e);var n=r(96);function i(t,e){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-properties.html",scope:{currentNode:"=",clusterModel:"=",clusterConfiguration:"="},link:r=>{r.isAdmin=!1,r.showEditConfigurationDialog=()=>{e.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:()=>({clusterConfiguration:r.clusterConfiguration})}}).result.finally((function(){r.$emit(n.UPDATE_CLUSTER,{force:!0})}))},r.showDeleteDialog=()=>{e.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then(t=>{r.$emit(n.DELETE_CLUSTER,{force:t})})};r.isAdmin=t.isAuthenticated()&&t.isAdmin()}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-configuration.cluster-properties",[]).directive("clusterProperties",i),i.$inject=["$jwtAuth","$uibModal"]},146:function(t,e){function r(){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",r),r.$inject=[]},147:function(t,e,r){"use strict";r.r(e);r(122),r(123);var n=r(95),i=r(85);const s={minLen:"3",maxLen:"255"};function o(t,e,r,o,a,l,u){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/multi-region.html",scope:{clusterModel:"=",clusterConfiguration:"="},link:c=>{const d=[];c.topology=void 0,c.TopologyState=i.TopologyState,c.isAdmin=!1,c.addingTag=!1,c.loaderTimeout=void 0,c.secondaryTag=void 0,c.TagLengthConstraints=s,c.add=()=>{c.addingTag=!0},c.cancel=()=>{c.addingTag=!1},c.createTag=t=>{const r={tag:t};return h(!0),l.addCusterTag(r).then(()=>{o.success(e.instant("cluster_management.cluster_configuration_multi_region.created_tag",{tag:t}))}).catch(t=>{const r=getError(t);o.error(r,e.instant("cluster_management.cluster_configuration_multi_region.error.creating"))}).finally(()=>{c.addingTag=!1,h(!1)})},c.deleteTag=t=>{a.openSimpleModal({title:e.instant("cluster_management.cluster_configuration_multi_region.confirm.delete",{tag:t}),message:e.instant("cluster_management.cluster_configuration_multi_region.confirm.warning"),warning:!0,backdrop:"static",stopPropagation:!0}).result.then(()=>(h(!0),l.deleteClusterTag(t))).then(()=>o.success(e.instant("cluster_management.cluster_configuration_multi_region.deleted_tag",{tag:t}))).catch(t=>{if("cancel"===t||"escape key press"===t)return;const r=getError(t);o.error(r,e.instant("cluster_management.cluster_configuration_multi_region.error.deleting"))}).finally(()=>h(!1))},c.enableSecondaryMode=()=>{c.addingTag=!1;const t={title:e.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary"),message:e.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary_warning"),warning:!0,backdrop:"static",confirmButtonKey:"common.ok.btn",stopPropagation:!0};a.openSimpleModal(t).result.then(()=>g()).then(t=>(h(!0),l.enableSecondaryMode(t))).then(()=>o.success(e.instant("cluster_management.cluster_configuration_multi_region.secondary_enabled"))).catch(t=>{if("cancel"===t||"escape key press"===t)return;const r=getError(t);o.error(r,e.instant("cluster_management.cluster_configuration_multi_region.error.secondary"))}).finally(()=>h(!1))},c.disableSecondaryMode=()=>{a.openSimpleModal({title:e.instant("cluster_management.cluster_configuration_multi_region.confirm.disable_secondary_mode"),message:e.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(()=>o.success(e.instant("cluster_management.cluster_configuration_multi_region.disabled_secondary_mode"))).catch(t=>{if("cancel"===t||"escape key press"===t)return;const r=getError(t);o.error(r,e.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>h(!1))};const g=()=>{const t={title:e.instant("cluster_management.cluster_configuration_multi_region.secondary_cluster_settings"),templateUrl:"js/angular/clustermanagement/templates/modal/secondary-mode-modal.html",controller:function(t,e,r){t.rpcAddress="",t.tag="",t.title=r.title,t.onClick=t=>t.stopPropagation(),t.ok=()=>{e.close({primaryNode:t.rpcAddress,tag:t.tag})},t.cancel=()=>{e.dismiss("cancel")}},size:"lg",warning:!0,backdrop:"static"};return a.openCustomModal(t).result},_=t=>{h(!0),l.getClusterConfig().then(e=>{c.secondaryTag=n.ClusterConfiguration.fromJSON(e.data).secondaryTag,(t=>{const e=t.nodes.find(t=>t.nodeState===i.NodeState.LEADER);c.topology=e.topologyStatus})(n.ClusterModel.fromJSON(t))}).catch(t=>{const r=getError(t);o.error(r,e.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>h(!1))},m=t=>{t||(c.addingTag=!1)},h=(t,e)=>{r.cancel(c.loaderTimeout),t?(c.loaderMessage=e,c.loaderTimeout=r(()=>{c.loader=t},150)):c.loader=!1};c.$on("$destroy",(function(){d.forEach(t=>t())}));c.isAdmin=t.isAuthenticated()&&t.isAdmin(),d.push(c.$watch("clusterModel",(function(t,e){t!==e&&_(t)}),!0)),d.push(u.onShowClusterConfigurationPanel(m)),_(c.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",o),o.$inject=["$jwtAuth","$translate","$timeout","toastr","ModalService","ClusterRestService","ClusterViewContextService"]},211:function(t,e,r){"use strict";r.r(e);r(145),r(146),r(147);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",i),i.$inject=["$jwtAuth","$uibModal","$translate","toastr","ClusterViewContextService"];const n={PROPERTIES:"properties",NODES:"nodes",MULTI_REGION:"multi_region"};function i(t,e,r,i,s){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/cluster-configuration.html",scope:{currentNode:"=",clusterModel:"=",clusterConfiguration:"="},link:t=>{const e=[];t.CONFIGURATION_TABS=n,t.activeTab=n.PROPERTIES,t.closeClusterConfigurationPanel=()=>{s.hideClusterConfigurationPanel()},t.switchTab=(e,r)=>{t.activeTab=r};t.$on("$destroy",(function(){e.forEach(t=>t()),t.closeClusterConfigurationPanel()}));e.push(s.onShowClusterConfigurationPanel(e=>{e||(t.activeTab=n.PROPERTIES)}))}}}},85:function(t,e,r){"use strict";r.r(e),r.d(e,"NodeState",(function(){return n})),r.d(e,"RecoveryState",(function(){return i})),r.d(e,"LinkState",(function(){return s})),r.d(e,"TopologyState",(function(){return o}));const n={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"},i={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"},o={PRIMARY_NODE:"PRIMARY_NODE",SECONDARY_NODE:"SECONDARY_NODE"}},95:function(t,e,r){"use strict";r.r(e),r.d(e,"Location",(function(){return n})),r.d(e,"Node",(function(){return i})),r.d(e,"TopologyStatus",(function(){return s})),r.d(e,"Link",(function(){return o})),r.d(e,"ClusterModel",(function(){return a})),r.d(e,"ClusterViewModel",(function(){return l})),r.d(e,"ClusterItemViewModel",(function(){return u})),r.d(e,"ClusterConfiguration",(function(){return c}));class n{constructor(t,e=null,r=null,n=!1,i=!1){this._endpoint=t,this._rpcAddress=e,this._error=r,this._isAvailable=n,this._isLocal=i}get isLocal(){return this._isLocal}get endpoint(){return this._endpoint}get rpcAddress(){return this._rpcAddress}get error(){return this._error}get isAvailable(){return this._isAvailable}set endpoint(t){this._endpoint=t}set rpcAddress(t){this._rpcAddress=t}set error(t){this._error=t}set isAvailable(t){this._isAvailable=t}set isLocal(t){this._isLocal=t}static fromJSON({endpoint:t,rpcAddress:e,error:r=null,isAvailable:i=!1,isLocal:s=!1}){return new n(t,e,r,i,s)}}class i{constructor(t,e,r,n,i,o,a,l,u){this._address=t,this._nodeState=e,this._term=r,this._syncStatus=n,this._lastLogTerm=i,this._lastLogIndex=o,this._endpoint=a,this._recoveryStatus=l,this._topologyStatus=s.fromJSON(u)}get address(){return this._address}get nodeState(){return this._nodeState}get term(){return this._term}get syncStatus(){return this._syncStatus}get lastLogTerm(){return this._lastLogTerm}get lastLogIndex(){return this._lastLogIndex}get endpoint(){return this._endpoint}get recoveryStatus(){return this._recoveryStatus}set address(t){this._address=t}set nodeState(t){this._nodeState=t}set term(t){this._term=t}set syncStatus(t){this._syncStatus=t}set lastLogTerm(t){this._lastLogTerm=t}set lastLogIndex(t){this._lastLogIndex=t}set endpoint(t){this._endpoint=t}set recoveryStatus(t){this._recoveryStatus=t}get topologyStatus(){return this._topologyStatus}set topologyStatus(t){return this._topologyStatus=t}static fromJSON({address:t,nodeState:e,term:r,syncStatus:n,lastLogTerm:s,lastLogIndex:o,endpoint:a,recoveryStatus:l,topologyStatus:u}){return new i(t,e,r,n,s,o,a,l,u)}}class s{constructor(t,e=new Map,r,n){this._state=t,this._primaryTags=e,this._primaryIndex=r,this._primaryLeader=n}get state(){return this._state}get primaryTags(){return this._primaryTags}get primaryIndex(){return this._primaryIndex}get primaryLeader(){return this._primaryLeader}static fromJSON({state:t,primaryTags:e={},primaryIndex:r,primaryLeader:n}){const i=Object.entries(e);return new s(t,i,r,n)}}class o{constructor(t,e,r,n){this._id=t,this._source=e,this._target=r,this._status=n}static fromJSON({id:t,source:e,target:r,status:n}){return new o(t,e,r,n)}}class a{constructor(t,e,r,n){this._locations=t,this._hasCluster=e,this._nodes=r,this._links=n}get locations(){return this._locations}set locations(t){this._locations=t}get hasCluster(){return this._hasCluster}set hasCluster(t){this._hasCluster=t}get nodes(){return this._nodes}set nodes(t){this._nodes=t}get links(){return this._links}set links(t){this._links=t}static fromJSON(t){const e=t.locations.map(n.fromJSON),r=t.nodes.map(i.fromJSON),s=t.links.map(o.fromJSON);return new a(e,t.hasCluster,r,s)}}class l{constructor(t){this._clusterModel=a.fromJSON(t),this._addToCluster=new Map,this._deleteFromCluster=new Map,this._currentNodesCount=0,this._clusterConfiguration=new c,this._localNodeEndpoint=t.locations.find(t=>t.isLocal).endpoint,this.MINIMUM_NODES_REQUIRED=2}getAttached(){const t=this._clusterModel.nodes.concat(Array.from(this._addToCluster.values()));return this._currentNodesCount=t.filter(t=>!this._deleteFromCluster.has(t.endpoint)).length,t}getViewModel(){let t=0;return this.getAttached().map(e=>{const r=new u(e);return this._deleteFromCluster.has(e.endpoint)?r.isDeleted=!0:r.index=t++,this._localNodeEndpoint===e.endpoint&&(r.isLocal=!0),r})}getAvailable(t=!1){const e=this._clusterModel.nodes;return this._clusterModel.locations.filter(r=>{const n=!this.isPresentInList(e,r.endpoint),i=r.isAvailable,s=!this._addToCluster.has(r.endpoint),o=!!t||!this._deleteFromCluster.has(r.endpoint);return n&&i&&o&&s})}getAvailableNodeEndpoints(){return this.getAvailable().map(t=>t.endpoint)}getLocalNode(){return this._clusterModel.locations.find(t=>t.isLocal)}addToCluster(t){const e=t.endpoint;t.endpoint&&this.addToLocations(t),this._deleteFromCluster.has(e)?this._deleteFromCluster.delete(e):this._addToCluster.set(e,t)}addToLocations(t){const e=d.findIndexByEndpoint(this._clusterModel.locations,t.endpoint);-1===e?this._clusterModel.locations.push(t):this._clusterModel.locations.splice(e,1)}deleteFromCluster(t){const e=t.endpoint;this._addToCluster.has(e)?this._addToCluster.delete(e):this._deleteFromCluster.set(e,t)}getDeleteFromCluster(){return Array.from(this._deleteFromCluster.values())}getUpdateActions(){const t=Array.from(this._addToCluster.values()).map(t=>t.endpoint),e={addNodes:t,removeNodes:Array.from(this._deleteFromCluster.values()).map(t=>t.endpoint)},r=this.updateClusterConfiguration(t);return r&&(e.clusterConfiguration=r),e}updateClusterConfiguration(t){return this.hasCluster()?null:(this._clusterConfiguration.nodes=t,this._clusterConfiguration.toJSON())}getClusterConfiguration(){return this._clusterConfiguration}restoreFromDeletion(t){this._deleteFromCluster.delete(t.endpoint)}isChanged(){return this._addToCluster.size>0||this._deleteFromCluster.size>0}isPresentInList(t,e){return d.isPresentInList(t,e)}findByEndpoint(t,e){return d.findByEndpoint(t,e)}findIndexByEndpoint(t,e){return d.findIndexByEndpoint(t,e)}hasValidNodesCount(){return this._currentNodesCount>=this.MINIMUM_NODES_REQUIRED}canDeleteNode(){const t=Math.floor(this._clusterModel.nodes.length/2);return this._deleteFromCluster.size<t}hasCluster(){return this._clusterModel.hasCluster}}class u{constructor(t){this._item=t,this._endpoint=t.endpoint,this._isDeleted=!1,this._index=void 0,this._isLocal=!1}getEndPoint(){return this._item.endpoint}getAddress(){return void 0!==this._item._address?this._item._address:void 0!==this._item.rpcAddress?this._item.rpcAddress:null}isNode(){return void 0!==this._item._address}isLocation(){return void 0===this._item._address}getNodeState(){return this.isNode()?this._item._nodeState:null}getIsAvailable(){return this.isNode()?null:this._item.isAvailable}getTerm(){return this.isNode()?this._item.term:null}getSyncStatus(){return this.isNode()?this._item.syncStatus:null}getIsLocal(){return this.isNode()?null:this._item.isLocal}get item(){return this._item}get endpoint(){return this._endpoint}set endpoint(t){return this._endpoint=t}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}get index(){return this._index}set index(t){this._index=t}get isLocal(){return this._isLocal}set isLocal(t){this._isLocal=t}}class c{constructor({electionMinTimeout:t=8e3,electionRangeTimeout:e=6e3,heartbeatInterval:r=2e3,messageSizeKB:n=64,verificationTimeout:i=1500,transactionLogMaximumSizeGB:s=50,batchUpdateInterval:o=5e3,nodes:a=[],secondaryTag:l,primaryNodes:u}={}){this._electionMinTimeout=t,this._electionRangeTimeout=e,this._heartbeatInterval=r,this._messageSizeKB=n,this._verificationTimeout=i,this._transactionLogMaximumSizeGB=s,this._batchUpdateInterval=o,this._nodes=a,this._secondaryTag=l,this._primaryNodes=u}static fromJSON(t){return new c(t)}get electionMinTimeout(){return this._electionMinTimeout}set electionMinTimeout(t){this._electionMinTimeout=t}get electionRangeTimeout(){return this._electionRangeTimeout}set electionRangeTimeout(t){this._electionRangeTimeout=t}get heartbeatInterval(){return this._heartbeatInterval}set heartbeatInterval(t){this._heartbeatInterval=t}get messageSizeKB(){return this._messageSizeKB}set messageSizeKB(t){this._messageSizeKB=t}get verificationTimeout(){return this._verificationTimeout}set verificationTimeout(t){this._verificationTimeout=t}get transactionLogMaximumSizeGB(){return this._transactionLogMaximumSizeGB}set transactionLogMaximumSizeGB(t){this._transactionLogMaximumSizeGB=t}get nodes(){return this._nodes}set nodes(t){this._nodes=t}get batchUpdateInterval(){return this._batchUpdateInterval}set batchUpdateInterval(t){this._batchUpdateInterval=t}get secondaryTag(){return this._secondaryTag}set secondaryTag(t){this._secondaryTag=t}get primaryNodes(){return this._primaryNodes}set primaryNodes(t){this._primaryNodes=t}toJSON(){const t={electionMinTimeout:this._electionMinTimeout,electionRangeTimeout:this._electionRangeTimeout,heartbeatInterval:this._heartbeatInterval,messageSizeKB:this._messageSizeKB,verificationTimeout:this._verificationTimeout,transactionLogMaximumSizeGB:this._transactionLogMaximumSizeGB,batchUpdateInterval:this._batchUpdateInterval,nodes:this._nodes};return void 0!==this._secondaryTag&&(t.secondaryTag=this._secondaryTag),void 0!==this._primaryNodes&&(t.primaryNodes=this._primaryNodes),t}}class d{static isPresentInList(t,e){return t.some(t=>t.endpoint===e)}static findByEndpoint(t,e){return t.find(t=>t.endpoint===e)}static findIndexByEndpoint(t,e){return t.findIndex(t=>t.endpoint===e)}}},96:function(t,e,r){"use strict";r.r(e),r.d(e,"UPDATE_CLUSTER",(function(){return n})),r.d(e,"DELETE_CLUSTER",(function(){return i})),r.d(e,"CLICK_IN_VIEW",(function(){return s})),r.d(e,"NODE_SELECTED",(function(){return o})),r.d(e,"CREATE_CLUSTER",(function(){return a})),r.d(e,"MODEL_UPDATED",(function(){return l}));const n="updateCluster",i="deleteCluster",s="clickInView",o="nodeSelected",a="createCluster",l="modelUpdated"}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[49,138,141,187,190,191],{122:function(t,e){angular.module("graphdb.framework.core.directives.ascii-validator",[]).directive("asciiValidator",(function(){return{restrict:"A",require:"ngModel",link:function(t,e,s,i){function n(t){const e=/^[\x21-\x7E]*$/.test(t);return i.$setValidity("asciiValidator",e),t}i.$parsers.push(n),i.$formatters.push(n)}}}))},123:function(t,e){angular.module("graphdb.framework.core.directives.length-validator",[]).directive("lengthValidator",(function(){return{restrict:"A",require:"ngModel",link:function(t,e,s,i){function n(t){const e=s.minLength?parseInt(s.minLength,10):0,n=s.maxLength?parseInt(s.maxLength,10):1/0,r=t&&t.length>=e&&t.length<=n;return i.$setValidity("lengthValidator",r),t}i.$parsers.push(n),i.$formatters.push(n)}}}))},147:function(t,e,s){"use strict";s.r(e);s(122),s(123);var i=s(95),n=s(85);const r={minLen:"3",maxLen:"255"};function o(t,e,s,o,a,l,d){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-configuration/multi-region.html",scope:{clusterModel:"=",clusterConfiguration:"="},link:u=>{const c=[];u.topology=void 0,u.TopologyState=n.TopologyState,u.isAdmin=!1,u.addingTag=!1,u.loaderTimeout=void 0,u.secondaryTag=void 0,u.TagLengthConstraints=r,u.add=()=>{u.addingTag=!0},u.cancel=()=>{u.addingTag=!1},u.createTag=t=>{const s={tag:t};return m(!0),l.addCusterTag(s).then(()=>{o.success(e.instant("cluster_management.cluster_configuration_multi_region.created_tag",{tag:t}))}).catch(t=>{const s=getError(t);o.error(s,e.instant("cluster_management.cluster_configuration_multi_region.error.creating"))}).finally(()=>{u.addingTag=!1,m(!1)})},u.deleteTag=t=>{a.openSimpleModal({title:e.instant("cluster_management.cluster_configuration_multi_region.confirm.delete",{tag:t}),message:e.instant("cluster_management.cluster_configuration_multi_region.confirm.warning"),warning:!0,backdrop:"static",stopPropagation:!0}).result.then(()=>(m(!0),l.deleteClusterTag(t))).then(()=>o.success(e.instant("cluster_management.cluster_configuration_multi_region.deleted_tag",{tag:t}))).catch(t=>{if("cancel"===t||"escape key press"===t)return;const s=getError(t);o.error(s,e.instant("cluster_management.cluster_configuration_multi_region.error.deleting"))}).finally(()=>m(!1))},u.enableSecondaryMode=()=>{u.addingTag=!1;const t={title:e.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary"),message:e.instant("cluster_management.cluster_configuration_multi_region.confirm.enable_secondary_warning"),warning:!0,backdrop:"static",confirmButtonKey:"common.ok.btn",stopPropagation:!0};a.openSimpleModal(t).result.then(()=>_()).then(t=>(m(!0),l.enableSecondaryMode(t))).then(()=>o.success(e.instant("cluster_management.cluster_configuration_multi_region.secondary_enabled"))).catch(t=>{if("cancel"===t||"escape key press"===t)return;const s=getError(t);o.error(s,e.instant("cluster_management.cluster_configuration_multi_region.error.secondary"))}).finally(()=>m(!1))},u.disableSecondaryMode=()=>{a.openSimpleModal({title:e.instant("cluster_management.cluster_configuration_multi_region.confirm.disable_secondary_mode"),message:e.instant("cluster_management.cluster_configuration_multi_region.confirm.disable_secondary_mode_warning"),warning:!0,backdrop:"static",stopPropagation:!0}).result.then(()=>(m(!0),l.disableSecondaryMode())).then(()=>o.success(e.instant("cluster_management.cluster_configuration_multi_region.disabled_secondary_mode"))).catch(t=>{if("cancel"===t||"escape key press"===t)return;const s=getError(t);o.error(s,e.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>m(!1))};const _=()=>{const t={title:e.instant("cluster_management.cluster_configuration_multi_region.secondary_cluster_settings"),templateUrl:"js/angular/clustermanagement/templates/modal/secondary-mode-modal.html",controller:function(t,e,s){t.rpcAddress="",t.tag="",t.title=s.title,t.onClick=t=>t.stopPropagation(),t.ok=()=>{e.close({primaryNode:t.rpcAddress,tag:t.tag})},t.cancel=()=>{e.dismiss("cancel")}},size:"lg",warning:!0,backdrop:"static"};return a.openCustomModal(t).result},g=t=>{m(!0),l.getClusterConfig().then(e=>{u.secondaryTag=i.ClusterConfiguration.fromJSON(e.data).secondaryTag,(t=>{const e=t.nodes.find(t=>t.nodeState===n.NodeState.LEADER);u.topology=e.topologyStatus})(i.ClusterModel.fromJSON(t))}).catch(t=>{const s=getError(t);o.error(s,e.instant("cluster_management.cluster_configuration_multi_region.error.disabling"))}).finally(()=>m(!1))},h=t=>{t||(u.addingTag=!1)},m=(t,e)=>{s.cancel(u.loaderTimeout),t?(u.loaderMessage=e,u.loaderTimeout=s(()=>{u.loader=t},150)):u.loader=!1};u.$on("$destroy",(function(){c.forEach(t=>t())}));u.isAdmin=t.isAuthenticated()&&t.isAdmin(),c.push(u.$watch("clusterModel",(function(t,e){t!==e&&g(t)}),!0)),c.push(d.onShowClusterConfigurationPanel(h)),g(u.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",o),o.$inject=["$jwtAuth","$translate","$timeout","toastr","ModalService","ClusterRestService","ClusterViewContextService"]},85:function(t,e,s){"use strict";s.r(e),s.d(e,"NodeState",(function(){return i})),s.d(e,"RecoveryState",(function(){return n})),s.d(e,"LinkState",(function(){return r})),s.d(e,"TopologyState",(function(){return o}));const i={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"},n={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"},r={IN_SYNC:"IN_SYNC",OUT_OF_SYNC:"OUT_OF_SYNC",SYNCING:"SYNCING",NO_CONNECTION:"NO_CONNECTION",RECEIVING_SNAPSHOT:"RECEIVING_SNAPSHOT"},o={PRIMARY_NODE:"PRIMARY_NODE",SECONDARY_NODE:"SECONDARY_NODE"}},95:function(t,e,s){"use strict";s.r(e),s.d(e,"Location",(function(){return i})),s.d(e,"Node",(function(){return n})),s.d(e,"TopologyStatus",(function(){return r})),s.d(e,"Link",(function(){return o})),s.d(e,"ClusterModel",(function(){return a})),s.d(e,"ClusterViewModel",(function(){return l})),s.d(e,"ClusterItemViewModel",(function(){return d})),s.d(e,"ClusterConfiguration",(function(){return u}));class i{constructor(t,e=null,s=null,i=!1,n=!1){this._endpoint=t,this._rpcAddress=e,this._error=s,this._isAvailable=i,this._isLocal=n}get isLocal(){return this._isLocal}get endpoint(){return this._endpoint}get rpcAddress(){return this._rpcAddress}get error(){return this._error}get isAvailable(){return this._isAvailable}set endpoint(t){this._endpoint=t}set rpcAddress(t){this._rpcAddress=t}set error(t){this._error=t}set isAvailable(t){this._isAvailable=t}set isLocal(t){this._isLocal=t}static fromJSON({endpoint:t,rpcAddress:e,error:s=null,isAvailable:n=!1,isLocal:r=!1}){return new i(t,e,s,n,r)}}class n{constructor(t,e,s,i,n,o,a,l,d){this._address=t,this._nodeState=e,this._term=s,this._syncStatus=i,this._lastLogTerm=n,this._lastLogIndex=o,this._endpoint=a,this._recoveryStatus=l,this._topologyStatus=r.fromJSON(d)}get address(){return this._address}get nodeState(){return this._nodeState}get term(){return this._term}get syncStatus(){return this._syncStatus}get lastLogTerm(){return this._lastLogTerm}get lastLogIndex(){return this._lastLogIndex}get endpoint(){return this._endpoint}get recoveryStatus(){return this._recoveryStatus}set address(t){this._address=t}set nodeState(t){this._nodeState=t}set term(t){this._term=t}set syncStatus(t){this._syncStatus=t}set lastLogTerm(t){this._lastLogTerm=t}set lastLogIndex(t){this._lastLogIndex=t}set endpoint(t){this._endpoint=t}set recoveryStatus(t){this._recoveryStatus=t}get topologyStatus(){return this._topologyStatus}set topologyStatus(t){return this._topologyStatus=t}static fromJSON({address:t,nodeState:e,term:s,syncStatus:i,lastLogTerm:r,lastLogIndex:o,endpoint:a,recoveryStatus:l,topologyStatus:d}){return new n(t,e,s,i,r,o,a,l,d)}}class r{constructor(t,e=new Map,s,i){this._state=t,this._primaryTags=e,this._primaryIndex=s,this._primaryLeader=i}get state(){return this._state}get primaryTags(){return this._primaryTags}get primaryIndex(){return this._primaryIndex}get primaryLeader(){return this._primaryLeader}static fromJSON({state:t,primaryTags:e={},primaryIndex:s,primaryLeader:i}){const n=Object.entries(e);return new r(t,n,s,i)}}class o{constructor(t,e,s,i){this._id=t,this._source=e,this._target=s,this._status=i}static fromJSON({id:t,source:e,target:s,status:i}){return new o(t,e,s,i)}}class a{constructor(t,e,s,i){this._locations=t,this._hasCluster=e,this._nodes=s,this._links=i}get locations(){return this._locations}set locations(t){this._locations=t}get hasCluster(){return this._hasCluster}set hasCluster(t){this._hasCluster=t}get nodes(){return this._nodes}set nodes(t){this._nodes=t}get links(){return this._links}set links(t){this._links=t}static fromJSON(t){const e=t.locations.map(i.fromJSON),s=t.nodes.map(n.fromJSON),r=t.links.map(o.fromJSON);return new a(e,t.hasCluster,s,r)}}class l{constructor(t){this._clusterModel=a.fromJSON(t),this._addToCluster=new Map,this._deleteFromCluster=new Map,this._currentNodesCount=0,this._clusterConfiguration=new u,this._localNodeEndpoint=t.locations.find(t=>t.isLocal).endpoint,this.MINIMUM_NODES_REQUIRED=2}getAttached(){const t=this._clusterModel.nodes.concat(Array.from(this._addToCluster.values()));return this._currentNodesCount=t.filter(t=>!this._deleteFromCluster.has(t.endpoint)).length,t}getViewModel(){let t=0;return this.getAttached().map(e=>{const s=new d(e);return this._deleteFromCluster.has(e.endpoint)?s.isDeleted=!0:s.index=t++,this._localNodeEndpoint===e.endpoint&&(s.isLocal=!0),s})}getAvailable(t=!1){const e=this._clusterModel.nodes;return this._clusterModel.locations.filter(s=>{const i=!this.isPresentInList(e,s.endpoint),n=s.isAvailable,r=!this._addToCluster.has(s.endpoint),o=!!t||!this._deleteFromCluster.has(s.endpoint);return i&&n&&o&&r})}getAvailableNodeEndpoints(){return this.getAvailable().map(t=>t.endpoint)}getLocalNode(){return this._clusterModel.locations.find(t=>t.isLocal)}addToCluster(t){const e=t.endpoint;t.endpoint&&this.addToLocations(t),this._deleteFromCluster.has(e)?this._deleteFromCluster.delete(e):this._addToCluster.set(e,t)}addToLocations(t){const e=c.findIndexByEndpoint(this._clusterModel.locations,t.endpoint);-1===e?this._clusterModel.locations.push(t):this._clusterModel.locations.splice(e,1)}deleteFromCluster(t){const e=t.endpoint;this._addToCluster.has(e)?this._addToCluster.delete(e):this._deleteFromCluster.set(e,t)}getDeleteFromCluster(){return Array.from(this._deleteFromCluster.values())}getUpdateActions(){const t=Array.from(this._addToCluster.values()).map(t=>t.endpoint),e={addNodes:t,removeNodes:Array.from(this._deleteFromCluster.values()).map(t=>t.endpoint)},s=this.updateClusterConfiguration(t);return s&&(e.clusterConfiguration=s),e}updateClusterConfiguration(t){return this.hasCluster()?null:(this._clusterConfiguration.nodes=t,this._clusterConfiguration.toJSON())}getClusterConfiguration(){return this._clusterConfiguration}restoreFromDeletion(t){this._deleteFromCluster.delete(t.endpoint)}isChanged(){return this._addToCluster.size>0||this._deleteFromCluster.size>0}isPresentInList(t,e){return c.isPresentInList(t,e)}findByEndpoint(t,e){return c.findByEndpoint(t,e)}findIndexByEndpoint(t,e){return c.findIndexByEndpoint(t,e)}hasValidNodesCount(){return this._currentNodesCount>=this.MINIMUM_NODES_REQUIRED}canDeleteNode(){const t=Math.floor(this._clusterModel.nodes.length/2);return this._deleteFromCluster.size<t}hasCluster(){return this._clusterModel.hasCluster}}class d{constructor(t){this._item=t,this._endpoint=t.endpoint,this._isDeleted=!1,this._index=void 0,this._isLocal=!1}getEndPoint(){return this._item.endpoint}getAddress(){return void 0!==this._item._address?this._item._address:void 0!==this._item.rpcAddress?this._item.rpcAddress:null}isNode(){return void 0!==this._item._address}isLocation(){return void 0===this._item._address}getNodeState(){return this.isNode()?this._item._nodeState:null}getIsAvailable(){return this.isNode()?null:this._item.isAvailable}getTerm(){return this.isNode()?this._item.term:null}getSyncStatus(){return this.isNode()?this._item.syncStatus:null}getIsLocal(){return this.isNode()?null:this._item.isLocal}get item(){return this._item}get endpoint(){return this._endpoint}set endpoint(t){return this._endpoint=t}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}get index(){return this._index}set index(t){this._index=t}get isLocal(){return this._isLocal}set isLocal(t){this._isLocal=t}}class u{constructor({electionMinTimeout:t=8e3,electionRangeTimeout:e=6e3,heartbeatInterval:s=2e3,messageSizeKB:i=64,verificationTimeout:n=1500,transactionLogMaximumSizeGB:r=50,batchUpdateInterval:o=5e3,nodes:a=[],secondaryTag:l,primaryNodes:d}={}){this._electionMinTimeout=t,this._electionRangeTimeout=e,this._heartbeatInterval=s,this._messageSizeKB=i,this._verificationTimeout=n,this._transactionLogMaximumSizeGB=r,this._batchUpdateInterval=o,this._nodes=a,this._secondaryTag=l,this._primaryNodes=d}static fromJSON(t){return new u(t)}get electionMinTimeout(){return this._electionMinTimeout}set electionMinTimeout(t){this._electionMinTimeout=t}get electionRangeTimeout(){return this._electionRangeTimeout}set electionRangeTimeout(t){this._electionRangeTimeout=t}get heartbeatInterval(){return this._heartbeatInterval}set heartbeatInterval(t){this._heartbeatInterval=t}get messageSizeKB(){return this._messageSizeKB}set messageSizeKB(t){this._messageSizeKB=t}get verificationTimeout(){return this._verificationTimeout}set verificationTimeout(t){this._verificationTimeout=t}get transactionLogMaximumSizeGB(){return this._transactionLogMaximumSizeGB}set transactionLogMaximumSizeGB(t){this._transactionLogMaximumSizeGB=t}get nodes(){return this._nodes}set nodes(t){this._nodes=t}get batchUpdateInterval(){return this._batchUpdateInterval}set batchUpdateInterval(t){this._batchUpdateInterval=t}get secondaryTag(){return this._secondaryTag}set secondaryTag(t){this._secondaryTag=t}get primaryNodes(){return this._primaryNodes}set primaryNodes(t){this._primaryNodes=t}toJSON(){const t={electionMinTimeout:this._electionMinTimeout,electionRangeTimeout:this._electionRangeTimeout,heartbeatInterval:this._heartbeatInterval,messageSizeKB:this._messageSizeKB,verificationTimeout:this._verificationTimeout,transactionLogMaximumSizeGB:this._transactionLogMaximumSizeGB,batchUpdateInterval:this._batchUpdateInterval,nodes:this._nodes};return void 0!==this._secondaryTag&&(t.secondaryTag=this._secondaryTag),void 0!==this._primaryNodes&&(t.primaryNodes=this._primaryNodes),t}}class c{static isPresentInList(t,e){return t.some(t=>t.endpoint===e)}static findByEndpoint(t,e){return t.find(t=>t.endpoint===e)}static findIndexByEndpoint(t,e){return t.findIndex(t=>t.endpoint===e)}}}}]);
|