graphdb-workbench 2.6.1 → 2.6.2-RC2
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/{10.2f1b7b3050f428758cd0.bundle.js → 10.c86a39a390b36ec08b90.bundle.js} +1 -1
- package/dist/{119.771db56d499dcdf1c953.bundle.js → 119.e2a1ccb260af6cddd91c.bundle.js} +1 -1
- package/dist/12.72b1cf9c0b2a0cf0e39b.bundle.js +1 -0
- package/dist/123.eb8114707f15749a90ae.bundle.js +1 -0
- package/dist/131.f41a0b6b9036447b1077.bundle.js +1 -1
- package/dist/{16.028d7ea5baf358e315cb.bundle.js → 16.af6bc53be819045291bd.bundle.js} +1 -1
- package/dist/21.72126081137288bb650e.bundle.js +1 -0
- package/dist/{23.91ef26cbbdeac17b5756.bundle.js → 23.a5165fa6e171a8db712b.bundle.js} +1 -1
- package/dist/242.a006b1c147b0cb957175.bundle.js +1 -0
- package/dist/25.5a98f7b1bf5b195fa51f.bundle.js +1 -0
- package/dist/257.943f597bddc0d65103c5.bundle.js +1 -1
- package/dist/259.2c88332b7f1b47935a47.bundle.js +1 -1
- package/dist/26.8bd9dc57add455291ab8.bundle.js +1 -0
- package/dist/260.d745422c537bdd9647bb.bundle.js +1 -1
- package/dist/261.7efff7f93f61f061f5ca.bundle.js +1 -1
- package/dist/27.92bfb161b420732902a3.bundle.js +1 -1
- package/dist/28.2e0277168c8f14f9c085.bundle.js +1 -1
- package/dist/288.6cef162ec3cec3cde603.bundle.js +1 -1
- package/dist/31.1e6ed4b31ac8c0dc44cd.bundle.js +1 -0
- package/dist/40.53352fda81f370182e99.bundle.js +1 -1
- package/dist/5.f15016e5e47214a9bc88.bundle.js +1 -0
- package/dist/63.dbce2c16115eac52fed2.bundle.js +1 -1
- package/dist/{7.15f6406e6baaef520b7f.bundle.js → 7.112cbad7864c8da551d3.bundle.js} +1 -1
- package/dist/96.53f0a874878aedfa987a.bundle.js +1 -0
- package/dist/{bundle.3aedab803b7c4896e885.bundle.js → bundle.605dddf42bf0eefaa4ec.bundle.js} +2 -2
- package/dist/css/aclmanagement.css +5 -0
- package/dist/css/bootstrap-graphdb-theme-dark-auto.css +4 -0
- package/dist/css/clustermanagement.css +5 -1
- package/dist/css/create-similarity-index.css +4 -0
- package/dist/css/graphs-config.css +4 -0
- package/dist/css/jdbc-create.css +4 -0
- package/dist/css/lib/ontotext-yasgui-web-component.css +4 -0
- package/dist/css/sparql-templates.css +4 -0
- package/dist/i18n/locale-en.json +2 -1
- package/dist/i18n/locale-fr.json +2 -1
- package/dist/index.html +4 -4
- 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/security/templates/user.html +1 -1
- package/dist/license-checker.json +4 -4
- package/dist/{main.cd9080d130335332d006.css → main.b830c2fc237abd684f41.css} +1 -1
- 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 +8 -5
- 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 +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +1 -1
- 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/webapi.html +2 -2
- package/dist/plugins.js +16 -23
- package/dist/res/swagger/index.html +27 -27
- package/package.json +2 -2
- package/dist/12.75466fc44ea53c351a67.bundle.js +0 -1
- package/dist/123.2610627b06c4276727b1.bundle.js +0 -1
- package/dist/21.6fc8ebce5e63eedb5f9e.bundle.js +0 -1
- package/dist/242.eafa039a4e07364e4a8f.bundle.js +0 -1
- package/dist/25.f5a19d06088f0938fc9f.bundle.js +0 -1
- package/dist/26.85a305c95834a8a1a05a.bundle.js +0 -1
- package/dist/31.2c95be2edb9c756e0f13.bundle.js +0 -1
- package/dist/5.f58f4e96c07a6a7a0e06.bundle.js +0 -1
- package/dist/96.e01346a08ab153a02364.bundle.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[25,170,189,190,221,233],{123:function(e,t,r){"use strict";r.r(t),r.d(t,"SparqlTemplateError",(function(){return a}));class a extends Error{}},124:function(e,t,r){"use strict";r.r(t),r.d(t,"DEFAULT_SPARQL_QUERY",(function(){return a})),r.d(t,"SparqlTemplateInfo",(function(){return n}));const a="PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX ex: <http://example.com#>\nDELETE {\n ?subject ex:myPredicate ?oldValue .\n} INSERT {\n ?subject ex:myPredicate ?newValue .\n} WHERE {\n ?id rdf:type ex:MyType .\n ?subject ex:isRelatedTo ?id .\n}\n";class n{constructor(e=a,t=!0,r){this.query=e,this.templateID=r,this.isNewTemplate=t,this.templateExist=!1,this.isValidTemplateId=!0,this.isValidQuery=!0,this.isValidQueryMode=!0}}},196:function(e,t){angular.module("graphdb.framework.rest.sparql-templates.service",[]).factory("SparqlTemplatesRestService",r),r.$inject=["$http"];function r(e){return{getSparqlTemplates:function(t){return e.get(`rest/repositories/${t}/sparql-templates`)},getSparqlTemplate:function(t,r){return e.get(`rest/repositories/${r}/sparql-templates/configuration`,{params:{templateID:t}})},createSparqlTemplate:function(t,r){return e.post(`rest/repositories/${r}/sparql-templates`,{templateID:t.templateID,query:t.query})},updateSparqlTemplate:function(t,r){return e.put(`rest/repositories/${r}/sparql-templates`,t.query,{params:{templateID:t.templateID},headers:{"Content-Type":"text/plain"}})},deleteSparqlTemplate:function(t,r){return e.delete(`rest/repositories/${r}/sparql-templates`,{params:{templateID:t}})}}}},198:function(e,t,r){"use strict";r.r(t);r(7),r(24),r(28),r(64),r(27),r(32);var a=r(0),n=r(124),s=r(123),i=r(62),l=r(61),o=r(14);function p(e,t,r,a,n,s,i){e.pluginName="sparql-template",e.setPluginIsActive=function(t){e.pluginIsActive=t},e.getSparqlTemplates=function(){s.isLicenseValid()&&t.getActiveRepository()&&!t.isActiveRepoOntopType()&&!t.isActiveRepoFedXType()?r.getSparqlTemplates(t.getActiveRepository()).success((function(t){e.sparqlTemplateIds=t})).error((function(e){const t=getError(e);a.error(t,i.instant("sparql.template.get.templates.error"))})):e.sparqlTemplateIds=[]},e.$watch((function(){return t.getActiveRepository()}),(function(){e.getSparqlTemplates()})),e.deleteTemplate=function(s){n.openSimpleModal({title:i.instant("common.warning"),message:i.instant("sparql.template.delete.template.warning",{templateID:s}),warning:!0}).result.then((function(){r.deleteSparqlTemplate(s,t.getActiveRepository()).success((function(){a.success(s,i.instant("sparql.template.delete.template.success")),e.getSparqlTemplates()})).error((function(e){a.error(getError(e),i.instant("sparql.template.delete.template.failure",{templateID:s}))}))}))}}function c(e,t,r,p,c,m,u,d,f,g,q,T,h,I,w,y){e.initialQuery=n.DEFAULT_SPARQL_QUERY,e.sparqlTemplateInfo=new n.SparqlTemplateInfo(e.initialQuery),e.title="",e.saveOrUpdateExecuted=!1,e.isDirty=!1,e.language=y.getLanguage(),e.canEditActiveRepo=!1;let v=!0;e.saveTemplate=function(){e.saveOrUpdateExecuted=!0,$()||C();const t=e.sparqlTemplateInfo.isNewTemplate?S:P;x(e.sparqlTemplateInfo).then(k).then(R).then(Q).then(t).then(M).catch(e=>{e instanceof s.SparqlTemplateError||console.log(e)})},e.isTemplateIdValid=e=>q.isValidIri(e,e.toString()),e.markDirty=()=>{e.isDirty=!0},e.markPristine=()=>{e.isDirty=!1};const E=(t,r=n.DEFAULT_SPARQL_QUERY)=>{e.sparqlTemplateInfo.query=r,e.sparqlTemplateInfo.templateID=V(),e.sparqlTemplateInfo.isNewTemplate=!e.sparqlTemplateInfo.templateID,j(),e.yasguiConfig={showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,yasqeActionButtons:o.DISABLE_YASQE_BUTTONS_CONFIGURATION,showQueryButton:!1,initialQuery:e.sparqlTemplateInfo.query,componentId:"sparql-template",prefixes:t,render:l.RenderingMode.YASQE,maxPersistentResponseSize:0,yasqeMode:e.canEditActiveRepo?i.YasqeMode.WRITE:i.YasqeMode.PROTECTED}},S=e=>D(e).then(b).then(A),D=t=>f.getSparqlTemplates(c.getActiveRepository()).then((function(r){return t.templateExist=r.data.find(t=>t===e.sparqlTemplateInfo.templateID),t})).catch((function(e){const t=getError(e);return p.error(t,h.instant("sparql.template.get.templates.error")),Promise.reject(new s.SparqlTemplateError("Failed to retrieve sparql templates."))})),R=e=>U().isQueryValid().then(t=>(e.isValidQuery=t,e.isValidQuery?e:Promise.reject(new s.SparqlTemplateError("Invalid query.")))),$=()=>e.sparqlTemplateInfo.isNewTemplate||e.isDirty,b=e=>new Promise((t,r)=>{if(e.templateExist){const n=Object(a.decodeHTML)(h.instant("sparql.template.existing.template.error",{templateID:e.templateID})),i=h.instant("common.confirm.save");F(i,n,()=>t(e),()=>r(new s.SparqlTemplateError("Save not confirmed.")))}else t(e)});function A(t){return f.createSparqlTemplate(t,c.getActiveRepository()).then((function(){return t.isNewTemplate=!1,e.markPristine(),p.success(t.templateID,h.instant("save.sparql.template.success.msg")),t})).catch((function(e){const r=getError(e);return p.error(r,h.instant("save.sparql.template.failure.msg",{templateID:t.templateID})),Promise.reject(new s.SparqlTemplateError("Failed to save the new template: "+t.templateID))}))}const P=t=>f.updateSparqlTemplate(t,c.getActiveRepository()).then((function(){return t.isNewTemplate=!1,e.markPristine(),p.success(e.sparqlTemplateInfo.templateID,h.instant("update.sparql.template.success.msg")),t})).catch((function(e){const r=getError(e);return p.error(r,h.instant("save.sparql.template.failure.msg",{templateID:t.templateID})),Promise.reject(new s.SparqlTemplateError("Failed to update the template: "+t.templateID))})),k=e=>U().getQuery().then(t=>(e.query=t,e)),Q=e=>U().getQueryMode().then(t=>(e.isValidQueryMode="update"===t,e.isValidQueryMode?e:Promise.reject(new s.SparqlTemplateError("Query mode is not valid.")))),x=t=>new Promise((r,a)=>{t.templateID?(t.isValidTemplateId=e.isTemplateIdValid(t.templateID),t.isValidTemplateId?r(t):a(new s.SparqlTemplateError("Template identifier is not valid."))):a(new s.SparqlTemplateError("A required template identifier is missing."))}),M=()=>{setTimeout((function(){C()}),1e3)},V=()=>{const e=r.hash()||"";return(r.search().templateID||"")+(e?"#"+e:"")},j=()=>{e.title=(e.sparqlTemplateInfo.templateID?h.instant("edit"):h.instant("common.create.btn"))+" "+h.instant("view.sparql.template.title")},C=()=>{r.url("/sparql-templates")},L=(t,r)=>{e.queryIsRunning=t,e.loaderMessage=e.queryIsRunning?r:""},U=()=>o.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor"),F=(e,t,r,a)=>{T.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(a)&&a()}))},N=()=>{window.removeEventListener("beforeunload",O),Y.forEach(e=>e())},O=t=>{e.isDirty&&(t.returnValue=!0)},Y=[];Y.push(e.$on("queryChanged",(t,r)=>{r.dirty?e.markDirty():e.markPristine()})),Y.push(t.$on("$translateChangeSuccess",()=>{e.language=y.getLanguage(),j()})),Y.push(e.$on("$locationChangeStart",(t,a)=>{if(e.isDirty){t.preventDefault();const e=h.instant("common.confirm"),n=h.instant("jdbc.warning.unsaved.changes");F(e,n,()=>{N();const e=r.absUrl().length-r.url().length,t=a.substring(e);r.path(t)})}else N()})),Y.push(w.subscribe("repositoryWillChangeEvent",t=>new Promise((function(r){if(e.sparqlTemplateInfo.isNewTemplate)return void r(t);const a=()=>{e.isDirty=!1,C(),r(t)};if(e.isDirty){const e=()=>{t.cancel=!0,r(t)},n=h.instant("common.confirm"),s=h.instant("jdbc.warning.unsaved.changes");F(n,s,a,e)}else a()})))),Y.push(e.$on("$destroy",N)),window.addEventListener("beforeunload",O);const _=()=>{const t=`${h.instant("common.refreshing.namespaces")}. ${h.instant("common.extra.message")}`;L(!0,t),e.sparqlTemplateInfo.templateID=V();const r=c.getActiveRepository();e.sparqlTemplateInfo.templateID?Promise.all([c.getPrefixes(r),f.getSparqlTemplate(e.sparqlTemplateInfo.templateID,r)]).then(([e,t])=>E(e,t.data)).finally(()=>L(!1)):c.getPrefixes(r).then(e=>E(e)).finally(()=>L(!1))};Y.push(e.$watch(e.getActiveRepositoryObject,t=>{t&&(e.canEditActiveRepo=e.canWriteActiveRepo(),v?(_(),v=!1):C())}))}angular.module("graphdb.framework.sparql-template.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr","graphdb.framework.utils.event-emitter-service"],["graphdb.framework.utils.notifications"]).controller("SparqlTemplatesCtrl",p).controller("SparqlTemplateCreateCtrl",c),p.$inject=["$scope","$repositories","SparqlTemplatesRestService","toastr","ModalService","$licenseService","$translate"],c.$inject=["$scope","$rootScope","$location","toastr","$repositories","$window","$timeout","$interval","SparqlTemplatesRestService","RDF4JRepositoriesRestService","UriUtils","ModalService","$translate","$q","EventEmitterService","$languageService"]},283:function(e,t,r){"use strict";r.r(t);r(7),r(25),r(126),r(24),r(198),r(196),r(27),r(78);angular.module("graphdb.framework.sparql-template",["toastr","ui.bootstrap","graphdb.framework.sparql-template.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.rest.sparql-templates.service","graphdb.framework.utils.uriutils","graphdb.framework.core.directives.yasgui-component"])},62:function(e,t,r){"use strict";r.r(t),r.d(t,"YasqeMode",(function(){return a}));const a={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},64:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise(a=>{e.success(t.instant(r)),setTimeout(a,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[26,64,136,163,164,170,233],{158:function(e,r,t){"use strict";t.r(r);t(64),t(10);var s=t(62),a=t(61),i=t(14),n=t(73),o=t(93);function u(e,r,t,u,p,c,d,h,g,y,l,Q,f,m,I,w){let R;e.newConfig=new n.GraphsConfig,e.revertConfig=void 0,e.page=1,e.totalPages=5,e.helpHidden=1===f.get(m.HIDE_GRAPH_CONFIG_HELP),e.isUpdate=!1,e.shared=!1,e.canEditActiveRepo=e.canWriteActiveRepo(),e.samples=[],e.tabConfig={inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs},e.getAutocompletePromise=void 0,e.getNamespacesPromise=void 0,e.tabsViewModel=[{page:1,label:I.instant("starting.point.label"),type:"startGraphQuery"},{page:2,label:I.instant("graph.expansion"),type:"expandQuery"},{page:3,label:I.instant("node.basics"),type:"resourceQuery"},{page:4,label:I.instant("edge.basics"),type:"predicateLabelQuery"},{page:5,label:I.instant("node.extra"),type:"resourcePropertiesQuery"}];const _=y.configName,C=p.getActiveRepository();e.toggleHelp=r=>{void 0===r&&(r=f.get(m.HIDE_GRAPH_CONFIG_HELP)),1!==r?(f.set(m.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(f.set(m.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=(r,t)=>{e.newConfig.startIRI=r,e.newConfig.startIRILabel=t,R=!0},e.isDefaultGraph=e=>e.isDefaultGraph(),e.isUserGraph=e=>!e.isDefaultGraph(),e.getSampleName=(e,r)=>{if(!e)return"";const t=e.getPropertyDescription(r);return t||(e.id?"Copy of "+e.name:e.name)},e.createGraphConfig=e=>{h.createGraphConfig(e).success((async function(){await l.showToastMessageWithDelay("graphexplore.saved.new.config"),t.url("graphs-visualizations")})).error((function(e){u.error(getError(e),I.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=e=>{h.updateGraphConfig(e).success((async function(){await l.showToastMessageWithDelay("graphexplore.saved.config"),t.url("graphs-visualizations")})).error((function(e){u.error(getError(e),I.instant("graphexplore.error.could.not.save"))}))},e.goToPage=r=>{e.page!==r&&M(()=>{e.showEditor(),e.page=r})},e.goToPreviousPage=()=>{e.page>1&&e.goToPage(e.page-1),N()&&(R=!1)},e.goToNextPage=()=>{T(),e.newConfig.isStartMode(n.StartMode.NODE)&&!R||e.goToPage(e.page+1)},e.saveGraphConfig=()=>{T(),N()&&!R||(e.newConfig.startQueryIncludeInferred=e.tabConfig.inference,e.newConfig.startQuerySameAs=e.tabConfig.sameAs,M(()=>{e.newConfig.name?(e.queryEditorIsDirty=!1,e.isUpdate?e.updateGraphConfig(e.newConfig.toSavePayload()):e.createGraphConfig(e.newConfig.toSavePayload())):P(I.instant("graphexplore.provide.config.name"))}))},e.setQuery=async r=>{const t=r||" ";(await E()).setQuery(t),e.markDirty()},e.markDirty=async()=>{if(e.revertConfig){const r=e.revertConfig.getQueryType(e.page),t=await v();e.queryEditorIsDirty=r!==t}},e.showEditor=()=>{e.viewMode="yasr",A(),b()},e.showPreview=()=>{e.viewMode="editor",S()},e.revertEditor=()=>{e.setQuery(e.revertConfig.getQueryType(e.page)),e.queryEditorIsDirty=!1};const E=()=>i.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor"),S=async(r,t)=>{const s=await E(),a=await s.getQueryType();if(t&&"SELECT"!==a&&"CONSTRUCT"!==a&&"DESCRIBE"!==a)return void u.warning(I.instant("query.editor.warning.msg"));"update"!==await s.getQueryMode()?e.queryIsRunning||(e.viewMode="editor",D()):u.warning(I.instant("cannot.execute.update.error"))},D=async()=>{(await E()).query(a.RenderingMode.YASR)},b=async()=>(await E()).changeRenderMode(a.RenderingMode.YASQE),v=async()=>(await E()).getQuery(),A=async()=>(await E()).abortQuery(),M=async r=>{const t=await(async()=>{const r=await E();let t=await r.getQuery();return t=t.trim(),e.newConfig.updateModel(t,e.page)})();1===e.page?t.isStartMode(n.StartMode.NODE)&&!t.startIRI?P(I.instant("graphexplore.select.start.node")):t.isStartMode(n.StartMode.QUERY)&&!t.startGraphQuery?P(I.instant("graphexplore.provide.query")):t.isStartMode(n.StartMode.QUERY)?L(r,t.startGraphQuery,"graph"):r():2===e.page?L(r,t.expandQuery,"construct",["node"]):3===e.page?L(r,t.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?L(r,t.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&L(r,t.resourcePropertiesQuery,"tuple",["node"],["property","value"])},G=()=>{e.tabConfig.inference=e.newConfig.startQueryIncludeInferred,e.tabConfig.sameAs=e.newConfig.startQuerySameAs,e.setQuery(e.newConfig.getQueryType(e.page))},P=e=>{u.warning(e)},x=()=>{e.getAutocompletePromise=g.checkAutocompleteStatus()},L=(e,r,t,s,a,i)=>{r?h.validateQuery(r,t,s,a,i).success(()=>{e()}).error(e=>{P(getError(e))}):e()},T=()=>{N()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})},N=()=>1===e.page&&e.newConfig.isStartMode(n.StartMode.NODE),q=()=>{h.getGraphConfigSamples().success((function(r){e.samples=Object(o.mapGraphConfigSamplesToGraphConfigs)(r).filter(r=>!r.id||e.newConfig.id!==r.id||(e.revertConfig=r,!1))})).error((function(e){u.error(getError(e),I.instant("graphexplore.error.graph.configs"))})),x(),e.getNamespacesPromise=Q.getNamespaces(e.getActiveRepository())},Y={endpoint:()=>"/repositories/"+p.getActiveRepository(),showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,yasqeActionButtons:i.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,showQueryButton:!1,initialQuery:" ",componentId:"graphs-config",render:a.RenderingMode.YASQE,maxPersistentResponseSize:0,yasqeMode:s.YasqeMode.PROTECTED,infer:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs},O=(r,t,s)=>{e.queryIsRunning=r},$=()=>{window.removeEventListener("beforeunload",U),H.forEach(e=>e())},U=r=>{e.queryEditorIsDirty&&(r.returnValue=!0)},H=[];H.push(e.$on("autocompleteStatus",x)),H.push(e.$on("$locationChangeStart",(r,s)=>{if(e.queryEditorIsDirty){r.preventDefault();((e,r,t,s)=>{w.openSimpleModal({title:e,message:r,warning:!0}).result.then((function(){angular.isFunction(t)&&t()}),(function(){angular.isFunction(s)&&s()}))})(I.instant("common.confirm"),I.instant("visual.config.warning.unsaved.changes"),()=>{$();const e=t.absUrl().length-t.url().length,r=s.substring(e);t.path(r)})}else $()})),H.push(e.$on("$destroy",$)),H.push(e.$watch(e.getActiveRepositoryObject,()=>{(e.newConfig.isStartMode(n.StartMode.QUERY)||e.page>1)&&(e.viewMode="yasr",A().then(b))})),window.addEventListener("beforeunload",U),e.$watch("newConfig.startMode",e=>{e===n.StartMode.QUERY&&G()}),e.$watch("page",r=>{(e.newConfig.isStartMode(n.StartMode.QUERY)||r>1)&&(e.showEditor(),G())}),p.getPrefixes(C).then(r=>(r=>{const t=e.$watch((function(){return e.getActiveRepositoryObject()}),(function(a){if(a){e.canEditActiveRepo=e.canWriteActiveRepo();const a=angular.extend({},Y,{prefixes:r,yasqeMode:e.canWriteActiveRepo()?s.YasqeMode.WRITE:s.YasqeMode.PROTECTED});e.yasguiConfig=a,t()}}))})(r)).finally(()=>O(!1)),_?(e.isUpdate=!0,h.getConfig(_).then((function(r){e.newConfig=r,q()})).catch(e=>{u.error(getError(e),I.instant("created.connector",{name:_}))})):(e.isUpdate=!1,q()),e.getActiveRepository()&&(O(!0,I.instant("common.refreshing.namespaces"),I.instant("common.extra.message")),p.getPrefixes(p.getActiveRepository()).then(r=>{e.namespaces=r}).catch((function(r){e.repositoryError=getError(r)})).finally((function(){O(!1)})))}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",u),u.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","ModalService"]},61:function(e,r,t){"use strict";t.r(r),t.d(r,"RenderingMode",(function(){return s}));const s={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},62:function(e,r,t){"use strict";t.r(r),t.d(r,"YasqeMode",(function(){return s}));const s={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},64:function(e,r){function t(e,r){return{showToastMessageWithDelay:function(t){return new Promise(s=>{e.success(r.instant(t)),setTimeout(s,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]},73:function(e,r,t){"use strict";t.r(r),t.d(r,"StartMode",(function(){return s})),t.d(r,"GraphsConfig",(function(){return a}));const s={QUERY:"query",NODE:"node",SEARCH:"search"};class a{constructor(e,r,t=s.SEARCH,a,i=!0,n=!0,o,u,p,c,d,h,g,y,l,Q,f,m,I,w,R){this._id=e,this._name=r,this._startMode=t,this._owner=a,this._startQueryIncludeInferred=i,this._startQuerySameAs=n,this._startGraphQuery=o,this._startIRI=u,this._startIRILabel=p,this._expandQuery=c,this._resourceQuery=d,this._predicateLabelQuery=h,this._resourcePropertiesQuery=g,this._shared=y,this._description=l,this._hint=Q,this._startGraphQueryDescription=f,this._expandQueryDescription=m,this._resourceQueryDescription=I,this._predicateLabelQueryDescription=w,this._resourcePropertiesQueryDescription=R}isStartMode(e){return this.startMode===e}isDefaultGraph(){return"Minimal"===this.name||"Advanced"===this.name}getPropertyDescription(e){return this[e+"Description"]}getQueryType(e){let r;return this.isStartMode(s.QUERY)&&1===e?r=this.startGraphQuery:2===e?r=this.expandQuery:3===e?r=this.resourceQuery:4===e?r=this.predicateLabelQuery:5===e&&(r=this.resourcePropertiesQuery),r||""}updateModel(e,r){return this.isStartMode(s.QUERY)&&1===r?this.startGraphQuery=e:2===r?this.expandQuery=e:3===r?this.resourceQuery=e:4===r?this.predicateLabelQuery=e:5===r&&(this.resourcePropertiesQuery=e),this}toSavePayload(){return{id:this.id,name:this.name,startMode:this.startMode,owner:this.owner,startQueryIncludeInferred:this.startQueryIncludeInferred,startQuerySameAs:this.startQuerySameAs,startGraphQuery:this.startGraphQuery,startIRI:this.startIRI,startIRILabel:this.startIRILabel,expandQuery:this.expandQuery,resourceQuery:this.resourceQuery,predicateLabelQuery:this.predicateLabelQuery,resourcePropertiesQuery:this.resourcePropertiesQuery,shared:this.shared,description:this.description,hint:this.hint}}get id(){return this._id}set id(e){this._id=e}get name(){return this._name}set name(e){this._name=e}get startMode(){return this._startMode}set startMode(e){this._startMode=e}get owner(){return this._owner}set owner(e){this._owner=e}get startQueryIncludeInferred(){return this._startQueryIncludeInferred}set startQueryIncludeInferred(e){this._startQueryIncludeInferred=e}get startQuerySameAs(){return this._startQuerySameAs}set startQuerySameAs(e){this._startQuerySameAs=e}get startGraphQuery(){return this._startGraphQuery}set startGraphQuery(e){this._startGraphQuery=e}get startIRI(){return this._startIRI}set startIRI(e){this._startIRI=e}get startIRILabel(){return this._startIRILabel}set startIRILabel(e){this._startIRILabel=e}get expandQuery(){return this._expandQuery}set expandQuery(e){this._expandQuery=e}get resourceQuery(){return this._resourceQuery}set resourceQuery(e){this._resourceQuery=e}get predicateLabelQuery(){return this._predicateLabelQuery}set predicateLabelQuery(e){this._predicateLabelQuery=e}get resourcePropertiesQuery(){return this._resourcePropertiesQuery}set resourcePropertiesQuery(e){this._resourcePropertiesQuery=e}get shared(){return this._shared}set shared(e){this._shared=e}get description(){return this._description}set description(e){this._description=e}get hint(){return this._hint}set hint(e){this._hint=e}get startGraphQueryDescription(){return this._startGraphQueryDescription}set startGraphQueryDescription(e){this._startGraphQueryDescription=e}get expandQueryDescription(){return this._expandQueryDescription}set expandQueryDescription(e){this._expandQueryDescription=e}get resourceQueryDescription(){return this._resourceQueryDescription}set resourceQueryDescription(e){this._resourceQueryDescription=e}get predicateLabelQueryDescription(){return this._predicateLabelQueryDescription}set predicateLabelQueryDescription(e){this._predicateLabelQueryDescription=e}get resourcePropertiesQueryDescription(){return this._resourcePropertiesQueryDescription}set resourcePropertiesQueryDescription(e){this._resourcePropertiesQueryDescription=e}}},93:function(e,r,t){"use strict";t.r(r),t.d(r,"mapGraphsConfigResponseToModel",(function(){return a})),t.d(r,"mapGraphConfigSampleToGraphConfig",(function(){return i})),t.d(r,"mapGraphConfigSamplesToGraphConfigs",(function(){return n}));var s=t(73);const a=e=>new s.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint),i=e=>new s.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint,e.startGraphQueryDescription,e.expandQueryDescription,e.resourceQueryDescription,e.predicateLabelQueryDescription,e.resourcePropertiesQueryDescription),n=e=>e.map(e=>i(e))}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[31,163,164,170,189,190,233],{123:function(e,t,r){"use strict";r.r(t),r.d(t,"SparqlTemplateError",(function(){return a}));class a extends Error{}},124:function(e,t,r){"use strict";r.r(t),r.d(t,"DEFAULT_SPARQL_QUERY",(function(){return a})),r.d(t,"SparqlTemplateInfo",(function(){return n}));const a="PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX ex: <http://example.com#>\nDELETE {\n ?subject ex:myPredicate ?oldValue .\n} INSERT {\n ?subject ex:myPredicate ?newValue .\n} WHERE {\n ?id rdf:type ex:MyType .\n ?subject ex:isRelatedTo ?id .\n}\n";class n{constructor(e=a,t=!0,r){this.query=e,this.templateID=r,this.isNewTemplate=t,this.templateExist=!1,this.isValidTemplateId=!0,this.isValidQuery=!0,this.isValidQueryMode=!0}}},198:function(e,t,r){"use strict";r.r(t);r(7),r(24),r(28),r(64),r(27),r(32);var a=r(0),n=r(124),s=r(123),i=r(62),o=r(61),l=r(14);function p(e,t,r,a,n,s,i){e.pluginName="sparql-template",e.setPluginIsActive=function(t){e.pluginIsActive=t},e.getSparqlTemplates=function(){s.isLicenseValid()&&t.getActiveRepository()&&!t.isActiveRepoOntopType()&&!t.isActiveRepoFedXType()?r.getSparqlTemplates(t.getActiveRepository()).success((function(t){e.sparqlTemplateIds=t})).error((function(e){const t=getError(e);a.error(t,i.instant("sparql.template.get.templates.error"))})):e.sparqlTemplateIds=[]},e.$watch((function(){return t.getActiveRepository()}),(function(){e.getSparqlTemplates()})),e.deleteTemplate=function(s){n.openSimpleModal({title:i.instant("common.warning"),message:i.instant("sparql.template.delete.template.warning",{templateID:s}),warning:!0}).result.then((function(){r.deleteSparqlTemplate(s,t.getActiveRepository()).success((function(){a.success(s,i.instant("sparql.template.delete.template.success")),e.getSparqlTemplates()})).error((function(e){a.error(getError(e),i.instant("sparql.template.delete.template.failure",{templateID:s}))}))}))}}function c(e,t,r,p,c,m,u,d,f,g,T,q,h,I,y,E){e.initialQuery=n.DEFAULT_SPARQL_QUERY,e.sparqlTemplateInfo=new n.SparqlTemplateInfo(e.initialQuery),e.title="",e.saveOrUpdateExecuted=!1,e.isDirty=!1,e.language=E.getLanguage(),e.canEditActiveRepo=!1;let w=!0;e.saveTemplate=function(){e.saveOrUpdateExecuted=!0,A()||k();const t=e.sparqlTemplateInfo.isNewTemplate?S:b;M(e.sparqlTemplateInfo).then(Q).then(R).then(x).then(t).then(V).catch(e=>{e instanceof s.SparqlTemplateError||console.log(e)})},e.isTemplateIdValid=e=>T.isValidIri(e,e.toString()),e.markDirty=()=>{e.isDirty=!0},e.markPristine=()=>{e.isDirty=!1};const v=(t,r=n.DEFAULT_SPARQL_QUERY)=>{e.sparqlTemplateInfo.query=r,e.sparqlTemplateInfo.templateID=j(),e.sparqlTemplateInfo.isNewTemplate=!e.sparqlTemplateInfo.templateID,U(),e.yasguiConfig={showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,yasqeActionButtons:l.DISABLE_YASQE_BUTTONS_CONFIGURATION,showQueryButton:!1,initialQuery:e.sparqlTemplateInfo.query,componentId:"sparql-template",prefixes:t,render:o.RenderingMode.YASQE,maxPersistentResponseSize:0,yasqeMode:e.canEditActiveRepo?i.YasqeMode.WRITE:i.YasqeMode.PROTECTED}},S=e=>D(e).then($).then(P),D=t=>f.getSparqlTemplates(c.getActiveRepository()).then((function(r){return t.templateExist=r.data.find(t=>t===e.sparqlTemplateInfo.templateID),t})).catch((function(e){const t=getError(e);return p.error(t,h.instant("sparql.template.get.templates.error")),Promise.reject(new s.SparqlTemplateError("Failed to retrieve sparql templates."))})),R=e=>Y().isQueryValid().then(t=>(e.isValidQuery=t,e.isValidQuery?e:Promise.reject(new s.SparqlTemplateError("Invalid query.")))),A=()=>e.sparqlTemplateInfo.isNewTemplate||e.isDirty,$=e=>new Promise((t,r)=>{if(e.templateExist){const n=Object(a.decodeHTML)(h.instant("sparql.template.existing.template.error",{templateID:e.templateID})),i=h.instant("common.confirm.save");C(i,n,()=>t(e),()=>r(new s.SparqlTemplateError("Save not confirmed.")))}else t(e)});function P(t){return f.createSparqlTemplate(t,c.getActiveRepository()).then((function(){return t.isNewTemplate=!1,e.markPristine(),p.success(t.templateID,h.instant("save.sparql.template.success.msg")),t})).catch((function(e){const r=getError(e);return p.error(r,h.instant("save.sparql.template.failure.msg",{templateID:t.templateID})),Promise.reject(new s.SparqlTemplateError("Failed to save the new template: "+t.templateID))}))}const b=t=>f.updateSparqlTemplate(t,c.getActiveRepository()).then((function(){return t.isNewTemplate=!1,e.markPristine(),p.success(e.sparqlTemplateInfo.templateID,h.instant("update.sparql.template.success.msg")),t})).catch((function(e){const r=getError(e);return p.error(r,h.instant("save.sparql.template.failure.msg",{templateID:t.templateID})),Promise.reject(new s.SparqlTemplateError("Failed to update the template: "+t.templateID))})),Q=e=>Y().getQuery().then(t=>(e.query=t,e)),x=e=>Y().getQueryMode().then(t=>(e.isValidQueryMode="update"===t,e.isValidQueryMode?e:Promise.reject(new s.SparqlTemplateError("Query mode is not valid.")))),M=t=>new Promise((r,a)=>{t.templateID?(t.isValidTemplateId=e.isTemplateIdValid(t.templateID),t.isValidTemplateId?r(t):a(new s.SparqlTemplateError("Template identifier is not valid."))):a(new s.SparqlTemplateError("A required template identifier is missing."))}),V=()=>{setTimeout((function(){k()}),1e3)},j=()=>{const e=r.hash()||"";return(r.search().templateID||"")+(e?"#"+e:"")},U=()=>{e.title=(e.sparqlTemplateInfo.templateID?h.instant("edit"):h.instant("common.create.btn"))+" "+h.instant("view.sparql.template.title")},k=()=>{r.url("/sparql-templates")},L=(t,r)=>{e.queryIsRunning=t,e.loaderMessage=e.queryIsRunning?r:""},Y=()=>l.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor"),C=(e,t,r,a)=>{q.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(a)&&a()}))},F=()=>{window.removeEventListener("beforeunload",N),O.forEach(e=>e())},N=t=>{e.isDirty&&(t.returnValue=!0)},O=[];O.push(e.$on("queryChanged",(t,r)=>{r.dirty?e.markDirty():e.markPristine()})),O.push(t.$on("$translateChangeSuccess",()=>{e.language=E.getLanguage(),U()})),O.push(e.$on("$locationChangeStart",(t,a)=>{if(e.isDirty){t.preventDefault();const e=h.instant("common.confirm"),n=h.instant("jdbc.warning.unsaved.changes");C(e,n,()=>{F();const e=r.absUrl().length-r.url().length,t=a.substring(e);r.path(t)})}else F()})),O.push(y.subscribe("repositoryWillChangeEvent",t=>new Promise((function(r){if(e.sparqlTemplateInfo.isNewTemplate)return void r(t);const a=()=>{e.isDirty=!1,k(),r(t)};if(e.isDirty){const e=()=>{t.cancel=!0,r(t)},n=h.instant("common.confirm"),s=h.instant("jdbc.warning.unsaved.changes");C(n,s,a,e)}else a()})))),O.push(e.$on("$destroy",F)),window.addEventListener("beforeunload",N);const _=()=>{const t=`${h.instant("common.refreshing.namespaces")}. ${h.instant("common.extra.message")}`;L(!0,t),e.sparqlTemplateInfo.templateID=j();const r=c.getActiveRepository();e.sparqlTemplateInfo.templateID?Promise.all([c.getPrefixes(r),f.getSparqlTemplate(e.sparqlTemplateInfo.templateID,r)]).then(([e,t])=>v(e,t.data)).finally(()=>L(!1)):c.getPrefixes(r).then(e=>v(e)).finally(()=>L(!1))};O.push(e.$watch(e.getActiveRepositoryObject,t=>{t&&(e.canEditActiveRepo=e.canWriteActiveRepo(),w?(_(),w=!1):k())}))}angular.module("graphdb.framework.sparql-template.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr","graphdb.framework.utils.event-emitter-service"],["graphdb.framework.utils.notifications"]).controller("SparqlTemplatesCtrl",p).controller("SparqlTemplateCreateCtrl",c),p.$inject=["$scope","$repositories","SparqlTemplatesRestService","toastr","ModalService","$licenseService","$translate"],c.$inject=["$scope","$rootScope","$location","toastr","$repositories","$window","$timeout","$interval","SparqlTemplatesRestService","RDF4JRepositoriesRestService","UriUtils","ModalService","$translate","$q","EventEmitterService","$languageService"]},61:function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingMode",(function(){return a}));const a={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},62:function(e,t,r){"use strict";r.r(t),r.d(t,"YasqeMode",(function(){return a}));const a={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},64:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise(a=>{e.success(t.instant(r)),setTimeout(a,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[5,43,56,57,58,92,93,94,97,212],{110:function(e,t,o){"use strict";o.r(t),o.d(t,"NodeState",(function(){return r})),o.d(t,"RecoveryState",(function(){return s})),o.d(t,"LinkState",(function(){return a}));o(65),o(76),o(134),o(135),o(136),o(137),o(138),o(139),o(140);var n=o(63);angular.module("graphdb.framework.clustermanagement.controllers.cluster-management",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.repositories.service","graphdb.framework.rest.cluster.service","graphdb.framework.clustermanagement.services.remote-locations","graphdb.framework.clustermanagement.controllers.remove-nodes","graphdb.framework.clustermanagement.controllers.create-cluster","graphdb.framework.clustermanagement.controllers.edit-cluster","graphdb.framework.clustermanagement.controllers.delete-cluster","graphdb.framework.clustermanagement.controllers.add-location","graphdb.framework.clustermanagement.controllers.add-nodes","graphdb.framework.clustermanagement.controllers.replace-nodes","toastr","pageslide-directive"]).controller("ClusterManagementCtrl",l);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"},s={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"},a={IN_SYNC:"IN_SYNC",OUT_OF_SYNC:"OUT_OF_SYNC",SYNCING:"SYNCING",NO_CONNECTION:"NO_CONNECTION"};function l(e,t,o,s,l,c,i,d,u,g,m,f,p,h,C,N,_){e.loader=!0,e.isLeader=!1,e.currentNode=null,e.clusterModel={},e.NodeState=r,e.leaderChanged=!1,e.currentLeader=null,e.isAdmin=function(){return d.isAuthenticated()&&d.isAdmin()},e.childContext={},e.shouldShowClusterSettingsPanel=!1;let L;function S(t){L||(L=e.getClusterStatus().then(()=>{if(t||!e.clusterConfiguration)return e.getClusterConfiguration()}).then(()=>{if(!e.currentNode||e.leaderChanged)return e.getCurrentNodeStatus()}).finally(()=>{L=null,e.childContext.redraw()}))}function $(){return N.getLocationsWithRpcAddresses().then(t=>{const o=t.find(e=>e.isLocal);o&&(o.endpoint=e.currentNode.endpoint,o.rpcAddress=e.currentNode.address),e.clusterModel.locations=t})}e.onopen=e.onclose=()=>angular.noop(),e.toggleSidePanel=()=>{e.shouldShowClusterSettingsPanel=!e.shouldShowClusterSettingsPanel},e.toggleLegend=()=>{e.childContext.toggleLegend&&e.childContext.toggleLegend()},e.setLoader=function(t,o){f.cancel(e.loaderTimeout),t?(e.loaderMessage=o,e.loaderTimeout=f((function(){e.loader=t}),50)):e.loader=!1},e.childContext.selectNode=function(t){e.selectedNode!==t?e.selectedNode=t:e.selectedNode=null,e.$apply()},e.getLoaderMessage=function(){return e.loaderMessage||C.instant("common.loading")},e.getClusterConfiguration=()=>p.getClusterConfig().then(t=>{if(e.clusterConfiguration=t.data,!e.currentNode)return e.getCurrentNodeStatus()}).catch(()=>{e.clusterConfiguration=null}),e.getClusterStatus=function(){return p.getClusterStatus().then((function(t){const o=t.data.slice(),n=o.find(e=>e.nodeState===r.LEADER);var s,l;s=e.currentLeader,(l=n)&&s&&s.address===l.address||(e.currentLeader=n,e.leaderChanged=!0),e.currentNode=o.find(t=>t.address===e.currentNode.address);const c=[];n&&Object.keys(n.syncStatus).forEach(e=>{const t=n.syncStatus[e];t!==a.NO_CONNECTION&&c.push({id:`${n.address}-${e}`,source:n.address,target:e,status:t})}),e.clusterModel.hasCluster=!0,e.clusterModel.nodes=o,e.clusterModel.links=c})).catch((function(t){404===t.status&&(e.clusterModel.hasCluster=!1,e.clusterModel.nodes=[],e.clusterModel.links=[],e.clusterConfiguration=null)}))},e.showCreateClusterDialog=function(){c.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-create-dialog.html",controller:"CreateClusterCtrl",size:"lg",resolve:{data:function(){return{deleteLocation:v,clusterModel:e.clusterModel}}}}).result.finally((function(){$(),S(!0)}))},e.showDeleteDialog=()=>{c.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then((function(t){const o=C.instant("cluster_management.delete_cluster_dialog.loader_message");e.setLoader(!0,o),p.deleteCluster(t).then(t=>{if(Object.values(t.data).every(e=>"Cluster was deleted on this node."===e)){const e=C.instant("cluster_management.delete_cluster_dialog.notifications.success_delete");s.success(e)}else{const e=C.instant("cluster_management.delete_cluster_dialog.notifications.success_delete_partial"),o=Object.keys(t.data).reduce((e,o)=>e+`<div>${o} - ${t.data[o]}</div>`,"");s.warning(o,e,{allowHtml:!0})}e.getClusterConfiguration()}).catch(e=>{const t=C.instant("cluster_management.delete_cluster_dialog.notifications.fail_delete");T(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),S(!0),_.$broadcast("reloadLocations")})}))},e.showEditConfigurationDialog=()=>{c.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:function(){return{clusterConfiguration:e.clusterConfiguration}}}}).result.finally((function(){S(!0)}))},e.getCurrentNodeStatus=()=>p.getNodeStatus().then(t=>{e.leaderChanged=!1,e.currentNode=t.data}).catch(t=>{e.currentNode=t.data,e.clusterModel.hasCluster=!1}).then(()=>$());const v=function(e){return m.openSimpleModal({title:C.instant("location.confirm.detach"),message:C.instant("location.confirm.detach.warning",{uri:e.endpoint}),warning:!0}).result.then(()=>l.deleteLocation(e.endpoint))};function w(t){s.success(t),e.getClusterConfiguration()}function T(e,t,o){let r=e.message||e;400===t&&Array.isArray(e)?r=e.reduce((e,t)=>e+`<div>${t}</div>`,""):412!==t||Object(n.isString)(e)||(r=Object.keys(e).reduce((t,o)=>t+`<div>${o} - ${e[o]}</div>`,"")),s.error(r,o,{allowHtml:!0})}e.showAddNodeToClusterDialog=()=>{c.open({templateUrl:"js/angular/clustermanagement/templates/modal/add-nodes-dialog.html",controller:"AddNodesDialogCtrl",size:"lg",resolve:{data:function(){return{deleteLocation:v,clusterModel:e.clusterModel,clusterConfiguration:e.clusterConfiguration}}}}).result.then((function(t){const o=C.instant("cluster_management.cluster_page.add_nodes_loader");e.setLoader(!0,o);const n=t.map(e=>e.rpcAddress);p.addNodesToCluster(n).then(()=>{w(C.instant("cluster_management.cluster_page.notifications.add_nodes_success"))}).catch(e=>{const t=C.instant("cluster_management.cluster_page.notifications.add_nodes_fail");T(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),S(!0)})})).finally(()=>$())},e.showReplaceNodesDialog=()=>{c.open({templateUrl:"js/angular/clustermanagement/templates/modal/replace-nodes-dialog.html",controller:"ReplaceNodesDialogCtrl",size:"lg",resolve:{data:function(){return{deleteLocation:v,clusterModel:e.clusterModel,clusterConfiguration:e.clusterConfiguration}}}}).result.then(t=>{const o=C.instant("cluster_management.cluster_page.replace_nodes_loader");e.setLoader(!0,o);const n={addNodes:t.newNodes.map(e=>e.rpcAddress),removeNodes:t.oldNodes.map(e=>e.rpcAddress)};p.replaceNodesInCluster(n).then(()=>{w(C.instant("cluster_management.cluster_page.notifications.replace_nodes_success"))}).catch(e=>{const t=C.instant("cluster_management.cluster_page.notifications.replace_nodes_fail");T(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),S(!0)})}).finally(()=>$())},e.showRemoveNodesFromClusterDialog=()=>{c.open({templateUrl:"js/angular/clustermanagement/templates/modal/remove-nodes-dialog.html",controller:"RemoveNodesDialogCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel}}}}).result.then((function(t){const o=C.instant("cluster_management.cluster_page.remove_nodes_loader");e.setLoader(!0,o);const n=t.map(e=>e.address);p.removeNodesFromCluster(n).then(()=>{w(C.instant("cluster_management.cluster_page.notifications.remove_nodes_success"))}).catch(e=>{const t=C.instant("cluster_management.cluster_page.notifications.remove_nodes_fail");T(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),S(!0)})}))},(e.loader=!0,e.getCurrentNodeStatus().then(()=>e.getClusterConfiguration()).then(()=>e.getClusterStatus()).finally(()=>{e.setLoader(!1)})).finally(()=>{const t=g((function(){S()}),1e3);e.$on("$destroy",(function(){g.cancel(t)}))});const R=angular.element(u),A=function(){e.childContext.resize()};R.bind("resize",A);const O=function(t){const o=t.target,n=document.getElementById("nodeTooltip");e.selectedNode&&n!==o&&!n.contains(o)&&e.childContext.selectNode(null)};R.bind("mousedown",O),e.$on("$destroy",(function(){R.unbind("resize",A),R.unbind("mousedown",O)}))}l.$inject=["$scope","$http","$q","toastr","$repositories","$uibModal","$sce","$jwtAuth","$window","$interval","ModalService","$timeout","ClusterRestService","$location","$translate","RemoteLocationsService","$rootScope"]},134:function(e,t){function o(e,t,o){const n=_.cloneDeep(o.clusterModel);e.clusterNodes=n.nodes,e.clusterNodes.forEach(e=>e.shouldRemove=!1),e.nodesToRemoveCount=0,e.leftNodesLessThanTwo=!1,e.toggleNode=function(t,o){o.shouldRemove=!o.shouldRemove,o.shouldRemove?e.nodesToRemoveCount++:e.nodesToRemoveCount--,e.leftNodesLessThanTwo=e.clusterNodes.length-e.nodesToRemoveCount<2},e.ok=function(){const o=e.clusterNodes.filter(e=>e.shouldRemove);t.close(o)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.clustermanagement.controllers.remove-nodes",[]).controller("RemoveNodesDialogCtrl",o),o.$inject=["$scope","$uibModalInstance","data"]},135:function(e,t,o){"use strict";o.r(t);o(65);angular.module("graphdb.framework.clustermanagement.controllers.create-cluster",[]).controller("CreateClusterCtrl",r);const n=function(){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"};function r(e,t,o,r,s,a,l,c,i,d){e.pageTitle=a.instant("cluster_management.cluster_page.create_page_title"),e.autofocusId="autofocus",e.errors=[],e.clusterConfiguration={electionMinTimeout:8e3,electionRangeTimeout:6e3,heartbeatInterval:2e3,messageSizeKB:64,verificationTimeout:1500,transactionLogMaximumSizeGB:50,nodes:[]},e.locations=l.clusterModel.locations.filter(e=>!e.isLocal),e.selectedLocations=l.clusterModel.locations.filter(e=>e.isLocal),e.loader=!1,e.deleteLocation=function(t,o){t.preventDefault(),t.stopPropagation(),l.deleteLocation(o).then(()=>e.locations=e.locations.filter(e=>e.endpoint!==o.endpoint))},e.getAdvancedOptionsClass=n,e.createCluster=function(){return e.setLoader(!0,a.instant("cluster_management.cluster_page.creating_cluster_loader")),e.clusterConfiguration.nodes=e.selectedLocations.map(e=>e.rpcAddress),r.createCluster(e.clusterConfiguration).then(()=>{s.success(a.instant("cluster_management.cluster_page.notifications.create_success")),t.close()}).catch((function(t){!function(t,o){let n;delete e.preconditionErrors,e.errors.splice(0),412===o?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===o?e.errors.push(...t):409===o?e.errors.push(t):(t.message||"string"==typeof t)&&(n=t.message||t);s.error(n,a.instant("cluster_management.cluster_page.notifications.create_failed"))}(t.data,t.status)})).finally(()=>{e.setLoader(!1),d.$broadcast("reloadLocations")})},e.isClusterConfigurationValid=()=>{const t=!e.clusterConfigurationForm.$invalid,o=e.selectedLocations&&e.selectedLocations.length>=2;return t&&o},e.setLoader=function(t,n){o.cancel(e.loaderTimeout),t?e.loaderTimeout=o((function(){e.loader=t,e.loaderMessage=n}),300):e.loader=!1},e.addNodeToList=function(t){t.rpcAddress&&(e.selectedLocations.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,o){o.isLocal||(e.selectedLocations.splice(t,1),e.locations.push(o))},e.addLocation=function(){i.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){e.isClusterConfigurationValid()?e.createCluster():s.warning(a.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}r.$inject=["$scope","$uibModalInstance","$timeout","ClusterRestService","toastr","$translate","data","$uibModal","RemoteLocationsService","$rootScope"]},136:function(e,t,o){"use strict";o.r(t);o(65);function n(e,t,o,n,r,s,a){e.pageTitle=s.instant("cluster_management.cluster_page.edit_page_title"),e.errors=[],e.clusterConfiguration=_.cloneDeep(a.clusterConfiguration),e.loader=!1,e.updateCluster=function(){return e.setLoader(!0,s.instant("cluster_management.cluster_page.updating_cluster_loader")),n.updateCluster(e.clusterConfiguration).then(()=>{r.success(s.instant("cluster_management.cluster_page.notifications.update_success")),t.close()}).catch((function(t){!function(t,o){delete e.preconditionErrors,r.error(s.instant("cluster_management.cluster_page.notifications.update_failed")),e.errors.splice(0),409===o||"string"==typeof t?e.errors.push(t):412===o?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===o&&e.errors.push(...t)}(t.data,t.status)})).finally(()=>e.setLoader(!1))},e.isClusterConfigurationValid=()=>!e.clusterConfigurationForm.$invalid,e.setLoader=function(t,n){o.cancel(e.loaderTimeout),t?e.loaderTimeout=o((function(){e.loader=t,e.loaderMessage=n}),300):e.loader=!1},e.ok=function(){e.isClusterConfigurationValid()?e.updateCluster():r.warning(s.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.clustermanagement.controllers.edit-cluster",[]).controller("EditClusterCtrl",n),n.$inject=["$scope","$uibModalInstance","$timeout","ClusterRestService","toastr","$translate","data"]},137:function(e,t){function o(e,t){e.forceDelete=!1,e.ok=function(){t.close(e.forceDelete)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.clustermanagement.controllers.delete-cluster",[]).controller("DeleteClusterCtrl",o),o.$inject=["$scope","$uibModalInstance"]},138:function(e,t){angular.module("graphdb.framework.clustermanagement.controllers.add-location",[]).controller("AddLocationFromClusterCtrl",o),o.$inject=["$scope","$uibModalInstance","toastr","productInfo","$translate"];function o(e,t,o,n,r){e.newLocation={uri:"",authType:"signature",username:"",password:"",active:!1},e.docBase=function(e){return"https://graphdb.ontotext.com/documentation/"+e.productShortVersion}(n),e.isValidLocation=function(){return(e.newLocation.uri.length<6||0===e.newLocation.uri.indexOf("http:")||0===e.newLocation.uri.indexOf("https:"))&&e.newLocation.uri.indexOf("/repositories")<=-1},e.ok=function(){e.newLocation?t.close(e.newLocation):o.error(r.instant("location.cannot.be.empty.error"))},e.cancel=function(){t.dismiss("cancel")}}},139:function(e,t,o){"use strict";o.r(t);o(76);function n(e,t,o,n,r){const s=_.cloneDeep(o.clusterConfiguration),a=_.cloneDeep(o.clusterModel);e.nodes=[],e.clusterNodes=a.nodes.map(e=>({rpcAddress:e.address,endpoint:e.endpoint})),e.locations=a.locations.filter(e=>!s.nodes.includes(e.rpcAddress)),e.locations.forEach(e=>e.isNew=!0),e.deleteLocation=function(t,n){t.preventDefault(),t.stopPropagation(),o.deleteLocation(n).then(()=>e.locations=e.locations.filter(e=>e.endpoint!==n.endpoint))},e.addNodeToList=function(t){t.rpcAddress&&(e.nodes.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,o){e.nodes.splice(t,1),e.locations.push(o)},e.addLocation=function(){r.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){t.close(e.nodes)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.clustermanagement.controllers.add-nodes",[]).controller("AddNodesDialogCtrl",n),n.$inject=["$scope","$uibModalInstance","data","$uibModal","RemoteLocationsService"]},140:function(e,t,o){"use strict";o.r(t);o(65),o(76);function n(e,t,o,n,r,s,a,l,c){const i=_.cloneDeep(s.clusterConfiguration),d=_.cloneDeep(s.clusterModel);e.replacementNodes=[],e.nodesToReplace=[],e.nodesToReplaceCount=0,e.leftNodesMajority=!1,e.clusterNodes=d.nodes.map(e=>({rpcAddress:e.address,endpoint:e.endpoint,shouldReplace:!1})),e.locations=d.locations.filter(e=>!i.nodes.includes(e.rpcAddress)),e.locations.forEach(e=>e.isNew=!0),e.addLocation=()=>{c.addLocation().then(t=>{t&&e.locations.push(t)})},e.toggleNode=(t,o)=>{if(o.shouldReplace=!o.shouldReplace,o.shouldReplace)e.nodesToReplaceCount++,e.nodesToReplace.push(o);else{e.nodesToReplaceCount--;const t=e.nodesToReplace.findIndex(e=>e.rpcAddress===o.rpcAddress);e.nodesToReplace.splice(t,1)}e.leftNodesMajority=u()+e.nodesToReplaceCount>e.clusterNodes.length},e.permitNodesReplace=()=>!e.leftNodesMajority&&(e.nodesToReplace.length>0||e.replacementNodes.length>0),e.addNodeToList=t=>{t.rpcAddress&&(e.replacementNodes.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.deleteLocation=(t,o)=>{t.preventDefault(),t.stopPropagation(),s.deleteLocation(o).then(()=>e.locations=e.locations.filter(e=>e.endpoint!==o.endpoint))},e.removeNodeFromList=(t,o)=>{e.replacementNodes.splice(t,1),e.locations.push(o)},e.ok=()=>{t.close({newNodes:e.replacementNodes,oldNodes:e.nodesToReplace})},e.cancel=()=>{t.dismiss("cancel")};const u=()=>Math.floor(e.clusterNodes.length/2)+1}angular.module("graphdb.framework.clustermanagement.controllers.replace-nodes",[]).controller("ReplaceNodesDialogCtrl",n),n.$inject=["$scope","$uibModalInstance","$timeout","toastr","$translate","data","$uibModal","$rootScope","RemoteLocationsService"]},65:function(e,t){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",o),o.$inject=["$http"];function o(e){return{getClusterConfig:function(){return e.get("rest/cluster/config")},createCluster:function(t){return e.post("rest/cluster/config",t)},updateCluster:function(t){t.nodes&&delete t.nodes;return e.patch("rest/cluster/config",t)},deleteCluster:function(t){const o=$.param({force:t});return e.delete("rest/cluster/config?"+o)},addNodesToCluster:function(t){return e.post("rest/cluster/config/node",{nodes:t})},replaceNodesInCluster:function(t){return e.patch("rest/cluster/config/node",t)},removeNodesFromCluster:function(t){return e.delete("rest/cluster/config/node",{data:{nodes:t},headers:{"Content-Type":"application/json"}})},getClusterStatus:function(){return e.get("rest/cluster/group/status")},getNodeStatus:function(){return e.get("rest/cluster/node/status")}}}},76:function(e,t,o){"use strict";o.r(t);o(33);function n(e,t,o,n,r){return{addLocation:function(){let e;return o.open({templateUrl:"js/angular/templates/modal/add-location.html",windowClass:"addLocationDialog",controller:"AddLocationFromClusterCtrl"}).result.then(o=>(e=o,e.isLocal=!1,e.endpoint=e.uri,function(e){let o;return n.addLocation(e).catch(e=>{const o=getError(e.data,e.status);return t.error(o,r.instant("common.error")),!1}).then(e=>!!e&&s()).then(t=>{if(!1!==t)return o=t.find(t=>t.endpoint===e.uri),o})}(e)))},getLocationsWithRpcAddresses:s};function s(){return n.getLocations().then((function(e){return e.data.map(e=>({isLocal:e.local,endpoint:e.uri,rpcAddress:e.rpcAddress||"",error:e.errorMsg}))})).catch((function(e){const o=getError(e.data,e.status);t.error(o,r.instant("common.error"))})).then(e=>{if(e)return function(e){const t=e.filter(e=>!e.isLocal&&!e.error).map(e=>function(e){return n.getLocationRpcAddress(e.endpoint)}(e).then(t=>(e.rpcAddress=t.data,e.isAvailable=!0,e)).catch(t=>{e.isAvailable=!1,e.error=getError(t.data,t.status)}));return Promise.allSettled(t).then(()=>e)}(e)})}}angular.module("graphdb.framework.clustermanagement.services.remote-locations",[]).factory("RemoteLocationsService",n),n.$inject=["$http","toastr","$uibModal","LocationsRestService","$translate"]}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[96],{141:function(t,e,n){"use strict";n.r(e),n.d(e,"clusterColors",(function(){return o})),n.d(e,"createClusterSvgElement",(function(){return a})),n.d(e,"createClusterZone",(function(){return s})),n.d(e,"setCreateClusterZone",(function(){return c})),n.d(e,"updateClusterZoneLabels",(function(){return d})),n.d(e,"moveElement",(function(){return u})),n.d(e,"createNodes",(function(){return i})),n.d(e,"updateNodes",(function(){return l})),n.d(e,"createLinks",(function(){return S})),n.d(e,"updateLinks",(function(){return p})),n.d(e,"setLinkColor",(function(){return N})),n.d(e,"setLinkStyle",(function(){return h})),n.d(e,"positionNodesOnClusterZone",(function(){return y}));var r=n(110);const o={ontoOrange:"var(--primary-color)",ontoBlue:"var(--secondary-color)",ontoGreen:"var(--tertiary-color)",ontoGrey:"var(--gray-color)"};function a(t){return d3.select(t).append("svg")}function s(t){const e=t.append("g");return e.append("circle").classed("cluster-zone",!0).style("fill","transparent").style("stroke-width","2"),e}function c(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",o.ontoOrange).style("text-anchor","middle").classed("settings-icon",!0).text("")}}function d(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 u(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("d",d3.line())}(r,e),t.exit().remove(),r.append("text").attr("class","icon-any node-icon"),function(t,e,n){const r=t.append("g");n?r.append("foreignObject").attr("y",e).attr("x",-e).attr("width",2*e).attr("height",10).attr("class","label-wrapper").append("xhtml:div").attr("class","id id-host"):(r.append("rect").attr("class","id-host-background").attr("rx",6),r.append("text").attr("y",e+15).attr("class","id id-host"),r.append("rect").attr("class","node-info-background").attr("rx",6),r.append("text").attr("y",e+45).attr("class","node-info-text"))}(r,e,n),o}function l(t){!function(t){t.select(".node-icon").classed("icon-any",(function(t){return!f(t)})).classed("fa-d3",f).text((function(t){return f(t)?function(t){if(_.isEmpty(t.recoveryStatus))return"";switch(t.recoveryStatus.state){case r.RecoveryState.SEARCHING_FOR_NODE:return"";case r.RecoveryState.WAITING_FOR_SNAPSHOT:return"";case r.RecoveryState.RECEIVING_SNAPSHOT:return"";case r.RecoveryState.APPLYING_SNAPSHOT:return"";case r.RecoveryState.BUILDING_SNAPSHOT:return"";case r.RecoveryState.SENDING_SNAPSHOT:return"";default:return""}}(t):function(t){if(t.nodeState===r.NodeState.LEADER)return"";if(t.nodeState===r.NodeState.FOLLOWER)return"";if(t.nodeState===r.NodeState.CANDIDATE)return"";if(t.nodeState===r.NodeState.NO_CONNECTION)return"";if(t.nodeState===r.NodeState.OUT_OF_SYNC)return"";if(t.nodeState===r.NodeState.READ_ONLY)return"";if(t.nodeState===r.NodeState.RESTRICTED)return"";return""}(t)}))}(t),function(t){t.select(".node.member").classed("leader",t=>t.nodeState===r.NodeState.LEADER).classed("follower",t=>t.nodeState===r.NodeState.FOLLOWER).classed("candidate",t=>t.nodeState===r.NodeState.CANDIDATE).classed("other",t=>t.nodeState!==r.NodeState.LEADER&&t.nodeState!==r.NodeState.FOLLOWER&&t.nodeState!==r.NodeState.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 d3.select(t.labelNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.labelNode).node().getBBox().height+10})).attr("x",(function(t){return d3.select(t.labelNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.labelNode).node().getBBox().y-5}))}(t),function(t){t.select(".node-info-text").each((function(t){t.infoNode=this})).text((function(t){return t.recoveryStatus&&t.recoveryStatus.message})),t.select(".node-info-background").attr("width",(function(t){return d3.select(t.infoNode).node().getBBox().width+10})).attr("height",(function(t){return d3.select(t.infoNode).node().getBBox().height+10})).attr("x",(function(t){return d3.select(t.infoNode).node().getBBox().x-5})).attr("y",(function(t){return d3.select(t.infoNode).node().getBBox().y-5})).classed("hidden",(function(t){return _.isEmpty(t.recoveryStatus)}))}(t)}function f(t){return!_.isEmpty(t.recoveryStatus)}function S(t){t.enter().append("path").classed("link",!0),t.exit().remove()}function p(t,e){t.attr("stroke",N).style("stroke-dasharray",h).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,a=r.y-n.y,s=Math.sqrt(o*o+a*a),c=o/s,d=a/s,u=n.x+55*c,i=n.y+55*d,l=r.x-55*c,f=r.y-55*d;return"M"+u+","+i+"L"+l+","+f}(t,e))}function N(t){return t.status===r.LinkState.IN_SYNC||t.status===r.LinkState.SYNCING?o.ontoGreen:t.status===r.LinkState.OUT_OF_SYNC?o.ontoGrey:"none"}function h(t){return t.status===r.LinkState.OUT_OF_SYNC||t.status===r.LinkState.SYNCING?"10 10":"none"}function y(t,e,n,r){t.attr("transform",(o,a)=>{const s=2*Math.PI*a/t.size(),c=e+Math.cos(s)*r,d=n+Math.sin(s)*r;return o.x=c,o.y=d,`translate(${c}, ${d})`})}}}]);
|