iguazio.dashboard-controls 1.2.17 → 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.17",
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": {
@@ -33,7 +33,7 @@
33
33
  "bootstrap": "~3.4.1",
34
34
  "del": "^6.1.1",
35
35
  "eslint-plugin-angular": "^4.0.1",
36
- "express": "4.19.2",
36
+ "express": "4.20.0",
37
37
  "gulp": "^4.0.2",
38
38
  "gulp-babel": "^8.0.0",
39
39
  "gulp-concat": "^2.6.1",
@@ -684,7 +684,7 @@ such restriction.
684
684
  ip: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
685
685
  mask: /^(((255\.){3}(255|254|252|248|240|224|192|128|0+))|((255\.){2}(255|254|252|248|240|224|192|128|0+)\.0)|((255\.)(255|254|252|248|240|224|192|128|0+)(\.0+){2})|((255|254|252|248|240|224|192|128|0+)(\.0+){3}))$/,
686
686
  hostName_IpAddress: /(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)|(^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9])\.)+([A-Za-z]|[A-Za-z][A-Za-z0-9-]*[A-Za-z0-9])$)/,
687
- dockerReference: /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*(:\d+)?\/)?[a-z0-9]+(([._]|__|[-]*)[a-z0-9]+)*(\/[a-z0-9]+(([._]|__|[-]*)[a-z0-9]+)*)*(:[\w][\w.-]{0,127})?(@[A-Za-z][A-Za-z0-9]*([-_+.][A-Za-z][A-Za-z0-9]*)*:[0-9a-fA-F]{32,})?$/,
687
+ dockerReference: /^(?!.*\/\/)(?:(?:[A-Za-z0-9](?:-[A-Za-z0-9]|[A-Za-z0-9])*)(?:\.(?:[A-Za-z0-9](?:-[A-Za-z0-9]|[A-Za-z0-9])*))*(?::\d+)?\/)?[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9._-]{0,127})?(?:@[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*:[0-9a-fA-F]{32,})?$/,
688
688
 
689
689
  getMaxLength: getMaxLength,
690
690
  getValidationRules: getValidationRules,
@@ -82,7 +82,7 @@ such restriction.
82
82
  */
83
83
  function getValidYaml(data) {
84
84
  function replacer(match, captureGroup1, captureGroup2) {
85
- return captureGroup1 + captureGroup2.replace(/"/g, '\\"');
85
+ return captureGroup1 + captureGroup2.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
86
86
  }
87
87
 
88
88
  return data.replace(/(\s*-)\s*\n\s+/g, '$1 ')
@@ -433,10 +433,11 @@ such restriction.
433
433
  * ```
434
434
  */
435
435
  function extractFileName(path, includeExtension, onlyExtension) {
436
- var start = path.lastIndexOf(lodash.defaultTo(onlyExtension, false) ? '.' : '/') + 1;
437
- var end = lodash.defaultTo(includeExtension, true) ? path.length : path.lastIndexOf('.');
436
+ var pathReplaced = lodash.defaultTo(path, '').replace(/\\/g, '/')
437
+ var start = pathReplaced.lastIndexOf(lodash.defaultTo(onlyExtension, false) ? '.' : '/') + 1;
438
+ var end = lodash.defaultTo(includeExtension, true) ? pathReplaced.length : pathReplaced.lastIndexOf('.');
438
439
 
439
- return lodash.defaultTo(path, '').replace('\\', '/').substring(start, end);
440
+ return pathReplaced.substring(start, end);
440
441
  }
441
442
 
442
443
  /**
@@ -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
  }