iguazio.dashboard-controls 1.2.18 → 1.2.19-vistra-logs

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-controls",
3
- "version": "1.2.18",
3
+ "version": "1.2.19-vistra-logs",
4
4
  "main": "dist/js/iguazio.dashboard-controls.js",
5
5
  "description": "Collection of resources (such as CSS styles, fonts and images) and AngularJs 1.x components and services to share among different Iguazio repos.",
6
6
  "repository": {
@@ -35,12 +35,13 @@ such restriction.
35
35
  controller: NclVersionController
36
36
  });
37
37
 
38
- function NclVersionController($i18next, $interval, $rootScope, $scope, $state, $stateParams, $transitions, $timeout,
38
+ function NclVersionController($i18next, $interval, $injector, $rootScope, $scope, $state, $stateParams, $transitions, $timeout,
39
39
  i18next, lodash, ngDialog, ConfigService, DialogsService, ExportService,
40
40
  FunctionsService, GeneralDataService, NuclioHeaderService,
41
41
  VersionHelperService) {
42
42
  var ctrl = this;
43
43
  var deregisterFunction = null;
44
+ var servicesService = null;
44
45
  var interval = null;
45
46
  var lng = i18next.language;
46
47
 
@@ -227,6 +228,10 @@ such restriction.
227
228
  }
228
229
  });
229
230
 
231
+ if ($injector.has('ServicesService')) {
232
+ servicesService = $injector.get('ServicesService')
233
+ }
234
+
230
235
  setImageNamePrefixTemplate();
231
236
  setIngressHost();
232
237
  initLogTabs();
@@ -682,11 +687,18 @@ such restriction.
682
687
  * Checks if the "Execution log" tab should be shown
683
688
  */
684
689
  function initLogTabs() {
685
- if (lodash.get(ConfigService, 'nuclio.defaultProxyLogsSource', '') === 'elasticsearch') {
686
- ctrl.navigationTabsConfig.push({
687
- tabName: $i18next.t('functions:EXECUTION_LOG', { lng: lng }),
688
- id: 'execution-log',
689
- uiRoute: 'app.project.function.edit.execution-log'
690
+ if (lodash.get(ConfigService, 'url.elasticsearch.path', '') && servicesService) {
691
+ servicesService.getServices().then(function (result) {
692
+ var services = result.services;
693
+ var logForwarderService = lodash.find(services, ['spec.name', 'log-forwarder']);
694
+
695
+ if (servicesService.isEnabled(logForwarderService)) {
696
+ ctrl.navigationTabsConfig.push({
697
+ tabName: $i18next.t('functions:EXECUTION_LOG', { lng: lng }),
698
+ id: 'execution-log',
699
+ uiRoute: 'app.project.function.edit.execution-log'
700
+ });
701
+ }
690
702
  });
691
703
  }
692
704
  }