(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{72:function(t,r,e){"use strict";e.r(r);e(33);function n(t,r,e,n,o){return{addLocation:function(){let t;return e.open({templateUrl:"js/angular/templates/modal/add-location.html",windowClass:"addLocationDialog",controller:"AddLocationFromClusterCtrl"}).result.then(e=>(t=e,t.isLocal=!1,t.endpoint=t.uri,function(t){let e;return n.addLocation(t).catch(t=>{const e=getError(t.data,t.status);return r.error(e,o.instant("common.error")),!1}).then(t=>!!t&&a()).then(r=>{if(!1!==r)return e=r.find(r=>r.endpoint===t.uri),e})}(t)))},getLocationsWithRpcAddresses:a};function a(){return n.getLocations().then((function(t){return t.data.map(t=>({isLocal:t.local,endpoint:t.uri,rpcAddress:t.rpcAddress||"",error:t.errorMsg}))})).catch((function(t){const e=getError(t.data,t.status);r.error(e,o.instant("common.error"))})).then(t=>{if(t)return function(t){const r=t.filter(t=>!t.isLocal&&!t.error).map(t=>function(t){return n.getLocationRpcAddress(t.endpoint)}(t).then(r=>(t.rpcAddress=r.data,t.isAvailable=!0,t)).catch(r=>{t.isAvailable=!1,t.error=getError(r.data,r.status)}));return Promise.allSettled(r).then(()=>t)}(t)})}}angular.module("graphdb.framework.clustermanagement.services.remote-locations",[]).factory("RemoteLocationsService",n),n.$inject=["$http","toastr","$uibModal","LocationsRestService","$translate"]}}]);