iguazio.dashboard-controls 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/i18n/en/functions.json +1 -1
- package/dist/js/iguazio.dashboard-controls.js +1973 -1972
- package/dist/less/iguazio.dashboard-controls.less +734 -734
- package/package.json +1 -1
- package/src/i18n/en/functions.json +1 -1
- package/src/igz_controls/services/control-panel-logs-data.service.js +2 -1
|
@@ -1528,7 +1528,8 @@ such restriction.
|
|
|
1528
1528
|
function prepareLogs(logs) {
|
|
1529
1529
|
return logs.map(function (logData) {
|
|
1530
1530
|
var log = lodash.get(logData, '_source', {});
|
|
1531
|
-
|
|
1531
|
+
var level = log.level ? ' (' + log.level + ') ' : '';
|
|
1532
|
+
return log['@timestamp'] + ' ' + log.name + level + lodash.get(log, 'message', '') + ' ' + JSON.stringify(lodash.get(log, 'more', {}));
|
|
1532
1533
|
});
|
|
1533
1534
|
}
|
|
1534
1535
|
}
|
|
@@ -5050,6 +5051,140 @@ such restriction.
|
|
|
5050
5051
|
})();
|
|
5051
5052
|
"use strict";
|
|
5052
5053
|
|
|
5054
|
+
/*
|
|
5055
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
5056
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
5057
|
+
an addition restriction as set forth herein. You may not use this
|
|
5058
|
+
file except in compliance with the License. You may obtain a copy of
|
|
5059
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5060
|
+
Unless required by applicable law or agreed to in writing, software
|
|
5061
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
5062
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
5063
|
+
implied. See the License for the specific language governing
|
|
5064
|
+
permissions and limitations under the License.
|
|
5065
|
+
In addition, you may not use the software for any purposes that are
|
|
5066
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
5067
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
5068
|
+
such restriction.
|
|
5069
|
+
*/
|
|
5070
|
+
(function () {
|
|
5071
|
+
'use strict';
|
|
5072
|
+
|
|
5073
|
+
IgzActionPanel.$inject = ["$scope", "$rootScope", "$i18next", "i18next", "lodash"];
|
|
5074
|
+
angular.module('iguazio.dashboard-controls').component('igzActionPanel', {
|
|
5075
|
+
bindings: {
|
|
5076
|
+
actions: '<',
|
|
5077
|
+
onItemsCheckedCount: '&?'
|
|
5078
|
+
},
|
|
5079
|
+
templateUrl: 'igz_controls/components/action-panel/action-panel.tpl.html',
|
|
5080
|
+
controller: IgzActionPanel,
|
|
5081
|
+
transclude: true
|
|
5082
|
+
});
|
|
5083
|
+
function IgzActionPanel($scope, $rootScope, $i18next, i18next, lodash) {
|
|
5084
|
+
var ctrl = this;
|
|
5085
|
+
var lng = i18next.language;
|
|
5086
|
+
var checkedItemsCount = 0;
|
|
5087
|
+
var mainActionsCount = 5;
|
|
5088
|
+
ctrl.mainActions = [];
|
|
5089
|
+
ctrl.remainActions = [];
|
|
5090
|
+
ctrl.$onInit = onInit;
|
|
5091
|
+
ctrl.$onChanges = onChanges;
|
|
5092
|
+
ctrl.isActionPanelShown = isActionPanelShown;
|
|
5093
|
+
|
|
5094
|
+
//
|
|
5095
|
+
// Hook methods
|
|
5096
|
+
//
|
|
5097
|
+
|
|
5098
|
+
/**
|
|
5099
|
+
* Initialization method
|
|
5100
|
+
*/
|
|
5101
|
+
function onInit() {
|
|
5102
|
+
$scope.$on('action-checkbox-all_checked-items-count-change', onUpdateCheckedItemsCount);
|
|
5103
|
+
$scope.$on('action-checkbox-all_check-all', onUpdateCheckedItemsCount);
|
|
5104
|
+
refreshActions();
|
|
5105
|
+
}
|
|
5106
|
+
|
|
5107
|
+
/**
|
|
5108
|
+
* On changes hook method
|
|
5109
|
+
*/
|
|
5110
|
+
function onChanges() {
|
|
5111
|
+
refreshActions();
|
|
5112
|
+
}
|
|
5113
|
+
|
|
5114
|
+
//
|
|
5115
|
+
// Private methods
|
|
5116
|
+
//
|
|
5117
|
+
|
|
5118
|
+
/**
|
|
5119
|
+
* Default action handler
|
|
5120
|
+
* @param {Object} action
|
|
5121
|
+
* @param {string} action.id - an action ID (e.g. delete, clone etc.)
|
|
5122
|
+
*/
|
|
5123
|
+
function defaultAction(action) {
|
|
5124
|
+
$rootScope.$broadcast('action-panel_fire-action', {
|
|
5125
|
+
action: action.id
|
|
5126
|
+
});
|
|
5127
|
+
}
|
|
5128
|
+
|
|
5129
|
+
/**
|
|
5130
|
+
* Checks whether the action panel can be shown
|
|
5131
|
+
* @returns {boolean}
|
|
5132
|
+
*/
|
|
5133
|
+
function isActionPanelShown() {
|
|
5134
|
+
return checkedItemsCount > 0;
|
|
5135
|
+
}
|
|
5136
|
+
|
|
5137
|
+
/**
|
|
5138
|
+
* Called when 'Check all' checkbox is clicked or checked some item.
|
|
5139
|
+
* @param {Event} event - $broadcast-ed event
|
|
5140
|
+
* @param {Object} data - $broadcast-ed data
|
|
5141
|
+
* @param {Object} data.checkedCount - count of checked items
|
|
5142
|
+
*/
|
|
5143
|
+
function onUpdateCheckedItemsCount(event, data) {
|
|
5144
|
+
checkedItemsCount = data.checkedCount;
|
|
5145
|
+
if (angular.isFunction(ctrl.onItemsCheckedCount)) {
|
|
5146
|
+
ctrl.onItemsCheckedCount({
|
|
5147
|
+
checkedCount: checkedItemsCount
|
|
5148
|
+
});
|
|
5149
|
+
}
|
|
5150
|
+
var visibleActions = lodash.filter(ctrl.actions, ['visible', true]);
|
|
5151
|
+
ctrl.mainActions = lodash.slice(visibleActions, 0, mainActionsCount);
|
|
5152
|
+
ctrl.remainingActions = lodash.slice(visibleActions, mainActionsCount, visibleActions.length);
|
|
5153
|
+
}
|
|
5154
|
+
|
|
5155
|
+
/**
|
|
5156
|
+
* Refreshes actions list
|
|
5157
|
+
*/
|
|
5158
|
+
function refreshActions() {
|
|
5159
|
+
ctrl.actions = lodash.filter(ctrl.actions, function (action) {
|
|
5160
|
+
return !lodash.has(action, 'visible') || action.visible;
|
|
5161
|
+
});
|
|
5162
|
+
angular.forEach(ctrl.actions, function (action) {
|
|
5163
|
+
if (!angular.isFunction(action.handler)) {
|
|
5164
|
+
action.handler = defaultAction;
|
|
5165
|
+
if (action.id === 'delete' && angular.isUndefined(action.confirm)) {
|
|
5166
|
+
action.confirm = {
|
|
5167
|
+
message: $i18next.t('common:DELETE_SELECTED_ITEMS_CONFIRM', {
|
|
5168
|
+
lng: lng
|
|
5169
|
+
}),
|
|
5170
|
+
yesLabel: $i18next.t('common:YES_DELETE', {
|
|
5171
|
+
lng: lng
|
|
5172
|
+
}),
|
|
5173
|
+
noLabel: $i18next.t('common:CANCEL', {
|
|
5174
|
+
lng: lng
|
|
5175
|
+
}),
|
|
5176
|
+
type: 'critical_alert'
|
|
5177
|
+
};
|
|
5178
|
+
}
|
|
5179
|
+
}
|
|
5180
|
+
});
|
|
5181
|
+
ctrl.mainActions = lodash.slice(ctrl.actions, 0, mainActionsCount);
|
|
5182
|
+
ctrl.remainingActions = lodash.slice(ctrl.actions, mainActionsCount, ctrl.actions.length);
|
|
5183
|
+
}
|
|
5184
|
+
}
|
|
5185
|
+
})();
|
|
5186
|
+
"use strict";
|
|
5187
|
+
|
|
5053
5188
|
/*
|
|
5054
5189
|
Copyright 2018 Iguazio Systems Ltd.
|
|
5055
5190
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -5298,26 +5433,26 @@ such restriction.
|
|
|
5298
5433
|
(function () {
|
|
5299
5434
|
'use strict';
|
|
5300
5435
|
|
|
5301
|
-
|
|
5302
|
-
angular.module('iguazio.dashboard-controls').component('
|
|
5436
|
+
IgzActionsPanesController.$inject = ["lodash", "ConfigService"];
|
|
5437
|
+
angular.module('iguazio.dashboard-controls').component('igzActionsPanes', {
|
|
5303
5438
|
bindings: {
|
|
5304
|
-
|
|
5305
|
-
|
|
5439
|
+
infoPaneDisable: '<?',
|
|
5440
|
+
isInfoPaneOpened: '<?',
|
|
5441
|
+
filtersToggleMethod: '&?',
|
|
5442
|
+
filtersCounter: '<?',
|
|
5443
|
+
isFiltersOpened: '<?',
|
|
5444
|
+
showFilterIcon: '@?',
|
|
5445
|
+
infoPaneToggleMethod: '&?',
|
|
5446
|
+
closeInfoPane: '&?'
|
|
5306
5447
|
},
|
|
5307
|
-
templateUrl: 'igz_controls/components/
|
|
5308
|
-
controller:
|
|
5309
|
-
transclude: true
|
|
5448
|
+
templateUrl: 'igz_controls/components/actions-panes/actions-panes.tpl.html',
|
|
5449
|
+
controller: IgzActionsPanesController
|
|
5310
5450
|
});
|
|
5311
|
-
function
|
|
5451
|
+
function IgzActionsPanesController(lodash, ConfigService) {
|
|
5312
5452
|
var ctrl = this;
|
|
5313
|
-
|
|
5314
|
-
var checkedItemsCount = 0;
|
|
5315
|
-
var mainActionsCount = 5;
|
|
5316
|
-
ctrl.mainActions = [];
|
|
5317
|
-
ctrl.remainActions = [];
|
|
5453
|
+
ctrl.callToggleMethod = null;
|
|
5318
5454
|
ctrl.$onInit = onInit;
|
|
5319
|
-
ctrl
|
|
5320
|
-
ctrl.isActionPanelShown = isActionPanelShown;
|
|
5455
|
+
ctrl.isShowFilterActionIcon = isShowFilterActionIcon;
|
|
5321
5456
|
|
|
5322
5457
|
//
|
|
5323
5458
|
// Hook methods
|
|
@@ -5327,230 +5462,19 @@ such restriction.
|
|
|
5327
5462
|
* Initialization method
|
|
5328
5463
|
*/
|
|
5329
5464
|
function onInit() {
|
|
5330
|
-
|
|
5331
|
-
$scope.$on('action-checkbox-all_check-all', onUpdateCheckedItemsCount);
|
|
5332
|
-
refreshActions();
|
|
5333
|
-
}
|
|
5334
|
-
|
|
5335
|
-
/**
|
|
5336
|
-
* On changes hook method
|
|
5337
|
-
*/
|
|
5338
|
-
function onChanges() {
|
|
5339
|
-
refreshActions();
|
|
5465
|
+
ctrl.callToggleMethod = angular.isFunction(ctrl.closeInfoPane) ? ctrl.closeInfoPane : ctrl.infoPaneToggleMethod;
|
|
5340
5466
|
}
|
|
5341
5467
|
|
|
5342
5468
|
//
|
|
5343
|
-
//
|
|
5469
|
+
// Public method
|
|
5344
5470
|
//
|
|
5345
5471
|
|
|
5346
5472
|
/**
|
|
5347
|
-
*
|
|
5348
|
-
* @param {Object} action
|
|
5349
|
-
* @param {string} action.id - an action ID (e.g. delete, clone etc.)
|
|
5350
|
-
*/
|
|
5351
|
-
function defaultAction(action) {
|
|
5352
|
-
$rootScope.$broadcast('action-panel_fire-action', {
|
|
5353
|
-
action: action.id
|
|
5354
|
-
});
|
|
5355
|
-
}
|
|
5356
|
-
|
|
5357
|
-
/**
|
|
5358
|
-
* Checks whether the action panel can be shown
|
|
5473
|
+
* Checks if filter toggles method exists and if filter pane should toggle only in demo mode
|
|
5359
5474
|
* @returns {boolean}
|
|
5360
5475
|
*/
|
|
5361
|
-
function
|
|
5362
|
-
return
|
|
5363
|
-
}
|
|
5364
|
-
|
|
5365
|
-
/**
|
|
5366
|
-
* Called when 'Check all' checkbox is clicked or checked some item.
|
|
5367
|
-
* @param {Event} event - $broadcast-ed event
|
|
5368
|
-
* @param {Object} data - $broadcast-ed data
|
|
5369
|
-
* @param {Object} data.checkedCount - count of checked items
|
|
5370
|
-
*/
|
|
5371
|
-
function onUpdateCheckedItemsCount(event, data) {
|
|
5372
|
-
checkedItemsCount = data.checkedCount;
|
|
5373
|
-
if (angular.isFunction(ctrl.onItemsCheckedCount)) {
|
|
5374
|
-
ctrl.onItemsCheckedCount({
|
|
5375
|
-
checkedCount: checkedItemsCount
|
|
5376
|
-
});
|
|
5377
|
-
}
|
|
5378
|
-
var visibleActions = lodash.filter(ctrl.actions, ['visible', true]);
|
|
5379
|
-
ctrl.mainActions = lodash.slice(visibleActions, 0, mainActionsCount);
|
|
5380
|
-
ctrl.remainingActions = lodash.slice(visibleActions, mainActionsCount, visibleActions.length);
|
|
5381
|
-
}
|
|
5382
|
-
|
|
5383
|
-
/**
|
|
5384
|
-
* Refreshes actions list
|
|
5385
|
-
*/
|
|
5386
|
-
function refreshActions() {
|
|
5387
|
-
ctrl.actions = lodash.filter(ctrl.actions, function (action) {
|
|
5388
|
-
return !lodash.has(action, 'visible') || action.visible;
|
|
5389
|
-
});
|
|
5390
|
-
angular.forEach(ctrl.actions, function (action) {
|
|
5391
|
-
if (!angular.isFunction(action.handler)) {
|
|
5392
|
-
action.handler = defaultAction;
|
|
5393
|
-
if (action.id === 'delete' && angular.isUndefined(action.confirm)) {
|
|
5394
|
-
action.confirm = {
|
|
5395
|
-
message: $i18next.t('common:DELETE_SELECTED_ITEMS_CONFIRM', {
|
|
5396
|
-
lng: lng
|
|
5397
|
-
}),
|
|
5398
|
-
yesLabel: $i18next.t('common:YES_DELETE', {
|
|
5399
|
-
lng: lng
|
|
5400
|
-
}),
|
|
5401
|
-
noLabel: $i18next.t('common:CANCEL', {
|
|
5402
|
-
lng: lng
|
|
5403
|
-
}),
|
|
5404
|
-
type: 'critical_alert'
|
|
5405
|
-
};
|
|
5406
|
-
}
|
|
5407
|
-
}
|
|
5408
|
-
});
|
|
5409
|
-
ctrl.mainActions = lodash.slice(ctrl.actions, 0, mainActionsCount);
|
|
5410
|
-
ctrl.remainingActions = lodash.slice(ctrl.actions, mainActionsCount, ctrl.actions.length);
|
|
5411
|
-
}
|
|
5412
|
-
}
|
|
5413
|
-
})();
|
|
5414
|
-
"use strict";
|
|
5415
|
-
|
|
5416
|
-
/*
|
|
5417
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
5418
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
5419
|
-
an addition restriction as set forth herein. You may not use this
|
|
5420
|
-
file except in compliance with the License. You may obtain a copy of
|
|
5421
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5422
|
-
Unless required by applicable law or agreed to in writing, software
|
|
5423
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
5424
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
5425
|
-
implied. See the License for the specific language governing
|
|
5426
|
-
permissions and limitations under the License.
|
|
5427
|
-
In addition, you may not use the software for any purposes that are
|
|
5428
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
5429
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
5430
|
-
such restriction.
|
|
5431
|
-
*/
|
|
5432
|
-
(function () {
|
|
5433
|
-
'use strict';
|
|
5434
|
-
|
|
5435
|
-
IgzActionsPanesController.$inject = ["lodash", "ConfigService"];
|
|
5436
|
-
angular.module('iguazio.dashboard-controls').component('igzActionsPanes', {
|
|
5437
|
-
bindings: {
|
|
5438
|
-
infoPaneDisable: '<?',
|
|
5439
|
-
isInfoPaneOpened: '<?',
|
|
5440
|
-
filtersToggleMethod: '&?',
|
|
5441
|
-
filtersCounter: '<?',
|
|
5442
|
-
isFiltersOpened: '<?',
|
|
5443
|
-
showFilterIcon: '@?',
|
|
5444
|
-
infoPaneToggleMethod: '&?',
|
|
5445
|
-
closeInfoPane: '&?'
|
|
5446
|
-
},
|
|
5447
|
-
templateUrl: 'igz_controls/components/actions-panes/actions-panes.tpl.html',
|
|
5448
|
-
controller: IgzActionsPanesController
|
|
5449
|
-
});
|
|
5450
|
-
function IgzActionsPanesController(lodash, ConfigService) {
|
|
5451
|
-
var ctrl = this;
|
|
5452
|
-
ctrl.callToggleMethod = null;
|
|
5453
|
-
ctrl.$onInit = onInit;
|
|
5454
|
-
ctrl.isShowFilterActionIcon = isShowFilterActionIcon;
|
|
5455
|
-
|
|
5456
|
-
//
|
|
5457
|
-
// Hook methods
|
|
5458
|
-
//
|
|
5459
|
-
|
|
5460
|
-
/**
|
|
5461
|
-
* Initialization method
|
|
5462
|
-
*/
|
|
5463
|
-
function onInit() {
|
|
5464
|
-
ctrl.callToggleMethod = angular.isFunction(ctrl.closeInfoPane) ? ctrl.closeInfoPane : ctrl.infoPaneToggleMethod;
|
|
5465
|
-
}
|
|
5466
|
-
|
|
5467
|
-
//
|
|
5468
|
-
// Public method
|
|
5469
|
-
//
|
|
5470
|
-
|
|
5471
|
-
/**
|
|
5472
|
-
* Checks if filter toggles method exists and if filter pane should toggle only in demo mode
|
|
5473
|
-
* @returns {boolean}
|
|
5474
|
-
*/
|
|
5475
|
-
function isShowFilterActionIcon() {
|
|
5476
|
-
return angular.isFunction(ctrl.filtersToggleMethod) && (lodash.isEqual(ctrl.showFilterIcon, 'true') || ConfigService.isDemoMode());
|
|
5477
|
-
}
|
|
5478
|
-
}
|
|
5479
|
-
})();
|
|
5480
|
-
"use strict";
|
|
5481
|
-
|
|
5482
|
-
/*
|
|
5483
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
5484
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
5485
|
-
an addition restriction as set forth herein. You may not use this
|
|
5486
|
-
file except in compliance with the License. You may obtain a copy of
|
|
5487
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5488
|
-
Unless required by applicable law or agreed to in writing, software
|
|
5489
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
5490
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
5491
|
-
implied. See the License for the specific language governing
|
|
5492
|
-
permissions and limitations under the License.
|
|
5493
|
-
In addition, you may not use the software for any purposes that are
|
|
5494
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
5495
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
5496
|
-
such restriction.
|
|
5497
|
-
*/
|
|
5498
|
-
(function () {
|
|
5499
|
-
'use strict';
|
|
5500
|
-
|
|
5501
|
-
IgzCopyToClipboard.$inject = ["$i18next", "i18next", "lodash", "DialogsService"];
|
|
5502
|
-
angular.module('iguazio.dashboard-controls').component('igzCopyToClipboard', {
|
|
5503
|
-
bindings: {
|
|
5504
|
-
tooltipPlacement: '@?',
|
|
5505
|
-
tooltipText: '@?',
|
|
5506
|
-
value: '<'
|
|
5507
|
-
},
|
|
5508
|
-
templateUrl: 'igz_controls/components/copy-to-clipboard/copy-to-clipboard.tpl.html',
|
|
5509
|
-
controller: IgzCopyToClipboard
|
|
5510
|
-
});
|
|
5511
|
-
function IgzCopyToClipboard($i18next, i18next, lodash, DialogsService) {
|
|
5512
|
-
var ctrl = this;
|
|
5513
|
-
var lng = i18next.language;
|
|
5514
|
-
ctrl.$onInit = onInit;
|
|
5515
|
-
ctrl.copyToClipboard = copyToClipboard;
|
|
5516
|
-
|
|
5517
|
-
//
|
|
5518
|
-
// Hook methods
|
|
5519
|
-
//
|
|
5520
|
-
|
|
5521
|
-
/**
|
|
5522
|
-
* Initialization method
|
|
5523
|
-
*/
|
|
5524
|
-
function onInit() {
|
|
5525
|
-
lodash.defaults(ctrl, {
|
|
5526
|
-
tooltipPlacement: 'top'
|
|
5527
|
-
});
|
|
5528
|
-
}
|
|
5529
|
-
|
|
5530
|
-
//
|
|
5531
|
-
// Public method
|
|
5532
|
-
//
|
|
5533
|
-
|
|
5534
|
-
/**
|
|
5535
|
-
* Copies a string to the clipboard.
|
|
5536
|
-
*/
|
|
5537
|
-
function copyToClipboard() {
|
|
5538
|
-
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
|
5539
|
-
var textarea = document.createElement('textarea');
|
|
5540
|
-
textarea.textContent = ctrl.value;
|
|
5541
|
-
textarea.style.position = 'fixed';
|
|
5542
|
-
document.body.appendChild(textarea);
|
|
5543
|
-
textarea.select();
|
|
5544
|
-
try {
|
|
5545
|
-
return document.execCommand('copy'); // Security exception may be thrown by some browsers.
|
|
5546
|
-
} catch (ex) {
|
|
5547
|
-
DialogsService.alert($i18next.t('common:COPY_TO_CLIPBOARD_FAILED', {
|
|
5548
|
-
lng: lng
|
|
5549
|
-
}), ex);
|
|
5550
|
-
} finally {
|
|
5551
|
-
document.body.removeChild(textarea);
|
|
5552
|
-
}
|
|
5553
|
-
}
|
|
5476
|
+
function isShowFilterActionIcon() {
|
|
5477
|
+
return angular.isFunction(ctrl.filtersToggleMethod) && (lodash.isEqual(ctrl.showFilterIcon, 'true') || ConfigService.isDemoMode());
|
|
5554
5478
|
}
|
|
5555
5479
|
}
|
|
5556
5480
|
})();
|
|
@@ -6019,6 +5943,83 @@ such restriction.
|
|
|
6019
5943
|
})();
|
|
6020
5944
|
"use strict";
|
|
6021
5945
|
|
|
5946
|
+
/*
|
|
5947
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
5948
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
5949
|
+
an addition restriction as set forth herein. You may not use this
|
|
5950
|
+
file except in compliance with the License. You may obtain a copy of
|
|
5951
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5952
|
+
Unless required by applicable law or agreed to in writing, software
|
|
5953
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
5954
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
5955
|
+
implied. See the License for the specific language governing
|
|
5956
|
+
permissions and limitations under the License.
|
|
5957
|
+
In addition, you may not use the software for any purposes that are
|
|
5958
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
5959
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
5960
|
+
such restriction.
|
|
5961
|
+
*/
|
|
5962
|
+
(function () {
|
|
5963
|
+
'use strict';
|
|
5964
|
+
|
|
5965
|
+
IgzCopyToClipboard.$inject = ["$i18next", "i18next", "lodash", "DialogsService"];
|
|
5966
|
+
angular.module('iguazio.dashboard-controls').component('igzCopyToClipboard', {
|
|
5967
|
+
bindings: {
|
|
5968
|
+
tooltipPlacement: '@?',
|
|
5969
|
+
tooltipText: '@?',
|
|
5970
|
+
value: '<'
|
|
5971
|
+
},
|
|
5972
|
+
templateUrl: 'igz_controls/components/copy-to-clipboard/copy-to-clipboard.tpl.html',
|
|
5973
|
+
controller: IgzCopyToClipboard
|
|
5974
|
+
});
|
|
5975
|
+
function IgzCopyToClipboard($i18next, i18next, lodash, DialogsService) {
|
|
5976
|
+
var ctrl = this;
|
|
5977
|
+
var lng = i18next.language;
|
|
5978
|
+
ctrl.$onInit = onInit;
|
|
5979
|
+
ctrl.copyToClipboard = copyToClipboard;
|
|
5980
|
+
|
|
5981
|
+
//
|
|
5982
|
+
// Hook methods
|
|
5983
|
+
//
|
|
5984
|
+
|
|
5985
|
+
/**
|
|
5986
|
+
* Initialization method
|
|
5987
|
+
*/
|
|
5988
|
+
function onInit() {
|
|
5989
|
+
lodash.defaults(ctrl, {
|
|
5990
|
+
tooltipPlacement: 'top'
|
|
5991
|
+
});
|
|
5992
|
+
}
|
|
5993
|
+
|
|
5994
|
+
//
|
|
5995
|
+
// Public method
|
|
5996
|
+
//
|
|
5997
|
+
|
|
5998
|
+
/**
|
|
5999
|
+
* Copies a string to the clipboard.
|
|
6000
|
+
*/
|
|
6001
|
+
function copyToClipboard() {
|
|
6002
|
+
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
|
6003
|
+
var textarea = document.createElement('textarea');
|
|
6004
|
+
textarea.textContent = ctrl.value;
|
|
6005
|
+
textarea.style.position = 'fixed';
|
|
6006
|
+
document.body.appendChild(textarea);
|
|
6007
|
+
textarea.select();
|
|
6008
|
+
try {
|
|
6009
|
+
return document.execCommand('copy'); // Security exception may be thrown by some browsers.
|
|
6010
|
+
} catch (ex) {
|
|
6011
|
+
DialogsService.alert($i18next.t('common:COPY_TO_CLIPBOARD_FAILED', {
|
|
6012
|
+
lng: lng
|
|
6013
|
+
}), ex);
|
|
6014
|
+
} finally {
|
|
6015
|
+
document.body.removeChild(textarea);
|
|
6016
|
+
}
|
|
6017
|
+
}
|
|
6018
|
+
}
|
|
6019
|
+
}
|
|
6020
|
+
})();
|
|
6021
|
+
"use strict";
|
|
6022
|
+
|
|
6022
6023
|
/*
|
|
6023
6024
|
Copyright 2018 Iguazio Systems Ltd.
|
|
6024
6025
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -11009,50 +11010,158 @@ such restriction.
|
|
|
11009
11010
|
(function () {
|
|
11010
11011
|
'use strict';
|
|
11011
11012
|
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
* @description
|
|
11015
|
-
* Text edit component. This component is a text editor based on `Monaco code editor`
|
|
11016
|
-
* https://github.com/Microsoft/monaco-editor
|
|
11017
|
-
*
|
|
11018
|
-
* @param {string} content - main text content which can be edited.
|
|
11019
|
-
* @param {Object} closeDialog - callback on closing editor dialog.
|
|
11020
|
-
* @param {Object} closeButtonText - name of the bottom close/cancel button.
|
|
11021
|
-
* @param {string} label - name of the text file.
|
|
11022
|
-
* @param {string} language - language of the current content (`plain text`, `javascript` etc.).
|
|
11023
|
-
* Note: uses for updating node after submitting
|
|
11024
|
-
* @param {string} submitButtonText - name of the bottom submit/apply button.
|
|
11025
|
-
* @param {Object} submitData - callback on submitting data.
|
|
11026
|
-
*/
|
|
11027
|
-
IgzTextPreviewController.$inject = ["$i18next", "$rootScope", "$scope", "$timeout", "i18next", "ngDialog", "lodash", "DialogsService"];
|
|
11028
|
-
angular.module('iguazio.dashboard-controls').component('igzTextEdit', {
|
|
11013
|
+
IgzToastStatusPanelController.$inject = ["$element", "$rootScope", "$timeout", "$transclude", "lodash"];
|
|
11014
|
+
angular.module('iguazio.dashboard-controls').component('igzToastStatusPanel', {
|
|
11029
11015
|
bindings: {
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
label: '@',
|
|
11035
|
-
language: '@',
|
|
11036
|
-
submitButtonText: '@',
|
|
11037
|
-
submitData: '&'
|
|
11016
|
+
onClose: '&?',
|
|
11017
|
+
panelMessages: '<',
|
|
11018
|
+
panelState: '<',
|
|
11019
|
+
permanent: '<?'
|
|
11038
11020
|
},
|
|
11039
|
-
templateUrl: 'igz_controls/components/
|
|
11040
|
-
controller:
|
|
11021
|
+
templateUrl: 'igz_controls/components/toast-status-panel/toast-status-panel.tpl.html',
|
|
11022
|
+
controller: IgzToastStatusPanelController,
|
|
11023
|
+
transclude: true
|
|
11041
11024
|
});
|
|
11042
|
-
function
|
|
11025
|
+
function IgzToastStatusPanelController($element, $rootScope, $timeout, $transclude, lodash) {
|
|
11043
11026
|
var ctrl = this;
|
|
11044
|
-
var
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
ctrl.
|
|
11050
|
-
ctrl
|
|
11051
|
-
ctrl
|
|
11052
|
-
ctrl.
|
|
11053
|
-
ctrl.
|
|
11054
|
-
|
|
11055
|
-
|
|
11027
|
+
var statusIcons = {
|
|
11028
|
+
'succeeded': 'igz-icon-tick-round',
|
|
11029
|
+
'in-progress': 'igz-icon-properties',
|
|
11030
|
+
'failed': 'igz-icon-block'
|
|
11031
|
+
};
|
|
11032
|
+
ctrl.isToastPanelShown = false;
|
|
11033
|
+
ctrl.isTranscludePassed = false;
|
|
11034
|
+
ctrl.$onChanges = onChanges;
|
|
11035
|
+
ctrl.closeToastPanel = closeToastPanel;
|
|
11036
|
+
ctrl.getState = getState;
|
|
11037
|
+
ctrl.getStateMessage = getStateMessage;
|
|
11038
|
+
|
|
11039
|
+
// checks if transclude template was passed
|
|
11040
|
+
$transclude(function (transclude) {
|
|
11041
|
+
ctrl.isTranscludePassed = transclude.length > 0 && !(
|
|
11042
|
+
// a single text node with whitespace only, meaning there is nothing important between the opening
|
|
11043
|
+
// tag `<igz-toast-status-panel>` and the closing tag `</igz-toast-status-panel>`
|
|
11044
|
+
transclude.length === 1 && transclude[0].nodeType === 3 && transclude.text().trim() === '');
|
|
11045
|
+
});
|
|
11046
|
+
|
|
11047
|
+
//
|
|
11048
|
+
// Hook methods
|
|
11049
|
+
//
|
|
11050
|
+
|
|
11051
|
+
/**
|
|
11052
|
+
* On changes method
|
|
11053
|
+
* @param {Object} changes
|
|
11054
|
+
*/
|
|
11055
|
+
function onChanges(changes) {
|
|
11056
|
+
if (lodash.has(changes, 'panelState')) {
|
|
11057
|
+
ctrl.isToastPanelShown = !lodash.isNil(changes.panelState.currentValue);
|
|
11058
|
+
$element.find('.panel-status-icon').removeClass(lodash.get(statusIcons, changes.panelState.previousValue)).addClass(lodash.get(statusIcons, changes.panelState.currentValue));
|
|
11059
|
+
$element.find('.toast-status-panel').removeClass(changes.panelState.previousValue).addClass(changes.panelState.currentValue);
|
|
11060
|
+
$element.find('.panel-status').removeClass(changes.panelState.previousValue).addClass(changes.panelState.currentValue);
|
|
11061
|
+
}
|
|
11062
|
+
}
|
|
11063
|
+
|
|
11064
|
+
//
|
|
11065
|
+
// Public methods
|
|
11066
|
+
//
|
|
11067
|
+
|
|
11068
|
+
/**
|
|
11069
|
+
* Shows/hides toast panel
|
|
11070
|
+
*/
|
|
11071
|
+
function closeToastPanel() {
|
|
11072
|
+
ctrl.isToastPanelShown = false;
|
|
11073
|
+
ctrl.panelState = null;
|
|
11074
|
+
if (lodash.isFunction(ctrl.onClose)) {
|
|
11075
|
+
ctrl.onClose();
|
|
11076
|
+
}
|
|
11077
|
+
$timeout(function () {
|
|
11078
|
+
$rootScope.$broadcast('igzWatchWindowResize::resize');
|
|
11079
|
+
});
|
|
11080
|
+
}
|
|
11081
|
+
|
|
11082
|
+
/**
|
|
11083
|
+
* Gets current state
|
|
11084
|
+
* @returns {?string} (e.g. "in-progress", "succeeded", "failed")
|
|
11085
|
+
*/
|
|
11086
|
+
function getState() {
|
|
11087
|
+
return ctrl.panelState;
|
|
11088
|
+
}
|
|
11089
|
+
|
|
11090
|
+
/**
|
|
11091
|
+
* Gets status message of given state
|
|
11092
|
+
* @param {string} state (e.g. "in-progress", "succeeded", "failed")
|
|
11093
|
+
* @returns {string}
|
|
11094
|
+
*/
|
|
11095
|
+
function getStateMessage(state) {
|
|
11096
|
+
return lodash.get(ctrl, ['panelMessages', state]);
|
|
11097
|
+
}
|
|
11098
|
+
}
|
|
11099
|
+
})();
|
|
11100
|
+
"use strict";
|
|
11101
|
+
|
|
11102
|
+
/*
|
|
11103
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
11104
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
11105
|
+
an addition restriction as set forth herein. You may not use this
|
|
11106
|
+
file except in compliance with the License. You may obtain a copy of
|
|
11107
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
11108
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11109
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11110
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
11111
|
+
implied. See the License for the specific language governing
|
|
11112
|
+
permissions and limitations under the License.
|
|
11113
|
+
In addition, you may not use the software for any purposes that are
|
|
11114
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
11115
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
11116
|
+
such restriction.
|
|
11117
|
+
*/
|
|
11118
|
+
(function () {
|
|
11119
|
+
'use strict';
|
|
11120
|
+
|
|
11121
|
+
/**
|
|
11122
|
+
* @name igzTextEdit
|
|
11123
|
+
* @description
|
|
11124
|
+
* Text edit component. This component is a text editor based on `Monaco code editor`
|
|
11125
|
+
* https://github.com/Microsoft/monaco-editor
|
|
11126
|
+
*
|
|
11127
|
+
* @param {string} content - main text content which can be edited.
|
|
11128
|
+
* @param {Object} closeDialog - callback on closing editor dialog.
|
|
11129
|
+
* @param {Object} closeButtonText - name of the bottom close/cancel button.
|
|
11130
|
+
* @param {string} label - name of the text file.
|
|
11131
|
+
* @param {string} language - language of the current content (`plain text`, `javascript` etc.).
|
|
11132
|
+
* Note: uses for updating node after submitting
|
|
11133
|
+
* @param {string} submitButtonText - name of the bottom submit/apply button.
|
|
11134
|
+
* @param {Object} submitData - callback on submitting data.
|
|
11135
|
+
*/
|
|
11136
|
+
IgzTextPreviewController.$inject = ["$i18next", "$rootScope", "$scope", "$timeout", "i18next", "ngDialog", "lodash", "DialogsService"];
|
|
11137
|
+
angular.module('iguazio.dashboard-controls').component('igzTextEdit', {
|
|
11138
|
+
bindings: {
|
|
11139
|
+
content: '@',
|
|
11140
|
+
closeDialog: '&',
|
|
11141
|
+
closeButtonText: '@',
|
|
11142
|
+
ngDialogId: '@',
|
|
11143
|
+
label: '@',
|
|
11144
|
+
language: '@',
|
|
11145
|
+
submitButtonText: '@',
|
|
11146
|
+
submitData: '&'
|
|
11147
|
+
},
|
|
11148
|
+
templateUrl: 'igz_controls/components/text-edit/text-edit.tpl.html',
|
|
11149
|
+
controller: IgzTextPreviewController
|
|
11150
|
+
});
|
|
11151
|
+
function IgzTextPreviewController($i18next, $rootScope, $scope, $timeout, i18next, ngDialog, lodash, DialogsService) {
|
|
11152
|
+
var ctrl = this;
|
|
11153
|
+
var lng = i18next.language;
|
|
11154
|
+
var contentCopy = '';
|
|
11155
|
+
ctrl.enableWordWrap = false;
|
|
11156
|
+
ctrl.fileChanged = false;
|
|
11157
|
+
ctrl.isLoadingState = false;
|
|
11158
|
+
ctrl.serverError = '';
|
|
11159
|
+
ctrl.$onInit = onInit;
|
|
11160
|
+
ctrl.onChangeText = onChangeText;
|
|
11161
|
+
ctrl.onClose = onClose;
|
|
11162
|
+
ctrl.onSubmit = onSubmit;
|
|
11163
|
+
|
|
11164
|
+
//
|
|
11056
11165
|
// Hook method
|
|
11057
11166
|
//
|
|
11058
11167
|
|
|
@@ -11147,114 +11256,6 @@ such restriction.
|
|
|
11147
11256
|
})();
|
|
11148
11257
|
"use strict";
|
|
11149
11258
|
|
|
11150
|
-
/*
|
|
11151
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
11152
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
11153
|
-
an addition restriction as set forth herein. You may not use this
|
|
11154
|
-
file except in compliance with the License. You may obtain a copy of
|
|
11155
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
11156
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11157
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11158
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
11159
|
-
implied. See the License for the specific language governing
|
|
11160
|
-
permissions and limitations under the License.
|
|
11161
|
-
In addition, you may not use the software for any purposes that are
|
|
11162
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
11163
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
11164
|
-
such restriction.
|
|
11165
|
-
*/
|
|
11166
|
-
(function () {
|
|
11167
|
-
'use strict';
|
|
11168
|
-
|
|
11169
|
-
IgzToastStatusPanelController.$inject = ["$element", "$rootScope", "$timeout", "$transclude", "lodash"];
|
|
11170
|
-
angular.module('iguazio.dashboard-controls').component('igzToastStatusPanel', {
|
|
11171
|
-
bindings: {
|
|
11172
|
-
onClose: '&?',
|
|
11173
|
-
panelMessages: '<',
|
|
11174
|
-
panelState: '<',
|
|
11175
|
-
permanent: '<?'
|
|
11176
|
-
},
|
|
11177
|
-
templateUrl: 'igz_controls/components/toast-status-panel/toast-status-panel.tpl.html',
|
|
11178
|
-
controller: IgzToastStatusPanelController,
|
|
11179
|
-
transclude: true
|
|
11180
|
-
});
|
|
11181
|
-
function IgzToastStatusPanelController($element, $rootScope, $timeout, $transclude, lodash) {
|
|
11182
|
-
var ctrl = this;
|
|
11183
|
-
var statusIcons = {
|
|
11184
|
-
'succeeded': 'igz-icon-tick-round',
|
|
11185
|
-
'in-progress': 'igz-icon-properties',
|
|
11186
|
-
'failed': 'igz-icon-block'
|
|
11187
|
-
};
|
|
11188
|
-
ctrl.isToastPanelShown = false;
|
|
11189
|
-
ctrl.isTranscludePassed = false;
|
|
11190
|
-
ctrl.$onChanges = onChanges;
|
|
11191
|
-
ctrl.closeToastPanel = closeToastPanel;
|
|
11192
|
-
ctrl.getState = getState;
|
|
11193
|
-
ctrl.getStateMessage = getStateMessage;
|
|
11194
|
-
|
|
11195
|
-
// checks if transclude template was passed
|
|
11196
|
-
$transclude(function (transclude) {
|
|
11197
|
-
ctrl.isTranscludePassed = transclude.length > 0 && !(
|
|
11198
|
-
// a single text node with whitespace only, meaning there is nothing important between the opening
|
|
11199
|
-
// tag `<igz-toast-status-panel>` and the closing tag `</igz-toast-status-panel>`
|
|
11200
|
-
transclude.length === 1 && transclude[0].nodeType === 3 && transclude.text().trim() === '');
|
|
11201
|
-
});
|
|
11202
|
-
|
|
11203
|
-
//
|
|
11204
|
-
// Hook methods
|
|
11205
|
-
//
|
|
11206
|
-
|
|
11207
|
-
/**
|
|
11208
|
-
* On changes method
|
|
11209
|
-
* @param {Object} changes
|
|
11210
|
-
*/
|
|
11211
|
-
function onChanges(changes) {
|
|
11212
|
-
if (lodash.has(changes, 'panelState')) {
|
|
11213
|
-
ctrl.isToastPanelShown = !lodash.isNil(changes.panelState.currentValue);
|
|
11214
|
-
$element.find('.panel-status-icon').removeClass(lodash.get(statusIcons, changes.panelState.previousValue)).addClass(lodash.get(statusIcons, changes.panelState.currentValue));
|
|
11215
|
-
$element.find('.toast-status-panel').removeClass(changes.panelState.previousValue).addClass(changes.panelState.currentValue);
|
|
11216
|
-
$element.find('.panel-status').removeClass(changes.panelState.previousValue).addClass(changes.panelState.currentValue);
|
|
11217
|
-
}
|
|
11218
|
-
}
|
|
11219
|
-
|
|
11220
|
-
//
|
|
11221
|
-
// Public methods
|
|
11222
|
-
//
|
|
11223
|
-
|
|
11224
|
-
/**
|
|
11225
|
-
* Shows/hides toast panel
|
|
11226
|
-
*/
|
|
11227
|
-
function closeToastPanel() {
|
|
11228
|
-
ctrl.isToastPanelShown = false;
|
|
11229
|
-
ctrl.panelState = null;
|
|
11230
|
-
if (lodash.isFunction(ctrl.onClose)) {
|
|
11231
|
-
ctrl.onClose();
|
|
11232
|
-
}
|
|
11233
|
-
$timeout(function () {
|
|
11234
|
-
$rootScope.$broadcast('igzWatchWindowResize::resize');
|
|
11235
|
-
});
|
|
11236
|
-
}
|
|
11237
|
-
|
|
11238
|
-
/**
|
|
11239
|
-
* Gets current state
|
|
11240
|
-
* @returns {?string} (e.g. "in-progress", "succeeded", "failed")
|
|
11241
|
-
*/
|
|
11242
|
-
function getState() {
|
|
11243
|
-
return ctrl.panelState;
|
|
11244
|
-
}
|
|
11245
|
-
|
|
11246
|
-
/**
|
|
11247
|
-
* Gets status message of given state
|
|
11248
|
-
* @param {string} state (e.g. "in-progress", "succeeded", "failed")
|
|
11249
|
-
* @returns {string}
|
|
11250
|
-
*/
|
|
11251
|
-
function getStateMessage(state) {
|
|
11252
|
-
return lodash.get(ctrl, ['panelMessages', state]);
|
|
11253
|
-
}
|
|
11254
|
-
}
|
|
11255
|
-
})();
|
|
11256
|
-
"use strict";
|
|
11257
|
-
|
|
11258
11259
|
/*
|
|
11259
11260
|
Copyright 2018 Iguazio Systems Ltd.
|
|
11260
11261
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -13432,231 +13433,80 @@ illegal under applicable law, and the grant of the foregoing license
|
|
|
13432
13433
|
under the Apache 2.0 license is conditioned upon your compliance with
|
|
13433
13434
|
such restriction.
|
|
13434
13435
|
*/
|
|
13435
|
-
/* eslint max-statements: ["error", 80] */
|
|
13436
13436
|
(function () {
|
|
13437
13437
|
'use strict';
|
|
13438
13438
|
|
|
13439
|
-
|
|
13440
|
-
angular.module('iguazio.dashboard-controls').component('
|
|
13439
|
+
NclVersionConfigurationEnvironmentVariablesController.$inject = ["$element", "$i18next", "$rootScope", "$timeout", "i18next", "lodash", "FormValidationService", "PreventDropdownCutOffService", "ValidationService"];
|
|
13440
|
+
angular.module('iguazio.dashboard-controls').component('nclVersionConfigurationEnvironmentVariables', {
|
|
13441
13441
|
bindings: {
|
|
13442
13442
|
version: '<',
|
|
13443
13443
|
onChangeCallback: '<',
|
|
13444
13444
|
isFunctionDeploying: '&'
|
|
13445
13445
|
},
|
|
13446
|
-
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-
|
|
13447
|
-
controller:
|
|
13446
|
+
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-environment-variables/version-configuration-environment-variables.tpl.html',
|
|
13447
|
+
controller: NclVersionConfigurationEnvironmentVariablesController
|
|
13448
13448
|
});
|
|
13449
|
-
function
|
|
13449
|
+
function NclVersionConfigurationEnvironmentVariablesController($element, $i18next, $rootScope, $timeout, i18next, lodash, FormValidationService, PreventDropdownCutOffService, ValidationService) {
|
|
13450
13450
|
var ctrl = this;
|
|
13451
13451
|
var lng = i18next.language;
|
|
13452
|
-
var
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
unit: 'G',
|
|
13456
|
-
root: 1000,
|
|
13457
|
-
power: 3
|
|
13458
|
-
};
|
|
13459
|
-
var preemptionMode = '';
|
|
13460
|
-
var scaleResourcesCopy = [];
|
|
13461
|
-
var scaleToZero = {};
|
|
13462
|
-
ctrl.cpuDropdownOptions = [{
|
|
13463
|
-
id: 'millicores',
|
|
13464
|
-
name: 'millicpu',
|
|
13465
|
-
unit: 'm',
|
|
13466
|
-
precision: '0',
|
|
13467
|
-
step: '100',
|
|
13468
|
-
minValue: 1,
|
|
13469
|
-
placeholder: '1500',
|
|
13470
|
-
onChange: function onChange(value) {
|
|
13471
|
-
return parseFloat(value) * 1000;
|
|
13472
|
-
},
|
|
13473
|
-
convertValue: function convertValue(value) {
|
|
13474
|
-
return parseInt(value);
|
|
13475
|
-
}
|
|
13476
|
-
}, {
|
|
13477
|
-
id: 'cpu',
|
|
13478
|
-
name: 'cpu',
|
|
13479
|
-
unit: '',
|
|
13480
|
-
precision: '3',
|
|
13481
|
-
step: '0.1',
|
|
13482
|
-
minValue: 0.1,
|
|
13483
|
-
placeholder: '1.5',
|
|
13484
|
-
onChange: function onChange(value) {
|
|
13485
|
-
return parseInt(value) / 1000;
|
|
13486
|
-
},
|
|
13487
|
-
convertValue: function convertValue(value) {
|
|
13488
|
-
return parseFloat(value) * 1000;
|
|
13489
|
-
}
|
|
13490
|
-
}];
|
|
13491
|
-
ctrl.defaultFunctionConfig = lodash.get(ConfigService, 'nuclio.defaultFunctionConfig.attributes', {});
|
|
13492
|
-
ctrl.dropdownOptions = [{
|
|
13493
|
-
id: 'bytes',
|
|
13494
|
-
name: 'Bytes',
|
|
13495
|
-
unit: '',
|
|
13496
|
-
root: 0,
|
|
13497
|
-
power: 0
|
|
13498
|
-
}, {
|
|
13499
|
-
id: 'kb',
|
|
13500
|
-
name: 'KB',
|
|
13501
|
-
unit: 'k',
|
|
13502
|
-
root: 1000,
|
|
13503
|
-
power: 1
|
|
13504
|
-
}, {
|
|
13505
|
-
id: 'kib',
|
|
13506
|
-
name: 'KiB',
|
|
13507
|
-
unit: 'Ki',
|
|
13508
|
-
root: 1024,
|
|
13509
|
-
power: 1
|
|
13510
|
-
}, {
|
|
13511
|
-
id: 'mb',
|
|
13512
|
-
name: 'MB',
|
|
13513
|
-
unit: 'M',
|
|
13514
|
-
root: 1000,
|
|
13515
|
-
power: 2
|
|
13516
|
-
}, {
|
|
13517
|
-
id: 'mib',
|
|
13518
|
-
name: 'MiB',
|
|
13519
|
-
unit: 'Mi',
|
|
13520
|
-
root: 1024,
|
|
13521
|
-
power: 2
|
|
13522
|
-
}, {
|
|
13523
|
-
id: 'gb',
|
|
13524
|
-
name: 'GB',
|
|
13525
|
-
unit: 'G',
|
|
13526
|
-
root: 1000,
|
|
13527
|
-
power: 3
|
|
13528
|
-
}, {
|
|
13529
|
-
id: 'gib',
|
|
13530
|
-
name: 'GiB',
|
|
13531
|
-
unit: 'Gi',
|
|
13532
|
-
root: 1024,
|
|
13533
|
-
power: 3
|
|
13534
|
-
}, {
|
|
13535
|
-
id: 'tb',
|
|
13536
|
-
name: 'TB',
|
|
13537
|
-
unit: 'T',
|
|
13538
|
-
root: 1000,
|
|
13539
|
-
power: 4
|
|
13540
|
-
}, {
|
|
13541
|
-
id: 'tib',
|
|
13542
|
-
name: 'TiB',
|
|
13543
|
-
unit: 'Ti',
|
|
13544
|
-
root: 1024,
|
|
13545
|
-
power: 4
|
|
13546
|
-
}, {
|
|
13547
|
-
id: 'pb',
|
|
13548
|
-
name: 'PB',
|
|
13549
|
-
unit: 'P',
|
|
13550
|
-
root: 1000,
|
|
13551
|
-
power: 5
|
|
13552
|
-
}, {
|
|
13553
|
-
id: 'pib',
|
|
13554
|
-
name: 'PiB',
|
|
13555
|
-
unit: 'Pi',
|
|
13556
|
-
root: 1024,
|
|
13557
|
-
power: 5
|
|
13558
|
-
}, {
|
|
13559
|
-
id: 'eb',
|
|
13560
|
-
name: 'EB',
|
|
13561
|
-
unit: 'E',
|
|
13562
|
-
root: 1000,
|
|
13563
|
-
power: 6
|
|
13564
|
-
}, {
|
|
13565
|
-
id: 'eib',
|
|
13566
|
-
name: 'EiB',
|
|
13567
|
-
unit: 'Ei',
|
|
13568
|
-
root: 1024,
|
|
13569
|
-
power: 6
|
|
13570
|
-
}];
|
|
13571
|
-
ctrl.nodeSelectors = [];
|
|
13572
|
-
ctrl.nodeSelectorsValidationRules = {
|
|
13573
|
-
key: ValidationService.getValidationRules('nodeSelectors.key').concat([{
|
|
13574
|
-
name: 'uniqueness',
|
|
13575
|
-
label: $i18next.t('common:UNIQUENESS', {
|
|
13576
|
-
lng: lng
|
|
13577
|
-
}),
|
|
13578
|
-
pattern: validateNodeSelectorUniqueness
|
|
13579
|
-
}]),
|
|
13580
|
-
value: ValidationService.getValidationRules('nodeSelectors.value')
|
|
13581
|
-
};
|
|
13582
|
-
ctrl.podsPriorityOptions = [{
|
|
13583
|
-
id: 'igz-workload-high',
|
|
13584
|
-
name: 'High'
|
|
13585
|
-
}, {
|
|
13586
|
-
id: 'igz-workload-medium',
|
|
13587
|
-
name: 'Medium'
|
|
13588
|
-
}, {
|
|
13589
|
-
id: 'igz-workload-low',
|
|
13590
|
-
name: 'Low'
|
|
13591
|
-
}];
|
|
13592
|
-
ctrl.podTolerationsOptions = [{
|
|
13593
|
-
id: 'allow',
|
|
13594
|
-
name: 'Allow',
|
|
13595
|
-
tooltip: $i18next.t('functions:TOOLTIP.POD_TOLERATIONS.ALLOW', {
|
|
13452
|
+
var envVariableFromValidationRules = ValidationService.getValidationRules('k8s.configMapKey', [{
|
|
13453
|
+
name: 'uniqueness',
|
|
13454
|
+
label: $i18next.t('common:UNIQUENESS', {
|
|
13596
13455
|
lng: lng
|
|
13597
|
-
})
|
|
13598
|
-
|
|
13599
|
-
|
|
13600
|
-
|
|
13601
|
-
|
|
13456
|
+
}),
|
|
13457
|
+
pattern: validateUniqueness.bind(null, ['configMapRef.name', 'secretRef.name'])
|
|
13458
|
+
}]);
|
|
13459
|
+
var envVariableKeyValidationRule = ValidationService.getValidationRules('k8s.envVarName', [{
|
|
13460
|
+
name: 'uniqueness',
|
|
13461
|
+
label: $i18next.t('common:UNIQUENESS', {
|
|
13602
13462
|
lng: lng
|
|
13603
|
-
})
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
|
|
13463
|
+
}),
|
|
13464
|
+
pattern: validateUniqueness.bind(null, ['name'])
|
|
13465
|
+
}]);
|
|
13466
|
+
var envVariableConfigmapKeyValidationRule = ValidationService.getValidationRules('k8s.configMapKey', [{
|
|
13467
|
+
name: 'uniqueness',
|
|
13468
|
+
label: $i18next.t('common:UNIQUENESS', {
|
|
13608
13469
|
lng: lng
|
|
13609
|
-
})
|
|
13610
|
-
|
|
13611
|
-
|
|
13612
|
-
ctrl.
|
|
13613
|
-
ctrl.
|
|
13614
|
-
|
|
13615
|
-
|
|
13470
|
+
}),
|
|
13471
|
+
pattern: validateUniqueness.bind(null, ['valueFrom.configMapKeyRef.key'])
|
|
13472
|
+
}]);
|
|
13473
|
+
ctrl.environmentVariablesForm = null;
|
|
13474
|
+
ctrl.igzScrollConfig = {
|
|
13475
|
+
maxElementsCount: 10,
|
|
13476
|
+
childrenSelector: '.table-body'
|
|
13477
|
+
};
|
|
13478
|
+
ctrl.validationRules = {
|
|
13479
|
+
key: envVariableKeyValidationRule,
|
|
13480
|
+
secretKey: ValidationService.getValidationRules('k8s.configMapKey'),
|
|
13481
|
+
secret: ValidationService.getValidationRules('k8s.secretName'),
|
|
13482
|
+
configmapKey: envVariableConfigmapKeyValidationRule,
|
|
13483
|
+
configmapRef: envVariableFromValidationRules,
|
|
13484
|
+
secretRef: envVariableFromValidationRules
|
|
13485
|
+
};
|
|
13486
|
+
ctrl.variables = [];
|
|
13487
|
+
ctrl.scrollConfig = {
|
|
13488
|
+
axis: 'y',
|
|
13489
|
+
advanced: {
|
|
13490
|
+
updateOnContentResize: true
|
|
13491
|
+
}
|
|
13492
|
+
};
|
|
13493
|
+
ctrl.$postLink = postLink;
|
|
13616
13494
|
ctrl.$onChanges = onChanges;
|
|
13617
|
-
ctrl
|
|
13618
|
-
ctrl.
|
|
13619
|
-
ctrl.
|
|
13620
|
-
ctrl.
|
|
13621
|
-
ctrl.getVersionPreemptionMode = getVersionPreemptionMode;
|
|
13622
|
-
ctrl.gpuInputCallback = gpuInputCallback;
|
|
13623
|
-
ctrl.handleNodeSelectorsAction = handleNodeSelectorsAction;
|
|
13624
|
-
ctrl.handleRevertToDefaultsClick = handleRevertToDefaultsClick;
|
|
13625
|
-
ctrl.isPodsPriorityShown = isPodsPriorityShown;
|
|
13626
|
-
ctrl.isInactivityWindowShown = isInactivityWindowShown;
|
|
13627
|
-
ctrl.memoryDropdownCallback = memoryDropdownCallback;
|
|
13628
|
-
ctrl.memoryInputCallback = memoryInputCallback;
|
|
13629
|
-
ctrl.onChangeNodeSelectorsData = onChangeNodeSelectorsData;
|
|
13630
|
-
ctrl.podTolerationDropdownCallback = podTolerationDropdownCallback;
|
|
13631
|
-
ctrl.podsPriorityDropdownCallback = podsPriorityDropdownCallback;
|
|
13632
|
-
ctrl.replicasInputCallback = replicasInputCallback;
|
|
13633
|
-
ctrl.sliderInputCallback = sliderInputCallback;
|
|
13495
|
+
ctrl.addNewVariable = addNewVariable;
|
|
13496
|
+
ctrl.handleAction = handleAction;
|
|
13497
|
+
ctrl.onChangeData = onChangeData;
|
|
13498
|
+
ctrl.onChangeType = onChangeType;
|
|
13634
13499
|
|
|
13635
13500
|
//
|
|
13636
13501
|
// Hook methods
|
|
13637
13502
|
//
|
|
13638
13503
|
|
|
13639
13504
|
/**
|
|
13640
|
-
*
|
|
13505
|
+
* Post linking method
|
|
13641
13506
|
*/
|
|
13642
|
-
function
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
}
|
|
13646
|
-
initTargetCpuSlider();
|
|
13647
|
-
preemptionMode = getVersionPreemptionMode() || lodash.get(ctrl.defaultFunctionConfig, 'spec.preemptionMode');
|
|
13648
|
-
if (preemptionMode) {
|
|
13649
|
-
initPodToleration();
|
|
13650
|
-
}
|
|
13651
|
-
ctrl.memoryWarningOpen = false;
|
|
13652
|
-
$timeout(function () {
|
|
13653
|
-
$scope.$watch('$ctrl.resourcesForm.$invalid', function (value) {
|
|
13654
|
-
$rootScope.$broadcast('change-state-deploy-button', {
|
|
13655
|
-
component: 'resources',
|
|
13656
|
-
isDisabled: value
|
|
13657
|
-
});
|
|
13658
|
-
});
|
|
13659
|
-
});
|
|
13507
|
+
function postLink() {
|
|
13508
|
+
// Bind DOM-related preventDropdownCutOff method to component's controller
|
|
13509
|
+
PreventDropdownCutOffService.preventDropdownCutOff($element, '.three-dot-menu');
|
|
13660
13510
|
}
|
|
13661
13511
|
|
|
13662
13512
|
/**
|
|
@@ -13665,27 +13515,25 @@ such restriction.
|
|
|
13665
13515
|
*/
|
|
13666
13516
|
function onChanges(changes) {
|
|
13667
13517
|
if (angular.isDefined(changes.version)) {
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
isDisabled: lodash.get(ctrl.resourcesForm, '$invalid', false)
|
|
13688
|
-
});
|
|
13518
|
+
ctrl.variables = lodash.chain(lodash.get(ctrl.version, 'spec.env', [])).concat(lodash.get(ctrl.version, 'spec.envFrom', [])).map(function (variable) {
|
|
13519
|
+
variable.ui = {
|
|
13520
|
+
editModeActive: false,
|
|
13521
|
+
isFormValid: false,
|
|
13522
|
+
name: 'variable'
|
|
13523
|
+
};
|
|
13524
|
+
return variable;
|
|
13525
|
+
}).value();
|
|
13526
|
+
ctrl.isOnlyValueTypeInputs = !lodash.some(ctrl.variables, 'valueFrom');
|
|
13527
|
+
$timeout(function () {
|
|
13528
|
+
if (ctrl.environmentVariablesForm.$invalid) {
|
|
13529
|
+
ctrl.environmentVariablesForm.$setSubmitted();
|
|
13530
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
13531
|
+
component: 'variable',
|
|
13532
|
+
isDisabled: true
|
|
13533
|
+
});
|
|
13534
|
+
}
|
|
13535
|
+
});
|
|
13536
|
+
}
|
|
13689
13537
|
}
|
|
13690
13538
|
|
|
13691
13539
|
//
|
|
@@ -13693,1081 +13541,1283 @@ such restriction.
|
|
|
13693
13541
|
//
|
|
13694
13542
|
|
|
13695
13543
|
/**
|
|
13696
|
-
* Adds new
|
|
13697
|
-
* param {Event} event - native event object
|
|
13544
|
+
* Adds new variable
|
|
13698
13545
|
*/
|
|
13699
|
-
function
|
|
13546
|
+
function addNewVariable(event) {
|
|
13700
13547
|
if (ctrl.isFunctionDeploying()) {
|
|
13701
13548
|
return;
|
|
13702
13549
|
}
|
|
13703
13550
|
$timeout(function () {
|
|
13704
|
-
if (ctrl.
|
|
13705
|
-
ctrl.
|
|
13551
|
+
if (ctrl.variables.length < 1 || lodash.chain(ctrl.variables).last().get('ui.isFormValid', true).value()) {
|
|
13552
|
+
ctrl.variables.push({
|
|
13706
13553
|
name: '',
|
|
13707
13554
|
value: '',
|
|
13708
13555
|
ui: {
|
|
13709
13556
|
editModeActive: true,
|
|
13710
13557
|
isFormValid: false,
|
|
13711
|
-
name: '
|
|
13558
|
+
name: 'variable'
|
|
13712
13559
|
}
|
|
13713
13560
|
});
|
|
13561
|
+
ctrl.environmentVariablesForm.$setPristine();
|
|
13714
13562
|
$rootScope.$broadcast('change-state-deploy-button', {
|
|
13715
|
-
component: '
|
|
13563
|
+
component: 'variable',
|
|
13716
13564
|
isDisabled: true
|
|
13717
13565
|
});
|
|
13718
13566
|
event.stopPropagation();
|
|
13719
|
-
checkNodeSelectorsIdentity();
|
|
13720
13567
|
}
|
|
13721
13568
|
}, 50);
|
|
13722
13569
|
}
|
|
13723
13570
|
|
|
13724
13571
|
/**
|
|
13725
|
-
*
|
|
13726
|
-
* @param {Object} item
|
|
13727
|
-
* @param {boolean} isItemChanged
|
|
13728
|
-
* @param {string} field
|
|
13729
|
-
*/
|
|
13730
|
-
function cpuDropdownCallback(item, isItemChanged, field) {
|
|
13731
|
-
if (!lodash.isEqual(item, ctrl[field])) {
|
|
13732
|
-
if (isRequestsInput(field)) {
|
|
13733
|
-
if (ctrl.resources.requests.cpu) {
|
|
13734
|
-
ctrl.resources.requests.cpu = item.onChange(ctrl.resources.requests.cpu);
|
|
13735
|
-
lodash.set(ctrl.version, 'spec.resources.requests.cpu', ctrl.resources.requests.cpu + item.unit);
|
|
13736
|
-
}
|
|
13737
|
-
} else if (ctrl.resources.limits.cpu) {
|
|
13738
|
-
ctrl.resources.limits.cpu = item.onChange(ctrl.resources.limits.cpu);
|
|
13739
|
-
lodash.set(ctrl.version, 'spec.resources.limits.cpu', ctrl.resources.limits.cpu + item.unit);
|
|
13740
|
-
}
|
|
13741
|
-
lodash.set(ctrl, field, item);
|
|
13742
|
-
checkIfCpuInputsValid();
|
|
13743
|
-
}
|
|
13744
|
-
}
|
|
13745
|
-
|
|
13746
|
-
/**
|
|
13747
|
-
* Number input callback
|
|
13748
|
-
* @param {number} newData
|
|
13749
|
-
* @param {string} field
|
|
13750
|
-
*/
|
|
13751
|
-
function cpuInputCallback(newData, field) {
|
|
13752
|
-
if (angular.isNumber(newData)) {
|
|
13753
|
-
if (isRequestsInput(field)) {
|
|
13754
|
-
ctrl.resources.requests.cpu = newData;
|
|
13755
|
-
newData = newData + ctrl.selectedCpuRequestItem.unit;
|
|
13756
|
-
} else {
|
|
13757
|
-
ctrl.resources.limits.cpu = newData;
|
|
13758
|
-
newData = newData + ctrl.selectedCpuLimitItem.unit;
|
|
13759
|
-
}
|
|
13760
|
-
lodash.set(ctrl.version, 'spec.' + field, newData);
|
|
13761
|
-
ctrl.onChangeCallback();
|
|
13762
|
-
} else {
|
|
13763
|
-
lodash.unset(ctrl.version, 'spec.' + field);
|
|
13764
|
-
ctrl[isRequestsInput(field) ? 'resources.requests.cpu' : 'resources.limits.cpu'] = null;
|
|
13765
|
-
}
|
|
13766
|
-
checkIfCpuInputsValid();
|
|
13767
|
-
}
|
|
13768
|
-
|
|
13769
|
-
/**
|
|
13770
|
-
* Number input callback for GPU fields
|
|
13771
|
-
* @param {number} newData
|
|
13772
|
-
* @param {string} field
|
|
13773
|
-
*/
|
|
13774
|
-
function gpuInputCallback(newData, field) {
|
|
13775
|
-
if (angular.isNumber(newData)) {
|
|
13776
|
-
lodash.set(ctrl.version, ['spec', 'resources', field, 'nvidia.com/gpu'], String(newData));
|
|
13777
|
-
lodash.set(ctrl.resources, [field, 'gpu'], String(newData));
|
|
13778
|
-
ctrl.onChangeCallback();
|
|
13779
|
-
} else {
|
|
13780
|
-
lodash.unset(ctrl.version, ['spec', 'resources', field, 'nvidia.com/gpu']);
|
|
13781
|
-
lodash.set(ctrl.resources, [field, 'gpu'], null);
|
|
13782
|
-
}
|
|
13783
|
-
}
|
|
13784
|
-
|
|
13785
|
-
/**
|
|
13786
|
-
* Handler on Node selector action type
|
|
13572
|
+
* Handler on specific action type
|
|
13787
13573
|
* @param {string} actionType
|
|
13788
|
-
* @param {number} index - index of
|
|
13574
|
+
* @param {number} index - index of variable in array
|
|
13789
13575
|
*/
|
|
13790
|
-
function
|
|
13576
|
+
function handleAction(actionType, index) {
|
|
13791
13577
|
if (actionType === 'delete') {
|
|
13792
|
-
ctrl.
|
|
13578
|
+
ctrl.variables.splice(index, 1);
|
|
13793
13579
|
$timeout(function () {
|
|
13794
|
-
|
|
13580
|
+
updateVariables();
|
|
13795
13581
|
});
|
|
13796
13582
|
}
|
|
13797
13583
|
}
|
|
13798
13584
|
|
|
13799
13585
|
/**
|
|
13800
|
-
*
|
|
13801
|
-
|
|
13802
|
-
|
|
13803
|
-
DialogsService.confirm($i18next.t('functions:REVERT_NODE_SELECTORS_TO_DEFAULTS_CONFIRM', {
|
|
13804
|
-
lng: lng
|
|
13805
|
-
}), $i18next.t('functions:YES_REVERT_CONFIRM', {
|
|
13806
|
-
lng: lng
|
|
13807
|
-
})).then(function () {
|
|
13808
|
-
setNodeSelectorsDefaultValue();
|
|
13809
|
-
$rootScope.$broadcast('igzWatchWindowResize::resize');
|
|
13810
|
-
});
|
|
13811
|
-
}
|
|
13812
|
-
|
|
13813
|
-
/**
|
|
13814
|
-
* Checks whether pods priority can be shown
|
|
13815
|
-
* @returns {boolean}
|
|
13816
|
-
*/
|
|
13817
|
-
function isPodsPriorityShown() {
|
|
13818
|
-
return !lodash.isNil(lodash.get(ConfigService, 'nuclio.validFunctionPriorityClassNames'));
|
|
13819
|
-
}
|
|
13820
|
-
|
|
13821
|
-
/**
|
|
13822
|
-
* Checks whether the inactivity window can be shown
|
|
13823
|
-
* @returns {boolean}
|
|
13586
|
+
* Changes data of specific variable
|
|
13587
|
+
* @param {Object} variable
|
|
13588
|
+
* @param {number} index
|
|
13824
13589
|
*/
|
|
13825
|
-
function
|
|
13826
|
-
|
|
13590
|
+
function onChangeData(variable, index) {
|
|
13591
|
+
ctrl.variables[index] = lodash.cloneDeep(variable);
|
|
13592
|
+
updateVariables();
|
|
13827
13593
|
}
|
|
13828
13594
|
|
|
13829
13595
|
/**
|
|
13830
|
-
*
|
|
13831
|
-
* @param {Object}
|
|
13832
|
-
* @param {
|
|
13833
|
-
* @param {string} field
|
|
13596
|
+
* Handles a change of variables type
|
|
13597
|
+
* @param {Object} newType
|
|
13598
|
+
* @param {number} index
|
|
13834
13599
|
*/
|
|
13835
|
-
function
|
|
13836
|
-
var
|
|
13837
|
-
|
|
13838
|
-
|
|
13839
|
-
|
|
13840
|
-
|
|
13841
|
-
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
checkIfMemoryInputsValid(newValue, field);
|
|
13600
|
+
function onChangeType(newType, index) {
|
|
13601
|
+
var variablesCopy = angular.copy(ctrl.variables);
|
|
13602
|
+
variablesCopy[index] = newType.id === 'value' ? {} : {
|
|
13603
|
+
valueFrom: {}
|
|
13604
|
+
};
|
|
13605
|
+
ctrl.isOnlyValueTypeInputs = !lodash.some(variablesCopy, 'valueFrom');
|
|
13606
|
+
if (newType.id === 'secret') {
|
|
13607
|
+
var form = lodash.get(ctrl.environmentVariablesForm, '$$controls[' + index + '][value-key]');
|
|
13608
|
+
if (angular.isDefined(form)) {
|
|
13609
|
+
lodash.forEach(ctrl.validationRules.configmapKey, function (rule) {
|
|
13610
|
+
form.$setValidity(rule.name, true);
|
|
13611
|
+
});
|
|
13612
|
+
}
|
|
13849
13613
|
}
|
|
13850
|
-
ctrl.onChangeCallback();
|
|
13851
13614
|
}
|
|
13852
13615
|
|
|
13616
|
+
//
|
|
13617
|
+
// Private methods
|
|
13618
|
+
//
|
|
13619
|
+
|
|
13853
13620
|
/**
|
|
13854
|
-
*
|
|
13855
|
-
* @param {number} newData
|
|
13856
|
-
* @param {string} field
|
|
13621
|
+
* Updates function's variables
|
|
13857
13622
|
*/
|
|
13858
|
-
function
|
|
13859
|
-
var
|
|
13860
|
-
|
|
13861
|
-
|
|
13862
|
-
|
|
13623
|
+
function updateVariables() {
|
|
13624
|
+
var isFormValid = true;
|
|
13625
|
+
var variables = lodash.chain(ctrl.variables).map(function (variable) {
|
|
13626
|
+
if (!variable.ui.isFormValid) {
|
|
13627
|
+
isFormValid = false;
|
|
13628
|
+
}
|
|
13629
|
+
return lodash.omit(variable, 'ui');
|
|
13630
|
+
}).reduce(function (acc, variable) {
|
|
13631
|
+
var envType = !lodash.get(variable, 'configMapRef.name', false) && !lodash.get(variable, 'secretRef.name', false) ? 'env' : 'envFrom';
|
|
13632
|
+
acc[envType] = acc[envType] ? lodash.concat(acc[envType], variable) : [variable];
|
|
13633
|
+
return acc;
|
|
13634
|
+
}, {}).value();
|
|
13863
13635
|
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
ctrl.memoryWarningOpen = !lodash.isNil(lodash.get(ctrl.version, 'spec.resources.limits.memory')) && lodash.isNil(lodash.get(ctrl.version, 'spec.resources.requests.memory'));
|
|
13636
|
+
// since uniqueness validation rule of some fields is dependent on the entire environment variable list,
|
|
13637
|
+
// then whenever the list is modified - the rest of the environment variables need to be re-validated
|
|
13638
|
+
FormValidationService.validateAllFields(ctrl.environmentVariablesForm);
|
|
13639
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
13640
|
+
component: 'variable',
|
|
13641
|
+
isDisabled: !isFormValid
|
|
13642
|
+
});
|
|
13643
|
+
lodash.set(ctrl.version, 'spec.env', lodash.get(variables, 'env', []));
|
|
13644
|
+
lodash.set(ctrl.version, 'spec.envFrom', lodash.get(variables, 'envFrom', []));
|
|
13874
13645
|
ctrl.onChangeCallback();
|
|
13875
13646
|
}
|
|
13876
13647
|
|
|
13877
13648
|
/**
|
|
13878
|
-
*
|
|
13879
|
-
* @param {
|
|
13880
|
-
* @param {
|
|
13881
|
-
|
|
13882
|
-
function onChangeNodeSelectorsData(nodeSelector, index) {
|
|
13883
|
-
ctrl.nodeSelectors[index] = lodash.cloneDeep(nodeSelector);
|
|
13884
|
-
updateNodeSelectors();
|
|
13885
|
-
}
|
|
13886
|
-
|
|
13887
|
-
/**
|
|
13888
|
-
* Pod toleration dropdown callback
|
|
13889
|
-
* @param {Object} tolerationOption
|
|
13890
|
-
* @param {boolean} isItemChanged
|
|
13891
|
-
* @param {string} field
|
|
13649
|
+
* Determines `uniqueness` validation for Environment Variables
|
|
13650
|
+
* @param {Array} paths
|
|
13651
|
+
* @param {string} value
|
|
13652
|
+
* @returns {boolean} - Returns true if the value is unique across the specified paths, false otherwise.
|
|
13892
13653
|
*/
|
|
13893
|
-
function
|
|
13894
|
-
|
|
13895
|
-
|
|
13654
|
+
function validateUniqueness(paths, value) {
|
|
13655
|
+
return lodash.filter(ctrl.variables, function (variable) {
|
|
13656
|
+
return paths.some(function (path) {
|
|
13657
|
+
return lodash.get(variable, path) === value;
|
|
13658
|
+
});
|
|
13659
|
+
}).length === 1;
|
|
13896
13660
|
}
|
|
13661
|
+
}
|
|
13662
|
+
})();
|
|
13663
|
+
"use strict";
|
|
13897
13664
|
|
|
13898
|
-
|
|
13899
|
-
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13665
|
+
/*
|
|
13666
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
13667
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
13668
|
+
an addition restriction as set forth herein. You may not use this
|
|
13669
|
+
file except in compliance with the License. You may obtain a copy of
|
|
13670
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13671
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13672
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13673
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
13674
|
+
implied. See the License for the specific language governing
|
|
13675
|
+
permissions and limitations under the License.
|
|
13676
|
+
In addition, you may not use the software for any purposes that are
|
|
13677
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
13678
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
13679
|
+
such restriction.
|
|
13680
|
+
*/
|
|
13681
|
+
(function () {
|
|
13682
|
+
'use strict';
|
|
13683
|
+
|
|
13684
|
+
NclVersionConfigurationLabelsController.$inject = ["$element", "$i18next", "$rootScope", "$timeout", "i18next", "lodash", "FormValidationService", "FunctionsService", "PreventDropdownCutOffService", "ValidationService", "VersionHelperService"];
|
|
13685
|
+
angular.module('iguazio.dashboard-controls').component('nclVersionConfigurationLabels', {
|
|
13686
|
+
bindings: {
|
|
13687
|
+
version: '<',
|
|
13688
|
+
onChangeCallback: '<',
|
|
13689
|
+
isFunctionDeploying: '&'
|
|
13690
|
+
},
|
|
13691
|
+
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-labels/version-configuration-labels.tpl.html',
|
|
13692
|
+
controller: NclVersionConfigurationLabelsController
|
|
13693
|
+
});
|
|
13694
|
+
function NclVersionConfigurationLabelsController($element, $i18next, $rootScope, $timeout, i18next, lodash, FormValidationService, FunctionsService, PreventDropdownCutOffService, ValidationService, VersionHelperService) {
|
|
13695
|
+
var ctrl = this;
|
|
13696
|
+
var lng = i18next.language;
|
|
13697
|
+
ctrl.igzScrollConfig = {
|
|
13698
|
+
maxElementsCount: 10,
|
|
13699
|
+
childrenSelector: '.table-body'
|
|
13700
|
+
};
|
|
13701
|
+
ctrl.isKubePlatform = false;
|
|
13702
|
+
ctrl.labelsForm = null;
|
|
13703
|
+
ctrl.scrollConfig = {
|
|
13704
|
+
axis: 'y',
|
|
13705
|
+
advanced: {
|
|
13706
|
+
updateOnContentResize: true
|
|
13707
|
+
}
|
|
13708
|
+
};
|
|
13709
|
+
ctrl.tooltip = '<a class="link" target="_blank" ' + 'href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/">' + $i18next.t('functions:TOOLTIP.LABELS.HEAD', {
|
|
13710
|
+
lng: lng
|
|
13711
|
+
}) + '</a> ' + $i18next.t('functions:TOOLTIP.LABELS.REST', {
|
|
13712
|
+
lng: lng
|
|
13713
|
+
});
|
|
13714
|
+
ctrl.keyTooltip = $i18next.t('functions:TOOLTIP.PREFIXED_NAME', {
|
|
13715
|
+
lng: lng,
|
|
13716
|
+
name: $i18next.t('common:LABEL', {
|
|
13717
|
+
lng: lng
|
|
13718
|
+
})
|
|
13719
|
+
});
|
|
13720
|
+
ctrl.validationRules = {
|
|
13721
|
+
key: ValidationService.getValidationRules('function.label.key', [{
|
|
13722
|
+
name: 'uniqueness',
|
|
13723
|
+
label: $i18next.t('common:UNIQUENESS', {
|
|
13724
|
+
lng: lng
|
|
13725
|
+
}),
|
|
13726
|
+
pattern: validateUniqueness
|
|
13727
|
+
}]),
|
|
13728
|
+
value: ValidationService.getValidationRules('k8s.qualifiedName')
|
|
13729
|
+
};
|
|
13730
|
+
ctrl.$postLink = postLink;
|
|
13731
|
+
ctrl.$onChanges = onChanges;
|
|
13732
|
+
ctrl.addNewLabel = addNewLabel;
|
|
13733
|
+
ctrl.handleAction = handleAction;
|
|
13734
|
+
ctrl.isLabelsDisabled = isLabelsDisabled;
|
|
13735
|
+
ctrl.onChangeData = onChangeData;
|
|
13736
|
+
|
|
13737
|
+
//
|
|
13738
|
+
// Hook methods
|
|
13739
|
+
//
|
|
13907
13740
|
|
|
13908
13741
|
/**
|
|
13909
|
-
*
|
|
13910
|
-
* @param {string|number} newData
|
|
13911
|
-
* @param {string} field
|
|
13742
|
+
* Post linking method
|
|
13912
13743
|
*/
|
|
13913
|
-
function
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
}
|
|
13919
|
-
lodash.set(ctrl, field, newData);
|
|
13920
|
-
if (field === 'minReplicas' && isInactivityWindowShown()) {
|
|
13921
|
-
updateScaleToZeroParameters();
|
|
13922
|
-
}
|
|
13923
|
-
if (lodash.includes(['minReplicas', 'maxReplicas'], field)) {
|
|
13924
|
-
updateTargetCpuSlider();
|
|
13925
|
-
}
|
|
13926
|
-
ctrl.onChangeCallback();
|
|
13744
|
+
function postLink() {
|
|
13745
|
+
ctrl.isKubePlatform = FunctionsService.isKubePlatform();
|
|
13746
|
+
|
|
13747
|
+
// Bind DOM-related preventDropdownCutOff method to component's controller
|
|
13748
|
+
PreventDropdownCutOffService.preventDropdownCutOff($element, '.three-dot-menu');
|
|
13927
13749
|
}
|
|
13928
13750
|
|
|
13929
13751
|
/**
|
|
13930
|
-
*
|
|
13931
|
-
* @param {
|
|
13932
|
-
* @param {string} field
|
|
13752
|
+
* On changes hook method.
|
|
13753
|
+
* @param {Object} changes
|
|
13933
13754
|
*/
|
|
13934
|
-
function
|
|
13935
|
-
if (lodash.
|
|
13936
|
-
lodash.
|
|
13937
|
-
|
|
13938
|
-
|
|
13755
|
+
function onChanges(changes) {
|
|
13756
|
+
if (lodash.has(changes, 'version')) {
|
|
13757
|
+
ctrl.labels = lodash.chain(ctrl.version).get('metadata.labels', {}).omitBy(function (value, key) {
|
|
13758
|
+
return lodash.startsWith(key, 'nuclio.io/');
|
|
13759
|
+
}).map(function (value, key) {
|
|
13760
|
+
return {
|
|
13761
|
+
name: key,
|
|
13762
|
+
value: value,
|
|
13763
|
+
ui: {
|
|
13764
|
+
editModeActive: false,
|
|
13765
|
+
isFormValid: false,
|
|
13766
|
+
name: 'label'
|
|
13767
|
+
}
|
|
13768
|
+
};
|
|
13769
|
+
}).value();
|
|
13770
|
+
ctrl.labels = lodash.compact(ctrl.labels);
|
|
13771
|
+
ctrl.addNewLabelTooltip = VersionHelperService.isVersionDeployed(ctrl.version) ? $i18next.t('functions:TOOLTIP.ADD_LABELS', {
|
|
13772
|
+
lng: lng
|
|
13773
|
+
}) : '';
|
|
13774
|
+
$timeout(function () {
|
|
13775
|
+
if (ctrl.labelsForm.$invalid) {
|
|
13776
|
+
ctrl.labelsForm.$setSubmitted();
|
|
13777
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
13778
|
+
component: 'label',
|
|
13779
|
+
isDisabled: true
|
|
13780
|
+
});
|
|
13781
|
+
}
|
|
13782
|
+
});
|
|
13939
13783
|
}
|
|
13940
|
-
ctrl.onChangeCallback();
|
|
13941
13784
|
}
|
|
13942
13785
|
|
|
13943
13786
|
//
|
|
13944
|
-
//
|
|
13787
|
+
// Public methods
|
|
13945
13788
|
//
|
|
13946
13789
|
|
|
13947
13790
|
/**
|
|
13948
|
-
*
|
|
13949
|
-
* Example:
|
|
13950
|
-
* Request: "400m" - Limit: "0.6" are valid
|
|
13951
|
-
* Request: "300m" - Limit: "0.2" are invalid
|
|
13791
|
+
* Adds new label
|
|
13952
13792
|
*/
|
|
13953
|
-
function
|
|
13954
|
-
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
if (lodash.isNil(requestsCpu) || lodash.isNil(limitsCpu)) {
|
|
13958
|
-
isFieldsValid = true;
|
|
13959
|
-
} else {
|
|
13960
|
-
isFieldsValid = ctrl.selectedCpuRequestItem.convertValue(requestsCpu) <= ctrl.selectedCpuLimitItem.convertValue(limitsCpu);
|
|
13793
|
+
function addNewLabel(event) {
|
|
13794
|
+
// prevent adding labels for deployed functions
|
|
13795
|
+
if (ctrl.isLabelsDisabled() || ctrl.isFunctionDeploying()) {
|
|
13796
|
+
return;
|
|
13961
13797
|
}
|
|
13962
|
-
|
|
13963
|
-
|
|
13798
|
+
$timeout(function () {
|
|
13799
|
+
if (ctrl.labels.length < 1 || lodash.last(ctrl.labels).ui.isFormValid) {
|
|
13800
|
+
ctrl.labels.push({
|
|
13801
|
+
name: '',
|
|
13802
|
+
value: '',
|
|
13803
|
+
ui: {
|
|
13804
|
+
editModeActive: true,
|
|
13805
|
+
isFormValid: false,
|
|
13806
|
+
name: 'label'
|
|
13807
|
+
}
|
|
13808
|
+
});
|
|
13809
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
13810
|
+
component: 'label',
|
|
13811
|
+
isDisabled: true
|
|
13812
|
+
});
|
|
13813
|
+
event.stopPropagation();
|
|
13814
|
+
}
|
|
13815
|
+
}, 50);
|
|
13964
13816
|
}
|
|
13965
13817
|
|
|
13966
13818
|
/**
|
|
13967
|
-
*
|
|
13968
|
-
*
|
|
13969
|
-
*
|
|
13970
|
-
* Request: "4TB" - Limit: "6GB" are invalid
|
|
13971
|
-
* @param {string} value
|
|
13972
|
-
* @param {string} field
|
|
13819
|
+
* Handler on specific action type
|
|
13820
|
+
* @param {string} actionType
|
|
13821
|
+
* @param {number} index - index of label in array
|
|
13973
13822
|
*/
|
|
13974
|
-
function
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
oppositeValue = lodash.get(ctrl.version, 'spec.resources.limits.memory');
|
|
13981
|
-
|
|
13982
|
-
// compare 'Request' and 'Limit' fields values converted in bytes
|
|
13983
|
-
isFieldsValid = lodash.isNil(oppositeValue) ? true : convertToBytes(value) <= convertToBytes(oppositeValue);
|
|
13984
|
-
} else if (lodash.includes(field, 'limits')) {
|
|
13985
|
-
oppositeValue = lodash.get(ctrl.version, 'spec.resources.requests.memory');
|
|
13986
|
-
|
|
13987
|
-
// compare 'Request' and 'Limit' fields values converted in bytes
|
|
13988
|
-
isFieldsValid = lodash.isNil(oppositeValue) ? true : convertToBytes(value) >= convertToBytes(oppositeValue);
|
|
13823
|
+
function handleAction(actionType, index) {
|
|
13824
|
+
if (actionType === 'delete') {
|
|
13825
|
+
ctrl.labels.splice(index, 1);
|
|
13826
|
+
$timeout(function () {
|
|
13827
|
+
updateLabels();
|
|
13828
|
+
});
|
|
13989
13829
|
}
|
|
13990
|
-
ctrl.resourcesForm.requestMemory.$setValidity('equality', isFieldsValid);
|
|
13991
|
-
ctrl.resourcesForm.limitsMemory.$setValidity('equality', isFieldsValid);
|
|
13992
13830
|
}
|
|
13993
13831
|
|
|
13994
13832
|
/**
|
|
13995
|
-
* Checks
|
|
13833
|
+
* Checks if labels should be disabled
|
|
13834
|
+
* @returns {boolean}
|
|
13996
13835
|
*/
|
|
13997
|
-
function
|
|
13998
|
-
|
|
13999
|
-
acc[nodeSelector.name] = nodeSelector.value;
|
|
14000
|
-
return acc;
|
|
14001
|
-
}, {});
|
|
14002
|
-
ctrl.revertToDefaultsBtnIsHidden = lodash.isEqual(lodash.get(ConfigService, 'nuclio.defaultFunctionConfig.attributes.spec.nodeSelector', {}), nodeSelectors);
|
|
13836
|
+
function isLabelsDisabled() {
|
|
13837
|
+
return ctrl.isKubePlatform && VersionHelperService.isVersionDeployed(ctrl.version);
|
|
14003
13838
|
}
|
|
14004
13839
|
|
|
14005
13840
|
/**
|
|
14006
|
-
*
|
|
14007
|
-
* @param {
|
|
14008
|
-
* @
|
|
13841
|
+
* Changes labels data
|
|
13842
|
+
* @param {Object} label
|
|
13843
|
+
* @param {number} index
|
|
14009
13844
|
*/
|
|
14010
|
-
function
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
return parseInt(value) * Math.pow(unitData.root, unitData.power);
|
|
13845
|
+
function onChangeData(label, index) {
|
|
13846
|
+
ctrl.labels[index] = lodash.cloneDeep(label);
|
|
13847
|
+
updateLabels();
|
|
14014
13848
|
}
|
|
14015
13849
|
|
|
13850
|
+
//
|
|
13851
|
+
// Private methods
|
|
13852
|
+
//
|
|
13853
|
+
|
|
14016
13854
|
/**
|
|
14017
|
-
*
|
|
14018
|
-
* @param {string} str - the string with value and unit.
|
|
14019
|
-
* @returns {string} the unit, or the empty-string if unit does not exist in the `str`.
|
|
14020
|
-
* @example
|
|
14021
|
-
* extractUnit('100 GB');
|
|
14022
|
-
* // => 'GB'
|
|
14023
|
-
*
|
|
14024
|
-
* extractUnit('100GB');
|
|
14025
|
-
* // => 'GB'
|
|
14026
|
-
*
|
|
14027
|
-
* extractUnit('100');
|
|
14028
|
-
* // => ''
|
|
13855
|
+
* Updates function`s labels
|
|
14029
13856
|
*/
|
|
14030
|
-
function
|
|
14031
|
-
|
|
13857
|
+
function updateLabels() {
|
|
13858
|
+
var isFormValid = true;
|
|
13859
|
+
var newLabels = {};
|
|
13860
|
+
lodash.forEach(ctrl.labels, function (label) {
|
|
13861
|
+
if (!label.ui.isFormValid) {
|
|
13862
|
+
isFormValid = false;
|
|
13863
|
+
}
|
|
13864
|
+
newLabels[label.name] = label.value;
|
|
13865
|
+
});
|
|
13866
|
+
|
|
13867
|
+
// since uniqueness validation rule of some fields is dependent on the entire label list, then whenever
|
|
13868
|
+
// the list is modified - the rest of the labels need to be re-validated
|
|
13869
|
+
FormValidationService.validateAllFields(ctrl.labelsForm);
|
|
13870
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
13871
|
+
component: 'label',
|
|
13872
|
+
isDisabled: !isFormValid
|
|
13873
|
+
});
|
|
13874
|
+
lodash.set(ctrl.version, 'metadata.labels', newLabels);
|
|
13875
|
+
ctrl.onChangeCallback();
|
|
14032
13876
|
}
|
|
14033
13877
|
|
|
14034
13878
|
/**
|
|
14035
|
-
*
|
|
14036
|
-
* @
|
|
13879
|
+
* Determines `uniqueness` validation for `Key` field
|
|
13880
|
+
* @param {string} value - value to validate
|
|
14037
13881
|
*/
|
|
14038
|
-
function
|
|
14039
|
-
return lodash.
|
|
13882
|
+
function validateUniqueness(value) {
|
|
13883
|
+
return lodash.filter(ctrl.labels, ['name', value]).length === 1;
|
|
13884
|
+
}
|
|
13885
|
+
}
|
|
13886
|
+
})();
|
|
13887
|
+
"use strict";
|
|
13888
|
+
|
|
13889
|
+
/*
|
|
13890
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
13891
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
13892
|
+
an addition restriction as set forth herein. You may not use this
|
|
13893
|
+
file except in compliance with the License. You may obtain a copy of
|
|
13894
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13895
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13896
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13897
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
13898
|
+
implied. See the License for the specific language governing
|
|
13899
|
+
permissions and limitations under the License.
|
|
13900
|
+
In addition, you may not use the software for any purposes that are
|
|
13901
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
13902
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
13903
|
+
such restriction.
|
|
13904
|
+
*/
|
|
13905
|
+
(function () {
|
|
13906
|
+
'use strict';
|
|
13907
|
+
|
|
13908
|
+
NclVersionConfigurationLoggingController.$inject = ["lodash"];
|
|
13909
|
+
angular.module('iguazio.dashboard-controls').component('nclVersionConfigurationLogging', {
|
|
13910
|
+
bindings: {
|
|
13911
|
+
version: '<',
|
|
13912
|
+
onChangeCallback: '<'
|
|
13913
|
+
},
|
|
13914
|
+
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-logging/version-configuration-logging.tpl.html',
|
|
13915
|
+
controller: NclVersionConfigurationLoggingController
|
|
13916
|
+
});
|
|
13917
|
+
function NclVersionConfigurationLoggingController(lodash) {
|
|
13918
|
+
var ctrl = this;
|
|
13919
|
+
ctrl.inputValueCallback = inputValueCallback;
|
|
13920
|
+
|
|
13921
|
+
//
|
|
13922
|
+
// Public methods
|
|
13923
|
+
//
|
|
13924
|
+
|
|
13925
|
+
/**
|
|
13926
|
+
* Update data callback
|
|
13927
|
+
* @param {string} newData
|
|
13928
|
+
* @param {string} field
|
|
13929
|
+
*/
|
|
13930
|
+
function inputValueCallback(newData, field) {
|
|
13931
|
+
lodash.set(ctrl.version, field, newData);
|
|
13932
|
+
ctrl.onChangeCallback();
|
|
13933
|
+
}
|
|
13934
|
+
}
|
|
13935
|
+
})();
|
|
13936
|
+
"use strict";
|
|
13937
|
+
|
|
13938
|
+
/*
|
|
13939
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
13940
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
13941
|
+
an addition restriction as set forth herein. You may not use this
|
|
13942
|
+
file except in compliance with the License. You may obtain a copy of
|
|
13943
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13944
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13945
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13946
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
13947
|
+
implied. See the License for the specific language governing
|
|
13948
|
+
permissions and limitations under the License.
|
|
13949
|
+
In addition, you may not use the software for any purposes that are
|
|
13950
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
13951
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
13952
|
+
such restriction.
|
|
13953
|
+
*/
|
|
13954
|
+
/* eslint max-statements: ["error", 80] */
|
|
13955
|
+
(function () {
|
|
13956
|
+
'use strict';
|
|
13957
|
+
|
|
13958
|
+
NclVersionConfigurationResourcesController.$inject = ["$i18next", "$rootScope", "$scope", "$stateParams", "$timeout", "i18next", "lodash", "ConfigService", "DialogsService", "FormValidationService", "ValidationService"];
|
|
13959
|
+
angular.module('iguazio.dashboard-controls').component('nclVersionConfigurationResources', {
|
|
13960
|
+
bindings: {
|
|
13961
|
+
version: '<',
|
|
13962
|
+
onChangeCallback: '<',
|
|
13963
|
+
isFunctionDeploying: '&'
|
|
13964
|
+
},
|
|
13965
|
+
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-resources/version-configuration-resources.tpl.html',
|
|
13966
|
+
controller: NclVersionConfigurationResourcesController
|
|
13967
|
+
});
|
|
13968
|
+
function NclVersionConfigurationResourcesController($i18next, $rootScope, $scope, $stateParams, $timeout, i18next, lodash, ConfigService, DialogsService, FormValidationService, ValidationService) {
|
|
13969
|
+
var ctrl = this;
|
|
13970
|
+
var lng = i18next.language;
|
|
13971
|
+
var defaultUnit = {
|
|
13972
|
+
id: 'gb',
|
|
13973
|
+
name: 'GB',
|
|
13974
|
+
unit: 'G',
|
|
13975
|
+
root: 1000,
|
|
13976
|
+
power: 3
|
|
13977
|
+
};
|
|
13978
|
+
var preemptionMode = '';
|
|
13979
|
+
var scaleResourcesCopy = [];
|
|
13980
|
+
var scaleToZero = {};
|
|
13981
|
+
ctrl.cpuDropdownOptions = [{
|
|
13982
|
+
id: 'millicores',
|
|
13983
|
+
name: 'millicpu',
|
|
13984
|
+
unit: 'm',
|
|
13985
|
+
precision: '0',
|
|
13986
|
+
step: '100',
|
|
13987
|
+
minValue: 1,
|
|
13988
|
+
placeholder: '1500',
|
|
13989
|
+
onChange: function onChange(value) {
|
|
13990
|
+
return parseFloat(value) * 1000;
|
|
13991
|
+
},
|
|
13992
|
+
convertValue: function convertValue(value) {
|
|
13993
|
+
return parseInt(value);
|
|
13994
|
+
}
|
|
13995
|
+
}, {
|
|
13996
|
+
id: 'cpu',
|
|
13997
|
+
name: 'cpu',
|
|
13998
|
+
unit: '',
|
|
13999
|
+
precision: '3',
|
|
14000
|
+
step: '0.1',
|
|
14001
|
+
minValue: 0.1,
|
|
14002
|
+
placeholder: '1.5',
|
|
14003
|
+
onChange: function onChange(value) {
|
|
14004
|
+
return parseInt(value) / 1000;
|
|
14005
|
+
},
|
|
14006
|
+
convertValue: function convertValue(value) {
|
|
14007
|
+
return parseFloat(value) * 1000;
|
|
14008
|
+
}
|
|
14009
|
+
}];
|
|
14010
|
+
ctrl.defaultFunctionConfig = lodash.get(ConfigService, 'nuclio.defaultFunctionConfig.attributes', {});
|
|
14011
|
+
ctrl.dropdownOptions = [{
|
|
14012
|
+
id: 'bytes',
|
|
14013
|
+
name: 'Bytes',
|
|
14014
|
+
unit: '',
|
|
14015
|
+
root: 0,
|
|
14016
|
+
power: 0
|
|
14017
|
+
}, {
|
|
14018
|
+
id: 'kb',
|
|
14019
|
+
name: 'KB',
|
|
14020
|
+
unit: 'k',
|
|
14021
|
+
root: 1000,
|
|
14022
|
+
power: 1
|
|
14023
|
+
}, {
|
|
14024
|
+
id: 'kib',
|
|
14025
|
+
name: 'KiB',
|
|
14026
|
+
unit: 'Ki',
|
|
14027
|
+
root: 1024,
|
|
14028
|
+
power: 1
|
|
14029
|
+
}, {
|
|
14030
|
+
id: 'mb',
|
|
14031
|
+
name: 'MB',
|
|
14032
|
+
unit: 'M',
|
|
14033
|
+
root: 1000,
|
|
14034
|
+
power: 2
|
|
14035
|
+
}, {
|
|
14036
|
+
id: 'mib',
|
|
14037
|
+
name: 'MiB',
|
|
14038
|
+
unit: 'Mi',
|
|
14039
|
+
root: 1024,
|
|
14040
|
+
power: 2
|
|
14041
|
+
}, {
|
|
14042
|
+
id: 'gb',
|
|
14043
|
+
name: 'GB',
|
|
14044
|
+
unit: 'G',
|
|
14045
|
+
root: 1000,
|
|
14046
|
+
power: 3
|
|
14047
|
+
}, {
|
|
14048
|
+
id: 'gib',
|
|
14049
|
+
name: 'GiB',
|
|
14050
|
+
unit: 'Gi',
|
|
14051
|
+
root: 1024,
|
|
14052
|
+
power: 3
|
|
14053
|
+
}, {
|
|
14054
|
+
id: 'tb',
|
|
14055
|
+
name: 'TB',
|
|
14056
|
+
unit: 'T',
|
|
14057
|
+
root: 1000,
|
|
14058
|
+
power: 4
|
|
14059
|
+
}, {
|
|
14060
|
+
id: 'tib',
|
|
14061
|
+
name: 'TiB',
|
|
14062
|
+
unit: 'Ti',
|
|
14063
|
+
root: 1024,
|
|
14064
|
+
power: 4
|
|
14065
|
+
}, {
|
|
14066
|
+
id: 'pb',
|
|
14067
|
+
name: 'PB',
|
|
14068
|
+
unit: 'P',
|
|
14069
|
+
root: 1000,
|
|
14070
|
+
power: 5
|
|
14071
|
+
}, {
|
|
14072
|
+
id: 'pib',
|
|
14073
|
+
name: 'PiB',
|
|
14074
|
+
unit: 'Pi',
|
|
14075
|
+
root: 1024,
|
|
14076
|
+
power: 5
|
|
14077
|
+
}, {
|
|
14078
|
+
id: 'eb',
|
|
14079
|
+
name: 'EB',
|
|
14080
|
+
unit: 'E',
|
|
14081
|
+
root: 1000,
|
|
14082
|
+
power: 6
|
|
14083
|
+
}, {
|
|
14084
|
+
id: 'eib',
|
|
14085
|
+
name: 'EiB',
|
|
14086
|
+
unit: 'Ei',
|
|
14087
|
+
root: 1024,
|
|
14088
|
+
power: 6
|
|
14089
|
+
}];
|
|
14090
|
+
ctrl.nodeSelectors = [];
|
|
14091
|
+
ctrl.nodeSelectorsValidationRules = {
|
|
14092
|
+
key: ValidationService.getValidationRules('nodeSelectors.key').concat([{
|
|
14093
|
+
name: 'uniqueness',
|
|
14094
|
+
label: $i18next.t('common:UNIQUENESS', {
|
|
14095
|
+
lng: lng
|
|
14096
|
+
}),
|
|
14097
|
+
pattern: validateNodeSelectorUniqueness
|
|
14098
|
+
}]),
|
|
14099
|
+
value: ValidationService.getValidationRules('nodeSelectors.value')
|
|
14100
|
+
};
|
|
14101
|
+
ctrl.podsPriorityOptions = [{
|
|
14102
|
+
id: 'igz-workload-high',
|
|
14103
|
+
name: 'High'
|
|
14104
|
+
}, {
|
|
14105
|
+
id: 'igz-workload-medium',
|
|
14106
|
+
name: 'Medium'
|
|
14107
|
+
}, {
|
|
14108
|
+
id: 'igz-workload-low',
|
|
14109
|
+
name: 'Low'
|
|
14110
|
+
}];
|
|
14111
|
+
ctrl.podTolerationsOptions = [{
|
|
14112
|
+
id: 'allow',
|
|
14113
|
+
name: 'Allow',
|
|
14114
|
+
tooltip: $i18next.t('functions:TOOLTIP.POD_TOLERATIONS.ALLOW', {
|
|
14115
|
+
lng: lng
|
|
14116
|
+
})
|
|
14117
|
+
}, {
|
|
14118
|
+
id: 'constrain',
|
|
14119
|
+
name: 'Constrain',
|
|
14120
|
+
tooltip: $i18next.t('functions:TOOLTIP.POD_TOLERATIONS.CONSTRAIN', {
|
|
14121
|
+
lng: lng
|
|
14122
|
+
})
|
|
14123
|
+
}, {
|
|
14124
|
+
id: 'prevent',
|
|
14125
|
+
name: 'Prevent',
|
|
14126
|
+
tooltip: $i18next.t('functions:TOOLTIP.POD_TOLERATIONS.PREVENT', {
|
|
14127
|
+
lng: lng
|
|
14128
|
+
})
|
|
14129
|
+
}];
|
|
14130
|
+
ctrl.revertToDefaultsBtnIsHidden = true;
|
|
14131
|
+
ctrl.selectedPodTolerationOption = null;
|
|
14132
|
+
ctrl.selectedPodsPriority = {};
|
|
14133
|
+
ctrl.windowSizeSlider = {};
|
|
14134
|
+
ctrl.$onInit = onInit;
|
|
14135
|
+
ctrl.$onChanges = onChanges;
|
|
14136
|
+
ctrl.$onDestroy = onDestroy;
|
|
14137
|
+
ctrl.addNewNodeSelector = addNewNodeSelector;
|
|
14138
|
+
ctrl.cpuDropdownCallback = cpuDropdownCallback;
|
|
14139
|
+
ctrl.cpuInputCallback = cpuInputCallback;
|
|
14140
|
+
ctrl.getVersionPreemptionMode = getVersionPreemptionMode;
|
|
14141
|
+
ctrl.gpuInputCallback = gpuInputCallback;
|
|
14142
|
+
ctrl.handleNodeSelectorsAction = handleNodeSelectorsAction;
|
|
14143
|
+
ctrl.handleRevertToDefaultsClick = handleRevertToDefaultsClick;
|
|
14144
|
+
ctrl.isPodsPriorityShown = isPodsPriorityShown;
|
|
14145
|
+
ctrl.isInactivityWindowShown = isInactivityWindowShown;
|
|
14146
|
+
ctrl.memoryDropdownCallback = memoryDropdownCallback;
|
|
14147
|
+
ctrl.memoryInputCallback = memoryInputCallback;
|
|
14148
|
+
ctrl.onChangeNodeSelectorsData = onChangeNodeSelectorsData;
|
|
14149
|
+
ctrl.podTolerationDropdownCallback = podTolerationDropdownCallback;
|
|
14150
|
+
ctrl.podsPriorityDropdownCallback = podsPriorityDropdownCallback;
|
|
14151
|
+
ctrl.replicasInputCallback = replicasInputCallback;
|
|
14152
|
+
ctrl.sliderInputCallback = sliderInputCallback;
|
|
14153
|
+
|
|
14154
|
+
//
|
|
14155
|
+
// Hook methods
|
|
14156
|
+
//
|
|
14157
|
+
|
|
14158
|
+
/**
|
|
14159
|
+
* Initialization method
|
|
14160
|
+
*/
|
|
14161
|
+
function onInit() {
|
|
14162
|
+
if (ctrl.isPodsPriorityShown()) {
|
|
14163
|
+
initPodsPriority();
|
|
14164
|
+
}
|
|
14165
|
+
initTargetCpuSlider();
|
|
14166
|
+
preemptionMode = getVersionPreemptionMode() || lodash.get(ctrl.defaultFunctionConfig, 'spec.preemptionMode');
|
|
14167
|
+
if (preemptionMode) {
|
|
14168
|
+
initPodToleration();
|
|
14169
|
+
}
|
|
14170
|
+
ctrl.memoryWarningOpen = false;
|
|
14171
|
+
$timeout(function () {
|
|
14172
|
+
$scope.$watch('$ctrl.resourcesForm.$invalid', function (value) {
|
|
14173
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14174
|
+
component: 'resources',
|
|
14175
|
+
isDisabled: value
|
|
14176
|
+
});
|
|
14177
|
+
});
|
|
14178
|
+
});
|
|
14179
|
+
}
|
|
14180
|
+
|
|
14181
|
+
/**
|
|
14182
|
+
* On changes hook method.
|
|
14183
|
+
* @param {Object} changes
|
|
14184
|
+
*/
|
|
14185
|
+
function onChanges(changes) {
|
|
14186
|
+
if (angular.isDefined(changes.version)) {
|
|
14187
|
+
initParametersData();
|
|
14188
|
+
updateTargetCpuSlider();
|
|
14189
|
+
ctrl.minReplicas = lodash.get(ctrl.version, 'spec.minReplicas');
|
|
14190
|
+
ctrl.maxReplicas = lodash.get(ctrl.version, 'spec.maxReplicas');
|
|
14191
|
+
initScaleToZeroData();
|
|
14192
|
+
initNodeSelectors();
|
|
14193
|
+
$timeout(function () {
|
|
14194
|
+
setFormValidity();
|
|
14195
|
+
checkIfCpuInputsValid();
|
|
14196
|
+
});
|
|
14197
|
+
}
|
|
14198
|
+
}
|
|
14199
|
+
|
|
14200
|
+
/**
|
|
14201
|
+
* On destroy method
|
|
14202
|
+
*/
|
|
14203
|
+
function onDestroy() {
|
|
14204
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14205
|
+
component: 'resources',
|
|
14206
|
+
isDisabled: lodash.get(ctrl.resourcesForm, '$invalid', false)
|
|
14207
|
+
});
|
|
14040
14208
|
}
|
|
14041
14209
|
|
|
14210
|
+
//
|
|
14211
|
+
// Public methods
|
|
14212
|
+
//
|
|
14213
|
+
|
|
14042
14214
|
/**
|
|
14043
|
-
*
|
|
14215
|
+
* Adds new node selector
|
|
14216
|
+
* param {Event} event - native event object
|
|
14044
14217
|
*/
|
|
14045
|
-
function
|
|
14046
|
-
|
|
14047
|
-
return
|
|
14048
|
-
name: key,
|
|
14049
|
-
value: value,
|
|
14050
|
-
ui: {
|
|
14051
|
-
editModeActive: false,
|
|
14052
|
-
isFormValid: key.length > 0 && value.length > 0,
|
|
14053
|
-
name: 'nodeSelector'
|
|
14054
|
-
}
|
|
14055
|
-
};
|
|
14056
|
-
}).value();
|
|
14057
|
-
if ($stateParams.isNewFunction && lodash.isEmpty(ctrl.nodeSelectors)) {
|
|
14058
|
-
setNodeSelectorsDefaultValue();
|
|
14059
|
-
} else {
|
|
14060
|
-
checkNodeSelectorsIdentity();
|
|
14218
|
+
function addNewNodeSelector(event) {
|
|
14219
|
+
if (ctrl.isFunctionDeploying()) {
|
|
14220
|
+
return;
|
|
14061
14221
|
}
|
|
14062
14222
|
$timeout(function () {
|
|
14063
|
-
if (ctrl.
|
|
14064
|
-
ctrl.
|
|
14223
|
+
if (ctrl.nodeSelectors.length < 1 || lodash.last(ctrl.nodeSelectors).ui.isFormValid) {
|
|
14224
|
+
ctrl.nodeSelectors.push({
|
|
14225
|
+
name: '',
|
|
14226
|
+
value: '',
|
|
14227
|
+
ui: {
|
|
14228
|
+
editModeActive: true,
|
|
14229
|
+
isFormValid: false,
|
|
14230
|
+
name: 'nodeSelector'
|
|
14231
|
+
}
|
|
14232
|
+
});
|
|
14065
14233
|
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14066
14234
|
component: 'nodeSelector',
|
|
14067
14235
|
isDisabled: true
|
|
14068
14236
|
});
|
|
14237
|
+
event.stopPropagation();
|
|
14238
|
+
checkNodeSelectorsIdentity();
|
|
14069
14239
|
}
|
|
14070
|
-
});
|
|
14240
|
+
}, 50);
|
|
14071
14241
|
}
|
|
14072
14242
|
|
|
14073
14243
|
/**
|
|
14074
|
-
*
|
|
14244
|
+
* CPU dropdown callback
|
|
14245
|
+
* @param {Object} item
|
|
14246
|
+
* @param {boolean} isItemChanged
|
|
14247
|
+
* @param {string} field
|
|
14075
14248
|
*/
|
|
14076
|
-
function
|
|
14077
|
-
|
|
14078
|
-
|
|
14079
|
-
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
cpu
|
|
14086
|
-
},
|
|
14087
|
-
limits: {
|
|
14088
|
-
memory: parseValue(limitsMemory),
|
|
14089
|
-
cpu: parseValue(limitsCpu),
|
|
14090
|
-
gpu: parseValue(limitsGpu)
|
|
14249
|
+
function cpuDropdownCallback(item, isItemChanged, field) {
|
|
14250
|
+
if (!lodash.isEqual(item, ctrl[field])) {
|
|
14251
|
+
if (isRequestsInput(field)) {
|
|
14252
|
+
if (ctrl.resources.requests.cpu) {
|
|
14253
|
+
ctrl.resources.requests.cpu = item.onChange(ctrl.resources.requests.cpu);
|
|
14254
|
+
lodash.set(ctrl.version, 'spec.resources.requests.cpu', ctrl.resources.requests.cpu + item.unit);
|
|
14255
|
+
}
|
|
14256
|
+
} else if (ctrl.resources.limits.cpu) {
|
|
14257
|
+
ctrl.resources.limits.cpu = item.onChange(ctrl.resources.limits.cpu);
|
|
14258
|
+
lodash.set(ctrl.version, 'spec.resources.limits.cpu', ctrl.resources.limits.cpu + item.unit);
|
|
14091
14259
|
}
|
|
14092
|
-
|
|
14260
|
+
lodash.set(ctrl, field, item);
|
|
14261
|
+
checkIfCpuInputsValid();
|
|
14262
|
+
}
|
|
14263
|
+
}
|
|
14093
14264
|
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
|
|
14265
|
+
/**
|
|
14266
|
+
* Number input callback
|
|
14267
|
+
* @param {number} newData
|
|
14268
|
+
* @param {string} field
|
|
14269
|
+
*/
|
|
14270
|
+
function cpuInputCallback(newData, field) {
|
|
14271
|
+
if (angular.isNumber(newData)) {
|
|
14272
|
+
if (isRequestsInput(field)) {
|
|
14273
|
+
ctrl.resources.requests.cpu = newData;
|
|
14274
|
+
newData = newData + ctrl.selectedCpuRequestItem.unit;
|
|
14275
|
+
} else {
|
|
14276
|
+
ctrl.resources.limits.cpu = newData;
|
|
14277
|
+
newData = newData + ctrl.selectedCpuLimitItem.unit;
|
|
14102
14278
|
}
|
|
14103
|
-
|
|
14104
|
-
|
|
14279
|
+
lodash.set(ctrl.version, 'spec.' + field, newData);
|
|
14280
|
+
ctrl.onChangeCallback();
|
|
14281
|
+
} else {
|
|
14282
|
+
lodash.unset(ctrl.version, 'spec.' + field);
|
|
14283
|
+
ctrl[isRequestsInput(field) ? 'resources.requests.cpu' : 'resources.limits.cpu'] = null;
|
|
14105
14284
|
}
|
|
14285
|
+
checkIfCpuInputsValid();
|
|
14106
14286
|
}
|
|
14107
14287
|
|
|
14108
14288
|
/**
|
|
14109
|
-
*
|
|
14289
|
+
* Number input callback for GPU fields
|
|
14290
|
+
* @param {number} newData
|
|
14291
|
+
* @param {string} field
|
|
14110
14292
|
*/
|
|
14111
|
-
function
|
|
14112
|
-
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
ctrl.
|
|
14116
|
-
lodash.set(ctrl.version, 'spec.priorityClassName', ctrl.selectedPodsPriority.id);
|
|
14293
|
+
function gpuInputCallback(newData, field) {
|
|
14294
|
+
if (angular.isNumber(newData)) {
|
|
14295
|
+
lodash.set(ctrl.version, ['spec', 'resources', field, 'nvidia.com/gpu'], String(newData));
|
|
14296
|
+
lodash.set(ctrl.resources, [field, 'gpu'], String(newData));
|
|
14297
|
+
ctrl.onChangeCallback();
|
|
14117
14298
|
} else {
|
|
14118
|
-
|
|
14299
|
+
lodash.unset(ctrl.version, ['spec', 'resources', field, 'nvidia.com/gpu']);
|
|
14300
|
+
lodash.set(ctrl.resources, [field, 'gpu'], null);
|
|
14119
14301
|
}
|
|
14120
14302
|
}
|
|
14121
14303
|
|
|
14122
14304
|
/**
|
|
14123
|
-
*
|
|
14305
|
+
* Handler on Node selector action type
|
|
14306
|
+
* @param {string} actionType
|
|
14307
|
+
* @param {number} index - index of the "Node selector" in the array
|
|
14124
14308
|
*/
|
|
14125
|
-
function
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14309
|
+
function handleNodeSelectorsAction(actionType, index) {
|
|
14310
|
+
if (actionType === 'delete') {
|
|
14311
|
+
ctrl.nodeSelectors.splice(index, 1);
|
|
14312
|
+
$timeout(function () {
|
|
14313
|
+
updateNodeSelectors();
|
|
14314
|
+
});
|
|
14129
14315
|
}
|
|
14130
14316
|
}
|
|
14131
14317
|
|
|
14132
14318
|
/**
|
|
14133
|
-
*
|
|
14319
|
+
* Opens pop up on revert to defaults click
|
|
14134
14320
|
*/
|
|
14135
|
-
function
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
}
|
|
14321
|
+
function handleRevertToDefaultsClick() {
|
|
14322
|
+
DialogsService.confirm($i18next.t('functions:REVERT_NODE_SELECTORS_TO_DEFAULTS_CONFIRM', {
|
|
14323
|
+
lng: lng
|
|
14324
|
+
}), $i18next.t('functions:YES_REVERT_CONFIRM', {
|
|
14325
|
+
lng: lng
|
|
14326
|
+
})).then(function () {
|
|
14327
|
+
setNodeSelectorsDefaultValue();
|
|
14328
|
+
$rootScope.$broadcast('igzWatchWindowResize::resize');
|
|
14329
|
+
});
|
|
14141
14330
|
}
|
|
14142
14331
|
|
|
14143
14332
|
/**
|
|
14144
|
-
*
|
|
14333
|
+
* Checks whether pods priority can be shown
|
|
14334
|
+
* @returns {boolean}
|
|
14145
14335
|
*/
|
|
14146
|
-
function
|
|
14147
|
-
|
|
14148
|
-
ctrl.targetCpuSliderConfig = {
|
|
14149
|
-
value: lodash.get(ctrl.defaultFunctionConfig, 'spec.resources.targetCPU', 75),
|
|
14150
|
-
valueLabel: 'disabled',
|
|
14151
|
-
pow: 0,
|
|
14152
|
-
unitLabel: '%',
|
|
14153
|
-
labelHelpIcon: false,
|
|
14154
|
-
options: {
|
|
14155
|
-
disabled: true,
|
|
14156
|
-
floor: 1,
|
|
14157
|
-
id: 'targetCPU',
|
|
14158
|
-
ceil: 100,
|
|
14159
|
-
step: 1,
|
|
14160
|
-
showSelectionBar: true
|
|
14161
|
-
}
|
|
14162
|
-
};
|
|
14163
|
-
updateTargetCpuSlider();
|
|
14336
|
+
function isPodsPriorityShown() {
|
|
14337
|
+
return !lodash.isNil(lodash.get(ConfigService, 'nuclio.validFunctionPriorityClassNames'));
|
|
14164
14338
|
}
|
|
14165
14339
|
|
|
14166
14340
|
/**
|
|
14167
|
-
* Checks
|
|
14341
|
+
* Checks whether the inactivity window can be shown
|
|
14342
|
+
* @returns {boolean}
|
|
14343
|
+
*/
|
|
14344
|
+
function isInactivityWindowShown() {
|
|
14345
|
+
return lodash.get(scaleToZero, 'mode') === 'enabled';
|
|
14346
|
+
}
|
|
14347
|
+
|
|
14348
|
+
/**
|
|
14349
|
+
* Memory dropdown callback
|
|
14350
|
+
* @param {Object} item
|
|
14351
|
+
* @param {boolean} isItemChanged
|
|
14168
14352
|
* @param {string} field
|
|
14169
14353
|
*/
|
|
14170
|
-
function
|
|
14171
|
-
|
|
14354
|
+
function memoryDropdownCallback(item, isItemChanged, field) {
|
|
14355
|
+
var sizeValue = lodash.parseInt(lodash.get(ctrl.version, field, ' 0G'));
|
|
14356
|
+
var newValue;
|
|
14357
|
+
if (lodash.includes(field, 'requests')) {
|
|
14358
|
+
ctrl.selectedRequestUnit = item;
|
|
14359
|
+
} else if (lodash.includes(field, 'limits')) {
|
|
14360
|
+
ctrl.selectedLimitUnit = item;
|
|
14361
|
+
}
|
|
14362
|
+
if (!angular.isNumber(sizeValue) || lodash.isNaN(sizeValue)) {
|
|
14363
|
+
lodash.unset(ctrl.version, field);
|
|
14364
|
+
} else {
|
|
14365
|
+
newValue = sizeValue + item.unit;
|
|
14366
|
+
lodash.set(ctrl.version, field, newValue);
|
|
14367
|
+
checkIfMemoryInputsValid(newValue, field);
|
|
14368
|
+
}
|
|
14369
|
+
ctrl.onChangeCallback();
|
|
14172
14370
|
}
|
|
14173
14371
|
|
|
14174
14372
|
/**
|
|
14175
|
-
*
|
|
14373
|
+
* Memory number input callback
|
|
14374
|
+
* @param {number} newData
|
|
14375
|
+
* @param {string} field
|
|
14176
14376
|
*/
|
|
14177
|
-
function
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14377
|
+
function memoryInputCallback(newData, field) {
|
|
14378
|
+
var newValue, sizeUnit;
|
|
14379
|
+
sizeUnit = isRequestsInput(field) ? lodash.get(ctrl.selectedRequestUnit, 'unit', 'G') : lodash.get(ctrl.selectedLimitUnit, 'unit', 'G');
|
|
14380
|
+
if (!angular.isNumber(newData)) {
|
|
14381
|
+
lodash.unset(ctrl.version.spec, field);
|
|
14181
14382
|
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
|
|
14190
|
-
}
|
|
14383
|
+
// if new value isn't number that both fields will be valid, because one of them is empty
|
|
14384
|
+
ctrl.resourcesForm.requestMemory.$setValidity('equality', true);
|
|
14385
|
+
ctrl.resourcesForm.limitsMemory.$setValidity('equality', true);
|
|
14386
|
+
} else {
|
|
14387
|
+
newValue = newData + sizeUnit;
|
|
14388
|
+
lodash.set(ctrl.version.spec, field, newValue);
|
|
14389
|
+
lodash.set(ctrl, field, newData);
|
|
14390
|
+
checkIfMemoryInputsValid(newValue, field);
|
|
14191
14391
|
}
|
|
14392
|
+
ctrl.memoryWarningOpen = !lodash.isNil(lodash.get(ctrl.version, 'spec.resources.limits.memory')) && lodash.isNil(lodash.get(ctrl.version, 'spec.resources.requests.memory'));
|
|
14393
|
+
ctrl.onChangeCallback();
|
|
14192
14394
|
}
|
|
14193
14395
|
|
|
14194
14396
|
/**
|
|
14195
|
-
*
|
|
14397
|
+
* Changes Node selector data
|
|
14398
|
+
* @param {Object} nodeSelector
|
|
14399
|
+
* @param {number} index
|
|
14196
14400
|
*/
|
|
14197
|
-
function
|
|
14198
|
-
ctrl.nodeSelectors = lodash.
|
|
14199
|
-
|
|
14200
|
-
name: key,
|
|
14201
|
-
value: value,
|
|
14202
|
-
ui: {
|
|
14203
|
-
editModeActive: false,
|
|
14204
|
-
isFormValid: key.length > 0 && value.length > 0,
|
|
14205
|
-
name: 'nodeSelector'
|
|
14206
|
-
}
|
|
14207
|
-
};
|
|
14208
|
-
}).value();
|
|
14209
|
-
$timeout(function () {
|
|
14210
|
-
updateNodeSelectors();
|
|
14211
|
-
}, 0);
|
|
14401
|
+
function onChangeNodeSelectorsData(nodeSelector, index) {
|
|
14402
|
+
ctrl.nodeSelectors[index] = lodash.cloneDeep(nodeSelector);
|
|
14403
|
+
updateNodeSelectors();
|
|
14212
14404
|
}
|
|
14213
14405
|
|
|
14214
14406
|
/**
|
|
14215
|
-
*
|
|
14407
|
+
* Pod toleration dropdown callback
|
|
14408
|
+
* @param {Object} tolerationOption
|
|
14409
|
+
* @param {boolean} isItemChanged
|
|
14410
|
+
* @param {string} field
|
|
14216
14411
|
*/
|
|
14217
|
-
function
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
lodash.forEach(ctrl.nodeSelectors, function (nodeSelector) {
|
|
14221
|
-
if (!nodeSelector.ui.isFormValid) {
|
|
14222
|
-
isFormValid = false;
|
|
14223
|
-
}
|
|
14224
|
-
newNodeSelectors[nodeSelector.name] = nodeSelector.value;
|
|
14225
|
-
});
|
|
14226
|
-
|
|
14227
|
-
// since uniqueness validation rule of some fields is dependent on the entire label list, then whenever
|
|
14228
|
-
// the list is modified - the rest of the labels need to be re-validated
|
|
14229
|
-
FormValidationService.validateAllFields(ctrl.nodeSelectorsForm);
|
|
14230
|
-
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14231
|
-
component: 'nodeSelector',
|
|
14232
|
-
isDisabled: !isFormValid || ctrl.nodeSelectorsForm.$invalid
|
|
14233
|
-
});
|
|
14234
|
-
lodash.set(ctrl.version, 'spec.nodeSelector', newNodeSelectors);
|
|
14235
|
-
checkNodeSelectorsIdentity();
|
|
14412
|
+
function podTolerationDropdownCallback(tolerationOption, isItemChanged, field) {
|
|
14413
|
+
ctrl.selectedPodTolerationOption = lodash.find(ctrl.podTolerationsOptions, ['id', tolerationOption.id]);
|
|
14414
|
+
lodash.set(ctrl.version, field, tolerationOption.id);
|
|
14236
14415
|
}
|
|
14237
14416
|
|
|
14238
14417
|
/**
|
|
14239
|
-
*
|
|
14418
|
+
* Pods priority dropdown callback
|
|
14419
|
+
* @param {Object} priorityOption
|
|
14420
|
+
* @param {boolean} isItemChanged
|
|
14421
|
+
* @param {string} field
|
|
14240
14422
|
*/
|
|
14241
|
-
function
|
|
14242
|
-
lodash.
|
|
14243
|
-
ui: {
|
|
14244
|
-
scaleToZero: {
|
|
14245
|
-
scaleResources: scaleResourcesCopy
|
|
14246
|
-
}
|
|
14247
|
-
}
|
|
14248
|
-
});
|
|
14249
|
-
var scaleResources = lodash.get(ctrl.version, 'ui.scaleToZero.scaleResources');
|
|
14250
|
-
if (ctrl.minReplicas === 0) {
|
|
14251
|
-
lodash.set(ctrl.version, 'spec.scaleToZero.scaleResources', scaleResources);
|
|
14252
|
-
} else {
|
|
14253
|
-
lodash.unset(ctrl.version, 'spec.scaleToZero');
|
|
14254
|
-
}
|
|
14255
|
-
var maxWindowSize = lodash.chain(scaleResources).maxBy(function (value) {
|
|
14256
|
-
return parseInt(value.windowSize);
|
|
14257
|
-
}).get('windowSize').value();
|
|
14258
|
-
ctrl.windowSizeSlider = {
|
|
14259
|
-
value: maxWindowSize,
|
|
14260
|
-
options: {
|
|
14261
|
-
stepsArray: scaleToZero.inactivityWindowPresets,
|
|
14262
|
-
showTicks: true,
|
|
14263
|
-
showTicksValues: true,
|
|
14264
|
-
disabled: !Number.isSafeInteger(ctrl.minReplicas) || ctrl.minReplicas > 0 || ctrl.isFunctionDeploying(),
|
|
14265
|
-
onChange: function onChange(_, newValue) {
|
|
14266
|
-
lodash.forEach(scaleResources, function (value) {
|
|
14267
|
-
value.windowSize = newValue;
|
|
14268
|
-
});
|
|
14269
|
-
if (ctrl.minReplicas === 0) {
|
|
14270
|
-
lodash.set(ctrl.version, 'spec.scaleToZero.scaleResources', scaleResources);
|
|
14271
|
-
}
|
|
14272
|
-
}
|
|
14273
|
-
}
|
|
14274
|
-
};
|
|
14423
|
+
function podsPriorityDropdownCallback(priorityOption, isItemChanged, field) {
|
|
14424
|
+
lodash.set(ctrl.version, field, priorityOption.id);
|
|
14275
14425
|
}
|
|
14276
14426
|
|
|
14277
14427
|
/**
|
|
14278
|
-
*
|
|
14428
|
+
* Replicas data update callback
|
|
14429
|
+
* @param {string|number} newData
|
|
14430
|
+
* @param {string} field
|
|
14279
14431
|
*/
|
|
14280
|
-
function
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
lodash.
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
}
|
|
14432
|
+
function replicasInputCallback(newData, field) {
|
|
14433
|
+
if (lodash.isNil(newData) || newData === '') {
|
|
14434
|
+
lodash.unset(ctrl.version.spec, field);
|
|
14435
|
+
} else {
|
|
14436
|
+
lodash.set(ctrl.version.spec, field, newData);
|
|
14437
|
+
}
|
|
14438
|
+
lodash.set(ctrl, field, newData);
|
|
14439
|
+
if (field === 'minReplicas' && isInactivityWindowShown()) {
|
|
14440
|
+
updateScaleToZeroParameters();
|
|
14441
|
+
}
|
|
14442
|
+
if (lodash.includes(['minReplicas', 'maxReplicas'], field)) {
|
|
14443
|
+
updateTargetCpuSlider();
|
|
14444
|
+
}
|
|
14445
|
+
ctrl.onChangeCallback();
|
|
14293
14446
|
}
|
|
14294
14447
|
|
|
14295
14448
|
/**
|
|
14296
|
-
*
|
|
14297
|
-
* @param {
|
|
14298
|
-
* @
|
|
14449
|
+
* Update limits callback
|
|
14450
|
+
* @param {number} newValue
|
|
14451
|
+
* @param {string} field
|
|
14299
14452
|
*/
|
|
14300
|
-
function
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
"use strict";
|
|
14306
|
-
|
|
14307
|
-
/*
|
|
14308
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
14309
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
14310
|
-
an addition restriction as set forth herein. You may not use this
|
|
14311
|
-
file except in compliance with the License. You may obtain a copy of
|
|
14312
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
14313
|
-
Unless required by applicable law or agreed to in writing, software
|
|
14314
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14315
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
14316
|
-
implied. See the License for the specific language governing
|
|
14317
|
-
permissions and limitations under the License.
|
|
14318
|
-
In addition, you may not use the software for any purposes that are
|
|
14319
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
14320
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
14321
|
-
such restriction.
|
|
14322
|
-
*/
|
|
14323
|
-
(function () {
|
|
14324
|
-
'use strict';
|
|
14325
|
-
|
|
14326
|
-
NclVersionConfigurationEnvironmentVariablesController.$inject = ["$element", "$i18next", "$rootScope", "$timeout", "i18next", "lodash", "FormValidationService", "PreventDropdownCutOffService", "ValidationService"];
|
|
14327
|
-
angular.module('iguazio.dashboard-controls').component('nclVersionConfigurationEnvironmentVariables', {
|
|
14328
|
-
bindings: {
|
|
14329
|
-
version: '<',
|
|
14330
|
-
onChangeCallback: '<',
|
|
14331
|
-
isFunctionDeploying: '&'
|
|
14332
|
-
},
|
|
14333
|
-
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-environment-variables/version-configuration-environment-variables.tpl.html',
|
|
14334
|
-
controller: NclVersionConfigurationEnvironmentVariablesController
|
|
14335
|
-
});
|
|
14336
|
-
function NclVersionConfigurationEnvironmentVariablesController($element, $i18next, $rootScope, $timeout, i18next, lodash, FormValidationService, PreventDropdownCutOffService, ValidationService) {
|
|
14337
|
-
var ctrl = this;
|
|
14338
|
-
var lng = i18next.language;
|
|
14339
|
-
var envVariableFromValidationRules = ValidationService.getValidationRules('k8s.configMapKey', [{
|
|
14340
|
-
name: 'uniqueness',
|
|
14341
|
-
label: $i18next.t('common:UNIQUENESS', {
|
|
14342
|
-
lng: lng
|
|
14343
|
-
}),
|
|
14344
|
-
pattern: validateUniqueness.bind(null, ['configMapRef.name', 'secretRef.name'])
|
|
14345
|
-
}]);
|
|
14346
|
-
var envVariableKeyValidationRule = ValidationService.getValidationRules('k8s.envVarName', [{
|
|
14347
|
-
name: 'uniqueness',
|
|
14348
|
-
label: $i18next.t('common:UNIQUENESS', {
|
|
14349
|
-
lng: lng
|
|
14350
|
-
}),
|
|
14351
|
-
pattern: validateUniqueness.bind(null, ['name'])
|
|
14352
|
-
}]);
|
|
14353
|
-
var envVariableConfigmapKeyValidationRule = ValidationService.getValidationRules('k8s.configMapKey', [{
|
|
14354
|
-
name: 'uniqueness',
|
|
14355
|
-
label: $i18next.t('common:UNIQUENESS', {
|
|
14356
|
-
lng: lng
|
|
14357
|
-
}),
|
|
14358
|
-
pattern: validateUniqueness.bind(null, ['valueFrom.configMapKeyRef.key'])
|
|
14359
|
-
}]);
|
|
14360
|
-
ctrl.environmentVariablesForm = null;
|
|
14361
|
-
ctrl.igzScrollConfig = {
|
|
14362
|
-
maxElementsCount: 10,
|
|
14363
|
-
childrenSelector: '.table-body'
|
|
14364
|
-
};
|
|
14365
|
-
ctrl.validationRules = {
|
|
14366
|
-
key: envVariableKeyValidationRule,
|
|
14367
|
-
secretKey: ValidationService.getValidationRules('k8s.configMapKey'),
|
|
14368
|
-
secret: ValidationService.getValidationRules('k8s.secretName'),
|
|
14369
|
-
configmapKey: envVariableConfigmapKeyValidationRule,
|
|
14370
|
-
configmapRef: envVariableFromValidationRules,
|
|
14371
|
-
secretRef: envVariableFromValidationRules
|
|
14372
|
-
};
|
|
14373
|
-
ctrl.variables = [];
|
|
14374
|
-
ctrl.scrollConfig = {
|
|
14375
|
-
axis: 'y',
|
|
14376
|
-
advanced: {
|
|
14377
|
-
updateOnContentResize: true
|
|
14453
|
+
function sliderInputCallback(newValue, field) {
|
|
14454
|
+
if (lodash.isNil(newValue)) {
|
|
14455
|
+
lodash.unset(ctrl.version, field);
|
|
14456
|
+
} else {
|
|
14457
|
+
lodash.set(ctrl.version, field, Number(newValue));
|
|
14378
14458
|
}
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
ctrl.$onChanges = onChanges;
|
|
14382
|
-
ctrl.addNewVariable = addNewVariable;
|
|
14383
|
-
ctrl.handleAction = handleAction;
|
|
14384
|
-
ctrl.onChangeData = onChangeData;
|
|
14385
|
-
ctrl.onChangeType = onChangeType;
|
|
14459
|
+
ctrl.onChangeCallback();
|
|
14460
|
+
}
|
|
14386
14461
|
|
|
14387
14462
|
//
|
|
14388
|
-
//
|
|
14463
|
+
// Private methods
|
|
14389
14464
|
//
|
|
14390
14465
|
|
|
14391
14466
|
/**
|
|
14392
|
-
*
|
|
14467
|
+
* Checks if cpu number inputs and drop-downs valid
|
|
14468
|
+
* Example:
|
|
14469
|
+
* Request: "400m" - Limit: "0.6" are valid
|
|
14470
|
+
* Request: "300m" - Limit: "0.2" are invalid
|
|
14393
14471
|
*/
|
|
14394
|
-
function
|
|
14395
|
-
|
|
14396
|
-
|
|
14472
|
+
function checkIfCpuInputsValid() {
|
|
14473
|
+
var requestsCpu = lodash.get(ctrl.version, 'spec.resources.requests.cpu');
|
|
14474
|
+
var limitsCpu = lodash.get(ctrl.version, 'spec.resources.limits.cpu');
|
|
14475
|
+
var isFieldsValid;
|
|
14476
|
+
if (lodash.isNil(requestsCpu) || lodash.isNil(limitsCpu)) {
|
|
14477
|
+
isFieldsValid = true;
|
|
14478
|
+
} else {
|
|
14479
|
+
isFieldsValid = ctrl.selectedCpuRequestItem.convertValue(requestsCpu) <= ctrl.selectedCpuLimitItem.convertValue(limitsCpu);
|
|
14480
|
+
}
|
|
14481
|
+
ctrl.resourcesForm.requestCpu.$setValidity('equality', isFieldsValid);
|
|
14482
|
+
ctrl.resourcesForm.limitsCpu.$setValidity('equality', isFieldsValid);
|
|
14397
14483
|
}
|
|
14398
14484
|
|
|
14399
14485
|
/**
|
|
14400
|
-
*
|
|
14401
|
-
*
|
|
14486
|
+
* Checks if memory number inputs and drop-downs valid
|
|
14487
|
+
* Example:
|
|
14488
|
+
* Request: "4GB" - Limit: "6GB" are valid
|
|
14489
|
+
* Request: "4TB" - Limit: "6GB" are invalid
|
|
14490
|
+
* @param {string} value
|
|
14491
|
+
* @param {string} field
|
|
14402
14492
|
*/
|
|
14403
|
-
function
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
|
|
14417
|
-
|
|
14418
|
-
component: 'variable',
|
|
14419
|
-
isDisabled: true
|
|
14420
|
-
});
|
|
14421
|
-
}
|
|
14422
|
-
});
|
|
14493
|
+
function checkIfMemoryInputsValid(value, field) {
|
|
14494
|
+
// oppositeValue is a variable for opposite field of current value
|
|
14495
|
+
// if value argument is a value of 'Request' field that 'oppositeValue' will contain value of 'Limit' field
|
|
14496
|
+
var oppositeValue;
|
|
14497
|
+
var isFieldsValid;
|
|
14498
|
+
if (lodash.includes(field, 'requests')) {
|
|
14499
|
+
oppositeValue = lodash.get(ctrl.version, 'spec.resources.limits.memory');
|
|
14500
|
+
|
|
14501
|
+
// compare 'Request' and 'Limit' fields values converted in bytes
|
|
14502
|
+
isFieldsValid = lodash.isNil(oppositeValue) ? true : convertToBytes(value) <= convertToBytes(oppositeValue);
|
|
14503
|
+
} else if (lodash.includes(field, 'limits')) {
|
|
14504
|
+
oppositeValue = lodash.get(ctrl.version, 'spec.resources.requests.memory');
|
|
14505
|
+
|
|
14506
|
+
// compare 'Request' and 'Limit' fields values converted in bytes
|
|
14507
|
+
isFieldsValid = lodash.isNil(oppositeValue) ? true : convertToBytes(value) >= convertToBytes(oppositeValue);
|
|
14423
14508
|
}
|
|
14509
|
+
ctrl.resourcesForm.requestMemory.$setValidity('equality', isFieldsValid);
|
|
14510
|
+
ctrl.resourcesForm.limitsMemory.$setValidity('equality', isFieldsValid);
|
|
14424
14511
|
}
|
|
14425
14512
|
|
|
14426
|
-
//
|
|
14427
|
-
// Public methods
|
|
14428
|
-
//
|
|
14429
|
-
|
|
14430
14513
|
/**
|
|
14431
|
-
*
|
|
14514
|
+
* Checks whether the `Revert to defaults` button must be hidden
|
|
14432
14515
|
*/
|
|
14433
|
-
function
|
|
14434
|
-
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14439
|
-
ctrl.variables.push({
|
|
14440
|
-
name: '',
|
|
14441
|
-
value: '',
|
|
14442
|
-
ui: {
|
|
14443
|
-
editModeActive: true,
|
|
14444
|
-
isFormValid: false,
|
|
14445
|
-
name: 'variable'
|
|
14446
|
-
}
|
|
14447
|
-
});
|
|
14448
|
-
ctrl.environmentVariablesForm.$setPristine();
|
|
14449
|
-
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14450
|
-
component: 'variable',
|
|
14451
|
-
isDisabled: true
|
|
14452
|
-
});
|
|
14453
|
-
event.stopPropagation();
|
|
14454
|
-
}
|
|
14455
|
-
}, 50);
|
|
14516
|
+
function checkNodeSelectorsIdentity() {
|
|
14517
|
+
var nodeSelectors = lodash.reduce(ctrl.nodeSelectors, function (acc, nodeSelector) {
|
|
14518
|
+
acc[nodeSelector.name] = nodeSelector.value;
|
|
14519
|
+
return acc;
|
|
14520
|
+
}, {});
|
|
14521
|
+
ctrl.revertToDefaultsBtnIsHidden = lodash.isEqual(lodash.get(ConfigService, 'nuclio.defaultFunctionConfig.attributes.spec.nodeSelector', {}), nodeSelectors);
|
|
14456
14522
|
}
|
|
14457
14523
|
|
|
14458
14524
|
/**
|
|
14459
|
-
*
|
|
14460
|
-
* @param {string}
|
|
14461
|
-
* @
|
|
14525
|
+
* Converts megabytes, gigabytes and terabytes into bytes
|
|
14526
|
+
* @param {string} value
|
|
14527
|
+
* @returns {number}
|
|
14462
14528
|
*/
|
|
14463
|
-
function
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
updateVariables();
|
|
14468
|
-
});
|
|
14469
|
-
}
|
|
14529
|
+
function convertToBytes(value) {
|
|
14530
|
+
var unit = extractUnit(value);
|
|
14531
|
+
var unitData = lodash.find(ctrl.dropdownOptions, ['unit', unit]);
|
|
14532
|
+
return parseInt(value) * Math.pow(unitData.root, unitData.power);
|
|
14470
14533
|
}
|
|
14471
14534
|
|
|
14472
14535
|
/**
|
|
14473
|
-
*
|
|
14474
|
-
* @param {
|
|
14475
|
-
* @
|
|
14536
|
+
* Extracts the unit part of a string consisting of a numerical value then a unit.
|
|
14537
|
+
* @param {string} str - the string with value and unit.
|
|
14538
|
+
* @returns {string} the unit, or the empty-string if unit does not exist in the `str`.
|
|
14539
|
+
* @example
|
|
14540
|
+
* extractUnit('100 GB');
|
|
14541
|
+
* // => 'GB'
|
|
14542
|
+
*
|
|
14543
|
+
* extractUnit('100GB');
|
|
14544
|
+
* // => 'GB'
|
|
14545
|
+
*
|
|
14546
|
+
* extractUnit('100');
|
|
14547
|
+
* // => ''
|
|
14476
14548
|
*/
|
|
14477
|
-
function
|
|
14478
|
-
|
|
14479
|
-
updateVariables();
|
|
14549
|
+
function extractUnit(str) {
|
|
14550
|
+
return lodash.get(str.match(/[a-zA-Z]+/), '[0]', '');
|
|
14480
14551
|
}
|
|
14481
14552
|
|
|
14482
14553
|
/**
|
|
14483
|
-
*
|
|
14484
|
-
* @
|
|
14485
|
-
* @param {number} index
|
|
14554
|
+
* Gets PreemptionMode from version spec
|
|
14555
|
+
* @returns {string}
|
|
14486
14556
|
*/
|
|
14487
|
-
function
|
|
14488
|
-
|
|
14489
|
-
variablesCopy[index] = newType.id === 'value' ? {} : {
|
|
14490
|
-
valueFrom: {}
|
|
14491
|
-
};
|
|
14492
|
-
ctrl.isOnlyValueTypeInputs = !lodash.some(variablesCopy, 'valueFrom');
|
|
14493
|
-
if (newType.id === 'secret') {
|
|
14494
|
-
var form = lodash.get(ctrl.environmentVariablesForm, '$$controls[' + index + '][value-key]');
|
|
14495
|
-
if (angular.isDefined(form)) {
|
|
14496
|
-
lodash.forEach(ctrl.validationRules.configmapKey, function (rule) {
|
|
14497
|
-
form.$setValidity(rule.name, true);
|
|
14498
|
-
});
|
|
14499
|
-
}
|
|
14500
|
-
}
|
|
14557
|
+
function getVersionPreemptionMode() {
|
|
14558
|
+
return lodash.get(ctrl.version, 'spec.preemptionMode');
|
|
14501
14559
|
}
|
|
14502
14560
|
|
|
14503
|
-
//
|
|
14504
|
-
// Private methods
|
|
14505
|
-
//
|
|
14506
|
-
|
|
14507
14561
|
/**
|
|
14508
|
-
*
|
|
14562
|
+
* Initializes data for Node selectors section
|
|
14509
14563
|
*/
|
|
14510
|
-
function
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14564
|
+
function initNodeSelectors() {
|
|
14565
|
+
ctrl.nodeSelectors = lodash.chain(ctrl.version).get('spec.nodeSelector', {}).map(function (value, key) {
|
|
14566
|
+
return {
|
|
14567
|
+
name: key,
|
|
14568
|
+
value: value,
|
|
14569
|
+
ui: {
|
|
14570
|
+
editModeActive: false,
|
|
14571
|
+
isFormValid: key.length > 0 && value.length > 0,
|
|
14572
|
+
name: 'nodeSelector'
|
|
14573
|
+
}
|
|
14574
|
+
};
|
|
14575
|
+
}).value();
|
|
14576
|
+
if ($stateParams.isNewFunction && lodash.isEmpty(ctrl.nodeSelectors)) {
|
|
14577
|
+
setNodeSelectorsDefaultValue();
|
|
14578
|
+
} else {
|
|
14579
|
+
checkNodeSelectorsIdentity();
|
|
14580
|
+
}
|
|
14581
|
+
$timeout(function () {
|
|
14582
|
+
if (ctrl.nodeSelectorsForm.$invalid) {
|
|
14583
|
+
ctrl.nodeSelectorsForm.$setSubmitted();
|
|
14584
|
+
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14585
|
+
component: 'nodeSelector',
|
|
14586
|
+
isDisabled: true
|
|
14587
|
+
});
|
|
14515
14588
|
}
|
|
14516
|
-
return lodash.omit(variable, 'ui');
|
|
14517
|
-
}).reduce(function (acc, variable) {
|
|
14518
|
-
var envType = !lodash.get(variable, 'configMapRef.name', false) && !lodash.get(variable, 'secretRef.name', false) ? 'env' : 'envFrom';
|
|
14519
|
-
acc[envType] = acc[envType] ? lodash.concat(acc[envType], variable) : [variable];
|
|
14520
|
-
return acc;
|
|
14521
|
-
}, {}).value();
|
|
14522
|
-
|
|
14523
|
-
// since uniqueness validation rule of some fields is dependent on the entire environment variable list,
|
|
14524
|
-
// then whenever the list is modified - the rest of the environment variables need to be re-validated
|
|
14525
|
-
FormValidationService.validateAllFields(ctrl.environmentVariablesForm);
|
|
14526
|
-
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14527
|
-
component: 'variable',
|
|
14528
|
-
isDisabled: !isFormValid
|
|
14529
14589
|
});
|
|
14530
|
-
lodash.set(ctrl.version, 'spec.env', lodash.get(variables, 'env', []));
|
|
14531
|
-
lodash.set(ctrl.version, 'spec.envFrom', lodash.get(variables, 'envFrom', []));
|
|
14532
|
-
ctrl.onChangeCallback();
|
|
14533
14590
|
}
|
|
14534
14591
|
|
|
14535
14592
|
/**
|
|
14536
|
-
*
|
|
14537
|
-
* @param {Array} paths
|
|
14538
|
-
* @param {string} value
|
|
14539
|
-
* @returns {boolean} - Returns true if the value is unique across the specified paths, false otherwise.
|
|
14593
|
+
* Init default common parameters for new version
|
|
14540
14594
|
*/
|
|
14541
|
-
function
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
|
|
14545
|
-
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
|
|
14557
|
-
|
|
14558
|
-
Unless required by applicable law or agreed to in writing, software
|
|
14559
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14560
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
14561
|
-
implied. See the License for the specific language governing
|
|
14562
|
-
permissions and limitations under the License.
|
|
14563
|
-
In addition, you may not use the software for any purposes that are
|
|
14564
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
14565
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
14566
|
-
such restriction.
|
|
14567
|
-
*/
|
|
14568
|
-
(function () {
|
|
14569
|
-
'use strict';
|
|
14570
|
-
|
|
14571
|
-
NclVersionConfigurationLabelsController.$inject = ["$element", "$i18next", "$rootScope", "$timeout", "i18next", "lodash", "FormValidationService", "FunctionsService", "PreventDropdownCutOffService", "ValidationService", "VersionHelperService"];
|
|
14572
|
-
angular.module('iguazio.dashboard-controls').component('nclVersionConfigurationLabels', {
|
|
14573
|
-
bindings: {
|
|
14574
|
-
version: '<',
|
|
14575
|
-
onChangeCallback: '<',
|
|
14576
|
-
isFunctionDeploying: '&'
|
|
14577
|
-
},
|
|
14578
|
-
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-labels/version-configuration-labels.tpl.html',
|
|
14579
|
-
controller: NclVersionConfigurationLabelsController
|
|
14580
|
-
});
|
|
14581
|
-
function NclVersionConfigurationLabelsController($element, $i18next, $rootScope, $timeout, i18next, lodash, FormValidationService, FunctionsService, PreventDropdownCutOffService, ValidationService, VersionHelperService) {
|
|
14582
|
-
var ctrl = this;
|
|
14583
|
-
var lng = i18next.language;
|
|
14584
|
-
ctrl.igzScrollConfig = {
|
|
14585
|
-
maxElementsCount: 10,
|
|
14586
|
-
childrenSelector: '.table-body'
|
|
14587
|
-
};
|
|
14588
|
-
ctrl.isKubePlatform = false;
|
|
14589
|
-
ctrl.labelsForm = null;
|
|
14590
|
-
ctrl.scrollConfig = {
|
|
14591
|
-
axis: 'y',
|
|
14592
|
-
advanced: {
|
|
14593
|
-
updateOnContentResize: true
|
|
14594
|
-
}
|
|
14595
|
-
};
|
|
14596
|
-
ctrl.tooltip = '<a class="link" target="_blank" ' + 'href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/">' + $i18next.t('functions:TOOLTIP.LABELS.HEAD', {
|
|
14597
|
-
lng: lng
|
|
14598
|
-
}) + '</a> ' + $i18next.t('functions:TOOLTIP.LABELS.REST', {
|
|
14599
|
-
lng: lng
|
|
14600
|
-
});
|
|
14601
|
-
ctrl.keyTooltip = $i18next.t('functions:TOOLTIP.PREFIXED_NAME', {
|
|
14602
|
-
lng: lng,
|
|
14603
|
-
name: $i18next.t('common:LABEL', {
|
|
14604
|
-
lng: lng
|
|
14605
|
-
})
|
|
14606
|
-
});
|
|
14607
|
-
ctrl.validationRules = {
|
|
14608
|
-
key: ValidationService.getValidationRules('function.label.key', [{
|
|
14609
|
-
name: 'uniqueness',
|
|
14610
|
-
label: $i18next.t('common:UNIQUENESS', {
|
|
14611
|
-
lng: lng
|
|
14612
|
-
}),
|
|
14613
|
-
pattern: validateUniqueness
|
|
14614
|
-
}]),
|
|
14615
|
-
value: ValidationService.getValidationRules('k8s.qualifiedName')
|
|
14616
|
-
};
|
|
14617
|
-
ctrl.$postLink = postLink;
|
|
14618
|
-
ctrl.$onChanges = onChanges;
|
|
14619
|
-
ctrl.addNewLabel = addNewLabel;
|
|
14620
|
-
ctrl.handleAction = handleAction;
|
|
14621
|
-
ctrl.isLabelsDisabled = isLabelsDisabled;
|
|
14622
|
-
ctrl.onChangeData = onChangeData;
|
|
14595
|
+
function initParametersData() {
|
|
14596
|
+
var requestsMemory = lodash.get(ctrl.version, 'spec.resources.requests.memory');
|
|
14597
|
+
var limitsMemory = lodash.get(ctrl.version, 'spec.resources.limits.memory');
|
|
14598
|
+
var requestsCpu = lodash.get(ctrl.version, 'spec.resources.requests.cpu');
|
|
14599
|
+
var limitsCpu = lodash.get(ctrl.version, 'spec.resources.limits.cpu');
|
|
14600
|
+
var limitsGpu = lodash.get(ctrl.version, ['spec', 'resources', 'limits', 'nvidia.com/gpu']);
|
|
14601
|
+
ctrl.resources = {
|
|
14602
|
+
requests: {
|
|
14603
|
+
memory: parseValue(requestsMemory),
|
|
14604
|
+
cpu: parseValue(requestsCpu)
|
|
14605
|
+
},
|
|
14606
|
+
limits: {
|
|
14607
|
+
memory: parseValue(limitsMemory),
|
|
14608
|
+
cpu: parseValue(limitsCpu),
|
|
14609
|
+
gpu: parseValue(limitsGpu)
|
|
14610
|
+
}
|
|
14611
|
+
};
|
|
14623
14612
|
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14613
|
+
// get size unit from memory values into int or set default, example: '15G' -> 'G'
|
|
14614
|
+
ctrl.selectedRequestUnit = lodash.isNil(requestsMemory) ? defaultUnit : lodash.find(ctrl.dropdownOptions, ['unit', extractUnit(requestsMemory)]);
|
|
14615
|
+
ctrl.selectedLimitUnit = lodash.isNil(limitsMemory) ? defaultUnit : lodash.find(ctrl.dropdownOptions, ['unit', extractUnit(limitsMemory)]);
|
|
14616
|
+
ctrl.selectedCpuRequestItem = lodash.isNil(requestsCpu) ? ctrl.cpuDropdownOptions[0] : lodash.find(ctrl.cpuDropdownOptions, ['unit', extractUnit(requestsCpu)]);
|
|
14617
|
+
ctrl.selectedCpuLimitItem = lodash.isNil(limitsCpu) ? ctrl.cpuDropdownOptions[0] : lodash.find(ctrl.cpuDropdownOptions, ['unit', extractUnit(limitsCpu)]);
|
|
14618
|
+
function parseValue(value) {
|
|
14619
|
+
if (lodash.isNil(value)) {
|
|
14620
|
+
return null;
|
|
14621
|
+
}
|
|
14622
|
+
var parsedValue = parseFloat(value);
|
|
14623
|
+
return parsedValue > 0 ? parsedValue : null;
|
|
14624
|
+
}
|
|
14625
|
+
}
|
|
14627
14626
|
|
|
14628
14627
|
/**
|
|
14629
|
-
*
|
|
14628
|
+
* Init default parameters for pods priority
|
|
14630
14629
|
*/
|
|
14631
|
-
function
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14630
|
+
function initPodsPriority() {
|
|
14631
|
+
var podsPriority = lodash.get(ctrl.version, 'spec.priorityClassName', '');
|
|
14632
|
+
if (lodash.isEmpty(podsPriority)) {
|
|
14633
|
+
var defaultPodsPriority = lodash.get(ConfigService, 'nuclio.defaultFunctionConfig.attributes.spec.priorityClassName', '');
|
|
14634
|
+
ctrl.selectedPodsPriority = lodash.isEmpty(defaultPodsPriority) ? lodash.find(ctrl.podsPriorityOptions, ['id', 'igz-workload-medium']) : defaultPodsPriority;
|
|
14635
|
+
lodash.set(ctrl.version, 'spec.priorityClassName', ctrl.selectedPodsPriority.id);
|
|
14636
|
+
} else {
|
|
14637
|
+
ctrl.selectedPodsPriority = lodash.find(ctrl.podsPriorityOptions, ['id', podsPriority]);
|
|
14638
|
+
}
|
|
14636
14639
|
}
|
|
14637
14640
|
|
|
14638
14641
|
/**
|
|
14639
|
-
*
|
|
14640
|
-
* @param {Object} changes
|
|
14642
|
+
* Init default parameters for pod toleration
|
|
14641
14643
|
*/
|
|
14642
|
-
function
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
}).map(function (value, key) {
|
|
14647
|
-
return {
|
|
14648
|
-
name: key,
|
|
14649
|
-
value: value,
|
|
14650
|
-
ui: {
|
|
14651
|
-
editModeActive: false,
|
|
14652
|
-
isFormValid: false,
|
|
14653
|
-
name: 'label'
|
|
14654
|
-
}
|
|
14655
|
-
};
|
|
14656
|
-
}).value();
|
|
14657
|
-
ctrl.labels = lodash.compact(ctrl.labels);
|
|
14658
|
-
ctrl.addNewLabelTooltip = VersionHelperService.isVersionDeployed(ctrl.version) ? $i18next.t('functions:TOOLTIP.ADD_LABELS', {
|
|
14659
|
-
lng: lng
|
|
14660
|
-
}) : '';
|
|
14661
|
-
$timeout(function () {
|
|
14662
|
-
if (ctrl.labelsForm.$invalid) {
|
|
14663
|
-
ctrl.labelsForm.$setSubmitted();
|
|
14664
|
-
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14665
|
-
component: 'label',
|
|
14666
|
-
isDisabled: true
|
|
14667
|
-
});
|
|
14668
|
-
}
|
|
14669
|
-
});
|
|
14644
|
+
function initPodToleration() {
|
|
14645
|
+
ctrl.selectedPodTolerationOption = lodash.find(ctrl.podTolerationsOptions, ['id', preemptionMode]);
|
|
14646
|
+
if (!getVersionPreemptionMode()) {
|
|
14647
|
+
lodash.set(ctrl.version, 'spec.preemptionMode', ctrl.selectedPodTolerationOption.id);
|
|
14670
14648
|
}
|
|
14671
14649
|
}
|
|
14672
14650
|
|
|
14673
|
-
//
|
|
14674
|
-
// Public methods
|
|
14675
|
-
//
|
|
14676
|
-
|
|
14677
14651
|
/**
|
|
14678
|
-
*
|
|
14652
|
+
* Initializes data for "Scale to zero" section
|
|
14679
14653
|
*/
|
|
14680
|
-
function
|
|
14681
|
-
|
|
14682
|
-
if (
|
|
14683
|
-
|
|
14654
|
+
function initScaleToZeroData() {
|
|
14655
|
+
scaleToZero = lodash.get(ConfigService, 'nuclio.scaleToZero', {});
|
|
14656
|
+
if (!lodash.isEmpty(scaleToZero)) {
|
|
14657
|
+
scaleResourcesCopy = lodash.get(ctrl.version, 'spec.scaleToZero.scaleResources', scaleToZero.scaleResources);
|
|
14658
|
+
updateScaleToZeroParameters();
|
|
14684
14659
|
}
|
|
14685
|
-
$timeout(function () {
|
|
14686
|
-
if (ctrl.labels.length < 1 || lodash.last(ctrl.labels).ui.isFormValid) {
|
|
14687
|
-
ctrl.labels.push({
|
|
14688
|
-
name: '',
|
|
14689
|
-
value: '',
|
|
14690
|
-
ui: {
|
|
14691
|
-
editModeActive: true,
|
|
14692
|
-
isFormValid: false,
|
|
14693
|
-
name: 'label'
|
|
14694
|
-
}
|
|
14695
|
-
});
|
|
14696
|
-
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14697
|
-
component: 'label',
|
|
14698
|
-
isDisabled: true
|
|
14699
|
-
});
|
|
14700
|
-
event.stopPropagation();
|
|
14701
|
-
}
|
|
14702
|
-
}, 50);
|
|
14703
14660
|
}
|
|
14704
14661
|
|
|
14705
14662
|
/**
|
|
14706
|
-
*
|
|
14707
|
-
* @param {string} actionType
|
|
14708
|
-
* @param {number} index - index of label in array
|
|
14663
|
+
* Initializes Target CPU slider.
|
|
14709
14664
|
*/
|
|
14710
|
-
function
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14665
|
+
function initTargetCpuSlider() {
|
|
14666
|
+
ctrl.targetCpuValueUnit = '';
|
|
14667
|
+
ctrl.targetCpuSliderConfig = {
|
|
14668
|
+
value: lodash.get(ctrl.defaultFunctionConfig, 'spec.resources.targetCPU', 75),
|
|
14669
|
+
valueLabel: 'disabled',
|
|
14670
|
+
pow: 0,
|
|
14671
|
+
unitLabel: '%',
|
|
14672
|
+
labelHelpIcon: false,
|
|
14673
|
+
options: {
|
|
14674
|
+
disabled: true,
|
|
14675
|
+
floor: 1,
|
|
14676
|
+
id: 'targetCPU',
|
|
14677
|
+
ceil: 100,
|
|
14678
|
+
step: 1,
|
|
14679
|
+
showSelectionBar: true
|
|
14680
|
+
}
|
|
14681
|
+
};
|
|
14682
|
+
updateTargetCpuSlider();
|
|
14717
14683
|
}
|
|
14718
14684
|
|
|
14719
14685
|
/**
|
|
14720
|
-
* Checks if
|
|
14721
|
-
* @
|
|
14686
|
+
* Checks if input is related to `CPU Request`
|
|
14687
|
+
* @param {string} field
|
|
14722
14688
|
*/
|
|
14723
|
-
function
|
|
14724
|
-
return
|
|
14689
|
+
function isRequestsInput(field) {
|
|
14690
|
+
return lodash.includes(field.toLowerCase(), 'request');
|
|
14725
14691
|
}
|
|
14726
14692
|
|
|
14727
14693
|
/**
|
|
14728
|
-
*
|
|
14729
|
-
* @param {Object} label
|
|
14730
|
-
* @param {number} index
|
|
14694
|
+
* Show form errors if form is invalid
|
|
14731
14695
|
*/
|
|
14732
|
-
function
|
|
14733
|
-
|
|
14734
|
-
|
|
14696
|
+
function setFormValidity() {
|
|
14697
|
+
lodash.forEach(['requestMemory', 'limitsMemory', 'requestCpu', 'limitsCpu', 'limitsGpu', 'minReplicas', 'maxReplicas'], prepareToValidity);
|
|
14698
|
+
var path = 'spec.resources.requests.memory';
|
|
14699
|
+
checkIfMemoryInputsValid(lodash.get(ctrl.version, path, '0'), path);
|
|
14700
|
+
|
|
14701
|
+
/**
|
|
14702
|
+
* Set `dirty` to true and `ctrl.numberInputChanged` of `number-input.component` to true
|
|
14703
|
+
* for remove `pristine` css class
|
|
14704
|
+
*/
|
|
14705
|
+
function prepareToValidity(field) {
|
|
14706
|
+
if (angular.isDefined(ctrl.resourcesForm[field])) {
|
|
14707
|
+
ctrl.resourcesForm[field].$dirty = true;
|
|
14708
|
+
ctrl.resourcesForm[field].$$element.scope().$ctrl.numberInputChanged = true;
|
|
14709
|
+
}
|
|
14710
|
+
}
|
|
14735
14711
|
}
|
|
14736
14712
|
|
|
14737
|
-
|
|
14738
|
-
|
|
14739
|
-
|
|
14713
|
+
/**
|
|
14714
|
+
* Set Node selectors default value
|
|
14715
|
+
*/
|
|
14716
|
+
function setNodeSelectorsDefaultValue() {
|
|
14717
|
+
ctrl.nodeSelectors = lodash.chain(ConfigService).get('nuclio.defaultFunctionConfig.attributes.spec.nodeSelector', []).map(function (value, key) {
|
|
14718
|
+
return {
|
|
14719
|
+
name: key,
|
|
14720
|
+
value: value,
|
|
14721
|
+
ui: {
|
|
14722
|
+
editModeActive: false,
|
|
14723
|
+
isFormValid: key.length > 0 && value.length > 0,
|
|
14724
|
+
name: 'nodeSelector'
|
|
14725
|
+
}
|
|
14726
|
+
};
|
|
14727
|
+
}).value();
|
|
14728
|
+
$timeout(function () {
|
|
14729
|
+
updateNodeSelectors();
|
|
14730
|
+
}, 0);
|
|
14731
|
+
}
|
|
14740
14732
|
|
|
14741
14733
|
/**
|
|
14742
|
-
* Updates
|
|
14734
|
+
* Updates Node selectors
|
|
14743
14735
|
*/
|
|
14744
|
-
function
|
|
14736
|
+
function updateNodeSelectors() {
|
|
14745
14737
|
var isFormValid = true;
|
|
14746
|
-
var
|
|
14747
|
-
lodash.forEach(ctrl.
|
|
14748
|
-
if (!
|
|
14738
|
+
var newNodeSelectors = {};
|
|
14739
|
+
lodash.forEach(ctrl.nodeSelectors, function (nodeSelector) {
|
|
14740
|
+
if (!nodeSelector.ui.isFormValid) {
|
|
14749
14741
|
isFormValid = false;
|
|
14750
14742
|
}
|
|
14751
|
-
|
|
14743
|
+
newNodeSelectors[nodeSelector.name] = nodeSelector.value;
|
|
14752
14744
|
});
|
|
14753
14745
|
|
|
14754
14746
|
// since uniqueness validation rule of some fields is dependent on the entire label list, then whenever
|
|
14755
14747
|
// the list is modified - the rest of the labels need to be re-validated
|
|
14756
|
-
FormValidationService.validateAllFields(ctrl.
|
|
14748
|
+
FormValidationService.validateAllFields(ctrl.nodeSelectorsForm);
|
|
14757
14749
|
$rootScope.$broadcast('change-state-deploy-button', {
|
|
14758
|
-
component: '
|
|
14759
|
-
isDisabled: !isFormValid
|
|
14750
|
+
component: 'nodeSelector',
|
|
14751
|
+
isDisabled: !isFormValid || ctrl.nodeSelectorsForm.$invalid
|
|
14752
|
+
});
|
|
14753
|
+
lodash.set(ctrl.version, 'spec.nodeSelector', newNodeSelectors);
|
|
14754
|
+
checkNodeSelectorsIdentity();
|
|
14755
|
+
}
|
|
14756
|
+
|
|
14757
|
+
/**
|
|
14758
|
+
* Updates parameters for "Scale to zero" section
|
|
14759
|
+
*/
|
|
14760
|
+
function updateScaleToZeroParameters() {
|
|
14761
|
+
lodash.defaultsDeep(ctrl.version, {
|
|
14762
|
+
ui: {
|
|
14763
|
+
scaleToZero: {
|
|
14764
|
+
scaleResources: scaleResourcesCopy
|
|
14765
|
+
}
|
|
14766
|
+
}
|
|
14767
|
+
});
|
|
14768
|
+
var scaleResources = lodash.get(ctrl.version, 'ui.scaleToZero.scaleResources');
|
|
14769
|
+
if (ctrl.minReplicas === 0) {
|
|
14770
|
+
lodash.set(ctrl.version, 'spec.scaleToZero.scaleResources', scaleResources);
|
|
14771
|
+
} else {
|
|
14772
|
+
lodash.unset(ctrl.version, 'spec.scaleToZero');
|
|
14773
|
+
}
|
|
14774
|
+
var maxWindowSize = lodash.chain(scaleResources).maxBy(function (value) {
|
|
14775
|
+
return parseInt(value.windowSize);
|
|
14776
|
+
}).get('windowSize').value();
|
|
14777
|
+
ctrl.windowSizeSlider = {
|
|
14778
|
+
value: maxWindowSize,
|
|
14779
|
+
options: {
|
|
14780
|
+
stepsArray: scaleToZero.inactivityWindowPresets,
|
|
14781
|
+
showTicks: true,
|
|
14782
|
+
showTicksValues: true,
|
|
14783
|
+
disabled: !Number.isSafeInteger(ctrl.minReplicas) || ctrl.minReplicas > 0 || ctrl.isFunctionDeploying(),
|
|
14784
|
+
onChange: function onChange(_, newValue) {
|
|
14785
|
+
lodash.forEach(scaleResources, function (value) {
|
|
14786
|
+
value.windowSize = newValue;
|
|
14787
|
+
});
|
|
14788
|
+
if (ctrl.minReplicas === 0) {
|
|
14789
|
+
lodash.set(ctrl.version, 'spec.scaleToZero.scaleResources', scaleResources);
|
|
14790
|
+
}
|
|
14791
|
+
}
|
|
14792
|
+
}
|
|
14793
|
+
};
|
|
14794
|
+
}
|
|
14795
|
+
|
|
14796
|
+
/**
|
|
14797
|
+
* Updates Target CPU slider state (enabled/disabled) and display value.
|
|
14798
|
+
*/
|
|
14799
|
+
function updateTargetCpuSlider() {
|
|
14800
|
+
var minReplicas = lodash.get(ctrl.version, 'spec.minReplicas');
|
|
14801
|
+
var maxReplicas = lodash.get(ctrl.version, 'spec.maxReplicas');
|
|
14802
|
+
var disabled = !lodash.isNumber(minReplicas) || !lodash.isNumber(maxReplicas) || maxReplicas <= 1 || minReplicas === maxReplicas || ctrl.isFunctionDeploying();
|
|
14803
|
+
var targetCpuValue = lodash.get(ctrl.version, 'spec.targetCPU', 75);
|
|
14804
|
+
ctrl.targetCpuValueUnit = disabled ? '' : '%';
|
|
14805
|
+
lodash.merge(ctrl.targetCpuSliderConfig, {
|
|
14806
|
+
value: targetCpuValue,
|
|
14807
|
+
valueLabel: disabled ? 'disabled' : targetCpuValue,
|
|
14808
|
+
options: {
|
|
14809
|
+
disabled: disabled
|
|
14810
|
+
}
|
|
14760
14811
|
});
|
|
14761
|
-
lodash.set(ctrl.version, 'metadata.labels', newLabels);
|
|
14762
|
-
ctrl.onChangeCallback();
|
|
14763
14812
|
}
|
|
14764
14813
|
|
|
14765
14814
|
/**
|
|
14766
|
-
* Determines `uniqueness` validation for `Key` field
|
|
14815
|
+
* Determines `uniqueness` validation for Node selector `Key` field
|
|
14767
14816
|
* @param {string} value - value to validate
|
|
14817
|
+
* @returns {boolean}
|
|
14768
14818
|
*/
|
|
14769
|
-
function
|
|
14770
|
-
return lodash.filter(ctrl.
|
|
14819
|
+
function validateNodeSelectorUniqueness(value) {
|
|
14820
|
+
return lodash.filter(ctrl.nodeSelectors, ['name', value]).length === 1;
|
|
14771
14821
|
}
|
|
14772
14822
|
}
|
|
14773
14823
|
})();
|
|
@@ -15236,55 +15286,6 @@ such restriction.
|
|
|
15236
15286
|
})();
|
|
15237
15287
|
"use strict";
|
|
15238
15288
|
|
|
15239
|
-
/*
|
|
15240
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
15241
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
15242
|
-
an addition restriction as set forth herein. You may not use this
|
|
15243
|
-
file except in compliance with the License. You may obtain a copy of
|
|
15244
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
15245
|
-
Unless required by applicable law or agreed to in writing, software
|
|
15246
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15247
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
15248
|
-
implied. See the License for the specific language governing
|
|
15249
|
-
permissions and limitations under the License.
|
|
15250
|
-
In addition, you may not use the software for any purposes that are
|
|
15251
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
15252
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
15253
|
-
such restriction.
|
|
15254
|
-
*/
|
|
15255
|
-
(function () {
|
|
15256
|
-
'use strict';
|
|
15257
|
-
|
|
15258
|
-
NclVersionConfigurationLoggingController.$inject = ["lodash"];
|
|
15259
|
-
angular.module('iguazio.dashboard-controls').component('nclVersionConfigurationLogging', {
|
|
15260
|
-
bindings: {
|
|
15261
|
-
version: '<',
|
|
15262
|
-
onChangeCallback: '<'
|
|
15263
|
-
},
|
|
15264
|
-
templateUrl: 'nuclio/functions/version/version-configuration/tabs/version-configuration-logging/version-configuration-logging.tpl.html',
|
|
15265
|
-
controller: NclVersionConfigurationLoggingController
|
|
15266
|
-
});
|
|
15267
|
-
function NclVersionConfigurationLoggingController(lodash) {
|
|
15268
|
-
var ctrl = this;
|
|
15269
|
-
ctrl.inputValueCallback = inputValueCallback;
|
|
15270
|
-
|
|
15271
|
-
//
|
|
15272
|
-
// Public methods
|
|
15273
|
-
//
|
|
15274
|
-
|
|
15275
|
-
/**
|
|
15276
|
-
* Update data callback
|
|
15277
|
-
* @param {string} newData
|
|
15278
|
-
* @param {string} field
|
|
15279
|
-
*/
|
|
15280
|
-
function inputValueCallback(newData, field) {
|
|
15281
|
-
lodash.set(ctrl.version, field, newData);
|
|
15282
|
-
ctrl.onChangeCallback();
|
|
15283
|
-
}
|
|
15284
|
-
}
|
|
15285
|
-
})();
|
|
15286
|
-
"use strict";
|
|
15287
|
-
|
|
15288
15289
|
/*
|
|
15289
15290
|
Copyright 2018 Iguazio Systems Ltd.
|
|
15290
15291
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -19430,6 +19431,96 @@ such restriction.
|
|
|
19430
19431
|
})();
|
|
19431
19432
|
"use strict";
|
|
19432
19433
|
|
|
19434
|
+
/*
|
|
19435
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
19436
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
19437
|
+
an addition restriction as set forth herein. You may not use this
|
|
19438
|
+
file except in compliance with the License. You may obtain a copy of
|
|
19439
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
19440
|
+
Unless required by applicable law or agreed to in writing, software
|
|
19441
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
19442
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
19443
|
+
implied. See the License for the specific language governing
|
|
19444
|
+
permissions and limitations under the License.
|
|
19445
|
+
In addition, you may not use the software for any purposes that are
|
|
19446
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
19447
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
19448
|
+
such restriction.
|
|
19449
|
+
*/
|
|
19450
|
+
(function () {
|
|
19451
|
+
'use strict';
|
|
19452
|
+
|
|
19453
|
+
OverrideFunctionDialogController.$inject = ["$state", "lodash", "EventHelperService"];
|
|
19454
|
+
angular.module('iguazio.dashboard-controls').component('nclOverrideFunctionDialog', {
|
|
19455
|
+
bindings: {
|
|
19456
|
+
closeDialog: '&',
|
|
19457
|
+
existingFunction: '<',
|
|
19458
|
+
newFunction: '<',
|
|
19459
|
+
project: '<'
|
|
19460
|
+
},
|
|
19461
|
+
templateUrl: 'nuclio/functions/override-function-dialog/override-function-dialog.tpl.html',
|
|
19462
|
+
controller: OverrideFunctionDialogController
|
|
19463
|
+
});
|
|
19464
|
+
function OverrideFunctionDialogController($state, lodash, EventHelperService) {
|
|
19465
|
+
var ctrl = this;
|
|
19466
|
+
ctrl.onClose = onClose;
|
|
19467
|
+
ctrl.openExistingFunction = openExistingFunction;
|
|
19468
|
+
ctrl.overrideFunction = overrideFunction;
|
|
19469
|
+
|
|
19470
|
+
//
|
|
19471
|
+
// Public methods
|
|
19472
|
+
//
|
|
19473
|
+
|
|
19474
|
+
/**
|
|
19475
|
+
* Closes dialog
|
|
19476
|
+
* @param {Event} [event]
|
|
19477
|
+
*/
|
|
19478
|
+
function onClose(event) {
|
|
19479
|
+
if (angular.isUndefined(event) || event.keyCode === EventHelperService.ENTER) {
|
|
19480
|
+
ctrl.closeDialog();
|
|
19481
|
+
}
|
|
19482
|
+
}
|
|
19483
|
+
|
|
19484
|
+
/**
|
|
19485
|
+
* Opens the existing function
|
|
19486
|
+
*/
|
|
19487
|
+
function openExistingFunction() {
|
|
19488
|
+
var projectName = lodash.get(ctrl.existingFunction, ['metadata', 'labels', 'nuclio.io/project-name']);
|
|
19489
|
+
$state.go('app.project.function.edit.code', {
|
|
19490
|
+
id: projectName,
|
|
19491
|
+
projectId: projectName,
|
|
19492
|
+
projectNamespace: ctrl.project.metadata.namespace,
|
|
19493
|
+
functionId: ctrl.existingFunction.metadata.name
|
|
19494
|
+
});
|
|
19495
|
+
ctrl.closeDialog();
|
|
19496
|
+
}
|
|
19497
|
+
|
|
19498
|
+
/**
|
|
19499
|
+
* Overrides the existing function
|
|
19500
|
+
*/
|
|
19501
|
+
function overrideFunction() {
|
|
19502
|
+
lodash.merge(ctrl.newFunction, {
|
|
19503
|
+
status: {
|
|
19504
|
+
state: ''
|
|
19505
|
+
},
|
|
19506
|
+
ui: {
|
|
19507
|
+
overwrite: true
|
|
19508
|
+
}
|
|
19509
|
+
});
|
|
19510
|
+
$state.go('app.project.function.edit.code', {
|
|
19511
|
+
isNewFunction: true,
|
|
19512
|
+
id: ctrl.project.metadata.name,
|
|
19513
|
+
projectId: ctrl.project.metadata.name,
|
|
19514
|
+
projectNamespace: ctrl.project.metadata.namespace,
|
|
19515
|
+
functionId: ctrl.newFunction.metadata.name,
|
|
19516
|
+
functionData: ctrl.newFunction
|
|
19517
|
+
});
|
|
19518
|
+
ctrl.closeDialog();
|
|
19519
|
+
}
|
|
19520
|
+
}
|
|
19521
|
+
})();
|
|
19522
|
+
"use strict";
|
|
19523
|
+
|
|
19433
19524
|
/*
|
|
19434
19525
|
Copyright 2018 Iguazio Systems Ltd.
|
|
19435
19526
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -19864,156 +19955,66 @@ such restriction.
|
|
|
19864
19955
|
|
|
19865
19956
|
/**
|
|
19866
19957
|
* Returns appropriate css icon class for functions status.
|
|
19867
|
-
* @returns {string} - icon class
|
|
19868
|
-
*/
|
|
19869
|
-
function setStatusIcon() {
|
|
19870
|
-
ctrl.statusIcon = ctrl.convertedStatusState === $i18next.t('common:RUNNING', {
|
|
19871
|
-
lng: lng
|
|
19872
|
-
}) ? 'igz-icon-pause' : ctrl.convertedStatusState === $i18next.t('common:STANDBY', {
|
|
19873
|
-
lng: lng
|
|
19874
|
-
}) ? 'igz-icon-play' : /* else */'';
|
|
19875
|
-
}
|
|
19876
|
-
|
|
19877
|
-
/**
|
|
19878
|
-
* Terminates the interval of function state polling.
|
|
19879
|
-
*/
|
|
19880
|
-
function terminateInterval() {
|
|
19881
|
-
if (!lodash.isNil(interval)) {
|
|
19882
|
-
$interval.cancel(interval);
|
|
19883
|
-
interval = null;
|
|
19884
|
-
}
|
|
19885
|
-
}
|
|
19886
|
-
|
|
19887
|
-
/**
|
|
19888
|
-
* Sends request to update function state
|
|
19889
|
-
* @param {string} [status='Building'] - The text to display in "Status" cell of the function while polling.
|
|
19890
|
-
*/
|
|
19891
|
-
function updateFunction(status) {
|
|
19892
|
-
ctrl.isSplashShowed.value = true;
|
|
19893
|
-
var pathsToExcludeOnDeploy = ['status', 'ui', 'versions'];
|
|
19894
|
-
var functionCopy = lodash.omit(ctrl["function"], pathsToExcludeOnDeploy);
|
|
19895
|
-
|
|
19896
|
-
// set `nuclio.io/project-name` label to relate this function to its project
|
|
19897
|
-
lodash.set(functionCopy, ['metadata', 'labels', 'nuclio.io/project-name'], ctrl.project.metadata.name);
|
|
19898
|
-
ctrl.updateFunction({
|
|
19899
|
-
'function': functionCopy,
|
|
19900
|
-
projectId: ctrl.project.metadata.name
|
|
19901
|
-
}).then(function () {
|
|
19902
|
-
tempFunctionCopy = null;
|
|
19903
|
-
pullFunctionState(status);
|
|
19904
|
-
})["catch"](function (error) {
|
|
19905
|
-
ctrl["function"] = tempFunctionCopy;
|
|
19906
|
-
var defaultMsg = $i18next.t('functions:ERROR_MSG.UPDATE_FUNCTION', {
|
|
19907
|
-
lng: lng
|
|
19908
|
-
});
|
|
19909
|
-
return DialogsService.alert(lodash.get(error, 'data.error', defaultMsg));
|
|
19910
|
-
})["finally"](function () {
|
|
19911
|
-
ctrl.isSplashShowed.value = false;
|
|
19912
|
-
});
|
|
19913
|
-
}
|
|
19914
|
-
|
|
19915
|
-
/**
|
|
19916
|
-
* Show dialog with YAML function config
|
|
19917
|
-
*/
|
|
19918
|
-
function viewConfig() {
|
|
19919
|
-
ngDialog.open({
|
|
19920
|
-
template: '<ncl-function-config-dialog data-close-dialog="closeThisDialog()" ' + ' data-function="ngDialogData.function">' + '</ncl-function-config-dialog>',
|
|
19921
|
-
plain: true,
|
|
19922
|
-
data: {
|
|
19923
|
-
"function": ctrl["function"]
|
|
19924
|
-
},
|
|
19925
|
-
className: 'ngdialog-theme-iguazio view-yaml-dialog-wrapper'
|
|
19926
|
-
});
|
|
19927
|
-
}
|
|
19928
|
-
}
|
|
19929
|
-
})();
|
|
19930
|
-
"use strict";
|
|
19931
|
-
|
|
19932
|
-
/*
|
|
19933
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
19934
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
19935
|
-
an addition restriction as set forth herein. You may not use this
|
|
19936
|
-
file except in compliance with the License. You may obtain a copy of
|
|
19937
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
19938
|
-
Unless required by applicable law or agreed to in writing, software
|
|
19939
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
19940
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
19941
|
-
implied. See the License for the specific language governing
|
|
19942
|
-
permissions and limitations under the License.
|
|
19943
|
-
In addition, you may not use the software for any purposes that are
|
|
19944
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
19945
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
19946
|
-
such restriction.
|
|
19947
|
-
*/
|
|
19948
|
-
(function () {
|
|
19949
|
-
'use strict';
|
|
19950
|
-
|
|
19951
|
-
OverrideFunctionDialogController.$inject = ["$state", "lodash", "EventHelperService"];
|
|
19952
|
-
angular.module('iguazio.dashboard-controls').component('nclOverrideFunctionDialog', {
|
|
19953
|
-
bindings: {
|
|
19954
|
-
closeDialog: '&',
|
|
19955
|
-
existingFunction: '<',
|
|
19956
|
-
newFunction: '<',
|
|
19957
|
-
project: '<'
|
|
19958
|
-
},
|
|
19959
|
-
templateUrl: 'nuclio/functions/override-function-dialog/override-function-dialog.tpl.html',
|
|
19960
|
-
controller: OverrideFunctionDialogController
|
|
19961
|
-
});
|
|
19962
|
-
function OverrideFunctionDialogController($state, lodash, EventHelperService) {
|
|
19963
|
-
var ctrl = this;
|
|
19964
|
-
ctrl.onClose = onClose;
|
|
19965
|
-
ctrl.openExistingFunction = openExistingFunction;
|
|
19966
|
-
ctrl.overrideFunction = overrideFunction;
|
|
19967
|
-
|
|
19968
|
-
//
|
|
19969
|
-
// Public methods
|
|
19970
|
-
//
|
|
19958
|
+
* @returns {string} - icon class
|
|
19959
|
+
*/
|
|
19960
|
+
function setStatusIcon() {
|
|
19961
|
+
ctrl.statusIcon = ctrl.convertedStatusState === $i18next.t('common:RUNNING', {
|
|
19962
|
+
lng: lng
|
|
19963
|
+
}) ? 'igz-icon-pause' : ctrl.convertedStatusState === $i18next.t('common:STANDBY', {
|
|
19964
|
+
lng: lng
|
|
19965
|
+
}) ? 'igz-icon-play' : /* else */'';
|
|
19966
|
+
}
|
|
19971
19967
|
|
|
19972
19968
|
/**
|
|
19973
|
-
*
|
|
19974
|
-
* @param {Event} [event]
|
|
19969
|
+
* Terminates the interval of function state polling.
|
|
19975
19970
|
*/
|
|
19976
|
-
function
|
|
19977
|
-
if (
|
|
19978
|
-
|
|
19971
|
+
function terminateInterval() {
|
|
19972
|
+
if (!lodash.isNil(interval)) {
|
|
19973
|
+
$interval.cancel(interval);
|
|
19974
|
+
interval = null;
|
|
19979
19975
|
}
|
|
19980
19976
|
}
|
|
19981
19977
|
|
|
19982
19978
|
/**
|
|
19983
|
-
*
|
|
19979
|
+
* Sends request to update function state
|
|
19980
|
+
* @param {string} [status='Building'] - The text to display in "Status" cell of the function while polling.
|
|
19984
19981
|
*/
|
|
19985
|
-
function
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
-
|
|
19982
|
+
function updateFunction(status) {
|
|
19983
|
+
ctrl.isSplashShowed.value = true;
|
|
19984
|
+
var pathsToExcludeOnDeploy = ['status', 'ui', 'versions'];
|
|
19985
|
+
var functionCopy = lodash.omit(ctrl["function"], pathsToExcludeOnDeploy);
|
|
19986
|
+
|
|
19987
|
+
// set `nuclio.io/project-name` label to relate this function to its project
|
|
19988
|
+
lodash.set(functionCopy, ['metadata', 'labels', 'nuclio.io/project-name'], ctrl.project.metadata.name);
|
|
19989
|
+
ctrl.updateFunction({
|
|
19990
|
+
'function': functionCopy,
|
|
19991
|
+
projectId: ctrl.project.metadata.name
|
|
19992
|
+
}).then(function () {
|
|
19993
|
+
tempFunctionCopy = null;
|
|
19994
|
+
pullFunctionState(status);
|
|
19995
|
+
})["catch"](function (error) {
|
|
19996
|
+
ctrl["function"] = tempFunctionCopy;
|
|
19997
|
+
var defaultMsg = $i18next.t('functions:ERROR_MSG.UPDATE_FUNCTION', {
|
|
19998
|
+
lng: lng
|
|
19999
|
+
});
|
|
20000
|
+
return DialogsService.alert(lodash.get(error, 'data.error', defaultMsg));
|
|
20001
|
+
})["finally"](function () {
|
|
20002
|
+
ctrl.isSplashShowed.value = false;
|
|
19992
20003
|
});
|
|
19993
|
-
ctrl.closeDialog();
|
|
19994
20004
|
}
|
|
19995
20005
|
|
|
19996
20006
|
/**
|
|
19997
|
-
*
|
|
20007
|
+
* Show dialog with YAML function config
|
|
19998
20008
|
*/
|
|
19999
|
-
function
|
|
20000
|
-
|
|
20001
|
-
|
|
20002
|
-
|
|
20009
|
+
function viewConfig() {
|
|
20010
|
+
ngDialog.open({
|
|
20011
|
+
template: '<ncl-function-config-dialog data-close-dialog="closeThisDialog()" ' + ' data-function="ngDialogData.function">' + '</ncl-function-config-dialog>',
|
|
20012
|
+
plain: true,
|
|
20013
|
+
data: {
|
|
20014
|
+
"function": ctrl["function"]
|
|
20003
20015
|
},
|
|
20004
|
-
|
|
20005
|
-
overwrite: true
|
|
20006
|
-
}
|
|
20007
|
-
});
|
|
20008
|
-
$state.go('app.project.function.edit.code', {
|
|
20009
|
-
isNewFunction: true,
|
|
20010
|
-
id: ctrl.project.metadata.name,
|
|
20011
|
-
projectId: ctrl.project.metadata.name,
|
|
20012
|
-
projectNamespace: ctrl.project.metadata.namespace,
|
|
20013
|
-
functionId: ctrl.newFunction.metadata.name,
|
|
20014
|
-
functionData: ctrl.newFunction
|
|
20016
|
+
className: 'ngdialog-theme-iguazio view-yaml-dialog-wrapper'
|
|
20015
20017
|
});
|
|
20016
|
-
ctrl.closeDialog();
|
|
20017
20018
|
}
|
|
20018
20019
|
}
|
|
20019
20020
|
})();
|
|
@@ -20786,46 +20787,229 @@ such restriction.
|
|
|
20786
20787
|
}
|
|
20787
20788
|
|
|
20788
20789
|
/**
|
|
20789
|
-
* Redirects to the function screen
|
|
20790
|
+
* Redirects to the function screen
|
|
20791
|
+
*/
|
|
20792
|
+
function goToFunctionScreen() {
|
|
20793
|
+
$state.go('app.project.function.edit.code');
|
|
20794
|
+
}
|
|
20795
|
+
|
|
20796
|
+
//
|
|
20797
|
+
// Private methods
|
|
20798
|
+
//
|
|
20799
|
+
|
|
20800
|
+
/**
|
|
20801
|
+
* Dynamically set Main Header Title on broadcast and on initial page load
|
|
20802
|
+
* @param {Object} [event]
|
|
20803
|
+
* @param {Object} [data]
|
|
20804
|
+
*/
|
|
20805
|
+
function setMainHeaderTitle(event, data) {
|
|
20806
|
+
if (!lodash.isNil(data)) {
|
|
20807
|
+
lodash.assign(ctrl.mainHeaderTitle, data);
|
|
20808
|
+
} else {
|
|
20809
|
+
ctrl.mainHeaderTitle = {
|
|
20810
|
+
title: $state.current.data.mainHeaderTitle
|
|
20811
|
+
};
|
|
20812
|
+
}
|
|
20813
|
+
}
|
|
20814
|
+
|
|
20815
|
+
/**
|
|
20816
|
+
* Dynamically pre-set Main Header Title on UI router state change, sets position of main wrapper and navigation
|
|
20817
|
+
* tabs config
|
|
20818
|
+
* Needed for better UX - header title changes correctly even before controller data resolved and broadcast
|
|
20819
|
+
* have been sent
|
|
20820
|
+
* @param {Object} transition
|
|
20821
|
+
*/
|
|
20822
|
+
function onStateChangeSuccess(transition) {
|
|
20823
|
+
var toState = transition.$to();
|
|
20824
|
+
|
|
20825
|
+
// Check to exclude prototypical inheritance of the `mainHeaderTitle` property from parent router state
|
|
20826
|
+
if (lodash.has(toState.data, 'mainHeaderTitle')) {
|
|
20827
|
+
ctrl.mainHeaderTitle = {
|
|
20828
|
+
title: toState.data.mainHeaderTitle
|
|
20829
|
+
};
|
|
20830
|
+
}
|
|
20831
|
+
}
|
|
20832
|
+
}
|
|
20833
|
+
})();
|
|
20834
|
+
"use strict";
|
|
20835
|
+
|
|
20836
|
+
/*
|
|
20837
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
20838
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
20839
|
+
an addition restriction as set forth herein. You may not use this
|
|
20840
|
+
file except in compliance with the License. You may obtain a copy of
|
|
20841
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
20842
|
+
Unless required by applicable law or agreed to in writing, software
|
|
20843
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
20844
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
20845
|
+
implied. See the License for the specific language governing
|
|
20846
|
+
permissions and limitations under the License.
|
|
20847
|
+
In addition, you may not use the software for any purposes that are
|
|
20848
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
20849
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
20850
|
+
such restriction.
|
|
20851
|
+
*/
|
|
20852
|
+
(function () {
|
|
20853
|
+
'use strict';
|
|
20854
|
+
|
|
20855
|
+
NclBreadcrumbsDropdown.$inject = ["$document", "$element", "$scope", "$state", "$i18next", "i18next", "lodash", "DialogsService"];
|
|
20856
|
+
angular.module('iguazio.dashboard-controls').component('nclBreadcrumbsDropdown', {
|
|
20857
|
+
bindings: {
|
|
20858
|
+
state: '<',
|
|
20859
|
+
title: '<',
|
|
20860
|
+
project: '<',
|
|
20861
|
+
type: '@',
|
|
20862
|
+
getFunctions: '&',
|
|
20863
|
+
getProjects: '&'
|
|
20864
|
+
},
|
|
20865
|
+
templateUrl: 'nuclio/common/components/breadcrumbs-dropdown/breadcrumbs-dropdown.tpl.html',
|
|
20866
|
+
controller: NclBreadcrumbsDropdown
|
|
20867
|
+
});
|
|
20868
|
+
function NclBreadcrumbsDropdown($document, $element, $scope, $state, $i18next, i18next, lodash, DialogsService) {
|
|
20869
|
+
var ctrl = this;
|
|
20870
|
+
var lng = i18next.language;
|
|
20871
|
+
ctrl.itemsList = [];
|
|
20872
|
+
ctrl.showDropdownList = false;
|
|
20873
|
+
ctrl.placeholder = $i18next.t('common:PLACEHOLDER.SEARCH', {
|
|
20874
|
+
lng: lng
|
|
20875
|
+
});
|
|
20876
|
+
ctrl.$onInit = onInit;
|
|
20877
|
+
ctrl.showDropdown = showDropdown;
|
|
20878
|
+
ctrl.showDetails = showDetails;
|
|
20879
|
+
|
|
20880
|
+
//
|
|
20881
|
+
// Hook methods
|
|
20882
|
+
//
|
|
20883
|
+
|
|
20884
|
+
/**
|
|
20885
|
+
* Initialization method
|
|
20886
|
+
*/
|
|
20887
|
+
function onInit() {
|
|
20888
|
+
if (ctrl.type === 'projects') {
|
|
20889
|
+
ctrl.getProjects().then(setNuclioItemsList)["catch"](function (error) {
|
|
20890
|
+
var defaultMsg = $i18next.t('functions:ERROR_MSG.GET_PROJECTS', {
|
|
20891
|
+
lng: lng
|
|
20892
|
+
});
|
|
20893
|
+
DialogsService.alert(lodash.get(error, 'data.error', defaultMsg));
|
|
20894
|
+
});
|
|
20895
|
+
} else if (ctrl.type === 'functions') {
|
|
20896
|
+
ctrl.getFunctions({
|
|
20897
|
+
id: ctrl.project.metadata.name,
|
|
20898
|
+
enrichApiGateways: false
|
|
20899
|
+
}).then(setNuclioItemsList)["catch"](function (error) {
|
|
20900
|
+
var defaultMsg = $i18next.t('functions:ERROR_MSG.GET_FUNCTIONS', {
|
|
20901
|
+
lng: lng
|
|
20902
|
+
});
|
|
20903
|
+
DialogsService.alert(lodash.get(error, 'data.error', defaultMsg));
|
|
20904
|
+
});
|
|
20905
|
+
}
|
|
20906
|
+
$document.on('click', unselectDropdown);
|
|
20907
|
+
}
|
|
20908
|
+
|
|
20909
|
+
//
|
|
20910
|
+
// Public method
|
|
20911
|
+
//
|
|
20912
|
+
|
|
20913
|
+
/**
|
|
20914
|
+
* Opens/closes dropdown
|
|
20915
|
+
*/
|
|
20916
|
+
function showDropdown() {
|
|
20917
|
+
$document.on('click', unselectDropdown);
|
|
20918
|
+
if (!ctrl.showDropdownList) {
|
|
20919
|
+
$element.find('.breadcrumb-arrow').css('background-color', '#c9c9cd');
|
|
20920
|
+
}
|
|
20921
|
+
ctrl.showDropdownList = !ctrl.showDropdownList;
|
|
20922
|
+
if (!ctrl.showDropdownList) {
|
|
20923
|
+
ctrl.searchText = '';
|
|
20924
|
+
$element.find('.breadcrumb-arrow').css('background-color', '');
|
|
20925
|
+
$document.off('click', unselectDropdown);
|
|
20926
|
+
}
|
|
20927
|
+
}
|
|
20928
|
+
|
|
20929
|
+
/**
|
|
20930
|
+
* Handles mouse click on a item's name
|
|
20931
|
+
* Navigates to selected page
|
|
20932
|
+
* @param {Event} event
|
|
20933
|
+
* @param {Object} item
|
|
20934
|
+
*/
|
|
20935
|
+
function showDetails(event, item) {
|
|
20936
|
+
var params = {};
|
|
20937
|
+
ctrl.showDropdownList = !ctrl.showDropdownList;
|
|
20938
|
+
ctrl.searchText = '';
|
|
20939
|
+
$document.off('click', unselectDropdown);
|
|
20940
|
+
$element.find('.breadcrumb-arrow').css('background-color', '');
|
|
20941
|
+
if (ctrl.type === 'projects') {
|
|
20942
|
+
params.projectId = item.id;
|
|
20943
|
+
$state.go('app.project.functions', params);
|
|
20944
|
+
} else if (ctrl.type === 'functions') {
|
|
20945
|
+
params = {
|
|
20946
|
+
isNewFunction: false,
|
|
20947
|
+
id: ctrl.project.metadata.name,
|
|
20948
|
+
functionId: item.id,
|
|
20949
|
+
projectNamespace: ctrl.project.metadata.namespace
|
|
20950
|
+
};
|
|
20951
|
+
$state.go('app.project.function.edit.code', params);
|
|
20952
|
+
}
|
|
20953
|
+
}
|
|
20954
|
+
|
|
20955
|
+
//
|
|
20956
|
+
// Private method
|
|
20957
|
+
//
|
|
20958
|
+
|
|
20959
|
+
/**
|
|
20960
|
+
* Handles promise
|
|
20961
|
+
* Sets projects list for dropdown in Nuclio breadcrumbs
|
|
20962
|
+
* @param {Object} data
|
|
20963
|
+
*/
|
|
20964
|
+
function setProjectsItemList(data) {
|
|
20965
|
+
ctrl.itemsList = lodash.map(data, function (item) {
|
|
20966
|
+
return {
|
|
20967
|
+
id: item.metadata.name,
|
|
20968
|
+
name: item.metadata.name,
|
|
20969
|
+
isNuclioState: true
|
|
20970
|
+
};
|
|
20971
|
+
});
|
|
20972
|
+
}
|
|
20973
|
+
|
|
20974
|
+
/**
|
|
20975
|
+
* Handles promise
|
|
20976
|
+
* Sets functions list for dropdown in Nuclio breadcrumbs
|
|
20977
|
+
* @param {Object} data
|
|
20790
20978
|
*/
|
|
20791
|
-
function
|
|
20792
|
-
|
|
20979
|
+
function setFunctionsItemList(data) {
|
|
20980
|
+
ctrl.itemsList = lodash.map(data, function (item) {
|
|
20981
|
+
return {
|
|
20982
|
+
id: item.metadata.name,
|
|
20983
|
+
name: item.metadata.name,
|
|
20984
|
+
isNuclioState: true
|
|
20985
|
+
};
|
|
20986
|
+
});
|
|
20793
20987
|
}
|
|
20794
20988
|
|
|
20795
|
-
//
|
|
20796
|
-
// Private methods
|
|
20797
|
-
//
|
|
20798
|
-
|
|
20799
20989
|
/**
|
|
20800
|
-
*
|
|
20801
|
-
* @param {Object}
|
|
20802
|
-
* @param {Object} [data]
|
|
20990
|
+
* Checks what item list need to set for dropdown in Nuclio breadcrumbs
|
|
20991
|
+
* @param {Object} data
|
|
20803
20992
|
*/
|
|
20804
|
-
function
|
|
20805
|
-
if (
|
|
20806
|
-
|
|
20807
|
-
} else {
|
|
20808
|
-
|
|
20809
|
-
title: $state.current.data.mainHeaderTitle
|
|
20810
|
-
};
|
|
20993
|
+
function setNuclioItemsList(data) {
|
|
20994
|
+
if (ctrl.type === 'projects') {
|
|
20995
|
+
setProjectsItemList(data);
|
|
20996
|
+
} else if (ctrl.type === 'functions') {
|
|
20997
|
+
setFunctionsItemList(lodash.defaultTo(data.data, data));
|
|
20811
20998
|
}
|
|
20812
20999
|
}
|
|
20813
21000
|
|
|
20814
21001
|
/**
|
|
20815
|
-
*
|
|
20816
|
-
*
|
|
20817
|
-
* Needed for better UX - header title changes correctly even before controller data resolved and broadcast
|
|
20818
|
-
* have been sent
|
|
20819
|
-
* @param {Object} transition
|
|
21002
|
+
* Handle click on the document and not on the dropdown field and close the dropdown
|
|
21003
|
+
* @param {Object} e - event
|
|
20820
21004
|
*/
|
|
20821
|
-
function
|
|
20822
|
-
|
|
20823
|
-
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
|
|
20828
|
-
};
|
|
21005
|
+
function unselectDropdown(e) {
|
|
21006
|
+
if ($element.find(e.target).length === 0) {
|
|
21007
|
+
$scope.$evalAsync(function () {
|
|
21008
|
+
ctrl.showDropdownList = false;
|
|
21009
|
+
ctrl.searchText = '';
|
|
21010
|
+
$document.off('click', unselectDropdown);
|
|
21011
|
+
$element.find('.breadcrumb-arrow').css('background-color', '');
|
|
21012
|
+
});
|
|
20829
21013
|
}
|
|
20830
21014
|
}
|
|
20831
21015
|
}
|
|
@@ -21073,225 +21257,42 @@ such restriction.
|
|
|
21073
21257
|
},
|
|
21074
21258
|
templateUrl: 'nuclio/common/components/deploy-log/deploy-log.tpl.html',
|
|
21075
21259
|
controller: NclDeployLogController
|
|
21076
|
-
});
|
|
21077
|
-
function NclDeployLogController(lodash) {
|
|
21078
|
-
var ctrl = this;
|
|
21079
|
-
ctrl.scrollConfig = {
|
|
21080
|
-
advanced: {
|
|
21081
|
-
updateOnContentResize: true
|
|
21082
|
-
},
|
|
21083
|
-
theme: 'light-thin'
|
|
21084
|
-
};
|
|
21085
|
-
ctrl.lodash = lodash;
|
|
21086
|
-
ctrl.getLogLevel = getLogLevel;
|
|
21087
|
-
ctrl.getLogParams = getLogParams;
|
|
21088
|
-
|
|
21089
|
-
//
|
|
21090
|
-
// Public methods
|
|
21091
|
-
//
|
|
21092
|
-
|
|
21093
|
-
/**
|
|
21094
|
-
* Get log level display value
|
|
21095
|
-
* @param {string} level - the level model value (one of: 'debug', 'info', 'warn', 'error')
|
|
21096
|
-
* @returns {string} the log level display value
|
|
21097
|
-
*/
|
|
21098
|
-
function getLogLevel(level) {
|
|
21099
|
-
return lodash.first(level).toUpperCase();
|
|
21100
|
-
}
|
|
21101
|
-
|
|
21102
|
-
/**
|
|
21103
|
-
* Get log parameters display value
|
|
21104
|
-
* @param {string} logEntry - the log entry that includes the parameters
|
|
21105
|
-
* @returns {string} the log level display value
|
|
21106
|
-
*/
|
|
21107
|
-
function getLogParams(logEntry) {
|
|
21108
|
-
var params = lodash.omit(logEntry, ['name', 'time', 'level', 'message', 'err']);
|
|
21109
|
-
return lodash.isEmpty(params) ? '' : '[' + lodash.map(params, function (value, key) {
|
|
21110
|
-
return key + ': ' + angular.toJson(value);
|
|
21111
|
-
}).join(', ').replace(/\\n/g, '\n').replace(/\\"/g, '"') + ']';
|
|
21112
|
-
}
|
|
21113
|
-
}
|
|
21114
|
-
})();
|
|
21115
|
-
"use strict";
|
|
21116
|
-
|
|
21117
|
-
/*
|
|
21118
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
21119
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
21120
|
-
an addition restriction as set forth herein. You may not use this
|
|
21121
|
-
file except in compliance with the License. You may obtain a copy of
|
|
21122
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
21123
|
-
Unless required by applicable law or agreed to in writing, software
|
|
21124
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
21125
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
21126
|
-
implied. See the License for the specific language governing
|
|
21127
|
-
permissions and limitations under the License.
|
|
21128
|
-
In addition, you may not use the software for any purposes that are
|
|
21129
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
21130
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
21131
|
-
such restriction.
|
|
21132
|
-
*/
|
|
21133
|
-
(function () {
|
|
21134
|
-
'use strict';
|
|
21135
|
-
|
|
21136
|
-
NclBreadcrumbsDropdown.$inject = ["$document", "$element", "$scope", "$state", "$i18next", "i18next", "lodash", "DialogsService"];
|
|
21137
|
-
angular.module('iguazio.dashboard-controls').component('nclBreadcrumbsDropdown', {
|
|
21138
|
-
bindings: {
|
|
21139
|
-
state: '<',
|
|
21140
|
-
title: '<',
|
|
21141
|
-
project: '<',
|
|
21142
|
-
type: '@',
|
|
21143
|
-
getFunctions: '&',
|
|
21144
|
-
getProjects: '&'
|
|
21145
|
-
},
|
|
21146
|
-
templateUrl: 'nuclio/common/components/breadcrumbs-dropdown/breadcrumbs-dropdown.tpl.html',
|
|
21147
|
-
controller: NclBreadcrumbsDropdown
|
|
21148
|
-
});
|
|
21149
|
-
function NclBreadcrumbsDropdown($document, $element, $scope, $state, $i18next, i18next, lodash, DialogsService) {
|
|
21150
|
-
var ctrl = this;
|
|
21151
|
-
var lng = i18next.language;
|
|
21152
|
-
ctrl.itemsList = [];
|
|
21153
|
-
ctrl.showDropdownList = false;
|
|
21154
|
-
ctrl.placeholder = $i18next.t('common:PLACEHOLDER.SEARCH', {
|
|
21155
|
-
lng: lng
|
|
21156
|
-
});
|
|
21157
|
-
ctrl.$onInit = onInit;
|
|
21158
|
-
ctrl.showDropdown = showDropdown;
|
|
21159
|
-
ctrl.showDetails = showDetails;
|
|
21160
|
-
|
|
21161
|
-
//
|
|
21162
|
-
// Hook methods
|
|
21163
|
-
//
|
|
21164
|
-
|
|
21165
|
-
/**
|
|
21166
|
-
* Initialization method
|
|
21167
|
-
*/
|
|
21168
|
-
function onInit() {
|
|
21169
|
-
if (ctrl.type === 'projects') {
|
|
21170
|
-
ctrl.getProjects().then(setNuclioItemsList)["catch"](function (error) {
|
|
21171
|
-
var defaultMsg = $i18next.t('functions:ERROR_MSG.GET_PROJECTS', {
|
|
21172
|
-
lng: lng
|
|
21173
|
-
});
|
|
21174
|
-
DialogsService.alert(lodash.get(error, 'data.error', defaultMsg));
|
|
21175
|
-
});
|
|
21176
|
-
} else if (ctrl.type === 'functions') {
|
|
21177
|
-
ctrl.getFunctions({
|
|
21178
|
-
id: ctrl.project.metadata.name,
|
|
21179
|
-
enrichApiGateways: false
|
|
21180
|
-
}).then(setNuclioItemsList)["catch"](function (error) {
|
|
21181
|
-
var defaultMsg = $i18next.t('functions:ERROR_MSG.GET_FUNCTIONS', {
|
|
21182
|
-
lng: lng
|
|
21183
|
-
});
|
|
21184
|
-
DialogsService.alert(lodash.get(error, 'data.error', defaultMsg));
|
|
21185
|
-
});
|
|
21186
|
-
}
|
|
21187
|
-
$document.on('click', unselectDropdown);
|
|
21188
|
-
}
|
|
21189
|
-
|
|
21190
|
-
//
|
|
21191
|
-
// Public method
|
|
21192
|
-
//
|
|
21193
|
-
|
|
21194
|
-
/**
|
|
21195
|
-
* Opens/closes dropdown
|
|
21196
|
-
*/
|
|
21197
|
-
function showDropdown() {
|
|
21198
|
-
$document.on('click', unselectDropdown);
|
|
21199
|
-
if (!ctrl.showDropdownList) {
|
|
21200
|
-
$element.find('.breadcrumb-arrow').css('background-color', '#c9c9cd');
|
|
21201
|
-
}
|
|
21202
|
-
ctrl.showDropdownList = !ctrl.showDropdownList;
|
|
21203
|
-
if (!ctrl.showDropdownList) {
|
|
21204
|
-
ctrl.searchText = '';
|
|
21205
|
-
$element.find('.breadcrumb-arrow').css('background-color', '');
|
|
21206
|
-
$document.off('click', unselectDropdown);
|
|
21207
|
-
}
|
|
21208
|
-
}
|
|
21209
|
-
|
|
21210
|
-
/**
|
|
21211
|
-
* Handles mouse click on a item's name
|
|
21212
|
-
* Navigates to selected page
|
|
21213
|
-
* @param {Event} event
|
|
21214
|
-
* @param {Object} item
|
|
21215
|
-
*/
|
|
21216
|
-
function showDetails(event, item) {
|
|
21217
|
-
var params = {};
|
|
21218
|
-
ctrl.showDropdownList = !ctrl.showDropdownList;
|
|
21219
|
-
ctrl.searchText = '';
|
|
21220
|
-
$document.off('click', unselectDropdown);
|
|
21221
|
-
$element.find('.breadcrumb-arrow').css('background-color', '');
|
|
21222
|
-
if (ctrl.type === 'projects') {
|
|
21223
|
-
params.projectId = item.id;
|
|
21224
|
-
$state.go('app.project.functions', params);
|
|
21225
|
-
} else if (ctrl.type === 'functions') {
|
|
21226
|
-
params = {
|
|
21227
|
-
isNewFunction: false,
|
|
21228
|
-
id: ctrl.project.metadata.name,
|
|
21229
|
-
functionId: item.id,
|
|
21230
|
-
projectNamespace: ctrl.project.metadata.namespace
|
|
21231
|
-
};
|
|
21232
|
-
$state.go('app.project.function.edit.code', params);
|
|
21233
|
-
}
|
|
21234
|
-
}
|
|
21235
|
-
|
|
21236
|
-
//
|
|
21237
|
-
// Private method
|
|
21238
|
-
//
|
|
21239
|
-
|
|
21240
|
-
/**
|
|
21241
|
-
* Handles promise
|
|
21242
|
-
* Sets projects list for dropdown in Nuclio breadcrumbs
|
|
21243
|
-
* @param {Object} data
|
|
21244
|
-
*/
|
|
21245
|
-
function setProjectsItemList(data) {
|
|
21246
|
-
ctrl.itemsList = lodash.map(data, function (item) {
|
|
21247
|
-
return {
|
|
21248
|
-
id: item.metadata.name,
|
|
21249
|
-
name: item.metadata.name,
|
|
21250
|
-
isNuclioState: true
|
|
21251
|
-
};
|
|
21252
|
-
});
|
|
21253
|
-
}
|
|
21254
|
-
|
|
21255
|
-
/**
|
|
21256
|
-
* Handles promise
|
|
21257
|
-
* Sets functions list for dropdown in Nuclio breadcrumbs
|
|
21258
|
-
* @param {Object} data
|
|
21259
|
-
*/
|
|
21260
|
-
function setFunctionsItemList(data) {
|
|
21261
|
-
ctrl.itemsList = lodash.map(data, function (item) {
|
|
21262
|
-
return {
|
|
21263
|
-
id: item.metadata.name,
|
|
21264
|
-
name: item.metadata.name,
|
|
21265
|
-
isNuclioState: true
|
|
21266
|
-
};
|
|
21267
|
-
});
|
|
21268
|
-
}
|
|
21260
|
+
});
|
|
21261
|
+
function NclDeployLogController(lodash) {
|
|
21262
|
+
var ctrl = this;
|
|
21263
|
+
ctrl.scrollConfig = {
|
|
21264
|
+
advanced: {
|
|
21265
|
+
updateOnContentResize: true
|
|
21266
|
+
},
|
|
21267
|
+
theme: 'light-thin'
|
|
21268
|
+
};
|
|
21269
|
+
ctrl.lodash = lodash;
|
|
21270
|
+
ctrl.getLogLevel = getLogLevel;
|
|
21271
|
+
ctrl.getLogParams = getLogParams;
|
|
21272
|
+
|
|
21273
|
+
//
|
|
21274
|
+
// Public methods
|
|
21275
|
+
//
|
|
21269
21276
|
|
|
21270
21277
|
/**
|
|
21271
|
-
*
|
|
21272
|
-
* @param {
|
|
21278
|
+
* Get log level display value
|
|
21279
|
+
* @param {string} level - the level model value (one of: 'debug', 'info', 'warn', 'error')
|
|
21280
|
+
* @returns {string} the log level display value
|
|
21273
21281
|
*/
|
|
21274
|
-
function
|
|
21275
|
-
|
|
21276
|
-
setProjectsItemList(data);
|
|
21277
|
-
} else if (ctrl.type === 'functions') {
|
|
21278
|
-
setFunctionsItemList(lodash.defaultTo(data.data, data));
|
|
21279
|
-
}
|
|
21282
|
+
function getLogLevel(level) {
|
|
21283
|
+
return lodash.first(level).toUpperCase();
|
|
21280
21284
|
}
|
|
21281
21285
|
|
|
21282
21286
|
/**
|
|
21283
|
-
*
|
|
21284
|
-
* @param {
|
|
21287
|
+
* Get log parameters display value
|
|
21288
|
+
* @param {string} logEntry - the log entry that includes the parameters
|
|
21289
|
+
* @returns {string} the log level display value
|
|
21285
21290
|
*/
|
|
21286
|
-
function
|
|
21287
|
-
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
$document.off('click', unselectDropdown);
|
|
21292
|
-
$element.find('.breadcrumb-arrow').css('background-color', '');
|
|
21293
|
-
});
|
|
21294
|
-
}
|
|
21291
|
+
function getLogParams(logEntry) {
|
|
21292
|
+
var params = lodash.omit(logEntry, ['name', 'time', 'level', 'message', 'err']);
|
|
21293
|
+
return lodash.isEmpty(params) ? '' : '[' + lodash.map(params, function (value, key) {
|
|
21294
|
+
return key + ': ' + angular.toJson(value);
|
|
21295
|
+
}).join(', ').replace(/\\n/g, '\n').replace(/\\"/g, '"') + ']';
|
|
21295
21296
|
}
|
|
21296
21297
|
}
|
|
21297
21298
|
})();
|
|
@@ -24638,69 +24639,6 @@ such restriction.
|
|
|
24638
24639
|
})();
|
|
24639
24640
|
"use strict";
|
|
24640
24641
|
|
|
24641
|
-
/*
|
|
24642
|
-
Copyright 2018 Iguazio Systems Ltd.
|
|
24643
|
-
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
24644
|
-
an addition restriction as set forth herein. You may not use this
|
|
24645
|
-
file except in compliance with the License. You may obtain a copy of
|
|
24646
|
-
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
24647
|
-
Unless required by applicable law or agreed to in writing, software
|
|
24648
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
24649
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
24650
|
-
implied. See the License for the specific language governing
|
|
24651
|
-
permissions and limitations under the License.
|
|
24652
|
-
In addition, you may not use the software for any purposes that are
|
|
24653
|
-
illegal under applicable law, and the grant of the foregoing license
|
|
24654
|
-
under the Apache 2.0 license is conditioned upon your compliance with
|
|
24655
|
-
such restriction.
|
|
24656
|
-
*/
|
|
24657
|
-
(function () {
|
|
24658
|
-
'use strict';
|
|
24659
|
-
|
|
24660
|
-
NclVersionConfigurationController.$inject = ["lodash", "ConfigService", "VersionHelperService"];
|
|
24661
|
-
angular.module('iguazio.dashboard-controls').component('nclVersionConfiguration', {
|
|
24662
|
-
bindings: {
|
|
24663
|
-
version: '<',
|
|
24664
|
-
isFunctionDeploying: '&'
|
|
24665
|
-
},
|
|
24666
|
-
templateUrl: 'nuclio/functions/version/version-configuration/version-configuration.tpl.html',
|
|
24667
|
-
controller: NclVersionConfigurationController
|
|
24668
|
-
});
|
|
24669
|
-
function NclVersionConfigurationController(lodash, ConfigService, VersionHelperService) {
|
|
24670
|
-
var ctrl = this;
|
|
24671
|
-
ctrl.scrollConfig = {
|
|
24672
|
-
axis: 'y',
|
|
24673
|
-
advanced: {
|
|
24674
|
-
autoScrollOnFocus: false,
|
|
24675
|
-
updateOnContentResize: true
|
|
24676
|
-
}
|
|
24677
|
-
};
|
|
24678
|
-
ctrl.isDemoMode = ConfigService.isDemoMode;
|
|
24679
|
-
ctrl.isRuntimeBlockVisible = isRuntimeBlockVisible;
|
|
24680
|
-
ctrl.onConfigurationChangeCallback = onConfigurationChangeCallback;
|
|
24681
|
-
|
|
24682
|
-
//
|
|
24683
|
-
// Public methods
|
|
24684
|
-
//
|
|
24685
|
-
|
|
24686
|
-
/**
|
|
24687
|
-
* Checks if `Runtime Attributes` block is visible
|
|
24688
|
-
* @returns {boolean}
|
|
24689
|
-
*/
|
|
24690
|
-
function isRuntimeBlockVisible() {
|
|
24691
|
-
return lodash.includes(['shell', 'java'], lodash.get(ctrl.version, 'spec.runtime'));
|
|
24692
|
-
}
|
|
24693
|
-
|
|
24694
|
-
/**
|
|
24695
|
-
* Checks if version's configuration was changed
|
|
24696
|
-
*/
|
|
24697
|
-
function onConfigurationChangeCallback() {
|
|
24698
|
-
VersionHelperService.updateIsVersionChanged(ctrl.version);
|
|
24699
|
-
}
|
|
24700
|
-
}
|
|
24701
|
-
})();
|
|
24702
|
-
"use strict";
|
|
24703
|
-
|
|
24704
24642
|
/*
|
|
24705
24643
|
Copyright 2018 Iguazio Systems Ltd.
|
|
24706
24644
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -25163,6 +25101,69 @@ such restriction.
|
|
|
25163
25101
|
})();
|
|
25164
25102
|
"use strict";
|
|
25165
25103
|
|
|
25104
|
+
/*
|
|
25105
|
+
Copyright 2018 Iguazio Systems Ltd.
|
|
25106
|
+
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
25107
|
+
an addition restriction as set forth herein. You may not use this
|
|
25108
|
+
file except in compliance with the License. You may obtain a copy of
|
|
25109
|
+
the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
25110
|
+
Unless required by applicable law or agreed to in writing, software
|
|
25111
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
25112
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
25113
|
+
implied. See the License for the specific language governing
|
|
25114
|
+
permissions and limitations under the License.
|
|
25115
|
+
In addition, you may not use the software for any purposes that are
|
|
25116
|
+
illegal under applicable law, and the grant of the foregoing license
|
|
25117
|
+
under the Apache 2.0 license is conditioned upon your compliance with
|
|
25118
|
+
such restriction.
|
|
25119
|
+
*/
|
|
25120
|
+
(function () {
|
|
25121
|
+
'use strict';
|
|
25122
|
+
|
|
25123
|
+
NclVersionConfigurationController.$inject = ["lodash", "ConfigService", "VersionHelperService"];
|
|
25124
|
+
angular.module('iguazio.dashboard-controls').component('nclVersionConfiguration', {
|
|
25125
|
+
bindings: {
|
|
25126
|
+
version: '<',
|
|
25127
|
+
isFunctionDeploying: '&'
|
|
25128
|
+
},
|
|
25129
|
+
templateUrl: 'nuclio/functions/version/version-configuration/version-configuration.tpl.html',
|
|
25130
|
+
controller: NclVersionConfigurationController
|
|
25131
|
+
});
|
|
25132
|
+
function NclVersionConfigurationController(lodash, ConfigService, VersionHelperService) {
|
|
25133
|
+
var ctrl = this;
|
|
25134
|
+
ctrl.scrollConfig = {
|
|
25135
|
+
axis: 'y',
|
|
25136
|
+
advanced: {
|
|
25137
|
+
autoScrollOnFocus: false,
|
|
25138
|
+
updateOnContentResize: true
|
|
25139
|
+
}
|
|
25140
|
+
};
|
|
25141
|
+
ctrl.isDemoMode = ConfigService.isDemoMode;
|
|
25142
|
+
ctrl.isRuntimeBlockVisible = isRuntimeBlockVisible;
|
|
25143
|
+
ctrl.onConfigurationChangeCallback = onConfigurationChangeCallback;
|
|
25144
|
+
|
|
25145
|
+
//
|
|
25146
|
+
// Public methods
|
|
25147
|
+
//
|
|
25148
|
+
|
|
25149
|
+
/**
|
|
25150
|
+
* Checks if `Runtime Attributes` block is visible
|
|
25151
|
+
* @returns {boolean}
|
|
25152
|
+
*/
|
|
25153
|
+
function isRuntimeBlockVisible() {
|
|
25154
|
+
return lodash.includes(['shell', 'java'], lodash.get(ctrl.version, 'spec.runtime'));
|
|
25155
|
+
}
|
|
25156
|
+
|
|
25157
|
+
/**
|
|
25158
|
+
* Checks if version's configuration was changed
|
|
25159
|
+
*/
|
|
25160
|
+
function onConfigurationChangeCallback() {
|
|
25161
|
+
VersionHelperService.updateIsVersionChanged(ctrl.version);
|
|
25162
|
+
}
|
|
25163
|
+
}
|
|
25164
|
+
})();
|
|
25165
|
+
"use strict";
|
|
25166
|
+
|
|
25166
25167
|
/*
|
|
25167
25168
|
Copyright 2018 Iguazio Systems Ltd.
|
|
25168
25169
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -27938,8 +27939,8 @@ try {
|
|
|
27938
27939
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
27939
27940
|
}
|
|
27940
27941
|
module.run(['$templateCache', function($templateCache) {
|
|
27941
|
-
$templateCache.put('igz_controls/components/action-
|
|
27942
|
-
'<div class="igz-action-
|
|
27942
|
+
$templateCache.put('igz_controls/components/action-panel/action-panel.tpl.html',
|
|
27943
|
+
'<div class="igz-action-panel" data-igz-right-click data-ng-show="$ctrl.isActionPanelShown()"> <div class="actions-list clearfix" data-ng-show="$ctrl.mainActions.length > 0 || $ctrl.remainingActions.length > 0"> <igz-action-item data-ng-repeat="action in $ctrl.mainActions" data-action="action"> </igz-action-item> <igz-action-item-more data-ng-if="$ctrl.remainingActions.length !== 0" data-actions="$ctrl.remainingActions"> <div class="transclude-container" data-ng-transclude></div> </igz-action-item-more> </div> <div class="actions-list empty" data-ng-show="$ctrl.mainActions.length === 0 && $ctrl.remainingActions.length === 0"> {{ \'common:NO_ACTIONS\' | i18next }} </div> </div> ');
|
|
27943
27944
|
}]);
|
|
27944
27945
|
})();
|
|
27945
27946
|
|
|
@@ -27950,8 +27951,8 @@ try {
|
|
|
27950
27951
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
27951
27952
|
}
|
|
27952
27953
|
module.run(['$templateCache', function($templateCache) {
|
|
27953
|
-
$templateCache.put('igz_controls/components/action-
|
|
27954
|
-
'<div class="igz-action-
|
|
27954
|
+
$templateCache.put('igz_controls/components/action-menu/action-menu.tpl.html',
|
|
27955
|
+
'<div class="igz-action-menu" data-ng-if="$ctrl.isVisible()"> <div class="menu-button {{$ctrl.iconClass}}" data-ng-class="{active: $ctrl.isMenuShown}" data-ng-click="$ctrl.toggleMenu($event)" data-uib-tooltip="{{ $ctrl.tooltipText }}" data-tooltip-enable="$ctrl.tooltipEnabled" data-tooltip-placement="top" data-tooltip-popup-delay="300" data-tooltip-append-to-body="true"> </div> <div class="menu-dropdown" data-ng-if="$ctrl.isMenuShown"> <div class="actions-list" data-ng-click="$ctrl.toggleMenu($event)"> <igz-action-item data-ng-repeat="action in $ctrl.actions track by action.id" data-action="action" data-actions="$ctrl.actions"> </igz-action-item> </div> <div class="shortcuts-list" data-ng-if="$ctrl.shortcuts && $ctrl.shortcuts.length > 0" data-ng-class="{\'first-block\': $ctrl.actions.length === 0}"> <div class="shortcuts-header">{{ \'common:SHORTCUTS\' | i18next }}</div> <div class="shortcuts-item" data-ng-repeat="shortcut in $ctrl.shortcuts" data-ng-click="$ctrl.showDetails($event, shortcut.state)"> {{shortcut.label}} </div> </div> </div> </div> ');
|
|
27955
27956
|
}]);
|
|
27956
27957
|
})();
|
|
27957
27958
|
|
|
@@ -27975,8 +27976,8 @@ try {
|
|
|
27975
27976
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
27976
27977
|
}
|
|
27977
27978
|
module.run(['$templateCache', function($templateCache) {
|
|
27978
|
-
$templateCache.put('igz_controls/components/
|
|
27979
|
-
'<div class="
|
|
27979
|
+
$templateCache.put('igz_controls/components/auto-complete/auto-complete.tpl.html',
|
|
27980
|
+
'<div class="auto-complete-wrapper"> <div class="input-row" data-ng-keydown="$ctrl.handleDropDownKeydown($event)"> <igz-validating-input-field class="auto-complete-input" data-field-type="input" data-is-focused="$ctrl.isFocused" data-update-data-callback="$ctrl.handleInputChange(newData)" data-item-blur-callback="$ctrl.handleInputBlur(event, inputValue, inputName)" data-input-value="$ctrl.currentValue" data-form-object="$ctrl.formObject" data-input-name="{{$ctrl.inputName}}" data-validation-is-required="$ctrl.isRequired" data-placeholder-text="{{$ctrl.placeholder}}" data-is-disabled="$ctrl.isDisabled" data-auto-complete="{{$ctrl.browserAutoComplete}}" data-trim="false" data-borders-mode="{{$ctrl.bordersMode}}" data-tooltip="$ctrl.tooltip"> </igz-validating-input-field> <igz-default-dropdown data-ng-if="$ctrl.isDropdownShown" class="auto-complete-filters" data-values-array="$ctrl.filters" data-selected-item="$ctrl.selectedFilter" data-item-select-callback="$ctrl.handleFilterChange(item, isItemChanged)" data-is-disabled="$ctrl.isDisabled"> </igz-default-dropdown> </div> <div class="suggestions-row"> <div class="auto-complete-suggestions-container" tabindex="-1" data-ng-if="$ctrl.isSuggestionsShown" data-ng-class="{\'auto-complete-suggestions-with-filters\': $ctrl.isDropdownShown}" data-ng-style="{\'top\': $ctrl.topPosition}" data-ng-scrollbars> <ul class="list" tabindex="-1"> <li class="list-item" tabindex="0" data-ng-repeat="item in $ctrl.suggestions track by $index" data-ng-click="$ctrl.handleSuggestionClick(item.value)" data-ng-keydown="$ctrl.handleSuggestionKeydown($event, item)"> <div class="list-item-block"> <span class="list-item-name" uib-tooltip="{{ item.label }}" data-tooltip-placement="auto" data-tooltip-popup-delay="200" data-tooltip-append-to-body="true"> {{ item.label }} </span> <span data-ng-if="item.additionalInfo" class="list-item-additional-info"> {{ item.additionalInfo }} </span> </div> </li> <li class="list-item readonly" data-ng-if="$ctrl.suggestions.length === 0 && $ctrl.loading" tabindex="-1"> <div class="list-item-block"> <span class="list-item-name">{{ \'common:LOADING_CAPITALIZE_ELLIPSIS\' | i18next }}</span> </div> </li> <li class="list-item readonly" data-ng-if="$ctrl.suggestions.length === 0 && !$ctrl.loading && $ctrl.emptyMessage" tabindex="-1"> <div class="list-item-block"> <span class="list-item-name">{{$ctrl.emptyMessage}}</span> </div> </li> <hr data-ng-if="$ctrl.isMoreLabelShown" tabindex="-1"> <li class="list-item readonly" data-ng-if="$ctrl.isMoreLabelShown" tabindex="-1"> <div class="list-item-block"> <span class="list-item-name">{{ \'common:MORE_ELLIPSIS\' | i18next }}</span> </div> </li> </ul> </div> </div> </div> ');
|
|
27980
27981
|
}]);
|
|
27981
27982
|
})();
|
|
27982
27983
|
|
|
@@ -27987,8 +27988,8 @@ try {
|
|
|
27987
27988
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
27988
27989
|
}
|
|
27989
27990
|
module.run(['$templateCache', function($templateCache) {
|
|
27990
|
-
$templateCache.put('igz_controls/components/
|
|
27991
|
-
'<div class="
|
|
27991
|
+
$templateCache.put('igz_controls/components/copy-to-clipboard/copy-to-clipboard.tpl.html',
|
|
27992
|
+
'<div class="igz-action-item" data-ng-click="$ctrl.copyToClipboard()" data-uib-tooltip="{{ $ctrl.tooltipText ? $ctrl.tooltipText : \'common:TOOLTIP.COPY_TO_CLIPBOARD\' | i18next }}" data-tooltip-placement="{{ $ctrl.tooltipPlacement }}" data-tooltip-popup-delay="300" data-tooltip-append-to-body="true"> <div class="action-icon ncl-icon-copy"></div> </div> ');
|
|
27992
27993
|
}]);
|
|
27993
27994
|
})();
|
|
27994
27995
|
|
|
@@ -28205,8 +28206,8 @@ try {
|
|
|
28205
28206
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28206
28207
|
}
|
|
28207
28208
|
module.run(['$templateCache', function($templateCache) {
|
|
28208
|
-
$templateCache.put('igz_controls/components/
|
|
28209
|
-
'<div class="
|
|
28209
|
+
$templateCache.put('igz_controls/components/toast-status-panel/toast-status-panel.tpl.html',
|
|
28210
|
+
'<div class="toast-status-panel" data-ng-show="$ctrl.isToastPanelShown"> <div class="btn-close igz-icon-close" data-ng-if="!$ctrl.permanent && $ctrl.panelState !== \'in-progress\'" data-ng-click="$ctrl.closeToastPanel()"> </div> <div class="panel-status"> <span class="panel-status-icon"></span> <div class="igz-scrollable-container msg-scrollable-container" data-ng-scrollbars> <div class="panel-status-msg" data-ng-if="$ctrl.isTranscludePassed" data-ng-transclude></div> <div class="panel-status-msg" data-ng-if="!$ctrl.isTranscludePassed"> {{$ctrl.getStateMessage($ctrl.panelState)}} </div> </div> </div> </div> ');
|
|
28210
28211
|
}]);
|
|
28211
28212
|
})();
|
|
28212
28213
|
|
|
@@ -28217,8 +28218,8 @@ try {
|
|
|
28217
28218
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28218
28219
|
}
|
|
28219
28220
|
module.run(['$templateCache', function($templateCache) {
|
|
28220
|
-
$templateCache.put('igz_controls/components/
|
|
28221
|
-
'<div class="
|
|
28221
|
+
$templateCache.put('igz_controls/components/text-edit/text-edit.tpl.html',
|
|
28222
|
+
'<div class="text-preview-directive-wrapper"> <div class="title text-ellipsis" tooltip="{{::$ctrl.label}}" data-tooltip-append-to-body="true" data-tooltip-popup-delay="400" data-tooltip-placement="bottom-left"> {{::$ctrl.label}} </div> <div class="text-preview-wrapper"> <div class="word-wrap-checkbox-wrapper"> <div class="word-wrap-checkbox col-50 col-checkbox"> <input id="wrap-checkbox" type="checkbox" data-ng-model="$ctrl.enableWordWrap"> <label for="wrap-checkbox">{{ \'common:WRAP\' | i18next }}</label> </div> </div> <ncl-monaco class="monaco-code-editor" data-function-source-code="$ctrl.content" data-selected-theme="\'vs-light\'" data-language="$ctrl.language" data-on-change-source-code-callback="$ctrl.onChangeText(sourceCode)" data-word-wrap="$ctrl.enableWordWrap"> </ncl-monaco> </div> <div class="close-button igz-icon-close" data-ng-click="$ctrl.onClose()"></div> <div class="buttons"> <button class="igz-button-just-text" tabindex="0" data-ng-hide="$ctrl.isLoadingState" data-ng-click="$ctrl.onClose()" data-ng-keydown="$ctrl.onClose($event)" data-test-id="general.text-edit_close.button"> {{::$ctrl.closeButtonText}} </button> <button class="igz-button-primary" tabindex="0" data-ng-hide="$ctrl.isLoadingState" data-ng-class="{\'disabled\': !$ctrl.fileChanged}" data-ng-click="$ctrl.onSubmit()" data-test-id="general.text-edit_save.button"> {{::$ctrl.submitButtonText}} </button> <button class="igz-button-primary" data-ng-show="$ctrl.isLoadingState"> {{ \'common:LOADING_CAPITALIZE_ELLIPSIS\' | i18next }} </button> <button class="error-text text-centered error-relative" data-ng-hide="$ctrl.serverError === \'\'"> {{ \'common:ERROR_COLON\' | i18next }} {{$ctrl.serverError}} </button> </div> </div> ');
|
|
28222
28223
|
}]);
|
|
28223
28224
|
})();
|
|
28224
28225
|
|
|
@@ -28327,10 +28328,8 @@ try {
|
|
|
28327
28328
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28328
28329
|
}
|
|
28329
28330
|
module.run(['$templateCache', function($templateCache) {
|
|
28330
|
-
$templateCache.put('nuclio/functions/function-
|
|
28331
|
-
'<div class="
|
|
28332
|
-
' \'invisible\': $ctrl.functionsService.checkedItem !== \'functions\' &&\n' +
|
|
28333
|
-
' $ctrl.functionsService.checkedItem !== \'\'}" data-item="$ctrl.function" data-item-type="functions"> </igz-action-checkbox> </div> <div class="common-table-cell function-collapse-cell function-row-collapse"> <span data-ng-if="$ctrl.function.spec.version > -1" class="collapse-icon" data-ng-click="$ctrl.isFunctionCollapsed = !$ctrl.isFunctionCollapsed" data-ng-class="{\'collapsed igz-icon-right\': $ctrl.isFunctionCollapsed, \'igz-icon-down\': !$ctrl.isFunctionCollapsed}"> </span> </div> <div class="igz-row common-table-cells-container" data-ng-click="$ctrl.onSelectRow($event)"> <div class="common-table-cell" data-test-id="functions.item-name" data-ng-class="[$ctrl.getFunctionsTableColSize(\'rowName\')]"> <div class="function-name text-ellipsis"> <span data-test-id="functions.item-name_name.text" data-uib-tooltip-html="$ctrl.functionNameTooltip" data-tooltip-append-to-body="true" data-tooltip-placement="top" data-tooltip-popup-delay="200"> {{$ctrl.function.metadata.name}} </span> <span data-test-id="functions.item-name_version.text" class="version-text item-cell-sub-text"> {{$ctrl.isFunctionCollapsed ? \'$LATEST\' : \'\'}} </span> </div> <span class="ncl-icon-api-gateway" data-test-id="functions.item-name_api-gw.icon" data-ng-if="$ctrl.function.status.apiGateways.length > 0" data-uib-tooltip="{{ \'functions:TOOLTIP.USED_BY_API_GATEWAY\' | i18next:{apiGatewayName: $ctrl.function.status.apiGateways[0]} }}" data-tooltip-placement="top" data-tooltip-append-to-body="true" data-tooltip-popup-delay="200"> </span> </div> <div class="common-table-cell function-status" data-test-id="functions.item-status" data-ng-class="[$ctrl.getFunctionsTableColSize(\'status\'), $ctrl.statusStateClasses[$ctrl.convertedStatusState]]" data-ng-show="$ctrl.isFunctionCollapsed"> {{$ctrl.convertedStatusState}} <div class="status-icon" data-uib-tooltip="{{$ctrl.getTooltip()}}" data-tooltip-append-to-body="true" data-tooltip-placement="top" data-ng-class="$ctrl.statusIcon" data-ng-click="$ctrl.toggleFunctionState($event)"> </div> </div> <div class="common-table-cell" data-test-id="functions.item-owner" data-ng-show="$ctrl.isFunctionCollapsed" data-ng-class="[$ctrl.getFunctionsTableColSize(\'owner\')]"> {{$ctrl.function.metadata.labels[\'iguazio.com/username\'] ? $ctrl.function.metadata.labels[\'iguazio.com/username\'] : \'common:N_A\' | i18next}} </div> <div data-ng-if="$ctrl.isDemoMode()" data-ng-show="$ctrl.isFunctionCollapsed" class="common-table-cell" data-ng-class="[$ctrl.getFunctionsTableColSize(\'replicas\')]"> {{$ctrl.function.spec.replicas}} </div> <div class="common-table-cell" data-test-id="functions.item-runtime" data-ng-show="$ctrl.isFunctionCollapsed" data-ng-class="[$ctrl.getFunctionsTableColSize(\'runtime\')]"> {{$ctrl.runtimes[$ctrl.function.spec.runtime]}} </div> <div class="common-table-cell" data-test-id="functions.item-invocation-per-sec" data-ng-show="$ctrl.isFunctionCollapsed" data-ng-class="[$ctrl.getFunctionsTableColSize(\'invocationPerSec\')]"> {{$ctrl.function.ui.metrics.invocationPerSec || 0}} </div> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_CPU}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'cpuCores\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_CPU] && $ctrl.isFunctionCollapsed" data-type="functions_cpu" data-entity="$ctrl.function" data-test-id="functions.item-cpu"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_CPU] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_CPU]}} </div> </igz-element-loading-status> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_MEMORY}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'metricsSize\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_MEMORY] && $ctrl.isFunctionCollapsed" data-type="functions_memory" data-entity="$ctrl.function" data-test-id="functions.item-memory"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_MEMORY] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_MEMORY]}} </div> </igz-element-loading-status> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_GPU}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'gpuCores\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_GPU] && $ctrl.isFunctionCollapsed" data-type="functions_gpu" data-entity="$ctrl.function" data-test-id="functions.item-gpu"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_GPU] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_GPU]}} </div> </igz-element-loading-status> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_EVENTS}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'metricsCount\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_EVENTS] && $ctrl.isFunctionCollapsed" data-type="functions_events" data-entity="$ctrl.function" data-test-id="functions.item-invocations"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_EVENTS] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_EVENTS]}} </div> </igz-element-loading-status> </div> <div class="common-table-cell actions-menu" data-test-id="functions.item-actions"> <igz-action-menu data-actions="$ctrl.functionActions" data-on-fire-action="$ctrl.onFireAction"> </igz-action-menu> </div> </div> <div class="items-wrapper" data-uib-collapse="$ctrl.isFunctionCollapsed"> <div data-ng-repeat="version in $ctrl.function.versions track by version.name"> <ncl-function-version-row class="function-version-wrapper" data-action-handler-callback="$ctrl.handleAction(actionType, checkedItems)" data-converted-status-state="$ctrl.convertedStatusState" data-function="$ctrl.function" data-is-function-collapsed="$ctrl.isFunctionCollapsed" data-project="$ctrl.project" data-status-icon="$ctrl.statusIcon" data-status-state-classes="$ctrl.statusStateClasses" data-toggle-function-state="$ctrl.toggleFunctionState(event)" data-version="version" data-versions-list="$ctrl.function.attr.versions"> </ncl-function-version-row> </div> </div> </div> ');
|
|
28331
|
+
$templateCache.put('nuclio/functions/override-function-dialog/override-function-dialog.tpl.html',
|
|
28332
|
+
'<div class="override-function-dialog"> <div class="close-button igz-icon-close" data-ng-click="$ctrl.onClose()"></div> <div class="title"> {{ \'functions:NAME_IN_USE\' | i18next }} </div> <div class="buttons"> <button class="ncl-secondary-button igz-button-secondary function-redirect-button" data-test-id="functions.override_function_visit_function.button" tabindex="0" data-ng-click="$ctrl.openExistingFunction()"> {{ \'functions:GO_TO_EXISTING_FUNCTION\' | i18next }} </button> <button class="ncl-secondary-button igz-button-just-text" data-test-id="functions.override_function_cancel.button" tabindex="1" data-ng-click="$ctrl.onClose()" data-ng-keydown="$ctrl.onClose($event)"> {{ \'common:CANCEL\' | i18next }} </button> <button class="ncl-primary-button igz-button-primary" data-test-id="functions.override_function_override.button" tabindex="2" data-ng-click="$ctrl.overrideFunction()"> {{ \'functions:OVERWRITE\' | i18next }} </button> </div> </div> ');
|
|
28334
28333
|
}]);
|
|
28335
28334
|
})();
|
|
28336
28335
|
|
|
@@ -28341,8 +28340,10 @@ try {
|
|
|
28341
28340
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28342
28341
|
}
|
|
28343
28342
|
module.run(['$templateCache', function($templateCache) {
|
|
28344
|
-
$templateCache.put('nuclio/functions/
|
|
28345
|
-
'<div class="
|
|
28343
|
+
$templateCache.put('nuclio/functions/function-collapsing-row/function-collapsing-row.tpl.html',
|
|
28344
|
+
'<div class="ncl-function-collapsing-row items-wrapper"> <div class="scrolling-row"></div> <div class="function-title-block common-table-row"> <div class="common-table-cell igz-col-3"> <igz-action-checkbox data-ng-class="{\'visible\': !$ctrl.isDemoMode() || $ctrl.functionsService.checkedItem === \'functions\',\n' +
|
|
28345
|
+
' \'invisible\': $ctrl.functionsService.checkedItem !== \'functions\' &&\n' +
|
|
28346
|
+
' $ctrl.functionsService.checkedItem !== \'\'}" data-item="$ctrl.function" data-item-type="functions"> </igz-action-checkbox> </div> <div class="common-table-cell function-collapse-cell function-row-collapse"> <span data-ng-if="$ctrl.function.spec.version > -1" class="collapse-icon" data-ng-click="$ctrl.isFunctionCollapsed = !$ctrl.isFunctionCollapsed" data-ng-class="{\'collapsed igz-icon-right\': $ctrl.isFunctionCollapsed, \'igz-icon-down\': !$ctrl.isFunctionCollapsed}"> </span> </div> <div class="igz-row common-table-cells-container" data-ng-click="$ctrl.onSelectRow($event)"> <div class="common-table-cell" data-test-id="functions.item-name" data-ng-class="[$ctrl.getFunctionsTableColSize(\'rowName\')]"> <div class="function-name text-ellipsis"> <span data-test-id="functions.item-name_name.text" data-uib-tooltip-html="$ctrl.functionNameTooltip" data-tooltip-append-to-body="true" data-tooltip-placement="top" data-tooltip-popup-delay="200"> {{$ctrl.function.metadata.name}} </span> <span data-test-id="functions.item-name_version.text" class="version-text item-cell-sub-text"> {{$ctrl.isFunctionCollapsed ? \'$LATEST\' : \'\'}} </span> </div> <span class="ncl-icon-api-gateway" data-test-id="functions.item-name_api-gw.icon" data-ng-if="$ctrl.function.status.apiGateways.length > 0" data-uib-tooltip="{{ \'functions:TOOLTIP.USED_BY_API_GATEWAY\' | i18next:{apiGatewayName: $ctrl.function.status.apiGateways[0]} }}" data-tooltip-placement="top" data-tooltip-append-to-body="true" data-tooltip-popup-delay="200"> </span> </div> <div class="common-table-cell function-status" data-test-id="functions.item-status" data-ng-class="[$ctrl.getFunctionsTableColSize(\'status\'), $ctrl.statusStateClasses[$ctrl.convertedStatusState]]" data-ng-show="$ctrl.isFunctionCollapsed"> {{$ctrl.convertedStatusState}} <div class="status-icon" data-uib-tooltip="{{$ctrl.getTooltip()}}" data-tooltip-append-to-body="true" data-tooltip-placement="top" data-ng-class="$ctrl.statusIcon" data-ng-click="$ctrl.toggleFunctionState($event)"> </div> </div> <div class="common-table-cell" data-test-id="functions.item-owner" data-ng-show="$ctrl.isFunctionCollapsed" data-ng-class="[$ctrl.getFunctionsTableColSize(\'owner\')]"> {{$ctrl.function.metadata.labels[\'iguazio.com/username\'] ? $ctrl.function.metadata.labels[\'iguazio.com/username\'] : \'common:N_A\' | i18next}} </div> <div data-ng-if="$ctrl.isDemoMode()" data-ng-show="$ctrl.isFunctionCollapsed" class="common-table-cell" data-ng-class="[$ctrl.getFunctionsTableColSize(\'replicas\')]"> {{$ctrl.function.spec.replicas}} </div> <div class="common-table-cell" data-test-id="functions.item-runtime" data-ng-show="$ctrl.isFunctionCollapsed" data-ng-class="[$ctrl.getFunctionsTableColSize(\'runtime\')]"> {{$ctrl.runtimes[$ctrl.function.spec.runtime]}} </div> <div class="common-table-cell" data-test-id="functions.item-invocation-per-sec" data-ng-show="$ctrl.isFunctionCollapsed" data-ng-class="[$ctrl.getFunctionsTableColSize(\'invocationPerSec\')]"> {{$ctrl.function.ui.metrics.invocationPerSec || 0}} </div> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_CPU}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'cpuCores\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_CPU] && $ctrl.isFunctionCollapsed" data-type="functions_cpu" data-entity="$ctrl.function" data-test-id="functions.item-cpu"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_CPU] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_CPU]}} </div> </igz-element-loading-status> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_MEMORY}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'metricsSize\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_MEMORY] && $ctrl.isFunctionCollapsed" data-type="functions_memory" data-entity="$ctrl.function" data-test-id="functions.item-memory"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_MEMORY] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_MEMORY]}} </div> </igz-element-loading-status> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_GPU}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'gpuCores\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_GPU] && $ctrl.isFunctionCollapsed" data-type="functions_gpu" data-entity="$ctrl.function" data-test-id="functions.item-gpu"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_GPU] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_GPU]}} </div> </igz-element-loading-status> <igz-element-loading-status class="common-table-cell element-loading-status-wrapper" data-name="{{$ctrl.functionMetrics.FUNCTION_EVENTS}}-{{$ctrl.function.metadata.name}}" data-loading-status-size="small" data-ng-class="[$ctrl.getFunctionsTableColSize(\'metricsCount\')]"> <igz-size data-ng-if="!$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_EVENTS] && $ctrl.isFunctionCollapsed" data-type="functions_events" data-entity="$ctrl.function" data-test-id="functions.item-invocations"> </igz-size> <div data-ng-if="$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_EVENTS] && $ctrl.isFunctionCollapsed"> {{$ctrl.function.ui.error[$ctrl.functionMetrics.FUNCTION_EVENTS]}} </div> </igz-element-loading-status> </div> <div class="common-table-cell actions-menu" data-test-id="functions.item-actions"> <igz-action-menu data-actions="$ctrl.functionActions" data-on-fire-action="$ctrl.onFireAction"> </igz-action-menu> </div> </div> <div class="items-wrapper" data-uib-collapse="$ctrl.isFunctionCollapsed"> <div data-ng-repeat="version in $ctrl.function.versions track by version.name"> <ncl-function-version-row class="function-version-wrapper" data-action-handler-callback="$ctrl.handleAction(actionType, checkedItems)" data-converted-status-state="$ctrl.convertedStatusState" data-function="$ctrl.function" data-is-function-collapsed="$ctrl.isFunctionCollapsed" data-project="$ctrl.project" data-status-icon="$ctrl.statusIcon" data-status-state-classes="$ctrl.statusStateClasses" data-toggle-function-state="$ctrl.toggleFunctionState(event)" data-version="version" data-versions-list="$ctrl.function.attr.versions"> </ncl-function-version-row> </div> </div> </div> ');
|
|
28346
28347
|
}]);
|
|
28347
28348
|
})();
|
|
28348
28349
|
|
|
@@ -28441,9 +28442,8 @@ try {
|
|
|
28441
28442
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28442
28443
|
}
|
|
28443
28444
|
module.run(['$templateCache', function($templateCache) {
|
|
28444
|
-
$templateCache.put('nuclio/common/components/
|
|
28445
|
-
'<div class="ncl-
|
|
28446
|
-
' \'igz-icon-down\': $ctrl.item.ui.editModeActive}"> </span> </div> <div data-ng-show="!$ctrl.item.ui.editModeActive" class="igz-row common-table-cells-container item-row"> <div class="item-name" data-ng-if="!$ctrl.isNil($ctrl.item.name)"> <div class="text-ellipsis"> {{$ctrl.item.name}} </div> <igz-more-info data-ng-if="$ctrl.item.ui.moreInfoMsg.name" data-trigger="click" data-is-html-enabled="true" data-is-open="$ctrl.item.ui.moreInfoMsg.name.isOpen" data-icon-type="{{$ctrl.item.ui.moreInfoMsg.name.type}}" data-description="{{$ctrl.item.ui.moreInfoMsg.name.description}}"> </igz-more-info> </div> <div class="text-ellipsis item-name" data-ng-if="!$ctrl.isNil($ctrl.item.volumeMount.name)"> {{ $ctrl.item.volumeMount.name }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.ui.selectedClass)"> {{$ctrl.item.ui.selectedClass.name}} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.hostPath)"> {{ \'common:HOST_PATH\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.flexVolume)"> {{ \'functions:V3IO\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.secret.secretName)"> {{ \'functions:SECRET\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.configMap.name)"> {{ \'functions:CONFIG_MAP\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.persistentVolumeClaim.claimName)"> {{ \'functions:PVC\' | i18next }} </div> <div class="igz-col-70 item-info"> <div data-ng-hide="$ctrl.item.ui.editModeActive" class="collapsed-item-info-block"> <span data-ng-if="!$ctrl.isNil($ctrl.item.url)"> <span class="field-label">{{ \'common:URL\' | i18next }}</span>: {{ $ctrl.item.url }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.maxWorkers)"> <span class="field-label">{{ \'functions:MAX_WORKERS\' | i18next }}</span>: {{ $ctrl.item.maxWorkers }}; </span> <span data-ng-if="$ctrl.isNumber($ctrl.item.workerAvailabilityTimeoutMilliseconds)"> <span class="field-label">{{ \'functions:WORKER_AVAILABILITY_TIMEOUT\' | i18next }}</span>: {{ $ctrl.item.workerAvailabilityTimeoutMilliseconds }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.secret)"> <span class="field-label">{{ \'functions:SECRET\' | i18next }}</span>: {{ $ctrl.getMask($ctrl.item.secret) }}; </span> <span data-ng-repeat="(key, value) in $ctrl.item.attributes" data-ng-if="$ctrl.displayedAttributesFields.includes(key)"> <span class="field-label">{{ key }}</span>: {{ $ctrl.getAttributeValue(key, value) }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.annotations)"> <span class="field-label">{{ \'functions:ANNOTATIONS\' | i18next }}</span>: {{ $ctrl.item.annotations }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.username)"> <span class="field-label">{{ \'common:USERNAME\' | i18next }}</span>: {{ $ctrl.item.username }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.password)"> <span class="field-label">{{ \'common:PASSWORD\' | i18next }}</span>: {{ $ctrl.getMask($ctrl.item.password) }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volumeMount.mountPath)"> <span class="field-label">{{ \'functions:MOUNT_PATH\' | i18next }}</span>: {{ $ctrl.item.volumeMount.mountPath }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.hostPath)"> <span class="field-label">{{ \'common:HOST_PATH\' | i18next }}</span>: {{ $ctrl.item.volume.hostPath.path }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volumeMount.readOnly)"> <span class="field-label">{{ \'common:READ_ONLY\' | i18next }}</span>: {{ $ctrl.item.volumeMount.readOnly }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.flexVolume.options.container)"> <span class="field-label">{{ \'functions:CONTAINER_NAME\' | i18next }}</span>: {{ $ctrl.item.volume.flexVolume.options.container }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.flexVolume.options.subPath)"> <span class="field-label">{{ \'functions:SUB_PATH\' | i18next }}</span>: {{ $ctrl.item.volume.flexVolume.options.subPath }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.configMap.name)"> <span class="field-label">{{ \'functions:CONFIG_MAP_NAME\' | i18next }}</span>: {{ $ctrl.item.volume.configMap.name }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.persistentVolumeClaim.claimName)"> <span class="field-label">{{ \'functions:PERSISTENT_VOLUME_CLAIM_NAME\' | i18next }}</span>: {{ $ctrl.item.volume.persistentVolumeClaim.claimName }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.workerAllocatorName)"> <span class="field-label">{{ \'functions:WORKER_ALLOCATOR_NAME\' | i18next }}</span>: {{ $ctrl.item.workerAllocatorName }}; </span> </div> </div> </div> <div data-ng-transclude class="igz-col-100" data-ng-if="$ctrl.item.ui.editModeActive"></div> <div class="common-table-cell actions-menu" data-ng-hide="$ctrl.readOnly" data-ng-if="::$ctrl.showDotMenu()"> <igz-action-menu data-actions="$ctrl.actions" data-on-fire-action="$ctrl.onFireAction"> </igz-action-menu> </div> <div class="common-table-cell single-action" data-ng-hide="$ctrl.readOnly" data-ng-if="::!$ctrl.showDotMenu()"> <div class="igz-action-panel"> <div class="actions-list"> <div class="igz-action-item" data-test-id="{{$ctrl.deleteTestId}}" data-ng-click="$ctrl.onClickAction($ctrl.actions[0])" data-uib-tooltip="{{$ctrl.actions[0].label}}" data-tooltip-popup-delay="1000" data-tooltip-placement="bottom" data-tooltip-append-to-body="true"> <span class="action-icon" data-ng-class="$ctrl.actions[0].icon"> </span> </div> </div> </div> </div> </div> </div> ');
|
|
28445
|
+
$templateCache.put('nuclio/common/components/breadcrumbs-dropdown/breadcrumbs-dropdown.tpl.html',
|
|
28446
|
+
'<div class="ncl-breadcrumbs-dropdown dropdown" data-ng-class="{\'open\': $ctrl.showDropdownList}"> <span class="breadcrumb-toggle" data-ng-click="$ctrl.showDropdown()"> <span class="breadcrumb-arrow" data-ng-class="{\'ncl-dropdown-expanded\': $ctrl.showDropdownList}"> <span class="igz-icon-right"></span> </span> </span> <div class="dropdown-menu"> <div class="search-input"> <input type="text" placeholder="{{$ctrl.placeholder}}" data-ng-model="$ctrl.searchText"> <span class="igz-icon-search"></span> </div> <ul class="dropdown-list" data-ng-scrollbars> <li data-ng-repeat="item in $ctrl.itemsList | filter: $ctrl.searchText"> <a class="item-name" data-ng-click="$ctrl.showDetails($event, item)" data-uib-tooltip="{{item.name}}" data-tooltip-popup-delay="200" data-tooltip-append-to-body="true" data-tooltip-placement="top"> {{item.name}} </a> <span class="igz-icon-tick" data-ng-show="$ctrl.title === item.name"></span> </li> </ul> </div> </div> ');
|
|
28447
28447
|
}]);
|
|
28448
28448
|
})();
|
|
28449
28449
|
|
|
@@ -28454,8 +28454,9 @@ try {
|
|
|
28454
28454
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28455
28455
|
}
|
|
28456
28456
|
module.run(['$templateCache', function($templateCache) {
|
|
28457
|
-
$templateCache.put('nuclio/common/components/
|
|
28458
|
-
'<div class="ncl-
|
|
28457
|
+
$templateCache.put('nuclio/common/components/collapsing-row/collapsing-row.tpl.html',
|
|
28458
|
+
'<div class="ncl-collapsing-row"> <div class="title-block common-table-row" data-ng-class="{\'collapsed\': !$ctrl.item.ui.editModeActive}"> <div class="common-table-cell row-collapse"> <span class="collapse-icon" data-ng-click="$ctrl.onCollapse($event)" data-ng-class="{\'collapsed igz-icon-right\': !$ctrl.item.ui.editModeActive,\n' +
|
|
28459
|
+
' \'igz-icon-down\': $ctrl.item.ui.editModeActive}"> </span> </div> <div data-ng-show="!$ctrl.item.ui.editModeActive" class="igz-row common-table-cells-container item-row"> <div class="item-name" data-ng-if="!$ctrl.isNil($ctrl.item.name)"> <div class="text-ellipsis"> {{$ctrl.item.name}} </div> <igz-more-info data-ng-if="$ctrl.item.ui.moreInfoMsg.name" data-trigger="click" data-is-html-enabled="true" data-is-open="$ctrl.item.ui.moreInfoMsg.name.isOpen" data-icon-type="{{$ctrl.item.ui.moreInfoMsg.name.type}}" data-description="{{$ctrl.item.ui.moreInfoMsg.name.description}}"> </igz-more-info> </div> <div class="text-ellipsis item-name" data-ng-if="!$ctrl.isNil($ctrl.item.volumeMount.name)"> {{ $ctrl.item.volumeMount.name }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.ui.selectedClass)"> {{$ctrl.item.ui.selectedClass.name}} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.hostPath)"> {{ \'common:HOST_PATH\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.flexVolume)"> {{ \'functions:V3IO\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.secret.secretName)"> {{ \'functions:SECRET\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.configMap.name)"> {{ \'functions:CONFIG_MAP\' | i18next }} </div> <div class="item-class" data-ng-if="!$ctrl.isNil($ctrl.item.volume.persistentVolumeClaim.claimName)"> {{ \'functions:PVC\' | i18next }} </div> <div class="igz-col-70 item-info"> <div data-ng-hide="$ctrl.item.ui.editModeActive" class="collapsed-item-info-block"> <span data-ng-if="!$ctrl.isNil($ctrl.item.url)"> <span class="field-label">{{ \'common:URL\' | i18next }}</span>: {{ $ctrl.item.url }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.maxWorkers)"> <span class="field-label">{{ \'functions:MAX_WORKERS\' | i18next }}</span>: {{ $ctrl.item.maxWorkers }}; </span> <span data-ng-if="$ctrl.isNumber($ctrl.item.workerAvailabilityTimeoutMilliseconds)"> <span class="field-label">{{ \'functions:WORKER_AVAILABILITY_TIMEOUT\' | i18next }}</span>: {{ $ctrl.item.workerAvailabilityTimeoutMilliseconds }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.secret)"> <span class="field-label">{{ \'functions:SECRET\' | i18next }}</span>: {{ $ctrl.getMask($ctrl.item.secret) }}; </span> <span data-ng-repeat="(key, value) in $ctrl.item.attributes" data-ng-if="$ctrl.displayedAttributesFields.includes(key)"> <span class="field-label">{{ key }}</span>: {{ $ctrl.getAttributeValue(key, value) }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.annotations)"> <span class="field-label">{{ \'functions:ANNOTATIONS\' | i18next }}</span>: {{ $ctrl.item.annotations }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.username)"> <span class="field-label">{{ \'common:USERNAME\' | i18next }}</span>: {{ $ctrl.item.username }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.password)"> <span class="field-label">{{ \'common:PASSWORD\' | i18next }}</span>: {{ $ctrl.getMask($ctrl.item.password) }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volumeMount.mountPath)"> <span class="field-label">{{ \'functions:MOUNT_PATH\' | i18next }}</span>: {{ $ctrl.item.volumeMount.mountPath }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.hostPath)"> <span class="field-label">{{ \'common:HOST_PATH\' | i18next }}</span>: {{ $ctrl.item.volume.hostPath.path }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volumeMount.readOnly)"> <span class="field-label">{{ \'common:READ_ONLY\' | i18next }}</span>: {{ $ctrl.item.volumeMount.readOnly }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.flexVolume.options.container)"> <span class="field-label">{{ \'functions:CONTAINER_NAME\' | i18next }}</span>: {{ $ctrl.item.volume.flexVolume.options.container }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.flexVolume.options.subPath)"> <span class="field-label">{{ \'functions:SUB_PATH\' | i18next }}</span>: {{ $ctrl.item.volume.flexVolume.options.subPath }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.configMap.name)"> <span class="field-label">{{ \'functions:CONFIG_MAP_NAME\' | i18next }}</span>: {{ $ctrl.item.volume.configMap.name }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.volume.persistentVolumeClaim.claimName)"> <span class="field-label">{{ \'functions:PERSISTENT_VOLUME_CLAIM_NAME\' | i18next }}</span>: {{ $ctrl.item.volume.persistentVolumeClaim.claimName }}; </span> <span data-ng-if="!$ctrl.isNil($ctrl.item.workerAllocatorName)"> <span class="field-label">{{ \'functions:WORKER_ALLOCATOR_NAME\' | i18next }}</span>: {{ $ctrl.item.workerAllocatorName }}; </span> </div> </div> </div> <div data-ng-transclude class="igz-col-100" data-ng-if="$ctrl.item.ui.editModeActive"></div> <div class="common-table-cell actions-menu" data-ng-hide="$ctrl.readOnly" data-ng-if="::$ctrl.showDotMenu()"> <igz-action-menu data-actions="$ctrl.actions" data-on-fire-action="$ctrl.onFireAction"> </igz-action-menu> </div> <div class="common-table-cell single-action" data-ng-hide="$ctrl.readOnly" data-ng-if="::!$ctrl.showDotMenu()"> <div class="igz-action-panel"> <div class="actions-list"> <div class="igz-action-item" data-test-id="{{$ctrl.deleteTestId}}" data-ng-click="$ctrl.onClickAction($ctrl.actions[0])" data-uib-tooltip="{{$ctrl.actions[0].label}}" data-tooltip-popup-delay="1000" data-tooltip-placement="bottom" data-tooltip-append-to-body="true"> <span class="action-icon" data-ng-class="$ctrl.actions[0].icon"> </span> </div> </div> </div> </div> </div> </div> ');
|
|
28459
28460
|
}]);
|
|
28460
28461
|
})();
|
|
28461
28462
|
|
|
@@ -28466,8 +28467,8 @@ try {
|
|
|
28466
28467
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28467
28468
|
}
|
|
28468
28469
|
module.run(['$templateCache', function($templateCache) {
|
|
28469
|
-
$templateCache.put('nuclio/common/components/
|
|
28470
|
-
'<div class="ncl-
|
|
28470
|
+
$templateCache.put('nuclio/common/components/deploy-log/deploy-log.tpl.html',
|
|
28471
|
+
'<div class="ncl-deploy-log-wrapper"> <div class="log-panel igz-scrollable-container" data-ng-scrollbars data-ng-scrollbars-config="$ctrl.scrollConfig"> <div class="log-entry" data-ng-if="$ctrl.lodash.isArray($ctrl.logEntries)" data-ng-repeat="log in $ctrl.logEntries track by $index"> <span class="log-entry-time" data-ng-if="log.time">[{{log.time | date:\'HH:mm:ss.sss\'}}]</span> <span class="log-entry-level-{{log.level}}" data-ng-if="log.level"> ({{$ctrl.getLogLevel(log.level)}})</span> <span class="log-entry-message"> {{log.message}}</span> <span class="log-entry-error" data-ng-if="log.err"> {{log.err}}</span> <span class="log-entry-params"> {{$ctrl.getLogParams(log)}}</span> </div> <div class="log-entry" data-ng-if="!$ctrl.lodash.isArray($ctrl.logEntries)"> {{$ctrl.logEntries}} </div> </div> </div> ');
|
|
28471
28472
|
}]);
|
|
28472
28473
|
})();
|
|
28473
28474
|
|
|
@@ -28621,8 +28622,8 @@ try {
|
|
|
28621
28622
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28622
28623
|
}
|
|
28623
28624
|
module.run(['$templateCache', function($templateCache) {
|
|
28624
|
-
$templateCache.put('nuclio/functions/version/version-
|
|
28625
|
-
'<div class="ncl-version-
|
|
28625
|
+
$templateCache.put('nuclio/functions/version/version-execution-log/version-execution-log.tpl.html',
|
|
28626
|
+
' <igz-splash-screen data-is-splash-showed="$ctrl.isSplashShowed"></igz-splash-screen> <div class="ncl-version-execution-log ncl-version" data-igz-extend-background> <div class="ncl-version-execution-log-wrapper"> <div class="row" data-ng-class="{\'filters-shown\': $ctrl.isFiltersShowed.value}"> <igz-info-page-filters data-is-filters-showed="$ctrl.isFiltersShowed.value" data-change-state-callback="$ctrl.isFiltersShowed.changeValue(newVal)" data-toggle-method="$ctrl.toggleFilters()" data-apply-filters="$ctrl.applyFilters()" data-apply-is-disabled="$ctrl.applyIsDisabled" data-watch-id="log-filter" data-reset-filters="$ctrl.resetFilters()"> <div class="info-page-filters-item search-input-item filter-message-wrapper"> <div class="filter-message align-items-center"> <span class="filter-label">{{ \'common:MESSAGE\' | i18next }}</span> <igz-more-info data-is-default-tooltip-enabled="true" data-default-tooltip-placement="top" data-is-html-enabled="true" data-description="{{ \'common:TOOLTIP.LOGS_MESSAGE_DESCRIPTION\' | i18next }}"> </igz-more-info> </div> <igz-search-input class="igz-component" data-data-set="$ctrl.logs" data-search-keys="$ctrl.searchKeys" data-placeholder="{{ \'common:PLACEHOLDER.SOME_LOG_MESSAGE\' | i18next }}" data-type="control" data-rule-type="message" data-search-states="$ctrl.searchStates" data-search-callback="$ctrl.onQueryChanged(searchQuery, ruleType)" data-on-search-submit="$ctrl.applyFilters()"> </igz-search-input> </div> <div class="info-page-filters-item all-padded"> <div class="browser-search-bar-wrapper"> <span class="filter-label"> {{ \'common:TIME_RANGE\' | i18next }} </span> <igz-date-time-picker data-pick-time="true" data-pick-future-dates="false" data-selected-preset="{{$ctrl.datePreset}}" data-input-date-from="$ctrl.timeRange.from" data-input-date-to="$ctrl.timeRange.to" data-is-date-range="true" data-is-required="true" data-custom-presets="$ctrl.customDatePresets" data-on-change-model="$ctrl.onTimeRangeChange(newValue, selectedPreset)"> </igz-date-time-picker> </div> </div> <div class="info-page-filters-item all-padded"> <div class="filter-label"> {{ \'common:LEVEL\' | i18next }} </div> <div class="filter-level-wrapper align-items-center"> <div class="igz-col-50"> <div class="filter-level-item"> <input type="checkbox" data-ng-model="$ctrl.filter.level.debug" id="level-debug"> <label for="level-debug"> <span class="level-icon ncl-icon-debug"></span> {{ \'common:DEBUG\' | i18next }} </label> </div> <div class="filter-level-item"> <input type="checkbox" data-ng-model="$ctrl.filter.level.warn" id="level-warning"> <label for="level-warning"> <span class="level-icon igz-icon-warning"></span> {{ \'common:WARNING\' | i18next }} </label> </div> </div> <div class="igz-col-50"> <div class="filter-level-item"> <input type="checkbox" data-ng-model="$ctrl.filter.level.info" id="level-info"> <label for="level-info"> <span class="level-icon igz-icon-info-round"></span> {{ \'common:INFO\' | i18next }} </label> </div> <div class="filter-level-item"> <input type="checkbox" data-ng-model="$ctrl.filter.level.error" id="level-error"> <label for="level-error"> <span class="level-icon igz-icon-cancel-path"></span> {{ \'common:ERROR\' | i18next }} </label> </div> </div> </div> </div> <div class="info-page-filters-item all-padded replicas"> <span class="filter-label asterisk"> {{ \'common:REPLICAS\' | i18next }} </span> <igz-multiple-checkboxes data-ng-model="$ctrl.selectedReplicas" data-options="$ctrl.replicasList" data-dropdown="true" data-select-all-none="true" data-ng-change="$ctrl.onCheckboxChange($event)" data-ng-required="true" data-base-id="select-replica_"> </igz-multiple-checkboxes> </div> </igz-info-page-filters> <igz-info-page-actions-bar> <div class="igz-action-panel"> <div class="actions-list"> <div class="actions-bar-left"> <span class="limitation-message" data-ng-i18next="[html]functions:LOGS_LINES_LIMITATION"></span> </div> <div class="actions-bar-right"> <div class="actions-bar-left actions-buttons-block actions-dropdown-block"> <igz-default-dropdown data-values-array="$ctrl.refreshRate.options" data-selected-item="$ctrl.refreshRate.value" data-select-property-only="value" data-item-select-callback="$ctrl.onRefreshRateChange(item, isItemChanged, field)" data-item-select-field="refreshRate.value"> </igz-default-dropdown> </div> <div class="actions-bar-left"> <igz-action-item-refresh data-is-disabled="$ctrl.isFunctionDeploying()" data-refresh="$ctrl.searchWithParams($ctrl.page.number, $ctrl.page.size)"> </igz-action-item-refresh> </div> <div class="actions-bar-left"> <div class="igz-action-item" data-ng-click="$ctrl.downloadLogFiles()" data-ng-class="{\'inactive\': $ctrl.logsAreDownloading || $ctrl.downloadButtonIsDisabled}" data-uib-tooltip="{{ \'common:DOWNLOAD\' | i18next }}" data-tooltip-placement="bottom" data-tooltip-popup-delay="300" data-tooltip-append-to-body="true"> <div class="action-icon igz-icon-download"></div> </div> </div> <igz-actions-panes data-filters-toggle-method="$ctrl.toggleFilters()" data-show-filter-icon="true" data-filters-counter="$ctrl.activeFilters" data-is-filters-opened="$ctrl.isFiltersShowed.value"> </igz-actions-panes> </div> </div> </div> </igz-info-page-actions-bar> <div class="igz-control-panel-log"> <div class="control-panel-log-table common-table"> <div class="search-input-not-found" data-ng-if="$ctrl.logs.length === 0"> {{ \'functions:NO_LOGS_HAVE_BEEN_FOUND\' | i18next }} </div> <div data-igz-extend-background class="common-table-body"> <div class="igz-scrollable-container logs-container" data-ng-scrollbars data-ng-scrollbars-config="$ctrl.scrollConfig" data-ng-hide="$ctrl.logs.length === 0"> <div data-ng-repeat="log in $ctrl.logs"> <igz-elastic-log-table-row data-entry-item="log"></igz-elastic-log-table-row> </div> <igz-pagination class="control-panel-log-pagination" data-page-data="$ctrl.page" data-pagination-callback="$ctrl.searchWithParams(page, size)" data-ng-hide="$ctrl.logs.length === 0" data-per-page-values="$ctrl.perPageValues"> </igz-pagination> </div> </div> </div> </div> </div> </div> </div> ');
|
|
28626
28627
|
}]);
|
|
28627
28628
|
})();
|
|
28628
28629
|
|
|
@@ -28633,8 +28634,8 @@ try {
|
|
|
28633
28634
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28634
28635
|
}
|
|
28635
28636
|
module.run(['$templateCache', function($templateCache) {
|
|
28636
|
-
$templateCache.put('nuclio/functions/version/version-
|
|
28637
|
-
'
|
|
28637
|
+
$templateCache.put('nuclio/functions/version/version-configuration/version-configuration.tpl.html',
|
|
28638
|
+
'<div class="ncl-version-configuration ncl-version" data-igz-extend-background> <div class="igz-scrollable-container" data-ng-scrollbars data-ng-scrollbars-config="$ctrl.scrollConfig"> <div class="ncl-version-configuration-wrapper"> <div class="row"> <ncl-version-configuration-basic-settings class="configuration-block" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-basic-settings> <ncl-version-configuration-resources class="configuration-block" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-resources> </div> <div class="row"> <ncl-version-configuration-environment-variables class="configuration-block" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-environment-variables> </div> <div class="row"> <ncl-version-configuration-labels class="configuration-block" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-labels> <ncl-version-configuration-annotations class="configuration-block" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-annotations> </div> <div class="row"> <ncl-version-configuration-volumes class="configuration-block" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback()"> </ncl-version-configuration-volumes> <ncl-version-configuration-build class="configuration-block" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-build> </div> <div class="row"> <ncl-version-configuration-logging data-ng-if="false" class="configuration-block" data-version="$ctrl.version" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-logging> <ncl-version-configuration-runtime-attributes data-ng-if="$ctrl.isRuntimeBlockVisible()" class="configuration-block runtime-attributes" data-version="$ctrl.version" data-is-function-deploying="$ctrl.isFunctionDeploying()" data-on-change-callback="$ctrl.onConfigurationChangeCallback"> </ncl-version-configuration-runtime-attributes> <div data-ng-if="$ctrl.isRuntimeBlockVisible()" class="configuration-block invisible"></div> </div> </div> </div> </div> ');
|
|
28638
28639
|
}]);
|
|
28639
28640
|
})();
|
|
28640
28641
|
|
|
@@ -28816,8 +28817,8 @@ try {
|
|
|
28816
28817
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28817
28818
|
}
|
|
28818
28819
|
module.run(['$templateCache', function($templateCache) {
|
|
28819
|
-
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-
|
|
28820
|
-
'<div class="ncl-version-configuration-resources"> <form name="$ctrl.resourcesForm" class="resources-wrapper" novalidate> <div class="title">{{ \'common:RESOURCES\' | i18next }}</div> <div class="row"> <div class="igz-row form-row" data-ng-if="$ctrl.selectedPodTolerationOption"> <div class="igz-col-40 row-title">{{ \'functions:RUN_ON_SPOT_NODES\' | i18next }} <igz-more-info data-description="{{$ctrl.selectedPodTolerationOption.tooltip}}"></igz-more-info> </div> <div class="igz-col-20 input-wrapper"></div> <div class="igz-col-40 input-wrapper"> <div class="row-input preemtion-mode-input"> <igz-default-dropdown data-values-array="$ctrl.podTolerationsOptions" data-selected-item="$ctrl.selectedPodTolerationOption" data-is-disabled="$ctrl.isFunctionDeploying()" data-item-select-callback="$ctrl.podTolerationDropdownCallback(item, isItemChanged, field)" data-item-select-field="spec.preemptionMode"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row" data-ng-if="$ctrl.isPodsPriorityShown()"> <div class="igz-col-40 row-title">{{ \'functions:PODS_PRIORITY\' | i18next }}</div> <div class="igz-col-20 input-wrapper"></div> <div class="igz-col-40 input-wrapper"> <div class="row-input priority-class-input"> <igz-default-dropdown data-values-array="$ctrl.podsPriorityOptions" data-selected-item="$ctrl.selectedPodsPriority" data-is-disabled="$ctrl.isFunctionDeploying()" data-item-select-callback="$ctrl.podsPriorityDropdownCallback(item, isItemChanged, field)" data-item-select-field="spec.priorityClassName"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title">{{ \'common:MEMORY\' | i18next }} <igz-more-info data-trigger="click" data-is-html-enabled="true" data-is-open="$ctrl.memoryWarningOpen" data-icon-type="{{$ctrl.memoryWarningOpen ? \'warn\' : \'info\'}}" data-description="{{ \'common:RESOURCES_WARNING_LIMIT_FILLED_REQUEST_EMPTY\' | i18next:{ when: \'the function is deployed\' } }}"> </igz-more-info> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:REQUEST\' | i18next }}</div> <div class="row-input memory-input memory-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="requestMemory" data-update-number-input-callback="$ctrl.memoryInputCallback(newData, field)" data-update-number-input-field="resources.requests.memory" data-min-value="1" data-current-value="$ctrl.resources.requests.memory" data-value-step="1"> </igz-number-input> </div> <div class="row-input memory-input memory-size-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.dropdownOptions" data-selected-item="$ctrl.selectedRequestUnit" data-item-select-callback="$ctrl.memoryDropdownCallback(item, isItemChanges, field)" data-item-select-field="spec.resources.requests.memory"> </igz-default-dropdown> </div> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:LIMIT\' | i18next }}</div> <div class="row-input memory-input memory-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="limitsMemory" data-min-value="1" data-update-number-input-callback="$ctrl.memoryInputCallback(newData, field)" data-update-number-input-field="resources.limits.memory" data-current-value="$ctrl.resources.limits.memory" data-value-step="1"> </igz-number-input> </div> <div class="row-input memory-input memory-size-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.dropdownOptions" data-selected-item="$ctrl.selectedLimitUnit" data-item-select-callback="$ctrl.memoryDropdownCallback(item, isItemChanges, field)" data-item-select-field="spec.resources.limits.memory"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title">{{ \'common:CPU\' | i18next }}</div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:REQUEST\' | i18next }}</div> <div class="row-input cpu-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="requestCpu" data-placeholder="{{ $ctrl.selectedCpuRequestItem.placeholder }}" data-update-number-input-callback="$ctrl.cpuInputCallback(newData, field)" data-update-number-input-field="resources.requests.cpu" data-min-value="$ctrl.selectedCpuRequestItem.minValue" data-precision="{{ $ctrl.selectedCpuRequestItem.precision }}" data-value-step="{{ $ctrl.selectedCpuRequestItem.step }}" data-current-value="$ctrl.resources.requests.cpu"> </igz-number-input> </div> <div class="row-input cpu-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.cpuDropdownOptions" data-selected-item="$ctrl.selectedCpuRequestItem" data-item-select-callback="$ctrl.cpuDropdownCallback(item, isItemChanged, field)" data-item-select-field="selectedCpuRequestItem"> </igz-default-dropdown> </div> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:LIMIT\' | i18next }}</div> <div class="row-input cpu-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="limitsCpu" data-placeholder="{{ $ctrl.selectedCpuLimitItem.placeholder }}" data-update-number-input-callback="$ctrl.cpuInputCallback(newData, field)" data-update-number-input-field="resources.limits.cpu" data-min-value="$ctrl.selectedCpuLimitItem.minValue" data-precision="{{ $ctrl.selectedCpuLimitItem.precision }}" data-value-step="{{ $ctrl.selectedCpuLimitItem.step }}" data-current-value="$ctrl.resources.limits.cpu"> </igz-number-input> </div> <div class="row-input cpu-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.cpuDropdownOptions" data-selected-item="$ctrl.selectedCpuLimitItem" data-item-select-callback="$ctrl.cpuDropdownCallback(item, isItemChanged, field)" data-item-select-field="selectedCpuLimitItem"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title">{{ \'common:GPU\' | i18next }}</div> <div class="igz-col-40 input-wrapper"></div> <div class="igz-col-40 input-wrapper" data-uib-tooltip="{{ \'functions:TOOLTIP.GPU_LIMIT\' | i18next }}" data-tooltip-append-to-body="true" data-tooltip-placement="bottom" data-tooltip-popup-delay="500"> <div class="input-title">{{ \'common:LIMIT\' | i18next }}</div> <div class="row-input gpu-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="limitsGpu" data-update-number-input-callback="$ctrl.gpuInputCallback(newData, field)" data-update-number-input-field="limits" data-min-value="1" data-max-value="4" data-value-step="1" data-current-value="$ctrl.resources.limits.gpu"> </igz-number-input> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title"> {{ \'common:REPLICAS\' | i18next }} </div> <div class="igz-col-40 input-wrapper"> <div class="input-title"> {{ \'common:MIN\' | i18next }} <igz-more-info data-description="{{ \'functions:MIN_REPLICAS\' | i18next:{default: $ctrl.defaultFunctionConfig.spec.minReplicas} }}" data-default-tooltip-placement="top" data-trigger="click"> </igz-more-info> </div> <div class="row-input replicas-number-input"> <igz-number-input data-form-object="$ctrl.resourcesForm" data-input-name="minReplicas" data-current-value="$ctrl.minReplicas" data-update-number-input-callback="$ctrl.replicasInputCallback(newData, field)" data-update-number-input-field="minReplicas" data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-placeholder="" data-precision="0" data-value-step="1" data-min-value="0" data-max-value="$ctrl.maxReplicas || Infinity"> </igz-number-input> </div> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title" data-ng-class="{ asterisk: $ctrl.minReplicas === 0 }"> {{ \'functions:MAX\' | i18next }} <igz-more-info data-description="{{ \'functions:MAX_REPLICAS\' | i18next:{default: $ctrl.defaultFunctionConfig.spec.maxReplicas} }}" data-default-tooltip-placement="top" data-trigger="click"> </igz-more-info> </div> <div class="row-input replicas-number-input"> <igz-number-input data-form-object="$ctrl.resourcesForm" data-input-name="maxReplicas" data-current-value="$ctrl.maxReplicas" data-update-number-input-callback="$ctrl.replicasInputCallback(newData, field)" data-update-number-input-field="maxReplicas" data-allow-empty-field="true" data-is-disabled="$ctrl.isFunctionDeploying()" data-placeholder="{{ $ctrl.minReplicas === 0 ? (\'functions:PLACEHOLDER.MAX_REQUIRED\' | i18next) : \'\' }}" data-precision="0" data-value-step="1" data-validation-is-required="$ctrl.minReplicas === 0" data-min-value="$ctrl.minReplicas || 1"> </igz-number-input> </div> </div> </div> <div class="igz-row form-row align-items-center slider-block" data-ng-if="$ctrl.isInactivityWindowShown()"> <div class="igz-col-25 row-title no-margin"> <span>{{ \'common:INACTIVITY_WINDOW\' | i18next }}</span> <igz-more-info data-description="{{ \'common:INACTIVITY_WINDOW_DESCRIPTION\' | i18next }}" data-trigger="click"> </igz-more-info> </div> <div class="igz-col-75 row-input slider" data-uib-tooltip="{{ \'functions:TOOLTIP.INACTIVITY_WINDOW\' | i18next }}" data-tooltip-enable="$ctrl.windowSizeSlider.options.disabled" data-tooltip-append-to-body="true" data-tooltip-placement="bottom" data-tooltip-popup-delay="500"> <rzslider class="rzslider" data-rz-slider-model="$ctrl.windowSizeSlider.value" data-rz-slider-options="$ctrl.windowSizeSlider.options"> </rzslider> </div> </div> <div class="igz-row form-row range-inputs-row slider-block"> <div class="igz-col-25 row-title no-margin target-cpu-title"> <span>{{ \'common:TARGET_CPU\' | i18next }}</span> <igz-more-info data-description="{{ \'functions:TARGET_CPU_DESCRIPTION\' | i18next:{default: $ctrl.defaultFunctionConfig.spec.targetCPU} }}" data-trigger="click" data-is-html-enabled="true"> </igz-more-info> </div> <div class="igz-col-75 row-input slider"> <igz-slider-input-block data-slider-config="$ctrl.targetCpuSliderConfig" data-measure-units="null" data-value-unit="$ctrl.targetCpuValueUnit" data-slider-block-updating-broadcast="" data-on-change-callback="$ctrl.sliderInputCallback" data-update-slider-input="spec.targetCPU" data-allow-full-range="true" data-uib-tooltip="{{ \'functions:TOOLTIP.TARGET_CPU\' | i18next }}" data-tooltip-enable="$ctrl.targetCpuSliderConfig.options.disabled" data-tooltip-append-to-body="true" data-tooltip-placement="bottom" data-tooltip-popup-delay="500"> </igz-slider-input-block> </div> </div> </div> </form> <form name="$ctrl.nodeSelectorsForm" novalidate> <div class="igz-row-flex"> <div class="title"> <span>{{ \'functions:NODE_SELECTORS\' | i18next }}</span> <igz-more-info data-description="{{ \'functions:NODE_SELECTORS_MORE_INFO\' | i18next }}" data-trigger="click"> </igz-more-info> </div> <a class="link" data-ng-class="{ \'disabled\': $ctrl.isFunctionDeploying() }" data-ng-click="$ctrl.handleRevertToDefaultsClick()" data-ng-hide="$ctrl.revertToDefaultsBtnIsHidden"> {{ \'functions:REVERT_TO_DEFAULTS\' | i18next }} </a> </div> <div class="row"> <div class="igz-row form-row"> <div class="table-body" data-ng-repeat="nodeSelector in $ctrl.nodeSelectors"> <ncl-key-value-input class="node-selectors" data-row-data="nodeSelector" data-item-index="$index" data-use-type="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-validation-rules="$ctrl.nodeSelectorsValidationRules" data-action-handler-callback="$ctrl.handleNodeSelectorsAction(actionType, index)" data-change-data-callback="$ctrl.onChangeNodeSelectorsData(newData, index)" data-submit-on-fly="true" data-value-optional="true"> </ncl-key-value-input> </div> <div class="igz-create-button" data-ng-class="{ \'disabled\': $ctrl.isFunctionDeploying() }" data-ng-click="$ctrl.addNewNodeSelector($event)"> <span class="igz-icon-add-round"></span> {{ \'common:ADD_ENTRY\' | i18next }} </div> </div> </div> </form> </div> ');
|
|
28820
|
+
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-environment-variables/version-configuration-environment-variables.tpl.html',
|
|
28821
|
+
'<div class="ncl-version-configuration-environment-variables"> <div class="title">{{ \'common:ENVIRONMENT_VARIABLES\' | i18next }}</div> <form name="$ctrl.environmentVariablesForm" class="resources-wrapper" novalidate> <div class="igz-scrollable-container scrollable-environment-variables" data-ng-scrollbars data-igz-ng-scrollbars-config="{{$ctrl.igzScrollConfig}}" data-ng-scrollbars-config="$ctrl.scrollConfig"> <div class="table-body" data-ng-repeat="variable in $ctrl.variables"> <ncl-key-value-input class="new-label-input" data-row-data="variable" data-item-index="$index" data-use-type="true" data-use-labels="true" data-is-disabled="$ctrl.isFunctionDeploying()" data-validation-rules="$ctrl.validationRules" data-all-value-types="$ctrl.isOnlyValueTypeInputs" data-action-handler-callback="$ctrl.handleAction(actionType, index)" data-change-data-callback="$ctrl.onChangeData(newData, index)" data-change-type-callback="$ctrl.onChangeType(newType, index)" data-dropdown-overlap="true" data-submit-on-fly="true"> </ncl-key-value-input> </div> </div> <div class="igz-create-button create-variable-button" data-ng-class="{ \'disabled\': $ctrl.isFunctionDeploying() }" data-ng-click="$ctrl.addNewVariable($event)"> <span class="igz-icon-add-round"></span> {{ \'common:ADD_ENVIRONMENT_VARIABLE\' | i18next }} </div> </form> </div> ');
|
|
28821
28822
|
}]);
|
|
28822
28823
|
})();
|
|
28823
28824
|
|
|
@@ -28828,8 +28829,8 @@ try {
|
|
|
28828
28829
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28829
28830
|
}
|
|
28830
28831
|
module.run(['$templateCache', function($templateCache) {
|
|
28831
|
-
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-
|
|
28832
|
-
'<div class="ncl-version-configuration-
|
|
28832
|
+
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-labels/version-configuration-labels.tpl.html',
|
|
28833
|
+
'<div class="ncl-version-configuration-labels"> <div class="title"> <span>{{ \'common:LABELS\' | i18next }}</span> <igz-more-info data-description="{{$ctrl.tooltip}}" data-trigger="click" data-is-html-enabled="true"> </igz-more-info> </div> <form name="$ctrl.labelsForm" class="labels-wrapper" novalidate> <div data-ng-if="$ctrl.labels.length > 0" class="table-headers"> <div class="key-header"> {{ \'common:KEY\' | i18next }} <igz-more-info data-description="{{$ctrl.keyTooltip}}" data-trigger="click" data-is-html-enabled="true"> </igz-more-info> </div> <div class="value-header"> {{ \'common:VALUE\' | i18next }} </div> </div> <div class="igz-scrollable-container scrollable-labels" data-ng-scrollbars data-igz-ng-scrollbars-config="{{$ctrl.igzScrollConfig}}" data-ng-scrollbars-config="$ctrl.scrollConfig"> <div class="table-body" data-ng-repeat="label in $ctrl.labels"> <ncl-key-value-input class="new-label-input" data-row-data="label" data-item-index="$index" data-use-type="false" data-validation-rules="$ctrl.validationRules" data-is-disabled="$ctrl.isLabelsDisabled() || $ctrl.isFunctionDeploying()" data-action-handler-callback="$ctrl.handleAction(actionType, index)" data-change-data-callback="$ctrl.onChangeData(newData, index)" data-submit-on-fly="true" data-key-tooltip="$ctrl.isLabelsDisabled() ? $ctrl.addNewLabelTooltip : \'\'" data-value-tooltip="$ctrl.isLabelsDisabled() ? $ctrl.addNewLabelTooltip : \'\'"> </ncl-key-value-input> </div> </div> <div class="igz-create-button create-label-button" data-ng-class="{\'disabled\': $ctrl.isLabelsDisabled() || $ctrl.isFunctionDeploying()}" data-ng-click="$ctrl.addNewLabel($event)" data-uib-tooltip="{{$ctrl.isLabelsDisabled() ? $ctrl.addNewLabelTooltip : \'\'}}" data-tooltip-append-to-body="true" data-tooltip-placement="right" data-tooltip-popup-delay="100"> <span class="igz-icon-add-round"></span> {{ \'functions:ADD_LABEL\' | i18next }} </div> </form> </div> ');
|
|
28833
28834
|
}]);
|
|
28834
28835
|
})();
|
|
28835
28836
|
|
|
@@ -28840,8 +28841,8 @@ try {
|
|
|
28840
28841
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28841
28842
|
}
|
|
28842
28843
|
module.run(['$templateCache', function($templateCache) {
|
|
28843
|
-
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-
|
|
28844
|
-
'<div class="ncl-version-configuration-
|
|
28844
|
+
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-logging/version-configuration-logging.tpl.html',
|
|
28845
|
+
'<div class="ncl-version-configuration-logging"> <div class="title">{{ \'functions:LOGGING\' | i18next }}</div> <div class="row"> <form name="$ctrl.loggingForm" class="logging-wrapper" novalidate></form> </div> </div> ');
|
|
28845
28846
|
}]);
|
|
28846
28847
|
})();
|
|
28847
28848
|
|
|
@@ -28852,8 +28853,8 @@ try {
|
|
|
28852
28853
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28853
28854
|
}
|
|
28854
28855
|
module.run(['$templateCache', function($templateCache) {
|
|
28855
|
-
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-
|
|
28856
|
-
'<div class="ncl-version-configuration-runtime-attributes"> <div class="title">{{ \'functions:RUNTIME_ATTRIBUTES\' | i18next }}</div> <form name="$ctrl.runtimeAttributesForm" class="runtime-attributes-wrapper" novalidate> <div class="row" data-ng-class="{\'info-row\': $ctrl.version.spec.runtime !== \'shell\'}" data-ng-if="$ctrl.version.spec.runtime !== \'java\'"> <div class="runtime-title"> <span class="label">{{ \'functions:RUNTIME\' | i18next }}</span> <div class="runtime"> {{$ctrl.version.spec.runtime}} </div> </div> <div class="arguments-input" data-ng-if="$ctrl.version.spec.runtime === \'shell\'"> <span class="label">{{ \'common:ARGUMENTS\' | i18next }}</span> <igz-validating-input-field data-field-type="input" data-input-name="arguments" data-input-value="$ctrl.runtimeAttributes.arguments" data-read-only="$ctrl.isFunctionDeploying()" data-update-data-callback="$ctrl.inputValueCallback(newData, field)" data-update-data-field="arguments" data-form-object="$ctrl.runtimeAttributesForm" data-placeholder-text="{{ \'functions:PLACEHOLDER.ENTER_ARGUMENTS\' | i18next }}"> </igz-validating-input-field> </div> </div> <div class="row igz-col-100 info-row" data-ng-if="$ctrl.version.spec.runtime === \'java\'"> <div class="row igz-col-100 info-row"> <span class="field-label">{{ \'functions:JVM_OPTIONS\' | i18next }}</span> <igz-validating-input-field data-field-type="textarea" data-input-name="jvmOptions" data-input-value="$ctrl.runtimeAttributes.jvmOptions" data-is-focused="false" data-read-only="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.runtimeAttributesForm" data-placeholder-text="{{ \'functions:PLACEHOLDER.ENTER_OPTION_ON_EACH_LINE\' | i18next }}" data-update-data-callback="$ctrl.inputValueCallback(newData, field)" data-update-data-field="jvmOptions" class="build-command-field java-attribute"> </igz-validating-input-field> </div> </div> <div class="row info-row" data-ng-if="$ctrl.version.spec.runtime === \'shell\'"> <span class="label">{{ \'functions:RESPONSE_HEADERS\' | i18next }}</span> <div data-ng-if="$ctrl.attributes.length > 0" class="table-headers"> <div class="key-header">{{ \'common:KEY\' | i18next }}</div> <div class="value-header">{{ \'common:VALUE\' | i18next }}</div> </div> <div class="igz-scrollable-container" data-ng-scrollbars data-igz-ng-scrollbars-config="{{$ctrl.igzScrollConfig}}" data-ng-scrollbars-config="$ctrl.scrollConfig"> <div class="table-body" data-ng-repeat="attribute in $ctrl.attributes"> <ncl-key-value-input class="new-label-input" data-row-data="attribute" data-use-type="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-item-index="$index" data-action-handler-callback="$ctrl.handleAction(actionType, index)" data-change-data-callback="$ctrl.onChangeData(newData, index)" data-submit-on-fly="true"> </ncl-key-value-input> </div> </div> <div class="igz-create-button create-label-button" data-ng-class="{\'disabled\': $ctrl.isFunctionDeploying()}" data-ng-click="$ctrl.addNewAttribute($event)"> <span class="igz-icon-add-round"></span> {{ \'functions:CREATE_NEW_RUNTIME_ATTRIBUTE\' | i18next }} </div> </div> </form> </div> ');
|
|
28856
|
+
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-resources/version-configuration-resources.tpl.html',
|
|
28857
|
+
'<div class="ncl-version-configuration-resources"> <form name="$ctrl.resourcesForm" class="resources-wrapper" novalidate> <div class="title">{{ \'common:RESOURCES\' | i18next }}</div> <div class="row"> <div class="igz-row form-row" data-ng-if="$ctrl.selectedPodTolerationOption"> <div class="igz-col-40 row-title">{{ \'functions:RUN_ON_SPOT_NODES\' | i18next }} <igz-more-info data-description="{{$ctrl.selectedPodTolerationOption.tooltip}}"></igz-more-info> </div> <div class="igz-col-20 input-wrapper"></div> <div class="igz-col-40 input-wrapper"> <div class="row-input preemtion-mode-input"> <igz-default-dropdown data-values-array="$ctrl.podTolerationsOptions" data-selected-item="$ctrl.selectedPodTolerationOption" data-is-disabled="$ctrl.isFunctionDeploying()" data-item-select-callback="$ctrl.podTolerationDropdownCallback(item, isItemChanged, field)" data-item-select-field="spec.preemptionMode"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row" data-ng-if="$ctrl.isPodsPriorityShown()"> <div class="igz-col-40 row-title">{{ \'functions:PODS_PRIORITY\' | i18next }}</div> <div class="igz-col-20 input-wrapper"></div> <div class="igz-col-40 input-wrapper"> <div class="row-input priority-class-input"> <igz-default-dropdown data-values-array="$ctrl.podsPriorityOptions" data-selected-item="$ctrl.selectedPodsPriority" data-is-disabled="$ctrl.isFunctionDeploying()" data-item-select-callback="$ctrl.podsPriorityDropdownCallback(item, isItemChanged, field)" data-item-select-field="spec.priorityClassName"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title">{{ \'common:MEMORY\' | i18next }} <igz-more-info data-trigger="click" data-is-html-enabled="true" data-is-open="$ctrl.memoryWarningOpen" data-icon-type="{{$ctrl.memoryWarningOpen ? \'warn\' : \'info\'}}" data-description="{{ \'common:RESOURCES_WARNING_LIMIT_FILLED_REQUEST_EMPTY\' | i18next:{ when: \'the function is deployed\' } }}"> </igz-more-info> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:REQUEST\' | i18next }}</div> <div class="row-input memory-input memory-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="requestMemory" data-update-number-input-callback="$ctrl.memoryInputCallback(newData, field)" data-update-number-input-field="resources.requests.memory" data-min-value="1" data-current-value="$ctrl.resources.requests.memory" data-value-step="1"> </igz-number-input> </div> <div class="row-input memory-input memory-size-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.dropdownOptions" data-selected-item="$ctrl.selectedRequestUnit" data-item-select-callback="$ctrl.memoryDropdownCallback(item, isItemChanges, field)" data-item-select-field="spec.resources.requests.memory"> </igz-default-dropdown> </div> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:LIMIT\' | i18next }}</div> <div class="row-input memory-input memory-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="limitsMemory" data-min-value="1" data-update-number-input-callback="$ctrl.memoryInputCallback(newData, field)" data-update-number-input-field="resources.limits.memory" data-current-value="$ctrl.resources.limits.memory" data-value-step="1"> </igz-number-input> </div> <div class="row-input memory-input memory-size-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.dropdownOptions" data-selected-item="$ctrl.selectedLimitUnit" data-item-select-callback="$ctrl.memoryDropdownCallback(item, isItemChanges, field)" data-item-select-field="spec.resources.limits.memory"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title">{{ \'common:CPU\' | i18next }}</div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:REQUEST\' | i18next }}</div> <div class="row-input cpu-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="requestCpu" data-placeholder="{{ $ctrl.selectedCpuRequestItem.placeholder }}" data-update-number-input-callback="$ctrl.cpuInputCallback(newData, field)" data-update-number-input-field="resources.requests.cpu" data-min-value="$ctrl.selectedCpuRequestItem.minValue" data-precision="{{ $ctrl.selectedCpuRequestItem.precision }}" data-value-step="{{ $ctrl.selectedCpuRequestItem.step }}" data-current-value="$ctrl.resources.requests.cpu"> </igz-number-input> </div> <div class="row-input cpu-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.cpuDropdownOptions" data-selected-item="$ctrl.selectedCpuRequestItem" data-item-select-callback="$ctrl.cpuDropdownCallback(item, isItemChanged, field)" data-item-select-field="selectedCpuRequestItem"> </igz-default-dropdown> </div> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title">{{ \'common:LIMIT\' | i18next }}</div> <div class="row-input cpu-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="limitsCpu" data-placeholder="{{ $ctrl.selectedCpuLimitItem.placeholder }}" data-update-number-input-callback="$ctrl.cpuInputCallback(newData, field)" data-update-number-input-field="resources.limits.cpu" data-min-value="$ctrl.selectedCpuLimitItem.minValue" data-precision="{{ $ctrl.selectedCpuLimitItem.precision }}" data-value-step="{{ $ctrl.selectedCpuLimitItem.step }}" data-current-value="$ctrl.resources.limits.cpu"> </igz-number-input> </div> <div class="row-input cpu-dropdown"> <igz-default-dropdown data-read-only="$ctrl.isFunctionDeploying()" data-values-array="$ctrl.cpuDropdownOptions" data-selected-item="$ctrl.selectedCpuLimitItem" data-item-select-callback="$ctrl.cpuDropdownCallback(item, isItemChanged, field)" data-item-select-field="selectedCpuLimitItem"> </igz-default-dropdown> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title">{{ \'common:GPU\' | i18next }}</div> <div class="igz-col-40 input-wrapper"></div> <div class="igz-col-40 input-wrapper" data-uib-tooltip="{{ \'functions:TOOLTIP.GPU_LIMIT\' | i18next }}" data-tooltip-append-to-body="true" data-tooltip-placement="bottom" data-tooltip-popup-delay="500"> <div class="input-title">{{ \'common:LIMIT\' | i18next }}</div> <div class="row-input gpu-number-input"> <igz-number-input data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.resourcesForm" data-input-name="limitsGpu" data-update-number-input-callback="$ctrl.gpuInputCallback(newData, field)" data-update-number-input-field="limits" data-min-value="1" data-max-value="4" data-value-step="1" data-current-value="$ctrl.resources.limits.gpu"> </igz-number-input> </div> </div> </div> <div class="igz-row form-row range-inputs-row"> <div class="igz-col-20 row-title"> {{ \'common:REPLICAS\' | i18next }} </div> <div class="igz-col-40 input-wrapper"> <div class="input-title"> {{ \'common:MIN\' | i18next }} <igz-more-info data-description="{{ \'functions:MIN_REPLICAS\' | i18next:{default: $ctrl.defaultFunctionConfig.spec.minReplicas} }}" data-default-tooltip-placement="top" data-trigger="click"> </igz-more-info> </div> <div class="row-input replicas-number-input"> <igz-number-input data-form-object="$ctrl.resourcesForm" data-input-name="minReplicas" data-current-value="$ctrl.minReplicas" data-update-number-input-callback="$ctrl.replicasInputCallback(newData, field)" data-update-number-input-field="minReplicas" data-allow-empty-field="true" data-validation-is-required="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-placeholder="" data-precision="0" data-value-step="1" data-min-value="0" data-max-value="$ctrl.maxReplicas || Infinity"> </igz-number-input> </div> </div> <div class="igz-col-40 input-wrapper"> <div class="input-title" data-ng-class="{ asterisk: $ctrl.minReplicas === 0 }"> {{ \'functions:MAX\' | i18next }} <igz-more-info data-description="{{ \'functions:MAX_REPLICAS\' | i18next:{default: $ctrl.defaultFunctionConfig.spec.maxReplicas} }}" data-default-tooltip-placement="top" data-trigger="click"> </igz-more-info> </div> <div class="row-input replicas-number-input"> <igz-number-input data-form-object="$ctrl.resourcesForm" data-input-name="maxReplicas" data-current-value="$ctrl.maxReplicas" data-update-number-input-callback="$ctrl.replicasInputCallback(newData, field)" data-update-number-input-field="maxReplicas" data-allow-empty-field="true" data-is-disabled="$ctrl.isFunctionDeploying()" data-placeholder="{{ $ctrl.minReplicas === 0 ? (\'functions:PLACEHOLDER.MAX_REQUIRED\' | i18next) : \'\' }}" data-precision="0" data-value-step="1" data-validation-is-required="$ctrl.minReplicas === 0" data-min-value="$ctrl.minReplicas || 1"> </igz-number-input> </div> </div> </div> <div class="igz-row form-row align-items-center slider-block" data-ng-if="$ctrl.isInactivityWindowShown()"> <div class="igz-col-25 row-title no-margin"> <span>{{ \'common:INACTIVITY_WINDOW\' | i18next }}</span> <igz-more-info data-description="{{ \'common:INACTIVITY_WINDOW_DESCRIPTION\' | i18next }}" data-trigger="click"> </igz-more-info> </div> <div class="igz-col-75 row-input slider" data-uib-tooltip="{{ \'functions:TOOLTIP.INACTIVITY_WINDOW\' | i18next }}" data-tooltip-enable="$ctrl.windowSizeSlider.options.disabled" data-tooltip-append-to-body="true" data-tooltip-placement="bottom" data-tooltip-popup-delay="500"> <rzslider class="rzslider" data-rz-slider-model="$ctrl.windowSizeSlider.value" data-rz-slider-options="$ctrl.windowSizeSlider.options"> </rzslider> </div> </div> <div class="igz-row form-row range-inputs-row slider-block"> <div class="igz-col-25 row-title no-margin target-cpu-title"> <span>{{ \'common:TARGET_CPU\' | i18next }}</span> <igz-more-info data-description="{{ \'functions:TARGET_CPU_DESCRIPTION\' | i18next:{default: $ctrl.defaultFunctionConfig.spec.targetCPU} }}" data-trigger="click" data-is-html-enabled="true"> </igz-more-info> </div> <div class="igz-col-75 row-input slider"> <igz-slider-input-block data-slider-config="$ctrl.targetCpuSliderConfig" data-measure-units="null" data-value-unit="$ctrl.targetCpuValueUnit" data-slider-block-updating-broadcast="" data-on-change-callback="$ctrl.sliderInputCallback" data-update-slider-input="spec.targetCPU" data-allow-full-range="true" data-uib-tooltip="{{ \'functions:TOOLTIP.TARGET_CPU\' | i18next }}" data-tooltip-enable="$ctrl.targetCpuSliderConfig.options.disabled" data-tooltip-append-to-body="true" data-tooltip-placement="bottom" data-tooltip-popup-delay="500"> </igz-slider-input-block> </div> </div> </div> </form> <form name="$ctrl.nodeSelectorsForm" novalidate> <div class="igz-row-flex"> <div class="title"> <span>{{ \'functions:NODE_SELECTORS\' | i18next }}</span> <igz-more-info data-description="{{ \'functions:NODE_SELECTORS_MORE_INFO\' | i18next }}" data-trigger="click"> </igz-more-info> </div> <a class="link" data-ng-class="{ \'disabled\': $ctrl.isFunctionDeploying() }" data-ng-click="$ctrl.handleRevertToDefaultsClick()" data-ng-hide="$ctrl.revertToDefaultsBtnIsHidden"> {{ \'functions:REVERT_TO_DEFAULTS\' | i18next }} </a> </div> <div class="row"> <div class="igz-row form-row"> <div class="table-body" data-ng-repeat="nodeSelector in $ctrl.nodeSelectors"> <ncl-key-value-input class="node-selectors" data-row-data="nodeSelector" data-item-index="$index" data-use-type="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-validation-rules="$ctrl.nodeSelectorsValidationRules" data-action-handler-callback="$ctrl.handleNodeSelectorsAction(actionType, index)" data-change-data-callback="$ctrl.onChangeNodeSelectorsData(newData, index)" data-submit-on-fly="true" data-value-optional="true"> </ncl-key-value-input> </div> <div class="igz-create-button" data-ng-class="{ \'disabled\': $ctrl.isFunctionDeploying() }" data-ng-click="$ctrl.addNewNodeSelector($event)"> <span class="igz-icon-add-round"></span> {{ \'common:ADD_ENTRY\' | i18next }} </div> </div> </div> </form> </div> ');
|
|
28857
28858
|
}]);
|
|
28858
28859
|
})();
|
|
28859
28860
|
|
|
@@ -28864,8 +28865,8 @@ try {
|
|
|
28864
28865
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28865
28866
|
}
|
|
28866
28867
|
module.run(['$templateCache', function($templateCache) {
|
|
28867
|
-
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-
|
|
28868
|
-
'<div class="ncl-version-configuration-
|
|
28868
|
+
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-runtime-attributes/version-configuration-runtime-attributes.tpl.html',
|
|
28869
|
+
'<div class="ncl-version-configuration-runtime-attributes"> <div class="title">{{ \'functions:RUNTIME_ATTRIBUTES\' | i18next }}</div> <form name="$ctrl.runtimeAttributesForm" class="runtime-attributes-wrapper" novalidate> <div class="row" data-ng-class="{\'info-row\': $ctrl.version.spec.runtime !== \'shell\'}" data-ng-if="$ctrl.version.spec.runtime !== \'java\'"> <div class="runtime-title"> <span class="label">{{ \'functions:RUNTIME\' | i18next }}</span> <div class="runtime"> {{$ctrl.version.spec.runtime}} </div> </div> <div class="arguments-input" data-ng-if="$ctrl.version.spec.runtime === \'shell\'"> <span class="label">{{ \'common:ARGUMENTS\' | i18next }}</span> <igz-validating-input-field data-field-type="input" data-input-name="arguments" data-input-value="$ctrl.runtimeAttributes.arguments" data-read-only="$ctrl.isFunctionDeploying()" data-update-data-callback="$ctrl.inputValueCallback(newData, field)" data-update-data-field="arguments" data-form-object="$ctrl.runtimeAttributesForm" data-placeholder-text="{{ \'functions:PLACEHOLDER.ENTER_ARGUMENTS\' | i18next }}"> </igz-validating-input-field> </div> </div> <div class="row igz-col-100 info-row" data-ng-if="$ctrl.version.spec.runtime === \'java\'"> <div class="row igz-col-100 info-row"> <span class="field-label">{{ \'functions:JVM_OPTIONS\' | i18next }}</span> <igz-validating-input-field data-field-type="textarea" data-input-name="jvmOptions" data-input-value="$ctrl.runtimeAttributes.jvmOptions" data-is-focused="false" data-read-only="$ctrl.isFunctionDeploying()" data-form-object="$ctrl.runtimeAttributesForm" data-placeholder-text="{{ \'functions:PLACEHOLDER.ENTER_OPTION_ON_EACH_LINE\' | i18next }}" data-update-data-callback="$ctrl.inputValueCallback(newData, field)" data-update-data-field="jvmOptions" class="build-command-field java-attribute"> </igz-validating-input-field> </div> </div> <div class="row info-row" data-ng-if="$ctrl.version.spec.runtime === \'shell\'"> <span class="label">{{ \'functions:RESPONSE_HEADERS\' | i18next }}</span> <div data-ng-if="$ctrl.attributes.length > 0" class="table-headers"> <div class="key-header">{{ \'common:KEY\' | i18next }}</div> <div class="value-header">{{ \'common:VALUE\' | i18next }}</div> </div> <div class="igz-scrollable-container" data-ng-scrollbars data-igz-ng-scrollbars-config="{{$ctrl.igzScrollConfig}}" data-ng-scrollbars-config="$ctrl.scrollConfig"> <div class="table-body" data-ng-repeat="attribute in $ctrl.attributes"> <ncl-key-value-input class="new-label-input" data-row-data="attribute" data-use-type="false" data-is-disabled="$ctrl.isFunctionDeploying()" data-item-index="$index" data-action-handler-callback="$ctrl.handleAction(actionType, index)" data-change-data-callback="$ctrl.onChangeData(newData, index)" data-submit-on-fly="true"> </ncl-key-value-input> </div> </div> <div class="igz-create-button create-label-button" data-ng-class="{\'disabled\': $ctrl.isFunctionDeploying()}" data-ng-click="$ctrl.addNewAttribute($event)"> <span class="igz-icon-add-round"></span> {{ \'functions:CREATE_NEW_RUNTIME_ATTRIBUTE\' | i18next }} </div> </div> </form> </div> ');
|
|
28869
28870
|
}]);
|
|
28870
28871
|
})();
|
|
28871
28872
|
|
|
@@ -28876,8 +28877,8 @@ try {
|
|
|
28876
28877
|
module = angular.module('iguazio.dashboard-controls.templates', []);
|
|
28877
28878
|
}
|
|
28878
28879
|
module.run(['$templateCache', function($templateCache) {
|
|
28879
|
-
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-
|
|
28880
|
-
'<div class="ncl-version-configuration-
|
|
28880
|
+
$templateCache.put('nuclio/functions/version/version-configuration/tabs/version-configuration-volumes/version-configuration-volumes.tpl.html',
|
|
28881
|
+
'<div class="ncl-version-configuration-volumes"> <div class="title"> <span>{{ \'functions:VOLUMES\' | i18next }}</span> <igz-more-info data-description="{{ \'functions:TOOLTIP.VOLUMES\' | i18next }}" data-trigger="click"> </igz-more-info> </div> <form name="$ctrl.volumesForm" class="volumes-wrapper" novalidate> <div class="ncl-version-volume"> <div class="common-table"> <div data-ng-if="$ctrl.volumes.length > 0" class="common-table-header item-header"> <div class="common-table-cell item-name"> {{ \'common:NAME\' | i18next }} </div> <div class="common-table-cell item-class"> {{ \'common:TYPE\' | i18next }} </div> <div class="common-table-cell item-info"> {{ \'functions:MOUNT_PATH_PARAMS\' | i18next }} </div> </div> <div class="common-table-body"> <div class="igz-scrollable-container scrollable-volumes" data-ng-scrollbars data-igz-ng-scrollbars-config="{{$ctrl.igzScrollConfig}}" data-ng-scrollbars-config="$ctrl.scrollConfig"> <ncl-collapsing-row data-ng-repeat="volume in $ctrl.volumes" data-item="volume" data-item-index="$index" data-type="volume" data-read-only="$ctrl.isFunctionDeploying()" data-action-handler-callback="$ctrl.handleAction(actionType, selectedItem, index)"> <ncl-edit-item class="common-table-cells-container edit-volume-row" data-item="volume" data-class-list="$ctrl.classList" data-class-placeholder="{{ \'functions:PLACEHOLDER.SELECT_TYPE\' | i18next }}" data-type="volume" data-read-only="$ctrl.isFunctionDeploying()" data-validation-rules="$ctrl.validationRules" data-max-lengths="$ctrl.maxLengths" data-on-submit-callback="$ctrl.editVolumeCallback(item)"> </ncl-edit-item> </ncl-collapsing-row> </div> </div> </div> </div> <div class="igz-create-button create-volume-button" data-ng-class="{\'disabled\': $ctrl.isFunctionDeploying()}" data-ng-click="$ctrl.createVolume($event)"> <span class="igz-icon-add-round"></span> {{ \'functions:ADD_VOLUME\' | i18next }} </div> </form> </div> ');
|
|
28881
28882
|
}]);
|
|
28882
28883
|
})();
|
|
28883
28884
|
|