(window.webpackJsonp=window.webpackJsonp||[]).push([[55,94],{138:function(o,t,e){"use strict";e.r(t);e(72);function n(o,t,e,n,r){const a=_.cloneDeep(e.clusterConfiguration),s=_.cloneDeep(e.clusterModel);o.nodes=[],o.clusterNodes=s.nodes.map(o=>({rpcAddress:o.address,endpoint:o.endpoint})),o.locations=s.locations.filter(o=>!a.nodes.includes(o.rpcAddress)),o.locations.forEach(o=>o.isNew=!0),o.deleteLocation=function(t,n){t.preventDefault(),t.stopPropagation(),e.deleteLocation(n).then(()=>o.locations=o.locations.filter(o=>o.endpoint!==n.endpoint))},o.addNodeToList=function(t){t.rpcAddress&&(o.nodes.push(t),o.locations=o.locations.filter(o=>o.endpoint!==t.endpoint))},o.removeNodeFromList=function(t,e){o.nodes.splice(t,1),o.locations.push(e)},o.addLocation=function(){r.addLocation().then(t=>{t&&o.locations.push(t)})},o.ok=function(){t.close(o.nodes)},o.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.clustermanagement.controllers.add-nodes",[]).controller("AddNodesDialogCtrl",n),n.$inject=["$scope","$uibModalInstance","data","$uibModal","RemoteLocationsService"]},72:function(o,t,e){"use strict";e.r(t);e(33);function n(o,t,e,n,r){return{addLocation:function(){let o;return e.open({templateUrl:"js/angular/templates/modal/add-location.html",windowClass:"addLocationDialog",controller:"AddLocationFromClusterCtrl"}).result.then(e=>(o=e,o.isLocal=!1,o.endpoint=o.uri,function(o){let e;return n.addLocation(o).catch(o=>{const e=getError(o.data,o.status);return t.error(e,r.instant("common.error")),!1}).then(o=>!!o&&a()).then(t=>{if(!1!==t)return e=t.find(t=>t.endpoint===o.uri),e})}(o)))},getLocationsWithRpcAddresses:a};function a(){return n.getLocations().then((function(o){return o.data.map(o=>({isLocal:o.local,endpoint:o.uri,rpcAddress:o.rpcAddress||"",error:o.errorMsg}))})).catch((function(o){const e=getError(o.data,o.status);t.error(e,r.instant("common.error"))})).then(o=>{if(o)return function(o){const t=o.filter(o=>!o.isLocal&&!o.error).map(o=>function(o){return n.getLocationRpcAddress(o.endpoint)}(o).then(t=>(o.rpcAddress=t.data,o.isAvailable=!0,o)).catch(t=>{o.isAvailable=!1,o.error=getError(t.data,t.status)}));return Promise.allSettled(t).then(()=>o)}(o)})}}angular.module("graphdb.framework.clustermanagement.services.remote-locations",[]).factory("RemoteLocationsService",n),n.$inject=["$http","toastr","$uibModal","LocationsRestService","$translate"]}}]);