graphdb-workbench 2.0.0-TR8 → 2.0.0-TR9

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.
Files changed (155) hide show
  1. package/README.md +6 -1
  2. package/dist/114.282a327015f8ae87918b.bundle.js +1 -1
  3. package/dist/114.282a327015f8ae87918b.bundle.js.map +1 -1
  4. package/dist/{12.60db051e76264d3f95b2.bundle.js → 12.5d4da897bdd91e8808fa.bundle.js} +2 -2
  5. package/dist/12.5d4da897bdd91e8808fa.bundle.js.map +1 -0
  6. package/dist/13.f62fa8acc6e68826e07a.bundle.js +4 -0
  7. package/dist/13.f62fa8acc6e68826e07a.bundle.js.map +1 -0
  8. package/dist/{14.7e9059b5c9c57d952e47.bundle.js → 14.349458c1675f763995a5.bundle.js} +2 -2
  9. package/dist/{14.7e9059b5c9c57d952e47.bundle.js.map → 14.349458c1675f763995a5.bundle.js.map} +1 -1
  10. package/dist/{15.02ad5872995df6d6692a.bundle.js → 15.ebce70c05fd90026747b.bundle.js} +2 -2
  11. package/dist/{15.02ad5872995df6d6692a.bundle.js.map → 15.ebce70c05fd90026747b.bundle.js.map} +1 -1
  12. package/dist/{17.8bfbe7d08efa149bdb00.bundle.js → 17.f01afdf3b3892d73a3fe.bundle.js} +2 -2
  13. package/dist/{17.8bfbe7d08efa149bdb00.bundle.js.map → 17.f01afdf3b3892d73a3fe.bundle.js.map} +1 -1
  14. package/dist/{18.5514f95535bdd2a71d6e.bundle.js → 18.10f65755b64a6534289e.bundle.js} +2 -2
  15. package/dist/{18.5514f95535bdd2a71d6e.bundle.js.map → 18.10f65755b64a6534289e.bundle.js.map} +1 -1
  16. package/dist/{21.e75213686a349ae7df89.bundle.js → 21.b6bf0d54a846411501c7.bundle.js} +2 -2
  17. package/dist/{21.e75213686a349ae7df89.bundle.js.map → 21.b6bf0d54a846411501c7.bundle.js.map} +1 -1
  18. package/dist/22.e8167eba683605211409.bundle.js +2 -0
  19. package/dist/22.e8167eba683605211409.bundle.js.map +1 -0
  20. package/dist/{23.32f2701680565c5d107b.bundle.js → 23.e3ca5b7bb2cee4f9467f.bundle.js} +3 -3
  21. package/dist/{23.32f2701680565c5d107b.bundle.js.map → 23.e3ca5b7bb2cee4f9467f.bundle.js.map} +1 -1
  22. package/dist/{24.8dd957168a8be963b393.bundle.js → 24.d5ea0f435b896dc12709.bundle.js} +2 -2
  23. package/dist/{24.8dd957168a8be963b393.bundle.js.map → 24.d5ea0f435b896dc12709.bundle.js.map} +1 -1
  24. package/dist/{25.cbe8e59c80330ff6e706.bundle.js → 25.5b3feb79a7be0ca1f4ad.bundle.js} +2 -2
  25. package/dist/{25.cbe8e59c80330ff6e706.bundle.js.map → 25.5b3feb79a7be0ca1f4ad.bundle.js.map} +1 -1
  26. package/dist/26.c4983d9f3009f41beb11.bundle.js +2 -0
  27. package/dist/26.c4983d9f3009f41beb11.bundle.js.map +1 -0
  28. package/dist/{26.67154910989ca1f563ec.bundle.js → 27.04085d1d15db39ca4a36.bundle.js} +2 -2
  29. package/dist/{26.67154910989ca1f563ec.bundle.js.map → 27.04085d1d15db39ca4a36.bundle.js.map} +1 -1
  30. package/dist/{28.b1c15ce7633c501836c5.bundle.js → 28.57b84065ebe40bb45f72.bundle.js} +2 -2
  31. package/dist/{28.b1c15ce7633c501836c5.bundle.js.map → 28.57b84065ebe40bb45f72.bundle.js.map} +1 -1
  32. package/dist/{29.66259b8a21bbb5431a06.bundle.js → 29.959ae6b366d15d0ddea9.bundle.js} +2 -2
  33. package/dist/{29.66259b8a21bbb5431a06.bundle.js.map → 29.959ae6b366d15d0ddea9.bundle.js.map} +1 -1
  34. package/dist/{3.9eb2c7cced9d8b971c99.bundle.js → 3.26d967229917c7c5cdfb.bundle.js} +2 -2
  35. package/dist/{3.9eb2c7cced9d8b971c99.bundle.js.map → 3.26d967229917c7c5cdfb.bundle.js.map} +1 -1
  36. package/dist/{31.d810abed46d7c73ade7f.bundle.js → 31.c808da656c9ee6b7e84e.bundle.js} +2 -2
  37. package/dist/{31.d810abed46d7c73ade7f.bundle.js.map → 31.c808da656c9ee6b7e84e.bundle.js.map} +1 -1
  38. package/dist/{32.4f4c8e24d97a9d315335.bundle.js → 32.92b02260015995b4f777.bundle.js} +2 -2
  39. package/dist/{32.4f4c8e24d97a9d315335.bundle.js.map → 32.92b02260015995b4f777.bundle.js.map} +1 -1
  40. package/dist/{33.c670eeb3a325251e141f.bundle.js → 33.479162c943ca9a1982aa.bundle.js} +2 -2
  41. package/dist/{33.c670eeb3a325251e141f.bundle.js.map → 33.479162c943ca9a1982aa.bundle.js.map} +1 -1
  42. package/dist/{35.b9183a8ffba2bbd8daa1.bundle.js → 35.9c81c96cc1621f9468aa.bundle.js} +2 -2
  43. package/dist/{35.b9183a8ffba2bbd8daa1.bundle.js.map → 35.9c81c96cc1621f9468aa.bundle.js.map} +1 -1
  44. package/dist/{36.d444f7ad7724d126da1c.bundle.js → 36.cee947247d32cdcec00e.bundle.js} +2 -2
  45. package/dist/{36.d444f7ad7724d126da1c.bundle.js.map → 36.cee947247d32cdcec00e.bundle.js.map} +1 -1
  46. package/dist/{37.e82ed70c9f1ccac1fa36.bundle.js → 37.42e443af5752a63a28fe.bundle.js} +2 -2
  47. package/dist/{37.e82ed70c9f1ccac1fa36.bundle.js.map → 37.42e443af5752a63a28fe.bundle.js.map} +1 -1
  48. package/dist/{38.93c5a81548a3294efd9d.bundle.js → 38.5fff5c171cdd2563aad1.bundle.js} +2 -2
  49. package/dist/{38.93c5a81548a3294efd9d.bundle.js.map → 38.5fff5c171cdd2563aad1.bundle.js.map} +1 -1
  50. package/dist/{39.30dddbc6461137994eb4.bundle.js → 39.91c49550b6e2d11104fa.bundle.js} +2 -2
  51. package/dist/{39.30dddbc6461137994eb4.bundle.js.map → 39.91c49550b6e2d11104fa.bundle.js.map} +1 -1
  52. package/dist/4.786e6f1de67e5c6289a3.bundle.js +2 -0
  53. package/dist/4.786e6f1de67e5c6289a3.bundle.js.map +1 -0
  54. package/dist/{40.ae6db480b8323937451c.bundle.js → 40.a7e0220eb0c8a125abde.bundle.js} +2 -2
  55. package/dist/{40.ae6db480b8323937451c.bundle.js.map → 40.a7e0220eb0c8a125abde.bundle.js.map} +1 -1
  56. package/dist/41.1258b9502ba9383894d7.bundle.js +2 -0
  57. package/dist/{41.ba8cb2fb7f46ccb2ab28.bundle.js.map → 41.1258b9502ba9383894d7.bundle.js.map} +1 -1
  58. package/dist/{43.8d096939ee87946076e0.bundle.js → 43.86f9220f4f79feec5b27.bundle.js} +2 -2
  59. package/dist/{43.8d096939ee87946076e0.bundle.js.map → 43.86f9220f4f79feec5b27.bundle.js.map} +1 -1
  60. package/dist/{47.92a64d48c14c1ae82934.bundle.js → 47.fca0edd51becf34c06b7.bundle.js} +2 -2
  61. package/dist/{47.92a64d48c14c1ae82934.bundle.js.map → 47.fca0edd51becf34c06b7.bundle.js.map} +1 -1
  62. package/dist/{48.4b57a948edab2d3b9c55.bundle.js → 48.e495edf3c48e1b2fc052.bundle.js} +2 -2
  63. package/dist/{48.4b57a948edab2d3b9c55.bundle.js.map → 48.e495edf3c48e1b2fc052.bundle.js.map} +1 -1
  64. package/dist/{53.4b8ed1b79c1c20cdadd4.bundle.js → 53.c29678970b0cb8aa4b47.bundle.js} +2 -2
  65. package/dist/{53.4b8ed1b79c1c20cdadd4.bundle.js.map → 53.c29678970b0cb8aa4b47.bundle.js.map} +1 -1
  66. package/dist/{55.751acc0e54255fa3ace7.bundle.js → 55.427172af3ba7612f747a.bundle.js} +2 -2
  67. package/dist/{55.751acc0e54255fa3ace7.bundle.js.map → 55.427172af3ba7612f747a.bundle.js.map} +1 -1
  68. package/dist/{57.677c1eebf6a003639fff.bundle.js → 57.41b09f5fa3ee623aab83.bundle.js} +2 -2
  69. package/dist/{57.677c1eebf6a003639fff.bundle.js.map → 57.41b09f5fa3ee623aab83.bundle.js.map} +1 -1
  70. package/dist/{58.2c460e480eefb1a02aea.bundle.js → 58.ce5a29dded68f58c53b4.bundle.js} +2 -2
  71. package/dist/{58.2c460e480eefb1a02aea.bundle.js.map → 58.ce5a29dded68f58c53b4.bundle.js.map} +1 -1
  72. package/dist/{59.b8e9155530acba27a6fa.bundle.js → 59.10efdeff3a8ef9e5733d.bundle.js} +2 -2
  73. package/dist/{59.b8e9155530acba27a6fa.bundle.js.map → 59.10efdeff3a8ef9e5733d.bundle.js.map} +1 -1
  74. package/dist/{60.27e731a670680751538c.bundle.js → 60.97fb695857f6241ae612.bundle.js} +2 -2
  75. package/dist/{60.27e731a670680751538c.bundle.js.map → 60.97fb695857f6241ae612.bundle.js.map} +1 -1
  76. package/dist/{61.fce8a2436742c2e20032.bundle.js → 61.5d71ec3fe0cda230482b.bundle.js} +2 -2
  77. package/dist/{61.fce8a2436742c2e20032.bundle.js.map → 61.5d71ec3fe0cda230482b.bundle.js.map} +1 -1
  78. package/dist/{62.9e101a1894ee0f9a48be.bundle.js → 62.d53d104f74f9fbdacb35.bundle.js} +2 -2
  79. package/dist/{62.9e101a1894ee0f9a48be.bundle.js.map → 62.d53d104f74f9fbdacb35.bundle.js.map} +1 -1
  80. package/dist/{63.3ffdfd6f35fe62ea729c.bundle.js → 63.46514dd9cf756bd0e831.bundle.js} +2 -2
  81. package/dist/{63.3ffdfd6f35fe62ea729c.bundle.js.map → 63.46514dd9cf756bd0e831.bundle.js.map} +1 -1
  82. package/dist/{65.96a1f2f3c83a29e2c6c3.bundle.js → 65.401f44aaddb8aec6be1e.bundle.js} +2 -2
  83. package/dist/{65.96a1f2f3c83a29e2c6c3.bundle.js.map → 65.401f44aaddb8aec6be1e.bundle.js.map} +1 -1
  84. package/dist/{66.cf37216fb6f8e53cef2b.bundle.js → 66.7a1e4093247d23b65387.bundle.js} +2 -2
  85. package/dist/{66.cf37216fb6f8e53cef2b.bundle.js.map → 66.7a1e4093247d23b65387.bundle.js.map} +1 -1
  86. package/dist/{69.60ff11762016829be80d.bundle.js → 69.1944a1afebe9115c9262.bundle.js} +2 -2
  87. package/dist/{69.60ff11762016829be80d.bundle.js.map → 69.1944a1afebe9115c9262.bundle.js.map} +1 -1
  88. package/dist/{70.f86421bf02a9bfda5b95.bundle.js → 70.84500509fe2b0d19ab93.bundle.js} +2 -2
  89. package/dist/{70.f86421bf02a9bfda5b95.bundle.js.map → 70.84500509fe2b0d19ab93.bundle.js.map} +1 -1
  90. package/dist/{76.fa9e5d02f7e1367b9b29.bundle.js → 76.2fa18e115678c4e24682.bundle.js} +2 -2
  91. package/dist/{76.fa9e5d02f7e1367b9b29.bundle.js.map → 76.2fa18e115678c4e24682.bundle.js.map} +1 -1
  92. package/dist/{8.66013fc0c58811b51903.bundle.js → 8.7209929899c18f8a4580.bundle.js} +2 -2
  93. package/dist/{8.66013fc0c58811b51903.bundle.js.map → 8.7209929899c18f8a4580.bundle.js.map} +1 -1
  94. package/dist/{80.37504cf0c1e5ad897478.bundle.js → 80.83e56da7d7a69fc34eed.bundle.js} +2 -2
  95. package/dist/{80.37504cf0c1e5ad897478.bundle.js.map → 80.83e56da7d7a69fc34eed.bundle.js.map} +1 -1
  96. package/dist/{82.9b4d4dc326055aa47e04.bundle.js → 82.74d50036c210cb10b7f5.bundle.js} +2 -2
  97. package/dist/{82.9b4d4dc326055aa47e04.bundle.js.map → 82.74d50036c210cb10b7f5.bundle.js.map} +1 -1
  98. package/dist/{84.fab513b88806deb0981a.bundle.js → 84.7f42dd9d7dc01baaf465.bundle.js} +2 -2
  99. package/dist/{84.fab513b88806deb0981a.bundle.js.map → 84.7f42dd9d7dc01baaf465.bundle.js.map} +1 -1
  100. package/dist/{86.b319a8b9fcabecd7a6c7.bundle.js → 86.581cbc54b6c6b6ea9f19.bundle.js} +2 -2
  101. package/dist/{86.b319a8b9fcabecd7a6c7.bundle.js.map → 86.581cbc54b6c6b6ea9f19.bundle.js.map} +1 -1
  102. package/dist/{87.765567c0cbe89cbdb03c.bundle.js → 87.3606797303ead8dc2879.bundle.js} +2 -2
  103. package/dist/{87.765567c0cbe89cbdb03c.bundle.js.map → 87.3606797303ead8dc2879.bundle.js.map} +1 -1
  104. package/dist/{88.50c46652774325bffad3.bundle.js → 88.f5b8f83e57c9bea3c137.bundle.js} +2 -2
  105. package/dist/{88.50c46652774325bffad3.bundle.js.map → 88.f5b8f83e57c9bea3c137.bundle.js.map} +1 -1
  106. package/dist/{89.91c58e1902b0f444b068.bundle.js → 89.f9b4c4ddff2c0b5b70f7.bundle.js} +2 -2
  107. package/dist/{89.91c58e1902b0f444b068.bundle.js.map → 89.f9b4c4ddff2c0b5b70f7.bundle.js.map} +1 -1
  108. package/dist/{9.16a945b967e9a52bf535.bundle.js → 9.6a95a5c1eec963050422.bundle.js} +2 -2
  109. package/dist/{9.16a945b967e9a52bf535.bundle.js.map → 9.6a95a5c1eec963050422.bundle.js.map} +1 -1
  110. package/dist/{90.e12e77898d6341e59d8f.bundle.js → 90.4d42ba583fbc1d63d3d2.bundle.js} +2 -2
  111. package/dist/{90.e12e77898d6341e59d8f.bundle.js.map → 90.4d42ba583fbc1d63d3d2.bundle.js.map} +1 -1
  112. package/dist/95.1f83b03f48326a6cec45.bundle.js +2 -0
  113. package/dist/{95.decfcd3477dee353025b.bundle.js.map → 95.1f83b03f48326a6cec45.bundle.js.map} +1 -1
  114. package/dist/{bundle.e787556c9b592367c35c.bundle.js → bundle.1a982e7b3e2d9d06a802.bundle.js} +5 -5
  115. package/dist/{bundle.e787556c9b592367c35c.bundle.js.map → bundle.1a982e7b3e2d9d06a802.bundle.js.map} +1 -1
  116. package/dist/index.html +3 -3
  117. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  118. package/dist/pages/autocomplete.html +1 -1
  119. package/dist/pages/choose-repository-type.html +1 -1
  120. package/dist/pages/clusterInfo.html +1 -1
  121. package/dist/pages/create-index.html +4 -4
  122. package/dist/pages/dependencies.html +1 -1
  123. package/dist/pages/domainRangeInfo.html +2 -2
  124. package/dist/pages/edit.html +1 -1
  125. package/dist/pages/explore.html +1 -1
  126. package/dist/pages/export.html +1 -1
  127. package/dist/pages/find.html +1 -1
  128. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  129. package/dist/pages/graphs-visualizations.html +14 -8
  130. package/dist/pages/import.html +1 -1
  131. package/dist/pages/jdbc-create.html +5 -5
  132. package/dist/pages/monitor/queries.html +1 -1
  133. package/dist/pages/monitor/resources.html +2 -2
  134. package/dist/pages/namespaces.html +2 -2
  135. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  136. package/dist/pages/rdfrank.html +2 -2
  137. package/dist/pages/repositories.html +2 -2
  138. package/dist/pages/repository.html +2 -2
  139. package/dist/pages/similarity-indexes.html +1 -1
  140. package/dist/pages/sparql-template-create.html +5 -5
  141. package/dist/pages/sparql.html +3 -3
  142. package/dist/pages/webapi.html +2 -2
  143. package/dist/res/swagger/index.html +25 -25
  144. package/package.json +1 -1
  145. package/dist/12.60db051e76264d3f95b2.bundle.js.map +0 -1
  146. package/dist/13.1419a81a33174950a34c.bundle.js +0 -4
  147. package/dist/13.1419a81a33174950a34c.bundle.js.map +0 -1
  148. package/dist/22.a3b52347055f1adac9ce.bundle.js +0 -2
  149. package/dist/22.a3b52347055f1adac9ce.bundle.js.map +0 -1
  150. package/dist/27.61bd08d0e926fe471a91.bundle.js +0 -2
  151. package/dist/27.61bd08d0e926fe471a91.bundle.js.map +0 -1
  152. package/dist/4.6a8bdb4c9048dd910bfd.bundle.js +0 -2
  153. package/dist/4.6a8bdb4c9048dd910bfd.bundle.js.map +0 -1
  154. package/dist/41.ba8cb2fb7f46ccb2ab28.bundle.js +0 -2
  155. package/dist/95.decfcd3477dee353025b.bundle.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/rest/cluster.rest.service.js","webpack:///./src/js/angular/clustermanagement/controllers.js"],"names":["angular","module","factory","ClusterRestService","$inject","CLUSTER_MASTERS_ENDPOINT","$http","getMaster","masterRepositoryID","data","get","configureMaster","master","location","url","encodeURIComponent","method","cloneRepository","post","cloningNodeLocation","currentNodeLocation","cloningNodeRepositoryID","selectedNodeName","newNodeRepositoryID","repositoryID","newNodeLocation","locationUri","newNodeTitle","repositoryTitle","connectWorker","masterLocation","workerLocation","workerURL","disconnectWorker","params","dataType","disconnectNodes","connectNodes","getLocation","node","local","split","ClusterManagementCtrl","$scope","$q","toastr","$repositories","$modal","$sce","$window","$interval","ModalService","$timeout","RepositoriesRestService","setLoader","loader","message","cancel","loaderTimeout","loaderMessage","getLoaderMessage","success","masterInformation","setMasterAttribute","attribute","value","attrData","getLabel","attributeChange","refreshMastersIcons","error","getError","finally","hasInfo","isWorker","locations","getLocations","showCloneModal","clone","selectedNode","name","open","templateUrl","controller","resolve","result","then","cloneCurrentRepository","uri","getNodes","indexOf","substring","source","target","onSuccess","worker","disabledReason","repositoryType","workers","timestamp","Date","now","cluster","push","addOrUpdateLink","peers","connectMasters","disconnectLinkConfirm","d","openSimpleModal","title","warning","disconnectLink","overrideDisabled","$","param","deleteLink","filter","x","masterNodeID","nodeID","peerLocation","peerRepositoryID","peerNodeID","selectNode","$apply","first","second","bidirectional","firstConfigs","secondConfigs","status","key","link","linksHash","reverseKey","reverseLink","links","needsToRestart","updateWarnings","deleteReverse","splice","console","log","needsToRefresh","updateMasterNode","isUpdate","isRandomLink","hasWorkers","masterData","averageReadTime","completedReads","completedWrites","failedReads","failedWrites","pendingWrites","runningReads","runningWrites","readonly","mode","length","forEach","peer","urlToNode","artificiallyAdded","workerNode","fingerprint","averageTaskTime","failedTasks","completedTasks","runningTasks","lastError","trustAsHtml","Math","floor","random","catch","nodes","clusters","getCluster","hasNodes","reduce","type","clusterIdx","mastersData","Object","keys","sort","k1","k2","map","all","_","sortBy","render","trackAddedOrRemovedNodes","uri2tempNode","i","updateClusterIfNeeded","checkNodes","updating","processUpdate","restart","updateStatuses","updateColors","promises","setMode","setReadonly","timerCounter","timer","$on","w","element","resize","bind","unbind","CloneRepositoryCtrl","$modalInstance","copy","ok","patt","RegExp","isInvalidRepoName","test","close","dismiss"],"mapp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AAKpL,EAAOmC,MAAMtD,cAC9CmB,EAAOmL,mBACRL,EAAeO,MAAMrL,EAAOmC,QAIpCnC,EAAOc,OAAS,WACZgK,EAAeQ,QAAQ,WA1vB/BjO,QACKC,OAAO,kDATI,CACZ,eACA,+CACA,8CACA,yCACA,WAKCkF,WAAW,wBAAyBzC,GACpCyC,WAAW,sBAAuBqI,GASvC9K,EAAsBtC,QAAU,CAAC,SAAU,QAAS,KAAM,SAAU,gBAAiB,SAAU,OAC3F,UAAW,YAAa,eAAgB,WAAY,qBAAsB,2BA+tB9EoN,EAAoBpN,QAAU,CAAC,SAAU,iBAAkB","file":"9.16a945b967e9a52bf535.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.cluster.service', [])\n .factory('ClusterRestService', ClusterRestService);\n\nClusterRestService.$inject = ['$http'];\n\nconst CLUSTER_MASTERS_ENDPOINT = 'rest/cluster/masters';\n\nfunction ClusterRestService($http) {\n return {\n getMaster,\n configureMaster,\n cloneRepository,\n connectWorker,\n disconnectWorker,\n disconnectNodes,\n connectNodes\n };\n\n function getMaster(masterRepositoryID, data = {}) {\n return $http.get(`${CLUSTER_MASTERS_ENDPOINT}/${masterRepositoryID}`, data);\n }\n\n function configureMaster(master, location, data) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}?masterLocation=${encodeURIComponent(location)}`,\n method: 'POST',\n data\n });\n }\n\n function cloneRepository(data) {\n return $http.post('rest/cluster/nodes/clone', {\n cloningNodeLocation: data.currentNodeLocation,\n cloningNodeRepositoryID: data.selectedNodeName,\n newNodeRepositoryID: data.repositoryID,\n newNodeLocation: data.locationUri,\n newNodeTitle: data.repositoryTitle\n })\n }\n\n function connectWorker(master, masterLocation, workerLocation) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/workers/`,\n method: 'POST',\n data: {\n workerURL: workerLocation,\n masterLocation: masterLocation\n }\n })\n }\n\n function disconnectWorker(master, params) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/workers?${params}`,\n method: 'DELETE',\n dataType: 'text'\n });\n }\n\n function disconnectNodes(master, params) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/peers?${params}`,\n method: 'DELETE',\n dataType: 'text'\n });\n }\n\n function connectNodes(master, data) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/peers`,\n method: 'POST',\n data\n });\n }\n}\n","import 'angular/core/services';\nimport 'angular/rest/cluster.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.cluster.service',\n 'toastr'\n];\n\nangular\n .module('graphdb.framework.clustermanagement.controllers', modules)\n .controller('ClusterManagementCtrl', ClusterManagementCtrl)\n .controller('CloneRepositoryCtrl', CloneRepositoryCtrl);\n\nfunction getLocation(node) {\n if (node.local) {\n return 'local';\n }\n return node.location.split('/repositories/')[0];\n}\n\nClusterManagementCtrl.$inject = ['$scope', '$http', '$q', 'toastr', '$repositories', '$modal', '$sce',\n '$window', '$interval', 'ModalService', '$timeout', 'ClusterRestService', 'RepositoriesRestService'];\n\nfunction ClusterManagementCtrl($scope, $http, $q, toastr, $repositories, $modal, $sce,\n $window, $interval, ModalService, $timeout, ClusterRestService,\n RepositoriesRestService) {\n // TODO: Similar function is declared multiple times in different components. Find out how to avoid it!\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.getLoaderMessage = function () {\n return $scope.loaderMessage || 'Loading...';\n };\n\n $scope.getMaster = function (masterRepositoryID) {\n ClusterRestService.getMaster(masterRepositoryID)\n .success(function (data) {\n $scope.masterInformation = data;\n });\n };\n\n $scope.setMasterAttribute = function (master, attribute, value) {\n const attrData = {};\n attrData[attribute] = value;\n\n $scope.setLoader(true, 'Setting attribute...');\n ClusterRestService.configureMaster($scope.getLabel(master.location), getLocation(master), attrData)\n .success(function () {\n $scope.attributeChange = false;\n toastr.success(\"Set \" + attribute + \" to \" + value + \".\", \"\");\n $scope.refreshMastersIcons();\n return true;\n }).error(function (data) {\n $scope.attributeChange = false;\n toastr.error(getError(data), \"Error setting attribute \" + attribute);\n return true;\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.hasInfo = function (node) {\n if (node == null) {\n return true;\n }\n if ($scope.isWorker(node)) {\n return 'fingerprint' in node;\n } else {\n return 'failedReads' in node;\n }\n };\n\n $scope.locations = function () {\n return $repositories.getLocations();\n };\n\n $scope.showCloneModal = function () {\n $scope.clone.locations = $scope.locations();\n $scope.clone.repositoryID = $scope.selectedNode.name;\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/clone-modal.html',\n controller: 'CloneRepositoryCtrl',\n resolve: {\n clone: function () {\n return $scope.clone;\n }\n }\n });\n modalInstance.result.then(function (clone) {\n $scope.clone = clone;\n $scope.cloneCurrentRepository();\n }, function () {\n $scope.selectedNode = null;\n });\n };\n\n $scope.cloneCurrentRepository = function () {\n const currentNodeLocation = getLocation($scope.selectedNode);\n\n $scope.setLoader(true, 'Cloning worker...');\n\n ClusterRestService.cloneRepository({\n currentNodeLocation: currentNodeLocation,\n selectedNodeName: $scope.selectedNode.name,\n repositoryID: $scope.clone.repositoryID,\n locationUri: $scope.clone.location.uri,\n repositoryTitle: $scope.clone.repositoryTitle\n }).success(function () {\n toastr.success('Cloned node into ' + $scope.clone.location);\n $scope.getNodes();\n }).error(function (data) {\n toastr.error(getError(data), \"Error cloning node\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.getLabel = function (url) {\n if (url.indexOf(\"http\") !== 0) {\n return name;\n }\n return url.substring(url.indexOf('/repositories') + 14);\n };\n\n /**\n * Creates a link between two nodes. That this function abstracts away\n * if firstNode is a master or it's secondNode\n */\n $scope.connectNodes = function (source, target, onSuccess) {\n let master;\n let worker;\n\n if ('disabledReason' in source) {\n toastr.error(source.disabledReason, \"Error\");\n return;\n }\n\n if ('disabledReason' in target) {\n toastr.error(target.disabledReason, \"Error\");\n return;\n }\n\n if (source.repositoryType === 'master' && target.repositoryType === 'master') {\n if (source.location in target.peers && target.location in source.peers) {\n toastr.error(\"Masters already connected\", \"Error\");\n } else if (source.location in target.peers) {\n $scope.connectMasters(source, target, false, onSuccess);\n } else if (target.location in source.peers) {\n $scope.connectMasters(target, source, false, onSuccess);\n } else {\n $scope.connectMasters(source, target, true, onSuccess);\n }\n return;\n } else if (source.repositoryType === 'master') {\n master = source;\n worker = target;\n } else if (target.repositoryType === 'master') {\n master = target;\n worker = source;\n } else {\n toastr.error(\"You cannot connect two workers\", \"Error\");\n return;\n }\n\n if (worker.location in master.workers) {\n toastr.error(\"Worker already connected to that master\", \"Error\");\n return;\n }\n\n $scope.setLoader(true, 'Connecting nodes...');\n\n ClusterRestService.connectWorker($scope.getLabel(master.location), getLocation(master), worker.location)\n .success(function () {\n const timestamp = Date.now();\n\n worker.cluster = worker.cluster || [];\n worker.cluster.push(master.cluster);\n\n $scope.addOrUpdateLink(master, worker, '', timestamp);\n\n master.workers[worker.location] = 1;\n\n onSuccess();\n\n toastr.success(\"Connected worker to master.\", \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error connecting worker\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.disconnectLinkConfirm = function (d, onSuccess) {\n ModalService.openSimpleModal({\n title: 'Confirm disconnect',\n message: 'Are you sure you want to disconnect the nodes?',\n warning: true\n }).result\n .then(function () {\n $scope.disconnectLink(d, onSuccess);\n });\n };\n\n function disconnectWorker(d, master, worker, onSuccess) {\n ClusterRestService.disconnectWorker($scope.getLabel(master.location), $.param({\n workerURL: worker.location,\n masterLocation: getLocation(master)\n })).success(function () {\n $scope.deleteLink(d);\n\n worker.cluster = worker.cluster.filter(function (x) {\n return x !== master.cluster;\n });\n\n delete master.workers[worker.location];\n\n onSuccess();\n\n toastr.success(\"Disconnected worker from master.\", \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error disconnecting worker\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n }\n\n function disconnectNodes(d, master, worker, onSuccess) {\n ClusterRestService.disconnectNodes($scope.getLabel(master.location), $.param({\n masterLocation: getLocation(master),\n masterNodeID: master.nodeID,\n peerLocation: getLocation(worker),\n peerRepositoryID: $scope.getLabel(worker.location),\n peerNodeID: worker.nodeID\n })).success(function (data) {\n $scope.deleteLink(d, true);\n\n delete worker.peers[master.location];\n delete master.peers[worker.location];\n\n onSuccess();\n\n toastr.success(data, \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error disconnecting masters\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n }\n\n $scope.disconnectLink = function (d, onSuccess, overrideDisabled) {\n let master = {};\n let worker = {};\n if (d.source.repositoryType === 'master') {\n master = d.source;\n worker = d.target;\n } else if (d.target.repositoryType === 'master') {\n master = d.target;\n worker = d.source;\n }\n\n if (!overrideDisabled && ('disabledReason' in master || worker.repositoryType === 'master' && 'disabledReason' in worker)) {\n ModalService.openSimpleModal({\n title: 'Confirm disconnect',\n message: 'One of the masters is currently unreachable and will be disconnected only at the reachable master.'\n + '<br><br>Proceed only if you know what you are doing.',\n warning: true\n }).result\n .then(function () {\n $scope.disconnectLink(d, onSuccess, true);\n });\n\n return;\n }\n\n $scope.setLoader(true, 'Disconnecting nodes...');\n\n if (worker.repositoryType === 'worker') {\n disconnectWorker(d, master, worker, onSuccess);\n } else {\n // Both are masters, despite the var name worker\n disconnectNodes(d, master, worker, onSuccess);\n }\n };\n\n // Called directives so we include scope apply here\n $scope.selectNode = function (node) {\n if ($scope.selectedNode !== node) {\n $scope.selectedNode = node;\n } else {\n $scope.selectedNode = null;\n }\n $scope.$apply();\n };\n\n $scope.isWorker = function (node) {\n return node !== undefined && node !== null && node.repositoryType === 'worker';\n };\n\n $scope.connectMasters = function (first, second, bidirectional, onSuccess) {\n const firstConfigs = first.location.split('/repositories/');\n const secondConfigs = second.location.split('/repositories/');\n\n $scope.setLoader(true, 'Connecting nodes...');\n\n ClusterRestService.connectNodes(firstConfigs[1], {\n masterLocation: first.local ? 'local' : firstConfigs[0],\n masterNodeID: first.nodeID,\n peerLocation: second.local ? 'local' : secondConfigs[0],\n peerRepositoryID: secondConfigs[1],\n peerNodeID: second.nodeID,\n bidirectional: bidirectional\n }).success(function (data) {\n // FIXME?? is there a proper connection between the masters. We don't know so we use 'ON'\n const timestamp = Date.now();\n\n $scope.addOrUpdateLink(first, second, 'ON', timestamp);\n first.peers[second.location] = 1;\n\n if (bidirectional) {\n second.peers[first.location] = 1;\n $scope.addOrUpdateLink(second, first, 'ON', timestamp);\n }\n\n onSuccess();\n\n toastr.success(data, \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error connecting masters\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.addOrUpdateLink = function (source, target, status, timestamp) {\n const key = source.location + '|' + target.location;\n let link = $scope.linksHash[key];\n const reverseKey = target.location + '|' + source.location;\n const reverseLink = $scope.linksHash[reverseKey];\n if (!link) {\n // adding a new link\n link = {};\n $scope.linksHash[key] = link;\n $scope.links.push(link);\n link['source'] = source;\n link['target'] = target;\n $scope.needsToRestart = true;\n } else {\n // updating, check if status changed\n // no-op at the moment\n }\n link['status'] = status;\n link['timestamp'] = timestamp;\n\n link['reversePeerMissing'] = source.repositoryType === 'master' && target.repositoryType === 'master' && !reverseLink;\n if (reverseLink && reverseLink['reversePeerMissing']) {\n reverseLink['reversePeerMissing'] = false;\n }\n $scope.linksHash[key] = link;\n\n if ($scope.updateWarnings) { // function isn't defined before render() is called\n $scope.updateWarnings();\n }\n\n return link;\n };\n\n $scope.deleteLink = function (link, deleteReverse) {\n $scope.links.splice($scope.links.indexOf(link), 1);\n const key = link.source.location + '|' + link.target.location;\n delete $scope.linksHash[key];\n if (link.source.disabledReason || link.target.disabledReason) {\n // removing a link to a funky node triggers a refresh to get rid of that node\n console.log(\"link to funky node removed, refresh\");\n $scope.needsToRefresh = true;\n }\n\n if (deleteReverse) {\n const reverseKey = link.target.location + '|' + link.source.location;\n const reverseLink = $scope.linksHash[reverseKey];\n if (reverseLink) {\n $scope.deleteLink(reverseLink, false);\n }\n }\n };\n\n $scope.updateMasterNode = function (node, timestamp, isUpdate, isRandomLink) {\n return ClusterRestService.getMaster(node.name, {\n params: {\n masterLocation: getLocation(node)\n }\n })\n .error(function (data) {\n const newDisabledReason = \"The location is unreachable.\";\n\n if (node.disabledReason !== newDisabledReason) {\n // show toast only once per disabled reason\n toastr.error(getError(data), \"Error accessing master \" + node.name);\n\n node.disabledReason = newDisabledReason;\n\n // Disabled, we don't know these so reset them to sane empty defaults\n node.peers = {};\n node.workers = {};\n node.hasWorkers = false;\n }\n\n node.timestamp = timestamp;\n\n return true;\n })\n .success(function (masterData) {\n node.averageReadTime = masterData.averageReadTime;\n node.completedReads = masterData.completedReads;\n node.completedWrites = masterData.completedWrites;\n node.failedReads = masterData.failedReads;\n node.failedWrites = masterData.failedWrites;\n node.pendingWrites = masterData.pendingWrites;\n node.runningReads = masterData.runningReads;\n node.runningWrites = masterData.runningWrites;\n node.readonly = masterData.readonly;\n node.mode = masterData.mode;\n node.nodeID = masterData.nodeID;\n node.peers = {};\n node.workers = {};\n node.timestamp = timestamp;\n node.hasWorkers = masterData.workers.length > 0;\n\n masterData.peers.forEach(function (peer) {\n node.peers[peer.location] = 1;\n if (!(peer.location in $scope.urlToNode)) {\n // either someone added a repository behind our back or it's a repository we don't have in our locations\n if (isUpdate) {\n console.log('master disappeared, refreshing');\n $scope.needsToRefresh = true;\n } else {\n // TODO: Test this properly. Nodes shouldn't get events, should look disabled properly\n $scope.urlToNode[peer.location] = {\n name: $scope.getLabel(peer.location),\n disabledReason: \"You are not connected to this master's location or the master was deleted\",\n location: peer.location,\n nodeID: peer.nodeID,\n repositoryType: 'master',\n artificiallyAdded: true\n };\n }\n }\n\n // FIXME?? is there a proper connection between the masters\n $scope.addOrUpdateLink(node, $scope.urlToNode[peer.location], 'ON', timestamp);\n });\n\n masterData.workers.forEach(function (worker) {\n node.workers[worker.location] = 1;\n let workerNode = {};\n if (worker.location in $scope.urlToNode) {\n workerNode = $scope.urlToNode[worker.location];\n } else {\n // either someone added a repository behind our back or it's a repository we don't have in our locations\n if (isUpdate) {\n console.log('worker disappeared, refreshing');\n $scope.needsToRefresh = true;\n return;\n } else {\n workerNode = $scope.urlToNode[worker.location] = {\n name: $scope.getLabel(worker.location),\n location: worker.location,\n repositoryType: 'worker',\n artificiallyAdded: true\n };\n }\n }\n\n workerNode.fingerprint = worker.fingerprint;\n workerNode.averageTaskTime = worker.averageTaskTime;\n workerNode.failedTasks = worker.failedTasks;\n workerNode.completedTasks = worker.completedTasks;\n workerNode.runningTasks = worker.runningTasks;\n workerNode.timestamp = timestamp;\n\n if (workerNode.artificiallyAdded) {\n workerNode.disabledReason = \"You are not connected to this worker's location.\";\n if (worker.lastError) {\n workerNode.disabledReason += '<br>' + worker.lastError;\n }\n } else if (worker.lastError) {\n workerNode.disabledReason = worker.lastError;\n } else {\n delete workerNode.disabledReason;\n }\n\n if (workerNode.disabledReason) {\n workerNode.disabledReason = $sce.trustAsHtml(workerNode.disabledReason);\n }\n\n workerNode.cluster = workerNode.cluster || [];\n if (workerNode.cluster.indexOf(node.cluster) === -1) {\n workerNode.cluster.push(node.cluster);\n }\n\n let status = worker.status;\n\n // debug stuff\n if (isRandomLink) {\n status = ['UNINITIALIZED', 'ON', 'OFF', 'REPLICATION_SERVER', 'REPLICATION_CLIENT',\n 'OUT_OF_SYNC', 'OUT_OF_SYNC_FORCED', 'WAITING_WRITE', 'WRITING'][Math.floor(Math.random() * 9)]; // NOSONAR\n }\n // end of debug stuff\n\n $scope.addOrUpdateLink(node, $scope.urlToNode[worker.location], status, timestamp);\n });\n }).catch(function () {\n return true;\n });\n };\n\n $scope.getNodes = function () {\n // Reset all of these, just in case\n $scope.nodes = [];\n $scope.links = [];\n $scope.linksHash = {};\n $scope.clone = {};\n $scope.selectedNode = null;\n $scope.clusters = [];\n\n $scope.setLoader(true);\n\n return RepositoriesRestService.getCluster()\n .success(function (data) {\n $scope.hasNodes = data.length > 0;\n $scope.links = [];\n $scope.linksHash = {};\n $scope.clusters = [];\n\n const timestamp = Date.now();\n\n $scope.urlToNode = data.reduce(function (result, node) {\n if (node.type === \"master\" || node.type === \"worker\") {\n result[node.uri] = {\n name: $scope.getLabel(node.uri),\n local: node.local,\n location: node.uri,\n repositoryType: node.type,\n timestamp: timestamp\n };\n }\n return result;\n }, {});\n\n let clusterIdx = 0;\n\n const mastersData = Object.keys($scope.urlToNode).filter(function (key) {\n return $scope.urlToNode[key].repositoryType === 'master';\n }).sort(function (k1, k2) {\n if (k1 < k2) {\n return -1;\n } else if (k1 > k2) {\n return 1;\n }\n\n return 0;\n }).map(function (key) {\n const node = $scope.urlToNode[key];\n\n node.cluster = clusterIdx;\n $scope.clusters.push(node);\n clusterIdx++;\n return $scope.updateMasterNode(node, timestamp);\n });\n\n return $q.all(mastersData).finally(function () {\n $scope.nodes = _.sortBy(\n Object.keys($scope.urlToNode).map(function (key) {\n return $scope.urlToNode[key];\n }),\n ['name']\n );\n\n $scope.render();\n\n $scope.setLoader(false);\n });\n\n })\n .error(function (data) {\n $scope.hasNodes = false;\n toastr.error(getError(data), \"Error getting nodes\");\n $scope.setLoader(false);\n })\n .finally(function () {\n $scope.needsToRefresh = false;\n });\n };\n\n $scope.trackAddedOrRemovedNodes = function (timestamp) {\n return RepositoriesRestService.getCluster()\n .success(function (data) {\n const uri2tempNode = data.reduce(function (result, node) {\n if (node.type === \"master\" || node.type === \"worker\") {\n result[node.uri] = {\n location: node.uri,\n repositoryType: node.type\n };\n }\n return result;\n }, {});\n\n for (let i = 0; i < $scope.nodes.length; i++) {\n const node = $scope.nodes[i];\n if (node.location in uri2tempNode) {\n if (!node.artificiallyAdded) {\n // old node exists in new list, update timestamp and delete from new list\n node.timestamp = timestamp;\n delete uri2tempNode[node.location];\n }\n } else if (!node.artificiallyAdded) {\n // old node disappeared and it's not disabled, force refresh\n console.log(\"old node disappeared, refresh\");\n $scope.needsToRefresh = true;\n return true;\n }\n }\n\n if (Object.keys(uri2tempNode).length > 0) {\n // there are still nodes in the new list, which means someone added a repo, force refresh\n console.log(\"new nodes appeared, refresh\");\n $scope.needsToRefresh = true;\n }\n })\n .error(function (data) {\n toastr.error(getError(data), \"Error getting nodes\");\n });\n };\n\n $scope.updateClusterIfNeeded = function (checkNodes) {\n // raise flag to prevent calling this more than once before one invocation completes\n $scope.updating = true;\n\n const timestamp = Date.now();\n\n const processUpdate = function () {\n if (!$scope.needsToRefresh) {\n // check for nodes disconnected behind our back, or nodes entirely removed\n for (let i = 0; i < $scope.links.length; i++) {\n const link = $scope.links[i];\n if (link['timestamp'] !== timestamp) {\n console.log('nodes disconnected, removing link');\n // In reality if a user disconnects the bidirectional peer-to-peer link\n // between masters in only one direction we'd still have a single link\n // in the cluster manager. This is tricky and we can't do much about it for now.\n $scope.deleteLink(link, false);\n }\n }\n }\n\n if ($scope.needsToRefresh) {\n // major changes, we need to refresh\n console.log('refresh requested');\n $scope.getNodes();\n } else if ($scope.needsToRestart) {\n // only statuses changed, just restart the graph\n console.log('only links changed, restarting');\n $scope.restart();\n } else {\n // updates the statuses (colours of links)\n $scope.updateStatuses();\n // update colours for multimaster workers\n $scope.updateColors();\n // update warnings for missing bidi links\n $scope.updateWarnings();\n // updating done (when we refresh, restart() will do that instead)\n $scope.updating = false;\n }\n };\n\n if (checkNodes) {\n $scope.trackAddedOrRemovedNodes(timestamp).then(function () {\n if (!$scope.needsToRefresh) {\n const promises = [];\n for (let i = 0; i < $scope.nodes.length; i++) {\n const node = $scope.nodes[i];\n if (node.repositoryType === 'master') {\n promises.push($scope.updateMasterNode(node, timestamp, true));\n }\n }\n $q.all(promises).finally(processUpdate);\n } else {\n processUpdate();\n }\n });\n } else {\n const promises = [];\n for (let i = 0; i < $scope.nodes.length; i++) {\n const node = $scope.nodes[i];\n if (node.repositoryType === 'master') {\n promises.push($scope.updateMasterNode(node, timestamp, true));\n }\n }\n $q.all(promises).finally(processUpdate);\n }\n };\n\n $scope.getNodes();\n\n $scope.setMode = function (mode) {\n $scope.attributeChange = true;\n $scope.setMasterAttribute($scope.selectedNode, 'Mode', mode);\n };\n\n $scope.setReadonly = function (readonly) {\n $scope.attributeChange = true;\n $scope.selectedNode.readonly = readonly;\n $scope.setMasterAttribute($scope.selectedNode, 'ReadOnly', readonly);\n };\n\n let timerCounter = 0;\n const timer = $interval(function () {\n // check for update only if not in the middle of set attribute operation\n if (!$scope.attributeChange && !$scope.updating) {\n timerCounter++;\n // every third iteration also checks for added/removed nodes\n $scope.updateClusterIfNeeded(timerCounter % 3 === 0);\n }\n }, 2000);\n\n $scope.$on(\"$destroy\", function () {\n $interval.cancel(timer);\n });\n\n $scope.attributeChange = false;\n $scope.updating = false;\n\n // track window resizing\n const w = angular.element($window);\n const resize = function () {\n $scope.resize();\n };\n w.bind('resize', resize);\n $scope.$on('$destroy', function () {\n w.unbind('resize', resize);\n });\n\n // track collapsing the nav bar\n $scope.$on('onToggleNavWidth', function () {\n $scope.resize();\n });\n}\n\nCloneRepositoryCtrl.$inject = ['$scope', '$modalInstance', 'clone'];\n\nfunction CloneRepositoryCtrl($scope, $modalInstance, clone) {\n\n $scope.clone = angular.copy(clone);\n $scope.ok = function () {\n const patt = new RegExp('^[a-zA-Z0-9-_]+$');\n $scope.isInvalidRepoName = !patt.test($scope.clone.repositoryID);\n if (!$scope.isInvalidRepoName) {\n $modalInstance.close($scope.clone);\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/rest/cluster.rest.service.js","webpack:///./src/js/angular/clustermanagement/controllers.js"],"names":["angular","module","factory","ClusterRestService","$inject","CLUSTER_MASTERS_ENDPOINT","$http","getMaster","masterRepositoryID","data","get","configureMaster","master","location","url","encodeURIComponent","method","cloneRepository","post","cloningNodeLocation","currentNodeLocation","cloningNodeRepositoryID","selectedNodeName","newNodeRepositoryID","repositoryID","newNodeLocation","locationUri","newNodeTitle","repositoryTitle","connectWorker","masterLocation","workerLocation","workerURL","disconnectWorker","params","dataType","disconnectNodes","connectNodes","getLocation","node","local","split","ClusterManagementCtrl","$scope","$q","toastr","$repositories","$modal","$sce","$window","$interval","ModalService","$timeout","RepositoriesRestService","setLoader","loader","message","cancel","loaderTimeout","loaderMessage","getLoaderMessage","success","masterInformation","setMasterAttribute","attribute","value","attrData","getLabel","attributeChange","refreshMastersIcons","error","getError","finally","hasInfo","isWorker","locations","getLocations","showCloneModal","clone","selectedNode","name","open","templateUrl","controller","resolve","result","then","cloneCurrentRepository","uri","getNodes","indexOf","substring","source","target","onSuccess","worker","disabledReason","repositoryType","workers","timestamp","Date","now","cluster","push","addOrUpdateLink","peers","connectMasters","disconnectLinkConfirm","d","openSimpleModal","title","warning","disconnectLink","overrideDisabled","$","param","deleteLink","filter","x","masterNodeID","nodeID","peerLocation","peerRepositoryID","peerNodeID","selectNode","$apply","first","second","bidirectional","firstConfigs","secondConfigs","status","key","link","linksHash","reverseKey","reverseLink","links","needsToRestart","updateWarnings","deleteReverse","splice","console","log","needsToRefresh","updateMasterNode","isUpdate","isRandomLink","hasWorkers","masterData","averageReadTime","completedReads","completedWrites","failedReads","failedWrites","pendingWrites","runningReads","runningWrites","readonly","mode","length","forEach","peer","urlToNode","artificiallyAdded","workerNode","fingerprint","averageTaskTime","failedTasks","completedTasks","runningTasks","lastError","trustAsHtml","Math","floor","random","catch","nodes","clusters","getCluster","hasNodes","reduce","type","clusterIdx","mastersData","Object","keys","sort","k1","k2","map","all","_","sortBy","render","trackAddedOrRemovedNodes","uri2tempNode","i","updateClusterIfNeeded","checkNodes","updating","processUpdate","restart","updateStatuses","updateColors","promises","setMode","setReadonly","timerCounter","timer","$on","w","element","resize","bind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,GAAK,WACR,MAAMC,EAAO,IAAIC,OAAO,oBACxBlL,EAAOmL,mBAAqBF,EAAKG,KAAKpL,EAAOmC,MAAMtD,cAC9CmB,EAAOmL,mBACRL,EAAeO,MAAMrL,EAAOmC,QAIpCnC,EAAOc,OAAS,WACZgK,EAAeQ,QAAQ,WA1vB/BjO,QACKC,OAAO,kDATI,CACZ,eACA,+CACA,8CACA,yCACA,WAKCkF,WAAW,wBAAyBzC,GACpCyC,WAAW,sBAAuBqI,GASvC9K,EAAsBtC,QAAU,CAAC,SAAU,QAAS,KAAM,SAAU,gBAAiB,SAAU,OAC3F,UAAW,YAAa,eAAgB,WAAY,qBAAsB,2BA+tB9EoN,EAAoBpN,QAAU,CAAC,SAAU,iBAAkB","file":"9.6a95a5c1eec963050422.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.cluster.service', [])\n .factory('ClusterRestService', ClusterRestService);\n\nClusterRestService.$inject = ['$http'];\n\nconst CLUSTER_MASTERS_ENDPOINT = 'rest/cluster/masters';\n\nfunction ClusterRestService($http) {\n return {\n getMaster,\n configureMaster,\n cloneRepository,\n connectWorker,\n disconnectWorker,\n disconnectNodes,\n connectNodes\n };\n\n function getMaster(masterRepositoryID, data = {}) {\n return $http.get(`${CLUSTER_MASTERS_ENDPOINT}/${masterRepositoryID}`, data);\n }\n\n function configureMaster(master, location, data) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}?masterLocation=${encodeURIComponent(location)}`,\n method: 'POST',\n data\n });\n }\n\n function cloneRepository(data) {\n return $http.post('rest/cluster/nodes/clone', {\n cloningNodeLocation: data.currentNodeLocation,\n cloningNodeRepositoryID: data.selectedNodeName,\n newNodeRepositoryID: data.repositoryID,\n newNodeLocation: data.locationUri,\n newNodeTitle: data.repositoryTitle\n })\n }\n\n function connectWorker(master, masterLocation, workerLocation) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/workers/`,\n method: 'POST',\n data: {\n workerURL: workerLocation,\n masterLocation: masterLocation\n }\n })\n }\n\n function disconnectWorker(master, params) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/workers?${params}`,\n method: 'DELETE',\n dataType: 'text'\n });\n }\n\n function disconnectNodes(master, params) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/peers?${params}`,\n method: 'DELETE',\n dataType: 'text'\n });\n }\n\n function connectNodes(master, data) {\n return $http({\n url: `${CLUSTER_MASTERS_ENDPOINT}/${master}/peers`,\n method: 'POST',\n data\n });\n }\n}\n","import 'angular/core/services';\nimport 'angular/rest/cluster.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.cluster.service',\n 'toastr'\n];\n\nangular\n .module('graphdb.framework.clustermanagement.controllers', modules)\n .controller('ClusterManagementCtrl', ClusterManagementCtrl)\n .controller('CloneRepositoryCtrl', CloneRepositoryCtrl);\n\nfunction getLocation(node) {\n if (node.local) {\n return 'local';\n }\n return node.location.split('/repositories/')[0];\n}\n\nClusterManagementCtrl.$inject = ['$scope', '$http', '$q', 'toastr', '$repositories', '$modal', '$sce',\n '$window', '$interval', 'ModalService', '$timeout', 'ClusterRestService', 'RepositoriesRestService'];\n\nfunction ClusterManagementCtrl($scope, $http, $q, toastr, $repositories, $modal, $sce,\n $window, $interval, ModalService, $timeout, ClusterRestService,\n RepositoriesRestService) {\n // TODO: Similar function is declared multiple times in different components. Find out how to avoid it!\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.getLoaderMessage = function () {\n return $scope.loaderMessage || 'Loading...';\n };\n\n $scope.getMaster = function (masterRepositoryID) {\n ClusterRestService.getMaster(masterRepositoryID)\n .success(function (data) {\n $scope.masterInformation = data;\n });\n };\n\n $scope.setMasterAttribute = function (master, attribute, value) {\n const attrData = {};\n attrData[attribute] = value;\n\n $scope.setLoader(true, 'Setting attribute...');\n ClusterRestService.configureMaster($scope.getLabel(master.location), getLocation(master), attrData)\n .success(function () {\n $scope.attributeChange = false;\n toastr.success(\"Set \" + attribute + \" to \" + value + \".\", \"\");\n $scope.refreshMastersIcons();\n return true;\n }).error(function (data) {\n $scope.attributeChange = false;\n toastr.error(getError(data), \"Error setting attribute \" + attribute);\n return true;\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.hasInfo = function (node) {\n if (node == null) {\n return true;\n }\n if ($scope.isWorker(node)) {\n return 'fingerprint' in node;\n } else {\n return 'failedReads' in node;\n }\n };\n\n $scope.locations = function () {\n return $repositories.getLocations();\n };\n\n $scope.showCloneModal = function () {\n $scope.clone.locations = $scope.locations();\n $scope.clone.repositoryID = $scope.selectedNode.name;\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/clone-modal.html',\n controller: 'CloneRepositoryCtrl',\n resolve: {\n clone: function () {\n return $scope.clone;\n }\n }\n });\n modalInstance.result.then(function (clone) {\n $scope.clone = clone;\n $scope.cloneCurrentRepository();\n }, function () {\n $scope.selectedNode = null;\n });\n };\n\n $scope.cloneCurrentRepository = function () {\n const currentNodeLocation = getLocation($scope.selectedNode);\n\n $scope.setLoader(true, 'Cloning worker...');\n\n ClusterRestService.cloneRepository({\n currentNodeLocation: currentNodeLocation,\n selectedNodeName: $scope.selectedNode.name,\n repositoryID: $scope.clone.repositoryID,\n locationUri: $scope.clone.location.uri,\n repositoryTitle: $scope.clone.repositoryTitle\n }).success(function () {\n toastr.success('Cloned node into ' + $scope.clone.location);\n $scope.getNodes();\n }).error(function (data) {\n toastr.error(getError(data), \"Error cloning node\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.getLabel = function (url) {\n if (url.indexOf(\"http\") !== 0) {\n return name;\n }\n return url.substring(url.indexOf('/repositories') + 14);\n };\n\n /**\n * Creates a link between two nodes. That this function abstracts away\n * if firstNode is a master or it's secondNode\n */\n $scope.connectNodes = function (source, target, onSuccess) {\n let master;\n let worker;\n\n if ('disabledReason' in source) {\n toastr.error(source.disabledReason, \"Error\");\n return;\n }\n\n if ('disabledReason' in target) {\n toastr.error(target.disabledReason, \"Error\");\n return;\n }\n\n if (source.repositoryType === 'master' && target.repositoryType === 'master') {\n if (source.location in target.peers && target.location in source.peers) {\n toastr.error(\"Masters already connected\", \"Error\");\n } else if (source.location in target.peers) {\n $scope.connectMasters(source, target, false, onSuccess);\n } else if (target.location in source.peers) {\n $scope.connectMasters(target, source, false, onSuccess);\n } else {\n $scope.connectMasters(source, target, true, onSuccess);\n }\n return;\n } else if (source.repositoryType === 'master') {\n master = source;\n worker = target;\n } else if (target.repositoryType === 'master') {\n master = target;\n worker = source;\n } else {\n toastr.error(\"You cannot connect two workers\", \"Error\");\n return;\n }\n\n if (worker.location in master.workers) {\n toastr.error(\"Worker already connected to that master\", \"Error\");\n return;\n }\n\n $scope.setLoader(true, 'Connecting nodes...');\n\n ClusterRestService.connectWorker($scope.getLabel(master.location), getLocation(master), worker.location)\n .success(function () {\n const timestamp = Date.now();\n\n worker.cluster = worker.cluster || [];\n worker.cluster.push(master.cluster);\n\n $scope.addOrUpdateLink(master, worker, '', timestamp);\n\n master.workers[worker.location] = 1;\n\n onSuccess();\n\n toastr.success(\"Connected worker to master.\", \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error connecting worker\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.disconnectLinkConfirm = function (d, onSuccess) {\n ModalService.openSimpleModal({\n title: 'Confirm disconnect',\n message: 'Are you sure you want to disconnect the nodes?',\n warning: true\n }).result\n .then(function () {\n $scope.disconnectLink(d, onSuccess);\n });\n };\n\n function disconnectWorker(d, master, worker, onSuccess) {\n ClusterRestService.disconnectWorker($scope.getLabel(master.location), $.param({\n workerURL: worker.location,\n masterLocation: getLocation(master)\n })).success(function () {\n $scope.deleteLink(d);\n\n worker.cluster = worker.cluster.filter(function (x) {\n return x !== master.cluster;\n });\n\n delete master.workers[worker.location];\n\n onSuccess();\n\n toastr.success(\"Disconnected worker from master.\", \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error disconnecting worker\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n }\n\n function disconnectNodes(d, master, worker, onSuccess) {\n ClusterRestService.disconnectNodes($scope.getLabel(master.location), $.param({\n masterLocation: getLocation(master),\n masterNodeID: master.nodeID,\n peerLocation: getLocation(worker),\n peerRepositoryID: $scope.getLabel(worker.location),\n peerNodeID: worker.nodeID\n })).success(function (data) {\n $scope.deleteLink(d, true);\n\n delete worker.peers[master.location];\n delete master.peers[worker.location];\n\n onSuccess();\n\n toastr.success(data, \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error disconnecting masters\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n }\n\n $scope.disconnectLink = function (d, onSuccess, overrideDisabled) {\n let master = {};\n let worker = {};\n if (d.source.repositoryType === 'master') {\n master = d.source;\n worker = d.target;\n } else if (d.target.repositoryType === 'master') {\n master = d.target;\n worker = d.source;\n }\n\n if (!overrideDisabled && ('disabledReason' in master || worker.repositoryType === 'master' && 'disabledReason' in worker)) {\n ModalService.openSimpleModal({\n title: 'Confirm disconnect',\n message: 'One of the masters is currently unreachable and will be disconnected only at the reachable master.'\n + '<br><br>Proceed only if you know what you are doing.',\n warning: true\n }).result\n .then(function () {\n $scope.disconnectLink(d, onSuccess, true);\n });\n\n return;\n }\n\n $scope.setLoader(true, 'Disconnecting nodes...');\n\n if (worker.repositoryType === 'worker') {\n disconnectWorker(d, master, worker, onSuccess);\n } else {\n // Both are masters, despite the var name worker\n disconnectNodes(d, master, worker, onSuccess);\n }\n };\n\n // Called directives so we include scope apply here\n $scope.selectNode = function (node) {\n if ($scope.selectedNode !== node) {\n $scope.selectedNode = node;\n } else {\n $scope.selectedNode = null;\n }\n $scope.$apply();\n };\n\n $scope.isWorker = function (node) {\n return node !== undefined && node !== null && node.repositoryType === 'worker';\n };\n\n $scope.connectMasters = function (first, second, bidirectional, onSuccess) {\n const firstConfigs = first.location.split('/repositories/');\n const secondConfigs = second.location.split('/repositories/');\n\n $scope.setLoader(true, 'Connecting nodes...');\n\n ClusterRestService.connectNodes(firstConfigs[1], {\n masterLocation: first.local ? 'local' : firstConfigs[0],\n masterNodeID: first.nodeID,\n peerLocation: second.local ? 'local' : secondConfigs[0],\n peerRepositoryID: secondConfigs[1],\n peerNodeID: second.nodeID,\n bidirectional: bidirectional\n }).success(function (data) {\n // FIXME?? is there a proper connection between the masters. We don't know so we use 'ON'\n const timestamp = Date.now();\n\n $scope.addOrUpdateLink(first, second, 'ON', timestamp);\n first.peers[second.location] = 1;\n\n if (bidirectional) {\n second.peers[first.location] = 1;\n $scope.addOrUpdateLink(second, first, 'ON', timestamp);\n }\n\n onSuccess();\n\n toastr.success(data, \"\");\n }).error(function (data) {\n toastr.error(getError(data), \"Error connecting masters\");\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.addOrUpdateLink = function (source, target, status, timestamp) {\n const key = source.location + '|' + target.location;\n let link = $scope.linksHash[key];\n const reverseKey = target.location + '|' + source.location;\n const reverseLink = $scope.linksHash[reverseKey];\n if (!link) {\n // adding a new link\n link = {};\n $scope.linksHash[key] = link;\n $scope.links.push(link);\n link['source'] = source;\n link['target'] = target;\n $scope.needsToRestart = true;\n } else {\n // updating, check if status changed\n // no-op at the moment\n }\n link['status'] = status;\n link['timestamp'] = timestamp;\n\n link['reversePeerMissing'] = source.repositoryType === 'master' && target.repositoryType === 'master' && !reverseLink;\n if (reverseLink && reverseLink['reversePeerMissing']) {\n reverseLink['reversePeerMissing'] = false;\n }\n $scope.linksHash[key] = link;\n\n if ($scope.updateWarnings) { // function isn't defined before render() is called\n $scope.updateWarnings();\n }\n\n return link;\n };\n\n $scope.deleteLink = function (link, deleteReverse) {\n $scope.links.splice($scope.links.indexOf(link), 1);\n const key = link.source.location + '|' + link.target.location;\n delete $scope.linksHash[key];\n if (link.source.disabledReason || link.target.disabledReason) {\n // removing a link to a funky node triggers a refresh to get rid of that node\n console.log(\"link to funky node removed, refresh\");\n $scope.needsToRefresh = true;\n }\n\n if (deleteReverse) {\n const reverseKey = link.target.location + '|' + link.source.location;\n const reverseLink = $scope.linksHash[reverseKey];\n if (reverseLink) {\n $scope.deleteLink(reverseLink, false);\n }\n }\n };\n\n $scope.updateMasterNode = function (node, timestamp, isUpdate, isRandomLink) {\n return ClusterRestService.getMaster(node.name, {\n params: {\n masterLocation: getLocation(node)\n }\n })\n .error(function (data) {\n const newDisabledReason = \"The location is unreachable.\";\n\n if (node.disabledReason !== newDisabledReason) {\n // show toast only once per disabled reason\n toastr.error(getError(data), \"Error accessing master \" + node.name);\n\n node.disabledReason = newDisabledReason;\n\n // Disabled, we don't know these so reset them to sane empty defaults\n node.peers = {};\n node.workers = {};\n node.hasWorkers = false;\n }\n\n node.timestamp = timestamp;\n\n return true;\n })\n .success(function (masterData) {\n node.averageReadTime = masterData.averageReadTime;\n node.completedReads = masterData.completedReads;\n node.completedWrites = masterData.completedWrites;\n node.failedReads = masterData.failedReads;\n node.failedWrites = masterData.failedWrites;\n node.pendingWrites = masterData.pendingWrites;\n node.runningReads = masterData.runningReads;\n node.runningWrites = masterData.runningWrites;\n node.readonly = masterData.readonly;\n node.mode = masterData.mode;\n node.nodeID = masterData.nodeID;\n node.peers = {};\n node.workers = {};\n node.timestamp = timestamp;\n node.hasWorkers = masterData.workers.length > 0;\n\n masterData.peers.forEach(function (peer) {\n node.peers[peer.location] = 1;\n if (!(peer.location in $scope.urlToNode)) {\n // either someone added a repository behind our back or it's a repository we don't have in our locations\n if (isUpdate) {\n console.log('master disappeared, refreshing');\n $scope.needsToRefresh = true;\n } else {\n // TODO: Test this properly. Nodes shouldn't get events, should look disabled properly\n $scope.urlToNode[peer.location] = {\n name: $scope.getLabel(peer.location),\n disabledReason: \"You are not connected to this master's location or the master was deleted\",\n location: peer.location,\n nodeID: peer.nodeID,\n repositoryType: 'master',\n artificiallyAdded: true\n };\n }\n }\n\n // FIXME?? is there a proper connection between the masters\n $scope.addOrUpdateLink(node, $scope.urlToNode[peer.location], 'ON', timestamp);\n });\n\n masterData.workers.forEach(function (worker) {\n node.workers[worker.location] = 1;\n let workerNode = {};\n if (worker.location in $scope.urlToNode) {\n workerNode = $scope.urlToNode[worker.location];\n } else {\n // either someone added a repository behind our back or it's a repository we don't have in our locations\n if (isUpdate) {\n console.log('worker disappeared, refreshing');\n $scope.needsToRefresh = true;\n return;\n } else {\n workerNode = $scope.urlToNode[worker.location] = {\n name: $scope.getLabel(worker.location),\n location: worker.location,\n repositoryType: 'worker',\n artificiallyAdded: true\n };\n }\n }\n\n workerNode.fingerprint = worker.fingerprint;\n workerNode.averageTaskTime = worker.averageTaskTime;\n workerNode.failedTasks = worker.failedTasks;\n workerNode.completedTasks = worker.completedTasks;\n workerNode.runningTasks = worker.runningTasks;\n workerNode.timestamp = timestamp;\n\n if (workerNode.artificiallyAdded) {\n workerNode.disabledReason = \"You are not connected to this worker's location.\";\n if (worker.lastError) {\n workerNode.disabledReason += '<br>' + worker.lastError;\n }\n } else if (worker.lastError) {\n workerNode.disabledReason = worker.lastError;\n } else {\n delete workerNode.disabledReason;\n }\n\n if (workerNode.disabledReason) {\n workerNode.disabledReason = $sce.trustAsHtml(workerNode.disabledReason);\n }\n\n workerNode.cluster = workerNode.cluster || [];\n if (workerNode.cluster.indexOf(node.cluster) === -1) {\n workerNode.cluster.push(node.cluster);\n }\n\n let status = worker.status;\n\n // debug stuff\n if (isRandomLink) {\n status = ['UNINITIALIZED', 'ON', 'OFF', 'REPLICATION_SERVER', 'REPLICATION_CLIENT',\n 'OUT_OF_SYNC', 'OUT_OF_SYNC_FORCED', 'WAITING_WRITE', 'WRITING'][Math.floor(Math.random() * 9)]; // NOSONAR\n }\n // end of debug stuff\n\n $scope.addOrUpdateLink(node, $scope.urlToNode[worker.location], status, timestamp);\n });\n }).catch(function () {\n return true;\n });\n };\n\n $scope.getNodes = function () {\n // Reset all of these, just in case\n $scope.nodes = [];\n $scope.links = [];\n $scope.linksHash = {};\n $scope.clone = {};\n $scope.selectedNode = null;\n $scope.clusters = [];\n\n $scope.setLoader(true);\n\n return RepositoriesRestService.getCluster()\n .success(function (data) {\n $scope.hasNodes = data.length > 0;\n $scope.links = [];\n $scope.linksHash = {};\n $scope.clusters = [];\n\n const timestamp = Date.now();\n\n $scope.urlToNode = data.reduce(function (result, node) {\n if (node.type === \"master\" || node.type === \"worker\") {\n result[node.uri] = {\n name: $scope.getLabel(node.uri),\n local: node.local,\n location: node.uri,\n repositoryType: node.type,\n timestamp: timestamp\n };\n }\n return result;\n }, {});\n\n let clusterIdx = 0;\n\n const mastersData = Object.keys($scope.urlToNode).filter(function (key) {\n return $scope.urlToNode[key].repositoryType === 'master';\n }).sort(function (k1, k2) {\n if (k1 < k2) {\n return -1;\n } else if (k1 > k2) {\n return 1;\n }\n\n return 0;\n }).map(function (key) {\n const node = $scope.urlToNode[key];\n\n node.cluster = clusterIdx;\n $scope.clusters.push(node);\n clusterIdx++;\n return $scope.updateMasterNode(node, timestamp);\n });\n\n return $q.all(mastersData).finally(function () {\n $scope.nodes = _.sortBy(\n Object.keys($scope.urlToNode).map(function (key) {\n return $scope.urlToNode[key];\n }),\n ['name']\n );\n\n $scope.render();\n\n $scope.setLoader(false);\n });\n\n })\n .error(function (data) {\n $scope.hasNodes = false;\n toastr.error(getError(data), \"Error getting nodes\");\n $scope.setLoader(false);\n })\n .finally(function () {\n $scope.needsToRefresh = false;\n });\n };\n\n $scope.trackAddedOrRemovedNodes = function (timestamp) {\n return RepositoriesRestService.getCluster()\n .success(function (data) {\n const uri2tempNode = data.reduce(function (result, node) {\n if (node.type === \"master\" || node.type === \"worker\") {\n result[node.uri] = {\n location: node.uri,\n repositoryType: node.type\n };\n }\n return result;\n }, {});\n\n for (let i = 0; i < $scope.nodes.length; i++) {\n const node = $scope.nodes[i];\n if (node.location in uri2tempNode) {\n if (!node.artificiallyAdded) {\n // old node exists in new list, update timestamp and delete from new list\n node.timestamp = timestamp;\n delete uri2tempNode[node.location];\n }\n } else if (!node.artificiallyAdded) {\n // old node disappeared and it's not disabled, force refresh\n console.log(\"old node disappeared, refresh\");\n $scope.needsToRefresh = true;\n return true;\n }\n }\n\n if (Object.keys(uri2tempNode).length > 0) {\n // there are still nodes in the new list, which means someone added a repo, force refresh\n console.log(\"new nodes appeared, refresh\");\n $scope.needsToRefresh = true;\n }\n })\n .error(function (data) {\n toastr.error(getError(data), \"Error getting nodes\");\n });\n };\n\n $scope.updateClusterIfNeeded = function (checkNodes) {\n // raise flag to prevent calling this more than once before one invocation completes\n $scope.updating = true;\n\n const timestamp = Date.now();\n\n const processUpdate = function () {\n if (!$scope.needsToRefresh) {\n // check for nodes disconnected behind our back, or nodes entirely removed\n for (let i = 0; i < $scope.links.length; i++) {\n const link = $scope.links[i];\n if (link['timestamp'] !== timestamp) {\n console.log('nodes disconnected, removing link');\n // In reality if a user disconnects the bidirectional peer-to-peer link\n // between masters in only one direction we'd still have a single link\n // in the cluster manager. This is tricky and we can't do much about it for now.\n $scope.deleteLink(link, false);\n }\n }\n }\n\n if ($scope.needsToRefresh) {\n // major changes, we need to refresh\n console.log('refresh requested');\n $scope.getNodes();\n } else if ($scope.needsToRestart) {\n // only statuses changed, just restart the graph\n console.log('only links changed, restarting');\n $scope.restart();\n } else {\n // updates the statuses (colours of links)\n $scope.updateStatuses();\n // update colours for multimaster workers\n $scope.updateColors();\n // update warnings for missing bidi links\n $scope.updateWarnings();\n // updating done (when we refresh, restart() will do that instead)\n $scope.updating = false;\n }\n };\n\n if (checkNodes) {\n $scope.trackAddedOrRemovedNodes(timestamp).then(function () {\n if (!$scope.needsToRefresh) {\n const promises = [];\n for (let i = 0; i < $scope.nodes.length; i++) {\n const node = $scope.nodes[i];\n if (node.repositoryType === 'master') {\n promises.push($scope.updateMasterNode(node, timestamp, true));\n }\n }\n $q.all(promises).finally(processUpdate);\n } else {\n processUpdate();\n }\n });\n } else {\n const promises = [];\n for (let i = 0; i < $scope.nodes.length; i++) {\n const node = $scope.nodes[i];\n if (node.repositoryType === 'master') {\n promises.push($scope.updateMasterNode(node, timestamp, true));\n }\n }\n $q.all(promises).finally(processUpdate);\n }\n };\n\n $scope.getNodes();\n\n $scope.setMode = function (mode) {\n $scope.attributeChange = true;\n $scope.setMasterAttribute($scope.selectedNode, 'Mode', mode);\n };\n\n $scope.setReadonly = function (readonly) {\n $scope.attributeChange = true;\n $scope.selectedNode.readonly = readonly;\n $scope.setMasterAttribute($scope.selectedNode, 'ReadOnly', readonly);\n };\n\n let timerCounter = 0;\n const timer = $interval(function () {\n // check for update only if not in the middle of set attribute operation\n if (!$scope.attributeChange && !$scope.updating) {\n timerCounter++;\n // every third iteration also checks for added/removed nodes\n $scope.updateClusterIfNeeded(timerCounter % 3 === 0);\n }\n }, 2000);\n\n $scope.$on(\"$destroy\", function () {\n $interval.cancel(timer);\n });\n\n $scope.attributeChange = false;\n $scope.updating = false;\n\n // track window resizing\n const w = angular.element($window);\n const resize = function () {\n $scope.resize();\n };\n w.bind('resize', resize);\n $scope.$on('$destroy', function () {\n w.unbind('resize', resize);\n });\n\n // track collapsing the nav bar\n $scope.$on('onToggleNavWidth', function () {\n $scope.resize();\n });\n}\n\nCloneRepositoryCtrl.$inject = ['$scope', '$modalInstance', 'clone'];\n\nfunction CloneRepositoryCtrl($scope, $modalInstance, clone) {\n\n $scope.clone = angular.copy(clone);\n $scope.ok = function () {\n const patt = new RegExp('^[a-zA-Z0-9-_]+$');\n $scope.isInvalidRepoName = !patt.test($scope.clone.repositoryID);\n if (!$scope.isInvalidRepoName) {\n $modalInstance.close($scope.clone);\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[90],{51:function(e,n){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];const t="rest/explore-graph/saved";function r(e){return{getSavedGraphs:function(){return e.get(t)},getSavedGraph:function(n){return e.get(`${t}/${encodeURIComponent(n)}`)},editSavedGraph:function(n){return e.put(`${t}/${encodeURIComponent(n.id)}`,n)},deleteSavedGraph:function(n){return e.delete(`${t}/${encodeURIComponent(n.id)}`)},addNewSavedGraph:function(n){return e.post(t,n)}}}}}]);
2
- //# sourceMappingURL=90.e12e77898d6341e59d8f.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[90],{52:function(e,n){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];const t="rest/explore-graph/saved";function r(e){return{getSavedGraphs:function(){return e.get(t)},getSavedGraph:function(n){return e.get(`${t}/${encodeURIComponent(n)}`)},editSavedGraph:function(n){return e.put(`${t}/${encodeURIComponent(n.id)}`,n)},deleteSavedGraph:function(n){return e.delete(`${t}/${encodeURIComponent(n.id)}`)},addNewSavedGraph:function(n){return e.post(t,n)}}}}}]);
2
+ //# sourceMappingURL=90.4d42ba583fbc1d63d3d2.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/rest/saved-graphs.rest.service.js"],"names":["angular","module","factory","SavedGraphsRestService","$inject","SAVED_GRAPHS_ENDPOINT","$http","getSavedGraphs","get","getSavedGraph","id","encodeURIComponent","editSavedGraph","graph","put","deleteSavedGraph","delete","addNewSavedGraph","post"],"mappings":"2EAAAA,QACKC,OAAO,0DAA2D,IAClEC,QAAQ,yBAA0BC,GAEvCA,EAAuBC,QAAU,CAAC,SAElC,MAAMC,EAAwB,2BAE9B,SAASF,EAAuBG,GAC5B,MAAO,CACHC,eAOJ,WACI,OAAOD,EAAME,IAAIH,IAPjBI,cAUJ,SAAuBC,GACnB,OAAOJ,EAAME,IAAI,GAAGH,KAAyBM,mBAAmBD,OAVhEE,eAaJ,SAAwBC,GACpB,OAAOP,EAAMQ,IAAI,GAAGT,KAAyBM,mBAAmBE,EAAMH,MAAOG,IAb7EE,iBAgBJ,SAA0BF,GACtB,OAAOP,EAAMU,OAAO,GAAGX,KAAyBM,mBAAmBE,EAAMH,QAhBzEO,iBAmBJ,SAA0BJ,GACtB,OAAOP,EAAMY,KAAKb,EAAuBQ","file":"90.e12e77898d6341e59d8f.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.graphexplore.savedgraphs.service', [])\n .factory('SavedGraphsRestService', SavedGraphsRestService);\n\nSavedGraphsRestService.$inject = ['$http'];\n\nconst SAVED_GRAPHS_ENDPOINT = 'rest/explore-graph/saved';\n\nfunction SavedGraphsRestService($http) {\n return {\n getSavedGraphs,\n getSavedGraph,\n editSavedGraph,\n deleteSavedGraph,\n addNewSavedGraph\n };\n\n function getSavedGraphs() {\n return $http.get(SAVED_GRAPHS_ENDPOINT);\n }\n\n function getSavedGraph(id) {\n return $http.get(`${SAVED_GRAPHS_ENDPOINT}/${encodeURIComponent(id)}`);\n }\n\n function editSavedGraph(graph) {\n return $http.put(`${SAVED_GRAPHS_ENDPOINT}/${encodeURIComponent(graph.id)}`, graph);\n }\n\n function deleteSavedGraph(graph) {\n return $http.delete(`${SAVED_GRAPHS_ENDPOINT}/${encodeURIComponent(graph.id)}`);\n }\n\n function addNewSavedGraph(graph) {\n return $http.post(SAVED_GRAPHS_ENDPOINT, graph);\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/rest/saved-graphs.rest.service.js"],"names":["angular","module","factory","SavedGraphsRestService","$inject","SAVED_GRAPHS_ENDPOINT","$http","getSavedGraphs","get","getSavedGraph","id","encodeURIComponent","editSavedGraph","graph","put","deleteSavedGraph","delete","addNewSavedGraph","post"],"mappings":"2EAAAA,QACKC,OAAO,0DAA2D,IAClEC,QAAQ,yBAA0BC,GAEvCA,EAAuBC,QAAU,CAAC,SAElC,MAAMC,EAAwB,2BAE9B,SAASF,EAAuBG,GAC5B,MAAO,CACHC,eAOJ,WACI,OAAOD,EAAME,IAAIH,IAPjBI,cAUJ,SAAuBC,GACnB,OAAOJ,EAAME,IAAI,GAAGH,KAAyBM,mBAAmBD,OAVhEE,eAaJ,SAAwBC,GACpB,OAAOP,EAAMQ,IAAI,GAAGT,KAAyBM,mBAAmBE,EAAMH,MAAOG,IAb7EE,iBAgBJ,SAA0BF,GACtB,OAAOP,EAAMU,OAAO,GAAGX,KAAyBM,mBAAmBE,EAAMH,QAhBzEO,iBAmBJ,SAA0BJ,GACtB,OAAOP,EAAMY,KAAKb,EAAuBQ","file":"90.4d42ba583fbc1d63d3d2.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.graphexplore.savedgraphs.service', [])\n .factory('SavedGraphsRestService', SavedGraphsRestService);\n\nSavedGraphsRestService.$inject = ['$http'];\n\nconst SAVED_GRAPHS_ENDPOINT = 'rest/explore-graph/saved';\n\nfunction SavedGraphsRestService($http) {\n return {\n getSavedGraphs,\n getSavedGraph,\n editSavedGraph,\n deleteSavedGraph,\n addNewSavedGraph\n };\n\n function getSavedGraphs() {\n return $http.get(SAVED_GRAPHS_ENDPOINT);\n }\n\n function getSavedGraph(id) {\n return $http.get(`${SAVED_GRAPHS_ENDPOINT}/${encodeURIComponent(id)}`);\n }\n\n function editSavedGraph(graph) {\n return $http.put(`${SAVED_GRAPHS_ENDPOINT}/${encodeURIComponent(graph.id)}`, graph);\n }\n\n function deleteSavedGraph(graph) {\n return $http.delete(`${SAVED_GRAPHS_ENDPOINT}/${encodeURIComponent(graph.id)}`);\n }\n\n function addNewSavedGraph(graph) {\n return $http.post(SAVED_GRAPHS_ENDPOINT, graph);\n }\n}\n"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[95],{40:function(e,t,n){"use strict";n.r(t);n(2),n(9);function s(e,t,n,s){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,s.getStatistics().then((function(t){e.settings.statistics="true"===t.data,e.supportsStatistics=!0}),(function(n){if(404===n.status)e.supportsStatistics=!1;else{const e=getError(n.data);t.error(e,"Error getting settings")}}))},e.getSettings(),e.setSettings=function(){e.loader=!0,s.toggleStatistics(e.settings.statistics).then((function(){n.close(),t.success("Settings have been saved")}),(function(e){const n=getError(e.data);t.error(n,"Error saving settings")}))},e.submitForm=function(){e.setSettings()},e.cancel=function(){n.dismiss("cancel")}}function i(e,t,n,s,i,c){e.loadingLicense=function(){return n.loadingLicense},n.checkLicenseStatus(),e.revertToFree=function(){c.openSimpleModal({title:"Confirm operation",message:"Reverting to a GraphDB Free license will make SE and EE features unusable. Are you sure?",warning:!0}).result.then((function(){t.unregisterLicense().success((function(){n.checkLicenseStatus()}))}))}}function c(e,t,n,s,i,c,o){e.$on("securityInit",(function(){o.isAdmin()||n.path("/license")})),e.sendLicenseToValidateAndActivate=a;const r=$(".license-textarea");function a(e){t.sendLicenseToValidate(e).success((function(n){"Invalid"!==n.licensee?(r.val(e),function(e,n){s.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then((function(){!function(e){e||(e=r.val());if(e){const n=atob(e.replace(/\s/g,""));t.registerLicense(n).success((function(){c.history.back()})).error((function(){i.error("Error registering GraphDB license")}))}else i.error("No license code available in textarea")}(n)}))}(n,e)):(r.val(""),i.error(n.message))})).error((function(){i.error("Invalid license")}))}e.$watch("currentFile",(function(){if(e.currentFile){const n=e.currentFile;t.extractFromLicenseFile(n).success((function(e){a(e)})).error((function(){i.error("Could not upload file")}))}})),e.getBackToPreviousPage=function(){c.history.back()}}function o(e,t,n){e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")},e.license=n}function r(e){e.loader=!0,e.setLoader=function(t){e.loader=t}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",s).controller("ValidateLicenseModalCtrl",o).controller("LicenseCtrl",i).controller("RegisterLicenseCtrl",c).controller("LoaderSamplesCtrl",r),s.$inject=["$scope","toastr","$modalInstance","LicenseRestService"],i.$inject=["$scope","LicenseRestService","$licenseService","toastr","$rootScope","ModalService"],c.$inject=["$scope","LicenseRestService","$location","$modal","toastr","$window","$jwtAuth"],o.$inject=["$scope","$modalInstance","license"],r.$inject=["$scope"]}}]);
2
+ //# sourceMappingURL=95.1f83b03f48326a6cec45.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/settings/controllers.js"],"names":["ActiveLocationSettingsCtrl","$scope","toastr","$modalInstance","LicenseRestService","supportsStatistics","settings","statistics","getSettings","loader","getStatistics","then","response","data","status","msg","getError","error","setSettings","toggleStatistics","close","success","submitForm","cancel","dismiss","LicenseCtrl","$licenseService","$rootScope","ModalService","loadingLicense","checkLicenseStatus","revertToFree","openSimpleModal","title","message","warning","result","unregisterLicense","RegisterLicenseCtrl","$location","$modal","$window","$jwtAuth","$on","isAdmin","path","sendLicenseToValidateAndActivate","textAreaSel","$","licenseCode","sendLicenseToValidate","validatedLicense","licensee","val","license","open","templateUrl","controller","size","resolve","decodedLicense","atob","replace","registerLicense","history","back","confirmWantedNewLicenseDetails","$watch","currentFile","file","extractFromLicenseFile","getBackToPreviousPage","ValidateLicenseModalCtrl","ok","LoaderSamplesCtrl","setLoader","angular","module","$inject"],"mappings":"0FAAA,iBAkBA,SAASA,EAA2BC,EAAQC,EAAQC,EAAgBC,GAChEH,EAAOI,oBAAqB,EAC5BJ,EAAOK,SAAW,CAACC,YAAY,GAC/BN,EAAOO,YAEP,WACIP,EAAOQ,QAAS,EAChBL,EAAmBM,gBAAgBC,MAAK,SAAUC,GAC9CX,EAAOK,SAASC,WAA+B,SAAlBK,EAASC,KACtCZ,EAAOI,oBAAqB,KAC7B,SAAUO,GACT,GAAwB,MAApBA,EAASE,OACTb,EAAO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sourcesContent":["import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\n\nangular\n .module('graphdb.framework.settings.controllers', [\n 'ngCookies',\n 'ui.bootstrap',\n 'graphdb.framework.core.services.jwtauth',\n 'toastr'\n ])\n .controller('ActiveLocationSettingsCtrl', ActiveLocationSettingsCtrl)\n .controller('ValidateLicenseModalCtrl', ValidateLicenseModalCtrl)\n .controller('LicenseCtrl', LicenseCtrl)\n .controller('RegisterLicenseCtrl', RegisterLicenseCtrl)\n .controller('LoaderSamplesCtrl', LoaderSamplesCtrl);\n\nActiveLocationSettingsCtrl.$inject = ['$scope', 'toastr', '$modalInstance', 'LicenseRestService'];\n\nfunction ActiveLocationSettingsCtrl($scope, toastr, $modalInstance, LicenseRestService) {\n $scope.supportsStatistics = true;\n $scope.settings = {statistics: false};\n $scope.getSettings = getSettings;\n\n function getSettings() {\n $scope.loader = true;\n LicenseRestService.getStatistics().then(function (response) {\n $scope.settings.statistics = response.data === 'true';\n $scope.supportsStatistics = true;\n }, function (response) {\n if (response.status === 404) {\n $scope.supportsStatistics = false;\n } else {\n const msg = getError(response.data);\n toastr.error(msg, 'Error getting settings');\n }\n });\n }\n\n $scope.getSettings();\n\n $scope.setSettings = function () {\n $scope.loader = true;\n LicenseRestService.toggleStatistics($scope.settings.statistics).then(function () {\n $modalInstance.close();\n toastr.success('Settings have been saved');\n }, function (response) {\n const msg = getError(response.data);\n toastr.error(msg, 'Error saving settings');\n });\n };\n\n $scope.submitForm = function () {\n $scope.setSettings();\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nLicenseCtrl.$inject = ['$scope', 'LicenseRestService', '$licenseService', 'toastr', '$rootScope', 'ModalService'];\n\nfunction LicenseCtrl($scope, LicenseRestService, $licenseService, toastr, $rootScope, ModalService) {\n\n $scope.loadingLicense = function() {\n return $licenseService.loadingLicense;\n }\n\n $licenseService.checkLicenseStatus();\n\n $scope.revertToFree = function () {\n ModalService.openSimpleModal({\n title: 'Confirm operation',\n message: \"Reverting to a GraphDB Free license will make SE and EE repositories unusable. Are you sure?\",\n warning: true\n }).result\n .then(function () {\n LicenseRestService.unregisterLicense()\n .success(function () {\n $licenseService.checkLicenseStatus();\n })\n });\n };\n}\n\nRegisterLicenseCtrl.$inject = ['$scope', 'LicenseRestService', '$location', '$modal', 'toastr', '$window', '$jwtAuth'];\n\nfunction RegisterLicenseCtrl($scope, LicenseRestService, $location, $modal, toastr, $window, $jwtAuth) {\n $scope.$on('securityInit', function () {\n if (!$jwtAuth.isAdmin()) {\n $location.path('/license');\n }\n });\n\n $scope.sendLicenseToValidateAndActivate = sendLicenseToValidateAndActivate;\n\n const textAreaSel = $('.license-textarea');\n\n // watch for uploaded license file\n $scope.$watch('currentFile', function () {\n if ($scope.currentFile) {\n const file = $scope.currentFile;\n LicenseRestService.extractFromLicenseFile(file)\n .success(function (licenseCode) {\n sendLicenseToValidateAndActivate(licenseCode);\n }).error(function () {\n toastr.error('Could not upload file');\n });\n }\n });\n\n $scope.getBackToPreviousPage = function () {\n $window.history.back();\n };\n\n // send license code for validation and activation\n function sendLicenseToValidateAndActivate(licenseCode) {\n LicenseRestService.sendLicenseToValidate(licenseCode)\n .success(function (validatedLicense) {\n if (validatedLicense.licensee !== 'Invalid') {\n // write code to textarea\n textAreaSel.val(licenseCode);\n // pop dialog for license details confirmation\n confirmWantedNewLicenseDetails(validatedLicense, licenseCode);\n } else {\n // clear textarea on invalid license\n textAreaSel.val('');\n // show error\n toastr.error(validatedLicense.message);\n }\n })\n .error(function () {\n toastr.error('Invalid license');\n });\n }\n\n\n // pops a modal dialog which asks you if your expected license details are correct\n // and sends license to GraphDB upon confirmation\n function confirmWantedNewLicenseDetails(license, licenseCode) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/settings/modal/validate-license.html',\n controller: 'ValidateLicenseModalCtrl',\n size: 'lg',\n resolve: {\n license: function () {\n return license;\n }\n }\n });\n\n modalInstance.result.then(function () {\n registerLicense(licenseCode);\n });\n }\n\n // send license code to GraphDB for activation\n function registerLicense(licenseCode) {\n if (!licenseCode) {\n licenseCode = textAreaSel.val();\n }\n\n if (licenseCode) {\n // replacing whitespace makes this work on Safari too,\n // whereas other browser happily ignore the whitespace\n const decodedLicense = atob(licenseCode.replace(/\\s/g, ''));\n LicenseRestService.registerLicense(decodedLicense)\n .success(function () {\n $window.history.back();\n }).error(function () {\n toastr.error('Error registering GraphDB license');\n });\n } else {\n toastr.error('No license code available in textarea');\n }\n }\n}\n\nValidateLicenseModalCtrl.$inject = ['$scope', '$modalInstance', 'license'];\n\nfunction ValidateLicenseModalCtrl($scope, $modalInstance, license) {\n $scope.ok = ok;\n $scope.cancel = cancel;\n $scope.license = license;\n\n function ok() {\n $modalInstance.close();\n }\n\n function cancel() {\n $modalInstance.dismiss('cancel');\n }\n}\n\nLoaderSamplesCtrl.$inject = ['$scope'];\n\nfunction LoaderSamplesCtrl($scope) {\n $scope.loader = true;\n $scope.setLoader = function (loader) {\n $scope.loader = loader;\n };\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/settings/controllers.js"],"names":["ActiveLocationSettingsCtrl","$scope","toastr","$modalInstance","LicenseRestService","supportsStatistics","settings","statistics","getSettings","loader","getStatistics","then","response","data","status","msg","getError","error","setSettings","toggleStatistics","close","success","submitForm","cancel","dismiss","LicenseCtrl","$licenseService","$rootScope","ModalService","loadingLicense","checkLicenseStatus","revertToFree","openSimpleModal","title","message","warning","result","unregisterLicense","RegisterLicenseCtrl","$location","$modal","$window","$jwtAuth","$on","isAdmin","path","sendLicenseToValidateAndActivate","textAreaSel","$","licenseCode","sendLicenseToValidate","validatedLicense","licensee","val","license","open","templateUrl","controller","size","resolve","decodedLicense","atob","replace","registerLicense","history","back","confirmWantedNewLicenseDetails","$watch","currentFile","file","extractFromLicenseFile","getBackToPreviousPage","ValidateLicenseModalCtrl","ok","LoaderSamplesCtrl","setLoader","angular","module","$inject"],"mappings":"0FAAA,iBAkBA,SAASA,EAA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AA2B8E,QAAU,CAAC,SAAU,SAAU,iBAAkB,sBA4C5ErD,EAAYqD,QAAU,CAAC,SAAU,qBAAsB,kBAAmB,SAAU,aAAc,gBAyBlGxC,EAAoBwC,QAAU,CAAC,SAAU,qBAAsB,YAAa,SAAU,SAAU,UAAW,YA6F3GN,EAAyBM,QAAU,CAAC,SAAU,iBAAkB,WAgBhEJ,EAAkBI,QAAU,CAAC","file":"95.1f83b03f48326a6cec45.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\n\nangular\n .module('graphdb.framework.settings.controllers', [\n 'ngCookies',\n 'ui.bootstrap',\n 'graphdb.framework.core.services.jwtauth',\n 'toastr'\n ])\n .controller('ActiveLocationSettingsCtrl', ActiveLocationSettingsCtrl)\n .controller('ValidateLicenseModalCtrl', ValidateLicenseModalCtrl)\n .controller('LicenseCtrl', LicenseCtrl)\n .controller('RegisterLicenseCtrl', RegisterLicenseCtrl)\n .controller('LoaderSamplesCtrl', LoaderSamplesCtrl);\n\nActiveLocationSettingsCtrl.$inject = ['$scope', 'toastr', '$modalInstance', 'LicenseRestService'];\n\nfunction ActiveLocationSettingsCtrl($scope, toastr, $modalInstance, LicenseRestService) {\n $scope.supportsStatistics = true;\n $scope.settings = {statistics: false};\n $scope.getSettings = getSettings;\n\n function getSettings() {\n $scope.loader = true;\n LicenseRestService.getStatistics().then(function (response) {\n $scope.settings.statistics = response.data === 'true';\n $scope.supportsStatistics = true;\n }, function (response) {\n if (response.status === 404) {\n $scope.supportsStatistics = false;\n } else {\n const msg = getError(response.data);\n toastr.error(msg, 'Error getting settings');\n }\n });\n }\n\n $scope.getSettings();\n\n $scope.setSettings = function () {\n $scope.loader = true;\n LicenseRestService.toggleStatistics($scope.settings.statistics).then(function () {\n $modalInstance.close();\n toastr.success('Settings have been saved');\n }, function (response) {\n const msg = getError(response.data);\n toastr.error(msg, 'Error saving settings');\n });\n };\n\n $scope.submitForm = function () {\n $scope.setSettings();\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nLicenseCtrl.$inject = ['$scope', 'LicenseRestService', '$licenseService', 'toastr', '$rootScope', 'ModalService'];\n\nfunction LicenseCtrl($scope, LicenseRestService, $licenseService, toastr, $rootScope, ModalService) {\n\n $scope.loadingLicense = function() {\n return $licenseService.loadingLicense;\n };\n\n $licenseService.checkLicenseStatus();\n\n $scope.revertToFree = function () {\n ModalService.openSimpleModal({\n title: 'Confirm operation',\n message: \"Reverting to a GraphDB Free license will make SE and EE features unusable. Are you sure?\",\n warning: true\n }).result\n .then(function () {\n LicenseRestService.unregisterLicense()\n .success(function () {\n $licenseService.checkLicenseStatus();\n });\n });\n };\n}\n\nRegisterLicenseCtrl.$inject = ['$scope', 'LicenseRestService', '$location', '$modal', 'toastr', '$window', '$jwtAuth'];\n\nfunction RegisterLicenseCtrl($scope, LicenseRestService, $location, $modal, toastr, $window, $jwtAuth) {\n $scope.$on('securityInit', function () {\n if (!$jwtAuth.isAdmin()) {\n $location.path('/license');\n }\n });\n\n $scope.sendLicenseToValidateAndActivate = sendLicenseToValidateAndActivate;\n\n const textAreaSel = $('.license-textarea');\n\n // watch for uploaded license file\n $scope.$watch('currentFile', function () {\n if ($scope.currentFile) {\n const file = $scope.currentFile;\n LicenseRestService.extractFromLicenseFile(file)\n .success(function (licenseCode) {\n sendLicenseToValidateAndActivate(licenseCode);\n }).error(function () {\n toastr.error('Could not upload file');\n });\n }\n });\n\n $scope.getBackToPreviousPage = function () {\n $window.history.back();\n };\n\n // send license code for validation and activation\n function sendLicenseToValidateAndActivate(licenseCode) {\n LicenseRestService.sendLicenseToValidate(licenseCode)\n .success(function (validatedLicense) {\n if (validatedLicense.licensee !== 'Invalid') {\n // write code to textarea\n textAreaSel.val(licenseCode);\n // pop dialog for license details confirmation\n confirmWantedNewLicenseDetails(validatedLicense, licenseCode);\n } else {\n // clear textarea on invalid license\n textAreaSel.val('');\n // show error\n toastr.error(validatedLicense.message);\n }\n })\n .error(function () {\n toastr.error('Invalid license');\n });\n }\n\n\n // pops a modal dialog which asks you if your expected license details are correct\n // and sends license to GraphDB upon confirmation\n function confirmWantedNewLicenseDetails(license, licenseCode) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/settings/modal/validate-license.html',\n controller: 'ValidateLicenseModalCtrl',\n size: 'lg',\n resolve: {\n license: function () {\n return license;\n }\n }\n });\n\n modalInstance.result.then(function () {\n registerLicense(licenseCode);\n });\n }\n\n // send license code to GraphDB for activation\n function registerLicense(licenseCode) {\n if (!licenseCode) {\n licenseCode = textAreaSel.val();\n }\n\n if (licenseCode) {\n // replacing whitespace makes this work on Safari too,\n // whereas other browser happily ignore the whitespace\n const decodedLicense = atob(licenseCode.replace(/\\s/g, ''));\n LicenseRestService.registerLicense(decodedLicense)\n .success(function () {\n $window.history.back();\n }).error(function () {\n toastr.error('Error registering GraphDB license');\n });\n } else {\n toastr.error('No license code available in textarea');\n }\n }\n}\n\nValidateLicenseModalCtrl.$inject = ['$scope', '$modalInstance', 'license'];\n\nfunction ValidateLicenseModalCtrl($scope, $modalInstance, license) {\n $scope.ok = ok;\n $scope.cancel = cancel;\n $scope.license = license;\n\n function ok() {\n $modalInstance.close();\n }\n\n function cancel() {\n $modalInstance.dismiss('cancel');\n }\n}\n\nLoaderSamplesCtrl.$inject = ['$scope'];\n\nfunction LoaderSamplesCtrl($scope) {\n $scope.loader = true;\n $scope.setLoader = function (loader) {\n $scope.loader = loader;\n };\n}\n"],"sourceRoot":""}