@spinnaker/kubernetes 2025.0.6 → 2025.1.1
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/index.d.ts +1 -0
- package/dist/index.js +1178 -641
- package/dist/index.js.map +1 -1
- package/dist/interfaces/infrastructure.types.d.ts +4 -1
- package/dist/manifest/AnnotationCustomSections.d.ts +5 -0
- package/dist/manifest/annotationCustomSections.component.d.ts +2 -0
- package/dist/manifest/artifact/ManifestArtifact.d.ts +6 -0
- package/dist/manifest/index.d.ts +1 -1
- package/dist/manifest/manifest.service.d.ts +1 -1
- package/dist/manifest/rollout/RollingRestart.d.ts +9 -1
- package/dist/manifest/status/ManifestStatus.d.ts +8 -0
- package/dist/rawResource/controller/FiltersPubSub.d.ts +1 -1
- package/dist/reactShims/index.d.ts +1 -0
- package/dist/reactShims/kubernetes.react.injector.d.ts +11 -0
- package/dist/reactShims/kubernetes.react.module.d.ts +1 -0
- package/dist/serverGroup/details/KubernetesServerGroupActions.d.ts +7 -0
- package/dist/serverGroup/details/kubernetesServerGroupDetailsGetter.d.ts +4 -0
- package/dist/serverGroup/details/sections/IKubernetesServerGroupDetailsSectionProps.d.ts +5 -0
- package/dist/serverGroup/details/sections/ServerGroupAnnotationCustomSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ServerGroupEventsSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ServerGroupHealthSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ServerGroupImagesSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ServerGroupInformationSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ServerGroupLabelsSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ServerGroupManifestStatusSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ServerGroupSizeSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/index.d.ts +9 -0
- package/dist/serverGroup/details/useManifest.d.ts +8 -0
- package/dist/serverGroup/index.d.ts +3 -4
- package/dist/serverGroup/{serverGroupCommandBuilder.service.d.ts → serverGroupCommandBuilder.d.ts} +0 -1
- package/dist/serverGroup/{serverGroupTransformer.service.d.ts → serverGroupTransformer.d.ts} +0 -1
- package/dist/serverGroupManager/details/ServerGroupManagerActions.d.ts +9 -0
- package/dist/serverGroupManager/details/ServerGroupManagerDetails.d.ts +7 -0
- package/dist/serverGroupManager/details/sections/IKubernetesServerGroupManagerDetailsSectionProps.d.ts +6 -0
- package/dist/serverGroupManager/details/sections/ServerGroupManagerAnnotationCustomSection.d.ts +3 -0
- package/dist/serverGroupManager/details/sections/ServerGroupManagerArtifactsSection.d.ts +3 -0
- package/dist/serverGroupManager/details/sections/ServerGroupManagerEventsSection.d.ts +3 -0
- package/dist/serverGroupManager/details/sections/ServerGroupManagerInformationSection.d.ts +3 -0
- package/dist/serverGroupManager/details/sections/ServerGroupManagerLabelsSection.d.ts +3 -0
- package/dist/serverGroupManager/details/sections/ServerGroupManagerManifestConditionSection.d.ts +3 -0
- package/dist/serverGroupManager/details/sections/ServerGroupManagerManifestStatusSection.d.ts +3 -0
- package/dist/serverGroupManager/details/sections/index.d.ts +8 -0
- package/dist/serverGroupManager/details/useKubernetesServerGroupManagerDetails.d.ts +4 -0
- package/dist/serverGroupManager/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/interfaces/infrastructure.types.ts +5 -0
- package/src/kubernetes.module.ts +32 -21
- package/src/manifest/AnnotationCustomSections.tsx +6 -0
- package/src/manifest/annotationCustomSections.component.ts +1 -1
- package/src/manifest/artifact/ManifestArtifact.tsx +16 -0
- package/src/manifest/index.ts +1 -1
- package/src/manifest/rollout/RollingRestart.tsx +2 -10
- package/src/manifest/status/ManifestStatus.tsx +39 -0
- package/src/manifest/status/status.component.ts +7 -32
- package/src/reactShims/index.ts +1 -0
- package/src/reactShims/kubernetes.react.injector.ts +30 -0
- package/src/reactShims/kubernetes.react.module.ts +12 -0
- package/src/serverGroup/details/KubernetesServerGroupActions.tsx +138 -0
- package/src/serverGroup/details/kubernetesServerGroupDetailsGetter.ts +63 -0
- package/src/serverGroup/details/sections/IKubernetesServerGroupDetailsSectionProps.ts +6 -0
- package/src/serverGroup/details/sections/ServerGroupAnnotationCustomSection.tsx +11 -0
- package/src/serverGroup/details/sections/ServerGroupEventsSection.tsx +14 -0
- package/src/serverGroup/details/sections/ServerGroupHealthSection.tsx +19 -0
- package/src/serverGroup/details/sections/ServerGroupImagesSection.tsx +14 -0
- package/src/serverGroup/details/sections/ServerGroupInformationSection.tsx +46 -0
- package/src/serverGroup/details/sections/ServerGroupLabelsSection.tsx +14 -0
- package/src/serverGroup/details/sections/ServerGroupManifestStatusSection.tsx +9 -0
- package/src/serverGroup/details/sections/ServerGroupSizeSection.tsx +35 -0
- package/src/serverGroup/details/sections/index.ts +9 -0
- package/src/serverGroup/details/useManifest.ts +42 -0
- package/src/serverGroup/index.ts +3 -4
- package/src/serverGroup/{serverGroupCommandBuilder.service.ts → serverGroupCommandBuilder.ts} +0 -9
- package/src/serverGroup/{serverGroupTransformer.service.spec.ts → serverGroupTransformer.spec.ts} +1 -1
- package/src/serverGroup/{serverGroupTransformer.service.ts → serverGroupTransformer.ts} +0 -7
- package/src/serverGroupManager/details/ServerGroupManagerActions.tsx +171 -0
- package/src/serverGroupManager/details/ServerGroupManagerDetails.tsx +72 -0
- package/src/serverGroupManager/details/sections/IKubernetesServerGroupManagerDetailsSectionProps.ts +7 -0
- package/src/serverGroupManager/details/sections/ServerGroupManagerAnnotationCustomSection.tsx +12 -0
- package/src/serverGroupManager/details/sections/ServerGroupManagerArtifactsSection.tsx +18 -0
- package/src/serverGroupManager/details/sections/ServerGroupManagerEventsSection.tsx +14 -0
- package/src/serverGroupManager/details/sections/ServerGroupManagerInformationSection.tsx +51 -0
- package/src/serverGroupManager/details/sections/ServerGroupManagerLabelsSection.tsx +14 -0
- package/src/serverGroupManager/details/sections/ServerGroupManagerManifestConditionSection.tsx +21 -0
- package/src/serverGroupManager/details/sections/ServerGroupManagerManifestStatusSection.tsx +10 -0
- package/src/serverGroupManager/details/sections/index.ts +8 -0
- package/src/serverGroupManager/details/useKubernetesServerGroupManagerDetails.tsx +53 -0
- package/src/serverGroupManager/index.ts +1 -1
- package/dist/manifest/artifact/artifact.component.d.ts +0 -1
- package/dist/serverGroup/details/details.controller.d.ts +0 -1
- package/dist/serverGroup/details/resize/resize.controller.d.ts +0 -1
- package/dist/serverGroupManager/details/details.controller.d.ts +0 -1
- package/src/manifest/artifact/artifact.component.ts +0 -23
- package/src/serverGroup/details/details.controller.ts +0 -207
- package/src/serverGroup/details/details.html +0 -153
- package/src/serverGroup/details/resize/resize.controller.ts +0 -73
- package/src/serverGroup/details/resize/resize.html +0 -57
- package/src/serverGroupManager/details/details.controller.ts +0 -191
- package/src/serverGroupManager/details/details.html +0 -136
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { module, copy
|
|
2
|
-
import { HelpContentsRegistry, AccountService, HelpField, AccountSelectInput, YamlEditor, TaskMonitor, ReactModal, WizardModal, WizardPage, noop, ManifestWriter, SETTINGS, ManifestReader, InstanceReader, RecentHistoryService, withErrorBoundary, relativeTime, JobManifestPodLogs, JobEventBasedPodNameProvider, HoverablePopover,
|
|
1
|
+
import { module, copy } from 'angular';
|
|
2
|
+
import { HelpContentsRegistry, AccountService, HelpField, AccountSelectInput, YamlEditor, TaskMonitor, ReactModal, WizardModal, WizardPage, noop, ManifestWriter, SETTINGS, ManifestReader, InstanceReader, RecentHistoryService, withErrorBoundary, relativeTime, JobManifestPodLogs, JobEventBasedPodNameProvider, HoverablePopover, StageConfigField, NumberInput, SearchService, AppListExtractor, ScopeClusterSelector, StageConstants, NgReact, Spinner, Tooltip, ExecutionDetailsSection, StageFailureMessage, Registry, ExecutionDetailsTasks, robotToHuman, AccountTag, ModalClose, TetheredSelect, StageArtifactSelector, ArtifactTypePatterns, Markdown, yamlDocumentsToString, CheckboxInput, RadioButtonInput, StageArtifactSelectorDelegate, FormikStageConfig, ReactInjector, CopyToClipboard, ManifestYaml, CollapsibleElement, ExecutionArtifactTab, ExpectedArtifactService, ArtifactReferenceService, DefaultPodNameProvider, JobStageExecutionLogs, EXECUTION_ARTIFACT_TAB, PipelineConfigValidator, ApplicationDataSourceRegistry, INFRASTRUCTURE_KEY, REST, CloudProviderLogo, FormField, ReactSelectInput, FilterSection, FilterCheckbox, Overridable, ConfirmationModalService, logger, CollapsibleSection, timestamp, APPLICATION_STATE_PROVIDER, ReactInject, SECURITY_GROUP_READER, TaskExecutor, ClusterTargetBuilder, AddEntityTagLinks, ModalInjector, ServerGroupReader, HealthCounts, IfFeatureEnabled, NameUtils, Details, EntityNotifications, ApplicationNameValidator, CloudProviderRegistry, YAML_EDITOR_COMPONENT, STAGE_ARTIFACT_SELECTOR_COMPONENT_REACT } from '@spinnaker/core';
|
|
3
3
|
import { cloneDeep, has, flattenDeep, chain, camelCase, get, partition, trim, sortBy, keys, isEmpty, defaults, flatten, groupBy, find, map, split, set, capitalize, orderBy } from 'lodash';
|
|
4
4
|
import { load, dump } from 'js-yaml';
|
|
5
|
-
import { $q, $log } from 'ngimport';
|
|
5
|
+
import ngimport_1, { $q, $log } from 'ngimport';
|
|
6
6
|
import React, { useState, useEffect } from 'react';
|
|
7
7
|
import DOMPurify from 'dompurify';
|
|
8
8
|
import { react2angular } from 'react2angular';
|
|
@@ -11,9 +11,9 @@ import 'brace/theme/textmate';
|
|
|
11
11
|
import AceEditor from 'react-ace';
|
|
12
12
|
import { DateTime } from 'luxon';
|
|
13
13
|
import Select, { Creatable } from 'react-select';
|
|
14
|
-
import { Subject, from } from 'rxjs';
|
|
14
|
+
import { Subject, from, Observable } from 'rxjs';
|
|
15
15
|
import { tap, switchMap, takeUntil } from 'rxjs/operators';
|
|
16
|
-
import { Modal, Dropdown } from 'react-bootstrap';
|
|
16
|
+
import { Modal, Dropdown, MenuItem } from 'react-bootstrap';
|
|
17
17
|
import { UISrefActive, UISref } from '@uirouter/react';
|
|
18
18
|
|
|
19
19
|
const helpContents = {
|
|
@@ -791,22 +791,6 @@ const kubernetesAnnotationCustomSectionsComponent = {
|
|
|
791
791
|
const KUBERNETES_ANNOTATION_CUSTOM_SECTIONS = "spinnaker.kubernetes.v2.manifest.annotation.custom.sections";
|
|
792
792
|
module(KUBERNETES_ANNOTATION_CUSTOM_SECTIONS, []).component("kubernetesAnnotationCustomSections", kubernetesAnnotationCustomSectionsComponent);
|
|
793
793
|
|
|
794
|
-
class KubernetesManifestArtifactCtrl {
|
|
795
|
-
}
|
|
796
|
-
const kubernetesManifestArtifactComponent = {
|
|
797
|
-
bindings: { artifact: "<" },
|
|
798
|
-
controller: KubernetesManifestArtifactCtrl,
|
|
799
|
-
controllerAs: "ctrl",
|
|
800
|
-
template: `
|
|
801
|
-
<span>
|
|
802
|
-
<b>{{ctrl.artifact.type}}</b>
|
|
803
|
-
<i>{{ctrl.artifact.reference}}</i>
|
|
804
|
-
</span>
|
|
805
|
-
`
|
|
806
|
-
};
|
|
807
|
-
const KUBERNETES_MANIFEST_ARTIFACT = "spinnaker.kubernetes.v2.manifest.artifact.component";
|
|
808
|
-
module(KUBERNETES_MANIFEST_ARTIFACT, []).component("kubernetesManifestArtifact", kubernetesManifestArtifactComponent);
|
|
809
|
-
|
|
810
794
|
class KubernetesDeleteManifestOptionsFormCtrl {
|
|
811
795
|
}
|
|
812
796
|
const kubernetesDeletManifestOptionsFormComponent = {
|
|
@@ -1123,34 +1107,6 @@ class ManifestResources extends React.Component {
|
|
|
1123
1107
|
const KUBERNETES_MANIFEST_RESOURCES = "spinnaker.kubernetes.v2.manifest.resources";
|
|
1124
1108
|
module(KUBERNETES_MANIFEST_RESOURCES, []).component("kubernetesManifestResources", react2angular(withErrorBoundary(ManifestResources, "kubernetesManifestResources"), ["manifest", "metrics"]));
|
|
1125
1109
|
|
|
1126
|
-
function RollingRestart({ application, serverGroupManager }) {
|
|
1127
|
-
function rollingRestart() {
|
|
1128
|
-
const rollingRestartParameters = {
|
|
1129
|
-
account: serverGroupManager.account,
|
|
1130
|
-
cloudProvider: "kubernetes",
|
|
1131
|
-
location: serverGroupManager.namespace,
|
|
1132
|
-
manifestName: serverGroupManager.name
|
|
1133
|
-
};
|
|
1134
|
-
ConfirmationModalService.confirm({
|
|
1135
|
-
account: serverGroupManager.account,
|
|
1136
|
-
askForReason: true,
|
|
1137
|
-
header: `Initiate rolling restart of ${serverGroupManager.name}`,
|
|
1138
|
-
submitMethod: () => {
|
|
1139
|
-
return ManifestWriter.rollingRestartManifest(rollingRestartParameters, application);
|
|
1140
|
-
},
|
|
1141
|
-
taskMonitorConfig: {
|
|
1142
|
-
application,
|
|
1143
|
-
title: `Rolling restart of ${serverGroupManager.name}`
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
}
|
|
1147
|
-
return /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("a", {
|
|
1148
|
-
onClick: rollingRestart
|
|
1149
|
-
}, "Rolling Restart"));
|
|
1150
|
-
}
|
|
1151
|
-
const KUBERNETES_ROLLING_RESTART = "spinnaker.kubernetes.v2.rolling.restart";
|
|
1152
|
-
module(KUBERNETES_ROLLING_RESTART, []).component("kubernetesRollingRestart", react2angular(withErrorBoundary(RollingRestart, "kubernetesRollingRestart"), ["application", "serverGroupManager"]));
|
|
1153
|
-
|
|
1154
1110
|
class KubernetesManifestPauseRolloutController {
|
|
1155
1111
|
constructor(coordinates, $uibModalInstance, application) {
|
|
1156
1112
|
this.$uibModalInstance = $uibModalInstance;
|
|
@@ -1793,34 +1749,33 @@ class ManifestCondition extends React.Component {
|
|
|
1793
1749
|
const KUBERNETES_MANIFEST_CONDITION = "spinnaker.kubernetes.v2.manifest.condition.component";
|
|
1794
1750
|
module(KUBERNETES_MANIFEST_CONDITION, []).component("kubernetesManifestCondition", react2angular(withErrorBoundary(ManifestCondition, "kubernetesManifestCondition"), ["condition"]));
|
|
1795
1751
|
|
|
1796
|
-
|
|
1752
|
+
function ManifestStatus$1({ status }) {
|
|
1753
|
+
if (!status) {
|
|
1754
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1755
|
+
className: "header"
|
|
1756
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1757
|
+
className: "horizontal middle center spinner-section"
|
|
1758
|
+
}, /* @__PURE__ */ React.createElement(Spinner, {
|
|
1759
|
+
size: "small"
|
|
1760
|
+
})));
|
|
1761
|
+
}
|
|
1762
|
+
return /* @__PURE__ */ React.createElement("div", null, !status.available.state && /* @__PURE__ */ React.createElement(Tooltip, {
|
|
1763
|
+
value: status.available.message
|
|
1764
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1765
|
+
className: "band band-warning"
|
|
1766
|
+
}, "Not Fully Available")), !status.stable.state && /* @__PURE__ */ React.createElement(Tooltip, {
|
|
1767
|
+
value: status.stable.message
|
|
1768
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1769
|
+
className: "band band-active"
|
|
1770
|
+
}, "Transitioning")), status.paused.state && /* @__PURE__ */ React.createElement(Tooltip, {
|
|
1771
|
+
value: status.paused.message
|
|
1772
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1773
|
+
className: "band band-info"
|
|
1774
|
+
}, "Rollout Paused")));
|
|
1797
1775
|
}
|
|
1798
|
-
|
|
1799
|
-
bindings: { status: "<" },
|
|
1800
|
-
controller: KubernetesManifestStatusCtrl,
|
|
1801
|
-
controllerAs: "ctrl",
|
|
1802
|
-
template: `
|
|
1803
|
-
<div ng-if="!ctrl.status" class="horizontal middle center spinner-section">
|
|
1804
|
-
<loading-spinner size="'small'"></loading-spinner>
|
|
1805
|
-
</div>
|
|
1806
|
-
<div ng-if="ctrl.status">
|
|
1807
|
-
<div class="band band-warning" ng-if="!ctrl.status.available.state"
|
|
1808
|
-
uib-tooltip="{{ctrl.status.available.message}}">
|
|
1809
|
-
Not Fully Available
|
|
1810
|
-
</div>
|
|
1811
|
-
<div class="band band-active" ng-if="!ctrl.status.stable.state"
|
|
1812
|
-
uib-tooltip="{{ctrl.status.stable.message}}">
|
|
1813
|
-
Transitioning
|
|
1814
|
-
</div>
|
|
1815
|
-
<div class="band band-info" ng-if="ctrl.status.paused.state"
|
|
1816
|
-
uib-tooltip="{{ctrl.status.paused.message}}">
|
|
1817
|
-
Rollout Paused
|
|
1818
|
-
</div>
|
|
1819
|
-
</div>
|
|
1820
|
-
`
|
|
1821
|
-
};
|
|
1776
|
+
|
|
1822
1777
|
const KUBERNETES_MANIFEST_STATUS = "spinnaker.kubernetes.v2.kubernetes.manifest.status.component";
|
|
1823
|
-
module(KUBERNETES_MANIFEST_STATUS, []).component("kubernetesManifestStatus",
|
|
1778
|
+
module(KUBERNETES_MANIFEST_STATUS, []).component("kubernetesManifestStatus", react2angular(withErrorBoundary(ManifestStatus$1, "kubernetesManifestStatus"), ["status"]));
|
|
1824
1779
|
|
|
1825
1780
|
var css_248z$5 = ".checkbox input[type='checkbox'].delete-manifest-options-input-cascading {\n margin-left: 0;\n}\n.delete-manifest-options-input-grace-period {\n display: inline-block;\n margin-right: 5px;\n max-width: 75px;\n}\n";
|
|
1826
1781
|
styleInject(css_248z$5);
|
|
@@ -4316,6 +4271,609 @@ module(KUBERNETS_RAW_RESOURCE_STATES, [APPLICATION_STATE_PROVIDER]).config([
|
|
|
4316
4271
|
const KUBERNETS_RAW_RESOURCE_MODULE = "spinnaker.kubernetes.rawresource";
|
|
4317
4272
|
module(KUBERNETS_RAW_RESOURCE_MODULE, [KUBERNETS_RAW_RESOURCE_DATA_SOURCE, KUBERNETS_RAW_RESOURCE_STATES]);
|
|
4318
4273
|
|
|
4274
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4275
|
+
|
|
4276
|
+
/**
|
|
4277
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
4278
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
4279
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
4280
|
+
* Released under MIT license <https://lodash.com/license>
|
|
4281
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
4282
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
4283
|
+
*/
|
|
4284
|
+
|
|
4285
|
+
/** Used as references for various `Number` constants. */
|
|
4286
|
+
var INFINITY = 1 / 0;
|
|
4287
|
+
|
|
4288
|
+
/** `Object#toString` result references. */
|
|
4289
|
+
var symbolTag = '[object Symbol]';
|
|
4290
|
+
|
|
4291
|
+
/** Used to match words composed of alphanumeric characters. */
|
|
4292
|
+
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
4293
|
+
|
|
4294
|
+
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
4295
|
+
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
4296
|
+
|
|
4297
|
+
/** Used to compose unicode character classes. */
|
|
4298
|
+
var rsAstralRange = '\\ud800-\\udfff',
|
|
4299
|
+
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
|
4300
|
+
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
|
4301
|
+
rsDingbatRange = '\\u2700-\\u27bf',
|
|
4302
|
+
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
|
4303
|
+
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
|
4304
|
+
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
|
4305
|
+
rsPunctuationRange = '\\u2000-\\u206f',
|
|
4306
|
+
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
|
|
4307
|
+
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
|
4308
|
+
rsVarRange = '\\ufe0e\\ufe0f',
|
|
4309
|
+
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
4310
|
+
|
|
4311
|
+
/** Used to compose unicode capture groups. */
|
|
4312
|
+
var rsApos = "['\u2019]",
|
|
4313
|
+
rsBreak = '[' + rsBreakRange + ']',
|
|
4314
|
+
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
|
|
4315
|
+
rsDigits = '\\d+',
|
|
4316
|
+
rsDingbat = '[' + rsDingbatRange + ']',
|
|
4317
|
+
rsLower = '[' + rsLowerRange + ']',
|
|
4318
|
+
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
|
4319
|
+
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
4320
|
+
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
4321
|
+
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
4322
|
+
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
4323
|
+
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
4324
|
+
rsUpper = '[' + rsUpperRange + ']',
|
|
4325
|
+
rsZWJ = '\\u200d';
|
|
4326
|
+
|
|
4327
|
+
/** Used to compose unicode regexes. */
|
|
4328
|
+
var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
|
|
4329
|
+
rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
|
|
4330
|
+
rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
|
|
4331
|
+
rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
|
|
4332
|
+
reOptMod = rsModifier + '?',
|
|
4333
|
+
rsOptVar = '[' + rsVarRange + ']?',
|
|
4334
|
+
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
4335
|
+
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
4336
|
+
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
|
|
4337
|
+
|
|
4338
|
+
/** Used to match apostrophes. */
|
|
4339
|
+
var reApos = RegExp(rsApos, 'g');
|
|
4340
|
+
|
|
4341
|
+
/**
|
|
4342
|
+
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
|
4343
|
+
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
4344
|
+
*/
|
|
4345
|
+
var reComboMark = RegExp(rsCombo, 'g');
|
|
4346
|
+
|
|
4347
|
+
/** Used to match complex or compound words. */
|
|
4348
|
+
var reUnicodeWord = RegExp([
|
|
4349
|
+
rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
|
|
4350
|
+
rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
|
|
4351
|
+
rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
|
|
4352
|
+
rsUpper + '+' + rsOptUpperContr,
|
|
4353
|
+
rsDigits,
|
|
4354
|
+
rsEmoji
|
|
4355
|
+
].join('|'), 'g');
|
|
4356
|
+
|
|
4357
|
+
/** Used to detect strings that need a more robust regexp to match words. */
|
|
4358
|
+
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
4359
|
+
|
|
4360
|
+
/** Used to map Latin Unicode letters to basic Latin letters. */
|
|
4361
|
+
var deburredLetters = {
|
|
4362
|
+
// Latin-1 Supplement block.
|
|
4363
|
+
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
|
4364
|
+
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
|
4365
|
+
'\xc7': 'C', '\xe7': 'c',
|
|
4366
|
+
'\xd0': 'D', '\xf0': 'd',
|
|
4367
|
+
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
|
4368
|
+
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
|
4369
|
+
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
|
4370
|
+
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
|
4371
|
+
'\xd1': 'N', '\xf1': 'n',
|
|
4372
|
+
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
|
4373
|
+
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
|
4374
|
+
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
|
|
4375
|
+
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
|
|
4376
|
+
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
|
4377
|
+
'\xc6': 'Ae', '\xe6': 'ae',
|
|
4378
|
+
'\xde': 'Th', '\xfe': 'th',
|
|
4379
|
+
'\xdf': 'ss',
|
|
4380
|
+
// Latin Extended-A block.
|
|
4381
|
+
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
|
|
4382
|
+
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
|
|
4383
|
+
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
|
|
4384
|
+
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
|
|
4385
|
+
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
|
|
4386
|
+
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
|
|
4387
|
+
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
|
|
4388
|
+
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
|
|
4389
|
+
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
|
|
4390
|
+
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
|
|
4391
|
+
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
|
|
4392
|
+
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
|
|
4393
|
+
'\u0134': 'J', '\u0135': 'j',
|
|
4394
|
+
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
|
|
4395
|
+
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
|
|
4396
|
+
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
|
|
4397
|
+
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
|
|
4398
|
+
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
|
|
4399
|
+
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
|
|
4400
|
+
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
|
|
4401
|
+
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
|
|
4402
|
+
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
|
|
4403
|
+
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
|
|
4404
|
+
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
|
|
4405
|
+
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
|
|
4406
|
+
'\u0163': 't', '\u0165': 't', '\u0167': 't',
|
|
4407
|
+
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
|
|
4408
|
+
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
|
|
4409
|
+
'\u0174': 'W', '\u0175': 'w',
|
|
4410
|
+
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
|
|
4411
|
+
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
|
|
4412
|
+
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
|
4413
|
+
'\u0132': 'IJ', '\u0133': 'ij',
|
|
4414
|
+
'\u0152': 'Oe', '\u0153': 'oe',
|
|
4415
|
+
'\u0149': "'n", '\u017f': 'ss'
|
|
4416
|
+
};
|
|
4417
|
+
|
|
4418
|
+
/** Detect free variable `global` from Node.js. */
|
|
4419
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
4420
|
+
|
|
4421
|
+
/** Detect free variable `self`. */
|
|
4422
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
4423
|
+
|
|
4424
|
+
/** Used as a reference to the global object. */
|
|
4425
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
4426
|
+
|
|
4427
|
+
/**
|
|
4428
|
+
* A specialized version of `_.reduce` for arrays without support for
|
|
4429
|
+
* iteratee shorthands.
|
|
4430
|
+
*
|
|
4431
|
+
* @private
|
|
4432
|
+
* @param {Array} [array] The array to iterate over.
|
|
4433
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
4434
|
+
* @param {*} [accumulator] The initial value.
|
|
4435
|
+
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
4436
|
+
* the initial value.
|
|
4437
|
+
* @returns {*} Returns the accumulated value.
|
|
4438
|
+
*/
|
|
4439
|
+
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
4440
|
+
var index = -1,
|
|
4441
|
+
length = array ? array.length : 0;
|
|
4442
|
+
|
|
4443
|
+
if (initAccum && length) {
|
|
4444
|
+
accumulator = array[++index];
|
|
4445
|
+
}
|
|
4446
|
+
while (++index < length) {
|
|
4447
|
+
accumulator = iteratee(accumulator, array[index], index, array);
|
|
4448
|
+
}
|
|
4449
|
+
return accumulator;
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
/**
|
|
4453
|
+
* Splits an ASCII `string` into an array of its words.
|
|
4454
|
+
*
|
|
4455
|
+
* @private
|
|
4456
|
+
* @param {string} The string to inspect.
|
|
4457
|
+
* @returns {Array} Returns the words of `string`.
|
|
4458
|
+
*/
|
|
4459
|
+
function asciiWords(string) {
|
|
4460
|
+
return string.match(reAsciiWord) || [];
|
|
4461
|
+
}
|
|
4462
|
+
|
|
4463
|
+
/**
|
|
4464
|
+
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
4465
|
+
*
|
|
4466
|
+
* @private
|
|
4467
|
+
* @param {Object} object The object to query.
|
|
4468
|
+
* @returns {Function} Returns the new accessor function.
|
|
4469
|
+
*/
|
|
4470
|
+
function basePropertyOf(object) {
|
|
4471
|
+
return function(key) {
|
|
4472
|
+
return object == null ? undefined : object[key];
|
|
4473
|
+
};
|
|
4474
|
+
}
|
|
4475
|
+
|
|
4476
|
+
/**
|
|
4477
|
+
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
|
|
4478
|
+
* letters to basic Latin letters.
|
|
4479
|
+
*
|
|
4480
|
+
* @private
|
|
4481
|
+
* @param {string} letter The matched letter to deburr.
|
|
4482
|
+
* @returns {string} Returns the deburred letter.
|
|
4483
|
+
*/
|
|
4484
|
+
var deburrLetter = basePropertyOf(deburredLetters);
|
|
4485
|
+
|
|
4486
|
+
/**
|
|
4487
|
+
* Checks if `string` contains a word composed of Unicode symbols.
|
|
4488
|
+
*
|
|
4489
|
+
* @private
|
|
4490
|
+
* @param {string} string The string to inspect.
|
|
4491
|
+
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
|
4492
|
+
*/
|
|
4493
|
+
function hasUnicodeWord(string) {
|
|
4494
|
+
return reHasUnicodeWord.test(string);
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4497
|
+
/**
|
|
4498
|
+
* Splits a Unicode `string` into an array of its words.
|
|
4499
|
+
*
|
|
4500
|
+
* @private
|
|
4501
|
+
* @param {string} The string to inspect.
|
|
4502
|
+
* @returns {Array} Returns the words of `string`.
|
|
4503
|
+
*/
|
|
4504
|
+
function unicodeWords(string) {
|
|
4505
|
+
return string.match(reUnicodeWord) || [];
|
|
4506
|
+
}
|
|
4507
|
+
|
|
4508
|
+
/** Used for built-in method references. */
|
|
4509
|
+
var objectProto = Object.prototype;
|
|
4510
|
+
|
|
4511
|
+
/**
|
|
4512
|
+
* Used to resolve the
|
|
4513
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
4514
|
+
* of values.
|
|
4515
|
+
*/
|
|
4516
|
+
var objectToString = objectProto.toString;
|
|
4517
|
+
|
|
4518
|
+
/** Built-in value references. */
|
|
4519
|
+
var Symbol = root.Symbol;
|
|
4520
|
+
|
|
4521
|
+
/** Used to convert symbols to primitives and strings. */
|
|
4522
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
4523
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
4524
|
+
|
|
4525
|
+
/**
|
|
4526
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
4527
|
+
* values to empty strings.
|
|
4528
|
+
*
|
|
4529
|
+
* @private
|
|
4530
|
+
* @param {*} value The value to process.
|
|
4531
|
+
* @returns {string} Returns the string.
|
|
4532
|
+
*/
|
|
4533
|
+
function baseToString(value) {
|
|
4534
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
4535
|
+
if (typeof value == 'string') {
|
|
4536
|
+
return value;
|
|
4537
|
+
}
|
|
4538
|
+
if (isSymbol(value)) {
|
|
4539
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
4540
|
+
}
|
|
4541
|
+
var result = (value + '');
|
|
4542
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
4543
|
+
}
|
|
4544
|
+
|
|
4545
|
+
/**
|
|
4546
|
+
* Creates a function like `_.camelCase`.
|
|
4547
|
+
*
|
|
4548
|
+
* @private
|
|
4549
|
+
* @param {Function} callback The function to combine each word.
|
|
4550
|
+
* @returns {Function} Returns the new compounder function.
|
|
4551
|
+
*/
|
|
4552
|
+
function createCompounder(callback) {
|
|
4553
|
+
return function(string) {
|
|
4554
|
+
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
|
|
4555
|
+
};
|
|
4556
|
+
}
|
|
4557
|
+
|
|
4558
|
+
/**
|
|
4559
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
4560
|
+
* and has a `typeof` result of "object".
|
|
4561
|
+
*
|
|
4562
|
+
* @static
|
|
4563
|
+
* @memberOf _
|
|
4564
|
+
* @since 4.0.0
|
|
4565
|
+
* @category Lang
|
|
4566
|
+
* @param {*} value The value to check.
|
|
4567
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
4568
|
+
* @example
|
|
4569
|
+
*
|
|
4570
|
+
* _.isObjectLike({});
|
|
4571
|
+
* // => true
|
|
4572
|
+
*
|
|
4573
|
+
* _.isObjectLike([1, 2, 3]);
|
|
4574
|
+
* // => true
|
|
4575
|
+
*
|
|
4576
|
+
* _.isObjectLike(_.noop);
|
|
4577
|
+
* // => false
|
|
4578
|
+
*
|
|
4579
|
+
* _.isObjectLike(null);
|
|
4580
|
+
* // => false
|
|
4581
|
+
*/
|
|
4582
|
+
function isObjectLike(value) {
|
|
4583
|
+
return !!value && typeof value == 'object';
|
|
4584
|
+
}
|
|
4585
|
+
|
|
4586
|
+
/**
|
|
4587
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
4588
|
+
*
|
|
4589
|
+
* @static
|
|
4590
|
+
* @memberOf _
|
|
4591
|
+
* @since 4.0.0
|
|
4592
|
+
* @category Lang
|
|
4593
|
+
* @param {*} value The value to check.
|
|
4594
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
4595
|
+
* @example
|
|
4596
|
+
*
|
|
4597
|
+
* _.isSymbol(Symbol.iterator);
|
|
4598
|
+
* // => true
|
|
4599
|
+
*
|
|
4600
|
+
* _.isSymbol('abc');
|
|
4601
|
+
* // => false
|
|
4602
|
+
*/
|
|
4603
|
+
function isSymbol(value) {
|
|
4604
|
+
return typeof value == 'symbol' ||
|
|
4605
|
+
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
4606
|
+
}
|
|
4607
|
+
|
|
4608
|
+
/**
|
|
4609
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
4610
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
4611
|
+
*
|
|
4612
|
+
* @static
|
|
4613
|
+
* @memberOf _
|
|
4614
|
+
* @since 4.0.0
|
|
4615
|
+
* @category Lang
|
|
4616
|
+
* @param {*} value The value to process.
|
|
4617
|
+
* @returns {string} Returns the string.
|
|
4618
|
+
* @example
|
|
4619
|
+
*
|
|
4620
|
+
* _.toString(null);
|
|
4621
|
+
* // => ''
|
|
4622
|
+
*
|
|
4623
|
+
* _.toString(-0);
|
|
4624
|
+
* // => '-0'
|
|
4625
|
+
*
|
|
4626
|
+
* _.toString([1, 2, 3]);
|
|
4627
|
+
* // => '1,2,3'
|
|
4628
|
+
*/
|
|
4629
|
+
function toString(value) {
|
|
4630
|
+
return value == null ? '' : baseToString(value);
|
|
4631
|
+
}
|
|
4632
|
+
|
|
4633
|
+
/**
|
|
4634
|
+
* Deburrs `string` by converting
|
|
4635
|
+
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
|
4636
|
+
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
|
4637
|
+
* letters to basic Latin letters and removing
|
|
4638
|
+
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
|
4639
|
+
*
|
|
4640
|
+
* @static
|
|
4641
|
+
* @memberOf _
|
|
4642
|
+
* @since 3.0.0
|
|
4643
|
+
* @category String
|
|
4644
|
+
* @param {string} [string=''] The string to deburr.
|
|
4645
|
+
* @returns {string} Returns the deburred string.
|
|
4646
|
+
* @example
|
|
4647
|
+
*
|
|
4648
|
+
* _.deburr('déjà vu');
|
|
4649
|
+
* // => 'deja vu'
|
|
4650
|
+
*/
|
|
4651
|
+
function deburr(string) {
|
|
4652
|
+
string = toString(string);
|
|
4653
|
+
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
|
|
4654
|
+
}
|
|
4655
|
+
|
|
4656
|
+
/**
|
|
4657
|
+
* Converts `string` to
|
|
4658
|
+
* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
|
|
4659
|
+
*
|
|
4660
|
+
* @static
|
|
4661
|
+
* @memberOf _
|
|
4662
|
+
* @since 3.0.0
|
|
4663
|
+
* @category String
|
|
4664
|
+
* @param {string} [string=''] The string to convert.
|
|
4665
|
+
* @returns {string} Returns the kebab cased string.
|
|
4666
|
+
* @example
|
|
4667
|
+
*
|
|
4668
|
+
* _.kebabCase('Foo Bar');
|
|
4669
|
+
* // => 'foo-bar'
|
|
4670
|
+
*
|
|
4671
|
+
* _.kebabCase('fooBar');
|
|
4672
|
+
* // => 'foo-bar'
|
|
4673
|
+
*
|
|
4674
|
+
* _.kebabCase('__FOO_BAR__');
|
|
4675
|
+
* // => 'foo-bar'
|
|
4676
|
+
*/
|
|
4677
|
+
var kebabCase = createCompounder(function(result, word, index) {
|
|
4678
|
+
return result + (index ? '-' : '') + word.toLowerCase();
|
|
4679
|
+
});
|
|
4680
|
+
|
|
4681
|
+
/**
|
|
4682
|
+
* Splits `string` into an array of its words.
|
|
4683
|
+
*
|
|
4684
|
+
* @static
|
|
4685
|
+
* @memberOf _
|
|
4686
|
+
* @since 3.0.0
|
|
4687
|
+
* @category String
|
|
4688
|
+
* @param {string} [string=''] The string to inspect.
|
|
4689
|
+
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
4690
|
+
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
4691
|
+
* @returns {Array} Returns the words of `string`.
|
|
4692
|
+
* @example
|
|
4693
|
+
*
|
|
4694
|
+
* _.words('fred, barney, & pebbles');
|
|
4695
|
+
* // => ['fred', 'barney', 'pebbles']
|
|
4696
|
+
*
|
|
4697
|
+
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
|
4698
|
+
* // => ['fred', 'barney', '&', 'pebbles']
|
|
4699
|
+
*/
|
|
4700
|
+
function words(string, pattern, guard) {
|
|
4701
|
+
string = toString(string);
|
|
4702
|
+
pattern = guard ? undefined : pattern;
|
|
4703
|
+
|
|
4704
|
+
if (pattern === undefined) {
|
|
4705
|
+
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
|
|
4706
|
+
}
|
|
4707
|
+
return string.match(pattern) || [];
|
|
4708
|
+
}
|
|
4709
|
+
|
|
4710
|
+
var lodash_kebabcase = kebabCase;
|
|
4711
|
+
|
|
4712
|
+
var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
|
|
4713
|
+
var extendStatics = Object.setPrototypeOf ||
|
|
4714
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
4715
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4716
|
+
return function (d, b) {
|
|
4717
|
+
extendStatics(d, b);
|
|
4718
|
+
function __() { this.constructor = d; }
|
|
4719
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4720
|
+
};
|
|
4721
|
+
})();
|
|
4722
|
+
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) {
|
|
4723
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4724
|
+
s = arguments[i];
|
|
4725
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
4726
|
+
t[p] = s[p];
|
|
4727
|
+
}
|
|
4728
|
+
return t;
|
|
4729
|
+
};
|
|
4730
|
+
|
|
4731
|
+
|
|
4732
|
+
|
|
4733
|
+
|
|
4734
|
+
/**
|
|
4735
|
+
* Wraps an Angular component in React. Returns a new React component.
|
|
4736
|
+
*
|
|
4737
|
+
* Usage:
|
|
4738
|
+
*
|
|
4739
|
+
* ```ts
|
|
4740
|
+
* const Bar = { bindings: {...}, template: '...', ... }
|
|
4741
|
+
*
|
|
4742
|
+
* angular
|
|
4743
|
+
* .module('foo', [])
|
|
4744
|
+
* .component('bar', Bar)
|
|
4745
|
+
*
|
|
4746
|
+
* type Props = {
|
|
4747
|
+
* onChange(value: number): void
|
|
4748
|
+
* }
|
|
4749
|
+
*
|
|
4750
|
+
* const Bar = angular2react<Props>('bar', Bar, $compile)
|
|
4751
|
+
*
|
|
4752
|
+
* <Bar onChange={...} />
|
|
4753
|
+
* ```
|
|
4754
|
+
*/
|
|
4755
|
+
function angular2react(componentName, component, $injector) {
|
|
4756
|
+
if ($injector === void 0) { $injector = ngimport_1.$injector; }
|
|
4757
|
+
return /** @class */ (function (_super) {
|
|
4758
|
+
__extends(class_1, _super);
|
|
4759
|
+
function class_1() {
|
|
4760
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
4761
|
+
_this.state = {
|
|
4762
|
+
didInitialCompile: false
|
|
4763
|
+
};
|
|
4764
|
+
return _this;
|
|
4765
|
+
}
|
|
4766
|
+
class_1.prototype.componentWillMount = function () {
|
|
4767
|
+
this.setState({
|
|
4768
|
+
scope: Object.assign($injector.get('$rootScope').$new(true), { props: writable(this.props) })
|
|
4769
|
+
});
|
|
4770
|
+
};
|
|
4771
|
+
class_1.prototype.componentWillUnmount = function () {
|
|
4772
|
+
if (!this.state.scope) {
|
|
4773
|
+
return;
|
|
4774
|
+
}
|
|
4775
|
+
this.state.scope.$destroy();
|
|
4776
|
+
};
|
|
4777
|
+
class_1.prototype.shouldComponentUpdate = function () {
|
|
4778
|
+
return false;
|
|
4779
|
+
};
|
|
4780
|
+
// called only once to set up DOM, after componentWillMount
|
|
4781
|
+
class_1.prototype.render = function () {
|
|
4782
|
+
var bindings = {};
|
|
4783
|
+
if (component.bindings) {
|
|
4784
|
+
for (var binding in component.bindings) {
|
|
4785
|
+
bindings[lodash_kebabcase(binding)] = "props." + binding;
|
|
4786
|
+
}
|
|
4787
|
+
}
|
|
4788
|
+
return React.createElement(lodash_kebabcase(componentName), __assign({}, bindings, { ref: this.compile.bind(this) }));
|
|
4789
|
+
};
|
|
4790
|
+
// makes angular aware of changed props
|
|
4791
|
+
// if we're not inside a digest cycle, kicks off a digest cycle before setting.
|
|
4792
|
+
class_1.prototype.componentWillReceiveProps = function (props) {
|
|
4793
|
+
if (!this.state.scope) {
|
|
4794
|
+
return;
|
|
4795
|
+
}
|
|
4796
|
+
this.state.scope.props = writable(props);
|
|
4797
|
+
this.digest();
|
|
4798
|
+
};
|
|
4799
|
+
class_1.prototype.compile = function (element) {
|
|
4800
|
+
if (this.state.didInitialCompile || !this.state.scope) {
|
|
4801
|
+
return;
|
|
4802
|
+
}
|
|
4803
|
+
$injector.get('$compile')(element)(this.state.scope);
|
|
4804
|
+
this.digest();
|
|
4805
|
+
this.setState({ didInitialCompile: true });
|
|
4806
|
+
};
|
|
4807
|
+
class_1.prototype.digest = function () {
|
|
4808
|
+
if (!this.state.scope) {
|
|
4809
|
+
return;
|
|
4810
|
+
}
|
|
4811
|
+
try {
|
|
4812
|
+
this.state.scope.$digest();
|
|
4813
|
+
}
|
|
4814
|
+
catch (e) { }
|
|
4815
|
+
};
|
|
4816
|
+
return class_1;
|
|
4817
|
+
}(React.Component));
|
|
4818
|
+
}
|
|
4819
|
+
var angular2react_2 = angular2react;
|
|
4820
|
+
/**
|
|
4821
|
+
* Angular may try to bind back a value via 2-way binding, but React marks all
|
|
4822
|
+
* properties on `props` as non-configurable and non-writable.
|
|
4823
|
+
*
|
|
4824
|
+
* If we use a `Proxy` to intercept writes to these non-writable properties,
|
|
4825
|
+
* we run into an issue where the proxy throws when trying to write anyway,
|
|
4826
|
+
* even if we `return false`.
|
|
4827
|
+
*
|
|
4828
|
+
* Instead, we use the below ad-hoc proxy to catch writes to non-writable
|
|
4829
|
+
* properties in `object`, and log a helpful warning when it happens.
|
|
4830
|
+
*/
|
|
4831
|
+
function writable(object) {
|
|
4832
|
+
var _object = {};
|
|
4833
|
+
var _loop_1 = function (key) {
|
|
4834
|
+
if (object.hasOwnProperty(key)) {
|
|
4835
|
+
Object.defineProperty(_object, key, {
|
|
4836
|
+
get: function () { return object[key]; },
|
|
4837
|
+
set: function (value) {
|
|
4838
|
+
var d = Object.getOwnPropertyDescriptor(object, key);
|
|
4839
|
+
if (d && d.writable) {
|
|
4840
|
+
return object[key] = value;
|
|
4841
|
+
}
|
|
4842
|
+
else {
|
|
4843
|
+
console.warn("Tried to write to non-writable property \"" + key + "\" of", object, ". Consider using a callback instead of 2-way binding.");
|
|
4844
|
+
}
|
|
4845
|
+
}
|
|
4846
|
+
});
|
|
4847
|
+
}
|
|
4848
|
+
};
|
|
4849
|
+
for (var key in object) {
|
|
4850
|
+
_loop_1(key);
|
|
4851
|
+
}
|
|
4852
|
+
return _object;
|
|
4853
|
+
}
|
|
4854
|
+
|
|
4855
|
+
class KubernetesReactInject extends ReactInject {
|
|
4856
|
+
constructor() {
|
|
4857
|
+
super(...arguments);
|
|
4858
|
+
this.$injectorProxy = {};
|
|
4859
|
+
this.KubernetesAnnotationCustomSections = angular2react_2("kubernetesAnnotationCustomSections", kubernetesAnnotationCustomSectionsComponent, this.$injectorProxy);
|
|
4860
|
+
}
|
|
4861
|
+
initialize($injector) {
|
|
4862
|
+
const realInjector = $injector;
|
|
4863
|
+
const proxyInjector = this.$injectorProxy;
|
|
4864
|
+
Object.keys($injector).filter((key) => typeof realInjector[key] === "function").forEach((key) => proxyInjector[key] = realInjector[key].bind(realInjector));
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4867
|
+
const KubernetesReactInjector = new KubernetesReactInject();
|
|
4868
|
+
|
|
4869
|
+
const KUBERNETES_REACT_MODULE = "spinnaker.kubernetes.react";
|
|
4870
|
+
module(KUBERNETES_REACT_MODULE, []).run([
|
|
4871
|
+
"$injector",
|
|
4872
|
+
function($injector) {
|
|
4873
|
+
KubernetesReactInjector.initialize($injector);
|
|
4874
|
+
}
|
|
4875
|
+
]);
|
|
4876
|
+
|
|
4319
4877
|
class KubernetesResourceDetails extends React.Component {
|
|
4320
4878
|
constructor(props) {
|
|
4321
4879
|
super(props);
|
|
@@ -4571,6 +5129,10 @@ KubernetesV2SecurityGroupTransformer.$inject = ["$q"];
|
|
|
4571
5129
|
const KUBERNETES_SECURITY_GROUP_TRANSFORMER = "spinnaker.kubernetes.securityGroupTransformer";
|
|
4572
5130
|
module(KUBERNETES_SECURITY_GROUP_TRANSFORMER, []).service("kubernetesV2SecurityGroupTransformer", KubernetesV2SecurityGroupTransformer);
|
|
4573
5131
|
|
|
5132
|
+
function ManifestArtifact({ artifact }) {
|
|
5133
|
+
return /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("b", null, artifact.type, "\xA0"), /* @__PURE__ */ React.createElement("i", null, artifact.reference));
|
|
5134
|
+
}
|
|
5135
|
+
|
|
4574
5136
|
const _ManifestTrafficService = class {
|
|
4575
5137
|
};
|
|
4576
5138
|
let ManifestTrafficService = _ManifestTrafficService;
|
|
@@ -4622,145 +5184,133 @@ ManifestTrafficService.isManaged = (serverGroup) => {
|
|
|
4622
5184
|
return serverGroup.serverGroupManagers && serverGroup.serverGroupManagers.length > 0;
|
|
4623
5185
|
};
|
|
4624
5186
|
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
this.$state = $state;
|
|
4631
|
-
this.$q = $q;
|
|
4632
|
-
this.state = { loading: true };
|
|
4633
|
-
this.canDisable = () => ManifestTrafficService.canDisableServerGroup(this.serverGroup);
|
|
4634
|
-
this.disableServerGroup = () => {
|
|
4635
|
-
ConfirmationModalService.confirm({
|
|
4636
|
-
header: `Really disable ${this.manifest.name}?`,
|
|
4637
|
-
buttonText: "Disable",
|
|
4638
|
-
askForReason: true,
|
|
4639
|
-
submitJustWithReason: true,
|
|
4640
|
-
submitMethod: ({ reason }) => ManifestTrafficService.disable(this.manifest, this.app, reason),
|
|
4641
|
-
taskMonitorConfig: {
|
|
4642
|
-
application: this.app,
|
|
4643
|
-
title: `Disabling ${this.manifest.name}`,
|
|
4644
|
-
onTaskComplete: () => this.app.getDataSource("serverGroups").refresh()
|
|
4645
|
-
}
|
|
4646
|
-
});
|
|
4647
|
-
};
|
|
4648
|
-
this.canEnable = () => ManifestTrafficService.canEnableServerGroup(this.serverGroup);
|
|
4649
|
-
this.enableServerGroup = () => {
|
|
4650
|
-
ConfirmationModalService.confirm({
|
|
4651
|
-
header: `Really enable ${this.manifest.name}?`,
|
|
4652
|
-
buttonText: "Enable",
|
|
4653
|
-
askForReason: true,
|
|
4654
|
-
submitJustWithReason: true,
|
|
4655
|
-
submitMethod: ({ reason }) => ManifestTrafficService.enable(this.manifest, this.app, reason),
|
|
4656
|
-
taskMonitorConfig: {
|
|
4657
|
-
application: this.app,
|
|
4658
|
-
title: `Enabling ${this.manifest.name}`,
|
|
4659
|
-
onTaskComplete: () => this.app.getDataSource("serverGroups").refresh()
|
|
4660
|
-
}
|
|
4661
|
-
});
|
|
4662
|
-
};
|
|
4663
|
-
const dataSource = this.app.getDataSource("serverGroups");
|
|
4664
|
-
dataSource.ready().then(() => {
|
|
4665
|
-
this.extractServerGroup(serverGroup);
|
|
4666
|
-
this.$scope.isDisabled = !SETTINGS.kubernetesAdHocInfraWritesEnabled;
|
|
4667
|
-
dataSource.onRefresh(this.$scope, () => this.extractServerGroup(serverGroup));
|
|
4668
|
-
}).catch(() => this.autoClose());
|
|
4669
|
-
}
|
|
4670
|
-
ownerReferences() {
|
|
4671
|
-
const manifest = this.manifest.manifest;
|
|
4672
|
-
if (manifest != null && manifest.hasOwnProperty("metadata") && manifest.metadata.hasOwnProperty("ownerReferences") && Array.isArray(manifest.metadata.ownerReferences)) {
|
|
4673
|
-
return manifest.metadata.ownerReferences;
|
|
5187
|
+
function useManifest({ manifest }) {
|
|
5188
|
+
const ownerReferences = () => {
|
|
5189
|
+
const manifestRaw = manifest.manifest;
|
|
5190
|
+
if (manifestRaw != null && manifestRaw.hasOwnProperty("metadata") && manifestRaw.metadata.hasOwnProperty("ownerReferences") && Array.isArray(manifestRaw.metadata.ownerReferences)) {
|
|
5191
|
+
return manifestRaw.metadata.ownerReferences;
|
|
4674
5192
|
} else {
|
|
4675
5193
|
return [];
|
|
4676
5194
|
}
|
|
4677
|
-
}
|
|
4678
|
-
ownerIsController(ownerReference) {
|
|
5195
|
+
};
|
|
5196
|
+
const ownerIsController = (ownerReference) => {
|
|
4679
5197
|
return ownerReference.hasOwnProperty("controller") && ownerReference.controller === true;
|
|
4680
|
-
}
|
|
4681
|
-
lowerCaseFirstLetter(s) {
|
|
5198
|
+
};
|
|
5199
|
+
const lowerCaseFirstLetter = (s) => {
|
|
4682
5200
|
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
4683
|
-
}
|
|
4684
|
-
manifestController() {
|
|
4685
|
-
const controller =
|
|
5201
|
+
};
|
|
5202
|
+
const manifestController = () => {
|
|
5203
|
+
const controller = ownerReferences().find(ownerIsController);
|
|
4686
5204
|
if (typeof controller === "undefined") {
|
|
4687
5205
|
return null;
|
|
4688
5206
|
} else {
|
|
4689
|
-
return
|
|
5207
|
+
return lowerCaseFirstLetter(controller.kind) + " " + controller.name;
|
|
4690
5208
|
}
|
|
4691
|
-
}
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
}
|
|
4695
|
-
|
|
4696
|
-
|
|
5209
|
+
};
|
|
5210
|
+
return {
|
|
5211
|
+
manifestController: manifestController()
|
|
5212
|
+
};
|
|
5213
|
+
}
|
|
5214
|
+
|
|
5215
|
+
function KubernetesServerGroupActions({ app, serverGroup }) {
|
|
5216
|
+
const showEntityTags = SETTINGS.feature && SETTINGS.feature.entityTags;
|
|
5217
|
+
const entityTagTargets = ClusterTargetBuilder.buildClusterTargets(serverGroup);
|
|
5218
|
+
const { manifest } = serverGroup;
|
|
5219
|
+
const { manifestController } = useManifest({ manifest });
|
|
5220
|
+
const canScaleServerGroup = () => {
|
|
5221
|
+
return serverGroup.kind !== "daemonSet" && manifestController === null;
|
|
5222
|
+
};
|
|
5223
|
+
const scaleServerGroup = () => {
|
|
5224
|
+
ModalInjector.modalService.open({
|
|
4697
5225
|
templateUrl: "kubernetes/src/manifest/scale/scale.html",
|
|
4698
|
-
controller: "kubernetesV2ManifestScaleCtrl",
|
|
4699
|
-
controllerAs: "ctrl",
|
|
5226
|
+
controller: "kubernetesV2ManifestScaleCtrl as ctrl",
|
|
4700
5227
|
resolve: {
|
|
4701
5228
|
coordinates: {
|
|
4702
|
-
name:
|
|
4703
|
-
namespace:
|
|
4704
|
-
account:
|
|
5229
|
+
name: serverGroup.name,
|
|
5230
|
+
namespace: serverGroup.namespace,
|
|
5231
|
+
account: serverGroup.account
|
|
4705
5232
|
},
|
|
4706
|
-
currentReplicas:
|
|
4707
|
-
application:
|
|
5233
|
+
currentReplicas: manifest.manifest.spec.replicas,
|
|
5234
|
+
application: app
|
|
4708
5235
|
}
|
|
4709
5236
|
});
|
|
4710
|
-
}
|
|
4711
|
-
canEditServerGroup() {
|
|
4712
|
-
return
|
|
4713
|
-
}
|
|
4714
|
-
editServerGroup() {
|
|
4715
|
-
KubernetesManifestCommandBuilder.buildNewManifestCommand(
|
|
4716
|
-
ManifestWizard.show({ title: "Edit Manifest", application:
|
|
5237
|
+
};
|
|
5238
|
+
const canEditServerGroup = () => {
|
|
5239
|
+
return manifestController === null;
|
|
5240
|
+
};
|
|
5241
|
+
const editServerGroup = () => {
|
|
5242
|
+
KubernetesManifestCommandBuilder.buildNewManifestCommand(app, manifest.manifest, serverGroup.moniker, serverGroup.account).then((builtCommand) => {
|
|
5243
|
+
ManifestWizard.show({ title: "Edit Manifest", application: app, command: builtCommand });
|
|
4717
5244
|
});
|
|
4718
|
-
}
|
|
4719
|
-
deleteServerGroup() {
|
|
4720
|
-
|
|
5245
|
+
};
|
|
5246
|
+
const deleteServerGroup = () => {
|
|
5247
|
+
ModalInjector.modalService.open({
|
|
4721
5248
|
templateUrl: "kubernetes/src/manifest/delete/delete.html",
|
|
4722
|
-
controller: "kubernetesV2ManifestDeleteCtrl",
|
|
4723
|
-
controllerAs: "ctrl",
|
|
5249
|
+
controller: "kubernetesV2ManifestDeleteCtrl as ctrl",
|
|
4724
5250
|
resolve: {
|
|
4725
5251
|
coordinates: {
|
|
4726
|
-
name:
|
|
4727
|
-
namespace:
|
|
4728
|
-
account:
|
|
5252
|
+
name: serverGroup.name,
|
|
5253
|
+
namespace: serverGroup.namespace,
|
|
5254
|
+
account: serverGroup.account
|
|
4729
5255
|
},
|
|
4730
|
-
manifestController: () =>
|
|
4731
|
-
application:
|
|
5256
|
+
manifestController: () => manifestController,
|
|
5257
|
+
application: app
|
|
4732
5258
|
}
|
|
4733
5259
|
});
|
|
4734
|
-
}
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
]).then(([serverGroupDetails, manifest]) => {
|
|
4748
|
-
if (!serverGroupDetails) {
|
|
4749
|
-
return this.autoClose();
|
|
5260
|
+
};
|
|
5261
|
+
const canDisable = () => ManifestTrafficService.canDisableServerGroup(serverGroup);
|
|
5262
|
+
const disableServerGroup = () => {
|
|
5263
|
+
ConfirmationModalService.confirm({
|
|
5264
|
+
header: `Really disable ${manifest.name}?`,
|
|
5265
|
+
buttonText: "Disable",
|
|
5266
|
+
askForReason: true,
|
|
5267
|
+
submitJustWithReason: true,
|
|
5268
|
+
submitMethod: ({ reason }) => ManifestTrafficService.disable(manifest, app, reason),
|
|
5269
|
+
taskMonitorConfig: {
|
|
5270
|
+
application: app,
|
|
5271
|
+
title: `Disabling ${manifest.name}`,
|
|
5272
|
+
onTaskComplete: () => app.getDataSource("serverGroups").refresh()
|
|
4750
5273
|
}
|
|
4751
|
-
this.serverGroup = serverGroupDetails;
|
|
4752
|
-
this.entityTagTargets = this.configureEntityTagTargets();
|
|
4753
|
-
this.manifest = manifest;
|
|
4754
|
-
this.state.loading = false;
|
|
4755
5274
|
});
|
|
4756
|
-
}
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
5275
|
+
};
|
|
5276
|
+
const canEnable = () => ManifestTrafficService.canEnableServerGroup(serverGroup);
|
|
5277
|
+
const enableServerGroup = () => {
|
|
5278
|
+
ConfirmationModalService.confirm({
|
|
5279
|
+
header: `Really enable ${manifest.name}?`,
|
|
5280
|
+
buttonText: "Enable",
|
|
5281
|
+
askForReason: true,
|
|
5282
|
+
submitJustWithReason: true,
|
|
5283
|
+
submitMethod: ({ reason }) => ManifestTrafficService.enable(manifest, app, reason),
|
|
5284
|
+
taskMonitorConfig: {
|
|
5285
|
+
application: app,
|
|
5286
|
+
title: `Enabling ${manifest.name}`,
|
|
5287
|
+
onTaskComplete: () => app.getDataSource("serverGroups").refresh()
|
|
5288
|
+
}
|
|
5289
|
+
});
|
|
5290
|
+
};
|
|
5291
|
+
return /* @__PURE__ */ React.createElement(Dropdown, {
|
|
5292
|
+
className: "dropdown",
|
|
5293
|
+
id: "server-group-actions-dropdown"
|
|
5294
|
+
}, /* @__PURE__ */ React.createElement(Dropdown.Toggle, {
|
|
5295
|
+
className: "btn btn-sm btn-primary dropdown-toggle"
|
|
5296
|
+
}, robotToHuman(serverGroup.kind), " Actions"), /* @__PURE__ */ React.createElement(Dropdown.Menu, null, canEditServerGroup() && /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5297
|
+
onClick: editServerGroup
|
|
5298
|
+
}, "Edit"), canScaleServerGroup() && /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5299
|
+
onClick: scaleServerGroup
|
|
5300
|
+
}, "Scale"), canEnable() && /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5301
|
+
onClick: enableServerGroup
|
|
5302
|
+
}, "Enable"), canDisable() && /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5303
|
+
onClick: disableServerGroup
|
|
5304
|
+
}, "Disable"), /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5305
|
+
onClick: deleteServerGroup
|
|
5306
|
+
}, "Delete"), showEntityTags && /* @__PURE__ */ React.createElement(AddEntityTagLinks, {
|
|
5307
|
+
component: serverGroup,
|
|
5308
|
+
application: app,
|
|
5309
|
+
entityType: "serverGroup",
|
|
5310
|
+
ownerOptions: entityTagTargets,
|
|
5311
|
+
onUpdate: () => app.serverGroups.refresh()
|
|
5312
|
+
})));
|
|
4760
5313
|
}
|
|
4761
|
-
KubernetesServerGroupDetailsController.$inject = ["serverGroup", "app", "$uibModal", "$scope", "$state", "$q"];
|
|
4762
|
-
const KUBERNETES_SERVER_GROUP_DETAILS_CTRL = "spinnaker.kubernetes.serverGroup.details.controller";
|
|
4763
|
-
module(KUBERNETES_SERVER_GROUP_DETAILS_CTRL, [SERVER_GROUP_WRITER]).controller("kubernetesV2ServerGroupDetailsCtrl", KubernetesServerGroupDetailsController);
|
|
4764
5314
|
window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
4765
5315
|
templateCache.put("kubernetes/src/manifest/scale/scale.html", `<div modal-page class="confirmation-modal">
|
|
4766
5316
|
<task-monitor monitor="ctrl.taskMonitor"></task-monitor>
|
|
@@ -4842,57 +5392,146 @@ window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
|
4842
5392
|
`);
|
|
4843
5393
|
}]);
|
|
4844
5394
|
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
this.application = application;
|
|
4851
|
-
this.verification = {
|
|
4852
|
-
verified: false
|
|
4853
|
-
};
|
|
4854
|
-
this.taskMonitor = new TaskMonitor({
|
|
4855
|
-
title: `Resizing ${this.serverGroup.name}`,
|
|
4856
|
-
application,
|
|
4857
|
-
modalInstance: $uibModalInstance
|
|
4858
|
-
});
|
|
4859
|
-
this.current = this.serverGroup.capacity;
|
|
4860
|
-
this.command = {
|
|
4861
|
-
capacity: copy(this.current),
|
|
4862
|
-
reason: null
|
|
4863
|
-
};
|
|
4864
|
-
}
|
|
4865
|
-
isValid() {
|
|
4866
|
-
return this.verification.verified && this.command.capacity.desired >= 0 && !equals(this.command.capacity, this.current);
|
|
4867
|
-
}
|
|
4868
|
-
cancel() {
|
|
4869
|
-
this.$uibModalInstance.dismiss();
|
|
4870
|
-
}
|
|
4871
|
-
resize() {
|
|
4872
|
-
this.taskMonitor.submit(() => {
|
|
4873
|
-
const payload = {
|
|
4874
|
-
capacity: this.command.capacity,
|
|
4875
|
-
serverGroupName: this.serverGroup.name,
|
|
4876
|
-
account: this.serverGroup.account,
|
|
4877
|
-
region: this.serverGroup.region,
|
|
4878
|
-
interestingHealthProviderNames: ["KubernetesPod"],
|
|
4879
|
-
reason: this.command.reason
|
|
4880
|
-
};
|
|
4881
|
-
return this.serverGroupWriter.resizeServerGroup(this.serverGroup, this.application, payload);
|
|
5395
|
+
function extractServerGroupSummary(props) {
|
|
5396
|
+
const { app, serverGroup } = props;
|
|
5397
|
+
return app.ready().then(() => {
|
|
5398
|
+
let summary = app.serverGroups.data.find((toCheck) => {
|
|
5399
|
+
return toCheck.name === serverGroup.name && toCheck.account === serverGroup.accountId && toCheck.region === serverGroup.region;
|
|
4882
5400
|
});
|
|
4883
|
-
|
|
5401
|
+
if (!summary) {
|
|
5402
|
+
app.loadBalancers.data.some((loadBalancer) => {
|
|
5403
|
+
if (loadBalancer.account === serverGroup.accountId && loadBalancer.region === serverGroup.region) {
|
|
5404
|
+
return loadBalancer.serverGroups.some((possibleServerGroup) => {
|
|
5405
|
+
if (possibleServerGroup.name === serverGroup.name) {
|
|
5406
|
+
summary = possibleServerGroup;
|
|
5407
|
+
return true;
|
|
5408
|
+
}
|
|
5409
|
+
return false;
|
|
5410
|
+
});
|
|
5411
|
+
}
|
|
5412
|
+
return false;
|
|
5413
|
+
});
|
|
5414
|
+
}
|
|
5415
|
+
return summary;
|
|
5416
|
+
});
|
|
5417
|
+
}
|
|
5418
|
+
function kubernetesServerGroupDetailsGetter(props, autoClose) {
|
|
5419
|
+
const { app, serverGroup: serverGroupInfo } = props;
|
|
5420
|
+
return new Observable((observer) => {
|
|
5421
|
+
extractServerGroupSummary(props).then((summary) => {
|
|
5422
|
+
Promise.all([
|
|
5423
|
+
ServerGroupReader.getServerGroup(app.name, serverGroupInfo.accountId, serverGroupInfo.region, serverGroupInfo.name),
|
|
5424
|
+
ManifestReader.getManifest(serverGroupInfo.accountId, serverGroupInfo.region, serverGroupInfo.name)
|
|
5425
|
+
]).then(([serverGroup, manifest]) => {
|
|
5426
|
+
Object.assign(serverGroup, summary, { account: serverGroupInfo.accountId });
|
|
5427
|
+
serverGroup.manifest = manifest;
|
|
5428
|
+
if (!isEmpty(serverGroup)) {
|
|
5429
|
+
observer.next(serverGroup);
|
|
5430
|
+
} else {
|
|
5431
|
+
autoClose();
|
|
5432
|
+
}
|
|
5433
|
+
}, autoClose);
|
|
5434
|
+
}, autoClose);
|
|
5435
|
+
});
|
|
5436
|
+
}
|
|
5437
|
+
|
|
5438
|
+
function ServerGroupAnnotationCustomSection({ serverGroup }) {
|
|
5439
|
+
const { manifest } = serverGroup;
|
|
5440
|
+
const { KubernetesAnnotationCustomSections } = KubernetesReactInjector;
|
|
5441
|
+
return /* @__PURE__ */ React.createElement(KubernetesAnnotationCustomSections, {
|
|
5442
|
+
manifest: manifest.manifest,
|
|
5443
|
+
resource: serverGroup
|
|
5444
|
+
});
|
|
5445
|
+
}
|
|
5446
|
+
|
|
5447
|
+
function ServerGroupEventsSection({ serverGroup }) {
|
|
5448
|
+
const { manifest } = serverGroup;
|
|
5449
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5450
|
+
heading: "Events",
|
|
5451
|
+
defaultExpanded: true
|
|
5452
|
+
}, /* @__PURE__ */ React.createElement(ManifestEvents, {
|
|
5453
|
+
manifest
|
|
5454
|
+
}));
|
|
5455
|
+
}
|
|
5456
|
+
|
|
5457
|
+
function ServerGroupHealthSection({ serverGroup }) {
|
|
5458
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5459
|
+
heading: "Health",
|
|
5460
|
+
defaultExpanded: true
|
|
5461
|
+
}, serverGroup && /* @__PURE__ */ React.createElement("dl", {
|
|
5462
|
+
className: "dl-horizontal dl-narrow"
|
|
5463
|
+
}, /* @__PURE__ */ React.createElement("dt", null, "Instances"), /* @__PURE__ */ React.createElement("dd", null, /* @__PURE__ */ React.createElement(HealthCounts, {
|
|
5464
|
+
container: serverGroup.instanceCounts,
|
|
5465
|
+
className: "pull-left"
|
|
5466
|
+
}))));
|
|
5467
|
+
}
|
|
5468
|
+
|
|
5469
|
+
function ServerGroupImagesSection({ serverGroup }) {
|
|
5470
|
+
const { manifest } = serverGroup;
|
|
5471
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5472
|
+
heading: "Images",
|
|
5473
|
+
defaultExpanded: true
|
|
5474
|
+
}, /* @__PURE__ */ React.createElement(ManifestImageDetails, {
|
|
5475
|
+
manifest: manifest.manifest
|
|
5476
|
+
}));
|
|
5477
|
+
}
|
|
5478
|
+
|
|
5479
|
+
function ServerGroupInformationSection({ serverGroup }) {
|
|
5480
|
+
const { manifest } = serverGroup;
|
|
5481
|
+
const { manifestController } = useManifest({ manifest });
|
|
5482
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5483
|
+
heading: "Information",
|
|
5484
|
+
defaultExpanded: true
|
|
5485
|
+
}, /* @__PURE__ */ React.createElement("dl", {
|
|
5486
|
+
className: "dl-horizontal dl-narrow"
|
|
5487
|
+
}, /* @__PURE__ */ React.createElement("dt", null, "Created"), /* @__PURE__ */ React.createElement("dd", null, timestamp(serverGroup.createdTime)), /* @__PURE__ */ React.createElement("dt", null, "Account"), /* @__PURE__ */ React.createElement("dd", null, /* @__PURE__ */ React.createElement(AccountTag, {
|
|
5488
|
+
account: serverGroup.account
|
|
5489
|
+
})), /* @__PURE__ */ React.createElement("dt", null, "Namespace"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.namespace), /* @__PURE__ */ React.createElement("dt", null, "Kind"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.kind), manifestController && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("dt", null, "Controller"), /* @__PURE__ */ React.createElement(UISref, {
|
|
5490
|
+
to: "^.serverGroupManager",
|
|
5491
|
+
params: {
|
|
5492
|
+
accountId: serverGroup.account,
|
|
5493
|
+
region: serverGroup.region,
|
|
5494
|
+
serverGroupManager: manifestController,
|
|
5495
|
+
provider: "kubernetes"
|
|
5496
|
+
}
|
|
5497
|
+
}, /* @__PURE__ */ React.createElement("a", null, /* @__PURE__ */ React.createElement("dd", null, robotToHuman(manifestController)))))));
|
|
5498
|
+
}
|
|
5499
|
+
|
|
5500
|
+
function ServerGroupLabelsSection({ serverGroup }) {
|
|
5501
|
+
const { manifest } = serverGroup;
|
|
5502
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5503
|
+
heading: "Labels",
|
|
5504
|
+
defaultExpanded: true
|
|
5505
|
+
}, /* @__PURE__ */ React.createElement(ManifestLabels, {
|
|
5506
|
+
manifest: manifest.manifest
|
|
5507
|
+
}));
|
|
5508
|
+
}
|
|
5509
|
+
|
|
5510
|
+
function ServerGroupManifestStatusSection({ serverGroup }) {
|
|
5511
|
+
const { manifest } = serverGroup;
|
|
5512
|
+
return /* @__PURE__ */ React.createElement(ManifestStatus$1, {
|
|
5513
|
+
status: manifest.status
|
|
5514
|
+
});
|
|
5515
|
+
}
|
|
5516
|
+
|
|
5517
|
+
function ServerGroupSizeSection({ serverGroup }) {
|
|
5518
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5519
|
+
heading: "Size",
|
|
5520
|
+
defaultExpanded: true
|
|
5521
|
+
}, serverGroup.capacity.min == null && /* @__PURE__ */ React.createElement("dl", {
|
|
5522
|
+
className: "dl-horizontal dl-narrow"
|
|
5523
|
+
}, /* @__PURE__ */ React.createElement("dt", null, "Current"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.instances.length)), serverGroup.capacity.min != null && serverGroup.capacity.min === serverGroup.capacity.max && /* @__PURE__ */ React.createElement("dl", {
|
|
5524
|
+
className: "dl-horizontal dl-narrow"
|
|
5525
|
+
}, /* @__PURE__ */ React.createElement("dt", null, "Min/Max"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.capacity.min), /* @__PURE__ */ React.createElement("dt", null, "Current"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.instances.length)), serverGroup.capacity.min !== serverGroup.capacity.max && /* @__PURE__ */ React.createElement("dl", {
|
|
5526
|
+
className: "dl-horizontal dl-narrow"
|
|
5527
|
+
}, /* @__PURE__ */ React.createElement("dt", null, "Min"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.capacity.min), /* @__PURE__ */ React.createElement("dt", null, "Max"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.capacity.max), /* @__PURE__ */ React.createElement("dt", null, "Current"), /* @__PURE__ */ React.createElement("dd", null, serverGroup.instances.length)));
|
|
4884
5528
|
}
|
|
4885
|
-
KubernetesServerGroupResizeController.$inject = ["serverGroup", "$uibModalInstance", "serverGroupWriter", "application"];
|
|
4886
|
-
const KUBERNETES_SERVER_GROUP_RESIZE_CTRL = "spinnaker.kubernetes.serverGroup.details.resize.controller";
|
|
4887
|
-
module(KUBERNETES_SERVER_GROUP_RESIZE_CTRL, [SERVER_GROUP_WRITER]).controller("kubernetesV2ServerGroupResizeCtrl", KubernetesServerGroupResizeController);
|
|
4888
5529
|
|
|
4889
5530
|
class KubernetesV2ServerGroupCommandBuilder {
|
|
4890
5531
|
buildNewServerGroupCommand(app) {
|
|
4891
5532
|
return KubernetesManifestCommandBuilder.buildNewManifestCommand(app);
|
|
4892
5533
|
}
|
|
4893
5534
|
}
|
|
4894
|
-
const KUBERNETES_SERVER_GROUP_COMMAND_BUILDER = "spinnaker.kubernetes.serverGroup.commandBuilder.service";
|
|
4895
|
-
module(KUBERNETES_SERVER_GROUP_COMMAND_BUILDER, []).service("kubernetesV2ServerGroupCommandBuilder", KubernetesV2ServerGroupCommandBuilder);
|
|
4896
5535
|
|
|
4897
5536
|
class KubernetesV2ServerGroupTransformer {
|
|
4898
5537
|
normalizeServerGroup(serverGroup, application) {
|
|
@@ -4907,143 +5546,160 @@ class KubernetesV2ServerGroupTransformer {
|
|
|
4907
5546
|
});
|
|
4908
5547
|
}
|
|
4909
5548
|
}
|
|
4910
|
-
const KUBERNETES_SERVER_GROUP_TRANSFORMER = "spinnaker.kubernetes.serverGroup.transformer.service";
|
|
4911
|
-
module(KUBERNETES_SERVER_GROUP_TRANSFORMER, []).service("kubernetesV2ServerGroupTransformer", KubernetesV2ServerGroupTransformer);
|
|
4912
5549
|
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
5550
|
+
function RollingRestart({ application, serverGroupManager }) {
|
|
5551
|
+
function rollingRestart() {
|
|
5552
|
+
const rollingRestartParameters = {
|
|
5553
|
+
account: serverGroupManager.account,
|
|
5554
|
+
cloudProvider: "kubernetes",
|
|
5555
|
+
location: serverGroupManager.namespace,
|
|
5556
|
+
manifestName: serverGroupManager.name
|
|
5557
|
+
};
|
|
5558
|
+
ConfirmationModalService.confirm({
|
|
5559
|
+
account: serverGroupManager.account,
|
|
5560
|
+
askForReason: true,
|
|
5561
|
+
header: `Initiate rolling restart of ${serverGroupManager.name}`,
|
|
5562
|
+
submitMethod: () => {
|
|
5563
|
+
return ManifestWriter.rollingRestartManifest(rollingRestartParameters, application);
|
|
5564
|
+
},
|
|
5565
|
+
taskMonitorConfig: {
|
|
5566
|
+
application,
|
|
5567
|
+
title: `Rolling restart of ${serverGroupManager.name}`
|
|
5568
|
+
}
|
|
5569
|
+
});
|
|
5570
|
+
}
|
|
5571
|
+
return /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("a", {
|
|
5572
|
+
onClick: rollingRestart
|
|
5573
|
+
}, "Rolling Restart"));
|
|
5574
|
+
}
|
|
5575
|
+
|
|
5576
|
+
function ServerGroupManagerActions({
|
|
5577
|
+
application,
|
|
5578
|
+
serverGroupManager,
|
|
5579
|
+
manifest
|
|
5580
|
+
}) {
|
|
5581
|
+
const isEnabled = SETTINGS.kubernetesAdHocInfraWritesEnabled;
|
|
5582
|
+
const entityTagTargets = ClusterTargetBuilder.buildManagerClusterTargets(serverGroupManager);
|
|
5583
|
+
const pauseRolloutServerGroupManager = () => {
|
|
5584
|
+
ModalInjector.modalService.open({
|
|
5585
|
+
templateUrl: "kubernetes/src/manifest/rollout/pause.html",
|
|
5586
|
+
controller: "kubernetesV2ManifestPauseRolloutCtrl as ctrl",
|
|
4933
5587
|
resolve: {
|
|
4934
5588
|
coordinates: {
|
|
4935
|
-
name:
|
|
4936
|
-
namespace:
|
|
4937
|
-
account:
|
|
5589
|
+
name: serverGroupManager.name,
|
|
5590
|
+
namespace: serverGroupManager.namespace,
|
|
5591
|
+
account: serverGroupManager.account
|
|
4938
5592
|
},
|
|
4939
|
-
application
|
|
5593
|
+
application
|
|
4940
5594
|
}
|
|
4941
5595
|
});
|
|
4942
|
-
}
|
|
4943
|
-
resumeRolloutServerGroupManager() {
|
|
4944
|
-
|
|
5596
|
+
};
|
|
5597
|
+
const resumeRolloutServerGroupManager = () => {
|
|
5598
|
+
ModalInjector.modalService.open({
|
|
4945
5599
|
templateUrl: "kubernetes/src/manifest/rollout/resume.html",
|
|
4946
|
-
controller: "kubernetesV2ManifestResumeRolloutCtrl",
|
|
4947
|
-
controllerAs: "ctrl",
|
|
5600
|
+
controller: "kubernetesV2ManifestResumeRolloutCtrl as ctrl",
|
|
4948
5601
|
resolve: {
|
|
4949
5602
|
coordinates: {
|
|
4950
|
-
name:
|
|
4951
|
-
namespace:
|
|
4952
|
-
account:
|
|
5603
|
+
name: serverGroupManager.name,
|
|
5604
|
+
namespace: serverGroupManager.namespace,
|
|
5605
|
+
account: serverGroupManager.account
|
|
4953
5606
|
},
|
|
4954
|
-
application
|
|
5607
|
+
application
|
|
4955
5608
|
}
|
|
4956
5609
|
});
|
|
4957
|
-
}
|
|
4958
|
-
canUndoRolloutServerGroupManager() {
|
|
4959
|
-
return
|
|
4960
|
-
}
|
|
4961
|
-
undoRolloutServerGroupManager() {
|
|
4962
|
-
|
|
5610
|
+
};
|
|
5611
|
+
const canUndoRolloutServerGroupManager = () => {
|
|
5612
|
+
return serverGroupManager && serverGroupManager.serverGroups && serverGroupManager.serverGroups.length > 0;
|
|
5613
|
+
};
|
|
5614
|
+
const undoRolloutServerGroupManager = () => {
|
|
5615
|
+
ModalInjector.modalService.open({
|
|
4963
5616
|
templateUrl: "kubernetes/src/manifest/rollout/undo.html",
|
|
4964
|
-
controller: "kubernetesV2ManifestUndoRolloutCtrl",
|
|
4965
|
-
controllerAs: "ctrl",
|
|
5617
|
+
controller: "kubernetesV2ManifestUndoRolloutCtrl as ctrl",
|
|
4966
5618
|
resolve: {
|
|
4967
5619
|
coordinates: {
|
|
4968
|
-
name:
|
|
4969
|
-
namespace:
|
|
4970
|
-
account:
|
|
5620
|
+
name: serverGroupManager.name,
|
|
5621
|
+
namespace: serverGroupManager.namespace,
|
|
5622
|
+
account: serverGroupManager.account
|
|
4971
5623
|
},
|
|
4972
5624
|
revisions: () => {
|
|
4973
|
-
const [, ...rest] = orderBy(
|
|
5625
|
+
const [, ...rest] = orderBy(serverGroupManager.serverGroups, ["moniker.sequence"], ["desc"]);
|
|
4974
5626
|
return rest.map((serverGroup, index) => ({
|
|
4975
5627
|
label: `${NameUtils.getSequence(serverGroup.moniker.sequence)}${index > 0 ? "" : " - previous revision"}`,
|
|
4976
5628
|
revision: serverGroup.moniker.sequence
|
|
4977
5629
|
}));
|
|
4978
5630
|
},
|
|
4979
|
-
application
|
|
5631
|
+
application
|
|
4980
5632
|
}
|
|
4981
5633
|
});
|
|
4982
|
-
}
|
|
4983
|
-
scaleServerGroupManager() {
|
|
4984
|
-
|
|
5634
|
+
};
|
|
5635
|
+
const scaleServerGroupManager = () => {
|
|
5636
|
+
ModalInjector.modalService.open({
|
|
4985
5637
|
templateUrl: "kubernetes/src/manifest/scale/scale.html",
|
|
4986
|
-
controller: "kubernetesV2ManifestScaleCtrl",
|
|
4987
|
-
controllerAs: "ctrl",
|
|
5638
|
+
controller: "kubernetesV2ManifestScaleCtrl as ctrl",
|
|
4988
5639
|
resolve: {
|
|
4989
5640
|
coordinates: {
|
|
4990
|
-
name:
|
|
4991
|
-
namespace:
|
|
4992
|
-
account:
|
|
5641
|
+
name: serverGroupManager.name,
|
|
5642
|
+
namespace: serverGroupManager.namespace,
|
|
5643
|
+
account: serverGroupManager.account
|
|
4993
5644
|
},
|
|
4994
|
-
currentReplicas:
|
|
4995
|
-
application
|
|
5645
|
+
currentReplicas: manifest.manifest.spec.replicas,
|
|
5646
|
+
application
|
|
4996
5647
|
}
|
|
4997
5648
|
});
|
|
4998
|
-
}
|
|
4999
|
-
editServerGroupManager() {
|
|
5000
|
-
KubernetesManifestCommandBuilder.buildNewManifestCommand(
|
|
5001
|
-
ManifestWizard.show({ title: "Edit Manifest", application
|
|
5649
|
+
};
|
|
5650
|
+
const editServerGroupManager = () => {
|
|
5651
|
+
KubernetesManifestCommandBuilder.buildNewManifestCommand(application, manifest.manifest, serverGroupManager.moniker, serverGroupManager.account).then((builtCommand) => {
|
|
5652
|
+
ManifestWizard.show({ title: "Edit Manifest", application, command: builtCommand });
|
|
5002
5653
|
});
|
|
5003
|
-
}
|
|
5004
|
-
deleteServerGroupManager() {
|
|
5005
|
-
|
|
5654
|
+
};
|
|
5655
|
+
const deleteServerGroupManager = () => {
|
|
5656
|
+
ModalInjector.modalService.open({
|
|
5006
5657
|
templateUrl: "kubernetes/src/manifest/delete/delete.html",
|
|
5007
|
-
controller: "kubernetesV2ManifestDeleteCtrl",
|
|
5008
|
-
controllerAs: "ctrl",
|
|
5658
|
+
controller: "kubernetesV2ManifestDeleteCtrl as ctrl",
|
|
5009
5659
|
resolve: {
|
|
5010
5660
|
coordinates: {
|
|
5011
|
-
name:
|
|
5012
|
-
namespace:
|
|
5013
|
-
account:
|
|
5661
|
+
name: serverGroupManager.name,
|
|
5662
|
+
namespace: serverGroupManager.namespace,
|
|
5663
|
+
account: serverGroupManager.account
|
|
5014
5664
|
},
|
|
5015
|
-
application
|
|
5665
|
+
application,
|
|
5016
5666
|
manifestController: () => null
|
|
5017
5667
|
}
|
|
5018
5668
|
});
|
|
5019
|
-
}
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
}
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
}
|
|
5669
|
+
};
|
|
5670
|
+
return /* @__PURE__ */ React.createElement(Dropdown, {
|
|
5671
|
+
className: "dropdown",
|
|
5672
|
+
id: "server-group-manager-actions-dropdown"
|
|
5673
|
+
}, isEnabled && /* @__PURE__ */ React.createElement(Dropdown.Toggle, {
|
|
5674
|
+
className: "btn btn-sm btn-primary dropdown-toggle"
|
|
5675
|
+
}, robotToHuman(serverGroupManager.kind), " Actions"), /* @__PURE__ */ React.createElement(Dropdown.Menu, null, /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5676
|
+
onClick: scaleServerGroupManager
|
|
5677
|
+
}, "Scale"), canUndoRolloutServerGroupManager() && /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5678
|
+
onClick: undoRolloutServerGroupManager
|
|
5679
|
+
}, "Undo Rollout"), manifest.status.paused.state && /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5680
|
+
onClick: resumeRolloutServerGroupManager
|
|
5681
|
+
}, "Resume Rollout"), !manifest.status.paused.state && !manifest.status.stable.state && /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5682
|
+
onClick: pauseRolloutServerGroupManager
|
|
5683
|
+
}, "Pause Rollout"), !manifest.status.paused.state && /* @__PURE__ */ React.createElement(RollingRestart, {
|
|
5684
|
+
application,
|
|
5685
|
+
serverGroupManager
|
|
5686
|
+
}), /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5687
|
+
className: "divider"
|
|
5688
|
+
}), /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5689
|
+
onClick: editServerGroupManager
|
|
5690
|
+
}, "Edit"), /* @__PURE__ */ React.createElement(MenuItem, {
|
|
5691
|
+
onClick: deleteServerGroupManager
|
|
5692
|
+
}, "Delete"), /* @__PURE__ */ React.createElement(IfFeatureEnabled, {
|
|
5693
|
+
feature: "entityTags",
|
|
5694
|
+
render: /* @__PURE__ */ React.createElement(AddEntityTagLinks, {
|
|
5695
|
+
component: serverGroupManager,
|
|
5696
|
+
application,
|
|
5697
|
+
entityType: "serverGroupManager",
|
|
5698
|
+
ownerOptions: entityTagTargets,
|
|
5699
|
+
onUpdate: () => application.serverGroupManagers.refresh()
|
|
5700
|
+
})
|
|
5701
|
+
})));
|
|
5043
5702
|
}
|
|
5044
|
-
KubernetesServerGroupManagerDetailsController.$inject = ["serverGroupManager", "$scope", "$uibModal", "app", "$state"];
|
|
5045
|
-
const KUBERNETES_SERVER_GROUP_MANAGER_DETAILS_CTRL = "spinnaker.kubernetes.serverGroupManager.details.controller";
|
|
5046
|
-
module(KUBERNETES_SERVER_GROUP_MANAGER_DETAILS_CTRL, []).controller("kubernetesV2ServerGroupManagerDetailsCtrl", KubernetesServerGroupManagerDetailsController);
|
|
5047
5703
|
window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
5048
5704
|
templateCache.put("kubernetes/src/manifest/rollout/pause.html", `<div modal-page class="confirmation-modal">
|
|
5049
5705
|
<task-monitor monitor="ctrl.taskMonitor"></task-monitor>
|
|
@@ -5234,6 +5890,180 @@ window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
|
5234
5890
|
`);
|
|
5235
5891
|
}]);
|
|
5236
5892
|
|
|
5893
|
+
function ServerGroupManagerAnnotationCustomSection({
|
|
5894
|
+
serverGroupManager,
|
|
5895
|
+
manifest
|
|
5896
|
+
}) {
|
|
5897
|
+
const { KubernetesAnnotationCustomSections } = KubernetesReactInjector;
|
|
5898
|
+
return /* @__PURE__ */ React.createElement(KubernetesAnnotationCustomSections, {
|
|
5899
|
+
manifest: manifest.manifest,
|
|
5900
|
+
resource: serverGroupManager
|
|
5901
|
+
});
|
|
5902
|
+
}
|
|
5903
|
+
|
|
5904
|
+
function ServerGroupManagerArtifactsSection({ manifest }) {
|
|
5905
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5906
|
+
heading: "Artifacts",
|
|
5907
|
+
defaultExpanded: true
|
|
5908
|
+
}, manifest.artifacts.map((artifact) => /* @__PURE__ */ React.createElement("ul", {
|
|
5909
|
+
key: artifact.reference
|
|
5910
|
+
}, /* @__PURE__ */ React.createElement(ManifestArtifact, {
|
|
5911
|
+
artifact
|
|
5912
|
+
}))));
|
|
5913
|
+
}
|
|
5914
|
+
|
|
5915
|
+
function ServerGroupManagerEventsSection({ manifest }) {
|
|
5916
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5917
|
+
heading: "Events",
|
|
5918
|
+
defaultExpanded: true
|
|
5919
|
+
}, /* @__PURE__ */ React.createElement(ManifestEvents, {
|
|
5920
|
+
manifest
|
|
5921
|
+
}));
|
|
5922
|
+
}
|
|
5923
|
+
|
|
5924
|
+
function ServerGroupManagerInformationSection({
|
|
5925
|
+
serverGroupManager
|
|
5926
|
+
}) {
|
|
5927
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5928
|
+
heading: "Information",
|
|
5929
|
+
defaultExpanded: true
|
|
5930
|
+
}, /* @__PURE__ */ React.createElement("dl", {
|
|
5931
|
+
className: "dl-horizontal dl-narrow"
|
|
5932
|
+
}, /* @__PURE__ */ React.createElement("dt", null, "Created"), /* @__PURE__ */ React.createElement("dd", null, timestamp(serverGroupManager.createdTime)), /* @__PURE__ */ React.createElement("dt", null, "Account"), /* @__PURE__ */ React.createElement("dd", null, /* @__PURE__ */ React.createElement(AccountTag, {
|
|
5933
|
+
account: serverGroupManager.account
|
|
5934
|
+
})), /* @__PURE__ */ React.createElement("dt", null, "Namespace"), /* @__PURE__ */ React.createElement("dd", null, serverGroupManager.namespace), /* @__PURE__ */ React.createElement("dt", null, "Kind"), /* @__PURE__ */ React.createElement("dd", null, serverGroupManager.kind), serverGroupManager.serverGroups.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("dt", null, "Managing"), /* @__PURE__ */ React.createElement("dd", null, orderBy(serverGroupManager.serverGroups, ["name"], ["asc"]).map((serverGroup) => /* @__PURE__ */ React.createElement("ul", {
|
|
5935
|
+
key: serverGroup.name
|
|
5936
|
+
}, /* @__PURE__ */ React.createElement(UISref, {
|
|
5937
|
+
to: "^.serverGroup",
|
|
5938
|
+
params: {
|
|
5939
|
+
region: serverGroup.region,
|
|
5940
|
+
accountId: serverGroup.account,
|
|
5941
|
+
serverGroup: serverGroup.name,
|
|
5942
|
+
provider: "kubernetes"
|
|
5943
|
+
}
|
|
5944
|
+
}, /* @__PURE__ */ React.createElement("a", null, robotToHuman(serverGroup.name)))))))));
|
|
5945
|
+
}
|
|
5946
|
+
|
|
5947
|
+
function ServerGroupManagerLabelsSection({ manifest }) {
|
|
5948
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5949
|
+
heading: "Labels",
|
|
5950
|
+
defaultExpanded: true
|
|
5951
|
+
}, /* @__PURE__ */ React.createElement(ManifestLabels, {
|
|
5952
|
+
manifest: manifest.manifest
|
|
5953
|
+
}));
|
|
5954
|
+
}
|
|
5955
|
+
|
|
5956
|
+
function ServerGroupManagerManifestConditionSection({
|
|
5957
|
+
manifest
|
|
5958
|
+
}) {
|
|
5959
|
+
return /* @__PURE__ */ React.createElement(CollapsibleSection, {
|
|
5960
|
+
heading: "Status",
|
|
5961
|
+
defaultExpanded: true
|
|
5962
|
+
}, manifest.manifest.status.conditions.map((condition) => /* @__PURE__ */ React.createElement("ul", {
|
|
5963
|
+
key: condition.lastTransitionTime
|
|
5964
|
+
}, /* @__PURE__ */ React.createElement(ManifestCondition, {
|
|
5965
|
+
condition
|
|
5966
|
+
}))));
|
|
5967
|
+
}
|
|
5968
|
+
|
|
5969
|
+
function ServerGroupManagerManifestStatusSection({
|
|
5970
|
+
manifest
|
|
5971
|
+
}) {
|
|
5972
|
+
return /* @__PURE__ */ React.createElement(ManifestStatus$1, {
|
|
5973
|
+
status: manifest.status
|
|
5974
|
+
});
|
|
5975
|
+
}
|
|
5976
|
+
|
|
5977
|
+
function useKubernetesServerGroupManagerDetails(props, autoClose) {
|
|
5978
|
+
const [serverGroupManager, setServerGroupManager] = useState();
|
|
5979
|
+
const [manifest, setManifest] = useState();
|
|
5980
|
+
const [loading, setLoading] = useState(true);
|
|
5981
|
+
useEffect(() => {
|
|
5982
|
+
if (serverGroupManager) {
|
|
5983
|
+
return;
|
|
5984
|
+
}
|
|
5985
|
+
const { serverGroupManager: params, app } = props;
|
|
5986
|
+
const { accountId, region, name } = params;
|
|
5987
|
+
setLoading(true);
|
|
5988
|
+
const serverGroupManagerDetails = app.getDataSource("serverGroupManagers").data.find((manager) => manager.name === name && manager.region === region && manager.account === accountId);
|
|
5989
|
+
if (!serverGroupManagerDetails) {
|
|
5990
|
+
autoClose();
|
|
5991
|
+
return;
|
|
5992
|
+
}
|
|
5993
|
+
ManifestReader.getManifest(accountId, region, name).then((manifest2) => {
|
|
5994
|
+
setManifest(manifest2);
|
|
5995
|
+
setServerGroupManager(serverGroupManagerDetails);
|
|
5996
|
+
}).catch((error) => {
|
|
5997
|
+
console.error("Error fetching manifest:", error);
|
|
5998
|
+
}).finally(() => {
|
|
5999
|
+
setLoading(false);
|
|
6000
|
+
});
|
|
6001
|
+
}, [autoClose, props, serverGroupManager]);
|
|
6002
|
+
return [serverGroupManager, manifest, loading];
|
|
6003
|
+
}
|
|
6004
|
+
|
|
6005
|
+
function ServerGroupManagerDetails(props) {
|
|
6006
|
+
const autoClose = () => {
|
|
6007
|
+
ReactInjector.$state.params.allowModalToStayOpen = true;
|
|
6008
|
+
ReactInjector.$state.go("^", null, { location: "replace" });
|
|
6009
|
+
};
|
|
6010
|
+
const [serverGroupManager, manifest, loading] = useKubernetesServerGroupManagerDetails(props, autoClose);
|
|
6011
|
+
if (loading)
|
|
6012
|
+
return /* @__PURE__ */ React.createElement(Details, {
|
|
6013
|
+
loading
|
|
6014
|
+
});
|
|
6015
|
+
return /* @__PURE__ */ React.createElement(Details, {
|
|
6016
|
+
loading
|
|
6017
|
+
}, /* @__PURE__ */ React.createElement(Details.Header, {
|
|
6018
|
+
icon: /* @__PURE__ */ React.createElement(CloudProviderLogo, {
|
|
6019
|
+
provider: props.serverGroupManager.provider,
|
|
6020
|
+
height: "36px",
|
|
6021
|
+
width: "36px"
|
|
6022
|
+
}),
|
|
6023
|
+
name: serverGroupManager.displayName,
|
|
6024
|
+
notifications: /* @__PURE__ */ React.createElement(IfFeatureEnabled, {
|
|
6025
|
+
feature: "entityTags",
|
|
6026
|
+
render: /* @__PURE__ */ React.createElement(EntityNotifications, {
|
|
6027
|
+
entity: serverGroupManager,
|
|
6028
|
+
application: props.app,
|
|
6029
|
+
placement: "bottom",
|
|
6030
|
+
hOffsetPercent: "90%",
|
|
6031
|
+
entityType: "serverGroupManager",
|
|
6032
|
+
pageLocation: "details",
|
|
6033
|
+
onUpdate: () => props.app.serverGroupManagers.refresh()
|
|
6034
|
+
})
|
|
6035
|
+
}),
|
|
6036
|
+
actions: /* @__PURE__ */ React.createElement(ServerGroupManagerActions, {
|
|
6037
|
+
application: props.app,
|
|
6038
|
+
serverGroupManager,
|
|
6039
|
+
manifest
|
|
6040
|
+
})
|
|
6041
|
+
}), /* @__PURE__ */ React.createElement(Details.Content, {
|
|
6042
|
+
loading
|
|
6043
|
+
}, /* @__PURE__ */ React.createElement(ServerGroupManagerManifestStatusSection, {
|
|
6044
|
+
serverGroupManager,
|
|
6045
|
+
manifest
|
|
6046
|
+
}), /* @__PURE__ */ React.createElement(ServerGroupManagerInformationSection, {
|
|
6047
|
+
serverGroupManager,
|
|
6048
|
+
manifest
|
|
6049
|
+
}), /* @__PURE__ */ React.createElement(ServerGroupManagerManifestConditionSection, {
|
|
6050
|
+
serverGroupManager,
|
|
6051
|
+
manifest
|
|
6052
|
+
}), /* @__PURE__ */ React.createElement(ServerGroupManagerAnnotationCustomSection, {
|
|
6053
|
+
serverGroupManager,
|
|
6054
|
+
manifest
|
|
6055
|
+
}), /* @__PURE__ */ React.createElement(ServerGroupManagerEventsSection, {
|
|
6056
|
+
serverGroupManager,
|
|
6057
|
+
manifest
|
|
6058
|
+
}), /* @__PURE__ */ React.createElement(ServerGroupManagerLabelsSection, {
|
|
6059
|
+
serverGroupManager,
|
|
6060
|
+
manifest
|
|
6061
|
+
}), /* @__PURE__ */ React.createElement(ServerGroupManagerArtifactsSection, {
|
|
6062
|
+
serverGroupManager,
|
|
6063
|
+
manifest
|
|
6064
|
+
})));
|
|
6065
|
+
}
|
|
6066
|
+
|
|
5237
6067
|
const _KubernetesApplicationNameValidator = class {
|
|
5238
6068
|
static validateSpecialCharacters(name, errors) {
|
|
5239
6069
|
const alphanumWithDashPattern = /^([a-zA-Z][a-zA-Z0-9-]*)?$/;
|
|
@@ -5268,15 +6098,10 @@ styleInject(css_248z);
|
|
|
5268
6098
|
|
|
5269
6099
|
const KUBERNETES_MODULE = "spinnaker.kubernetes";
|
|
5270
6100
|
const requires = [
|
|
6101
|
+
KUBERNETES_REACT_MODULE,
|
|
5271
6102
|
KUBERNETES_INSTANCE_DETAILS_CTRL,
|
|
5272
6103
|
KUBERNETES_LOAD_BALANCER_DETAILS_CTRL,
|
|
5273
6104
|
KUBERNETES_SECURITY_GROUP_DETAILS_CTRL,
|
|
5274
|
-
KUBERNETES_SERVER_GROUP_COMMAND_BUILDER,
|
|
5275
|
-
KUBERNETES_SERVER_GROUP_DETAILS_CTRL,
|
|
5276
|
-
KUBERNETES_SERVER_GROUP_TRANSFORMER,
|
|
5277
|
-
KUBERNETES_SERVER_GROUP_MANAGER_DETAILS_CTRL,
|
|
5278
|
-
KUBERNETES_SERVER_GROUP_RESIZE_CTRL,
|
|
5279
|
-
KUBERNETES_SERVER_GROUP_MANAGER_DETAILS_CTRL,
|
|
5280
6105
|
KUBERNETES_MANIFEST_DELETE_CTRL,
|
|
5281
6106
|
KUBERNETES_MANIFEST_SCALE_CTRL,
|
|
5282
6107
|
KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL,
|
|
@@ -5284,7 +6109,6 @@ const requires = [
|
|
|
5284
6109
|
KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL,
|
|
5285
6110
|
KUBERNETES_MANIFEST_STATUS,
|
|
5286
6111
|
KUBERNETES_MANIFEST_CONDITION,
|
|
5287
|
-
KUBERNETES_MANIFEST_ARTIFACT,
|
|
5288
6112
|
KUBERNETES_LOAD_BALANCER_TRANSFORMER,
|
|
5289
6113
|
KUBERNETES_SECURITY_GROUP_TRANSFORMER,
|
|
5290
6114
|
KUBERNETES_MANIFEST_SELECTOR,
|
|
@@ -5299,8 +6123,7 @@ const requires = [
|
|
|
5299
6123
|
JSON_EDITOR_COMPONENT,
|
|
5300
6124
|
KUBERNETES_ENABLE_MANIFEST_STAGE,
|
|
5301
6125
|
KUBERNETES_DISABLE_MANIFEST_STAGE,
|
|
5302
|
-
STAGE_ARTIFACT_SELECTOR_COMPONENT_REACT
|
|
5303
|
-
KUBERNETES_ROLLING_RESTART
|
|
6126
|
+
STAGE_ARTIFACT_SELECTOR_COMPONENT_REACT
|
|
5304
6127
|
];
|
|
5305
6128
|
if (SETTINGS.feature.kubernetesRawResources) {
|
|
5306
6129
|
requires.push(KUBERNETS_RAW_RESOURCE_MODULE);
|
|
@@ -5314,14 +6137,23 @@ module(KUBERNETES_MODULE, requires).config(() => {
|
|
|
5314
6137
|
},
|
|
5315
6138
|
serverGroup: {
|
|
5316
6139
|
CloneServerGroupModal: ManifestWizard,
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
6140
|
+
detailsActions: KubernetesServerGroupActions,
|
|
6141
|
+
detailsGetter: kubernetesServerGroupDetailsGetter,
|
|
6142
|
+
detailsSections: [
|
|
6143
|
+
ServerGroupManifestStatusSection,
|
|
6144
|
+
ServerGroupInformationSection,
|
|
6145
|
+
ServerGroupAnnotationCustomSection,
|
|
6146
|
+
ServerGroupImagesSection,
|
|
6147
|
+
ServerGroupEventsSection,
|
|
6148
|
+
ServerGroupLabelsSection,
|
|
6149
|
+
ServerGroupSizeSection,
|
|
6150
|
+
ServerGroupHealthSection
|
|
6151
|
+
],
|
|
6152
|
+
commandBuilder: KubernetesV2ServerGroupCommandBuilder,
|
|
6153
|
+
transformer: KubernetesV2ServerGroupTransformer
|
|
5321
6154
|
},
|
|
5322
6155
|
serverGroupManager: {
|
|
5323
|
-
|
|
5324
|
-
detailsController: "kubernetesV2ServerGroupManagerDetailsCtrl"
|
|
6156
|
+
details: ServerGroupManagerDetails
|
|
5325
6157
|
},
|
|
5326
6158
|
loadBalancer: {
|
|
5327
6159
|
CreateLoadBalancerModal: ManifestWizard,
|
|
@@ -5357,301 +6189,6 @@ module(KUBERNETES_MODULE, requires).config(() => {
|
|
|
5357
6189
|
]
|
|
5358
6190
|
});
|
|
5359
6191
|
});
|
|
5360
|
-
window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
5361
|
-
templateCache.put("kubernetes/src/serverGroup/details/details.html", `<div class="details-panel" ng-class="{disabled: ctrl.serverGroup.isDisabled || ctrl.serverGroup.disabled}">
|
|
5362
|
-
<div class="header" ng-if="ctrl.state.loading">
|
|
5363
|
-
<div class="close-button">
|
|
5364
|
-
<a class="btn btn-link" ui-sref="^">
|
|
5365
|
-
<span class="glyphicon glyphicon-remove"></span>
|
|
5366
|
-
</a>
|
|
5367
|
-
</div>
|
|
5368
|
-
<h4 class="text-center">
|
|
5369
|
-
<span us-spinner="{radius:20, width:6, length: 12}"></span>
|
|
5370
|
-
</h4>
|
|
5371
|
-
</div>
|
|
5372
|
-
|
|
5373
|
-
<div class="header" ng-if="!ctrl.state.loading">
|
|
5374
|
-
<div class="close-button">
|
|
5375
|
-
<a class="btn btn-link" ui-sref="^">
|
|
5376
|
-
<span class="glyphicon glyphicon-remove"></span>
|
|
5377
|
-
</a>
|
|
5378
|
-
</div>
|
|
5379
|
-
<div class="header-text horizontal middle">
|
|
5380
|
-
<cloud-provider-logo
|
|
5381
|
-
provider="ctrl.serverGroup.cloudProvider"
|
|
5382
|
-
height="'36px'"
|
|
5383
|
-
width="'36px'"
|
|
5384
|
-
></cloud-provider-logo>
|
|
5385
|
-
<h3 class="horizontal middle space-between flex-1" select-on-dbl-click>
|
|
5386
|
-
{{ctrl.serverGroup.displayName}}
|
|
5387
|
-
<render-if-feature feature="entityTags">
|
|
5388
|
-
<entity-notifications
|
|
5389
|
-
entity="ctrl.serverGroup"
|
|
5390
|
-
application="ctrl.app"
|
|
5391
|
-
placement="bottom"
|
|
5392
|
-
h-offset-percent="90%"
|
|
5393
|
-
entity-type="serverGroup"
|
|
5394
|
-
page-location="details"
|
|
5395
|
-
on-update="ctrl.app.serverGroups.refresh()"
|
|
5396
|
-
></entity-notifications>
|
|
5397
|
-
</render-if-feature>
|
|
5398
|
-
</h3>
|
|
5399
|
-
</div>
|
|
5400
|
-
<div class="actions">
|
|
5401
|
-
<div class="dropdown" uib-dropdown dropdown-append-to-body>
|
|
5402
|
-
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle ng-hide="isDisabled">
|
|
5403
|
-
{{ctrl.serverGroup.kind | robotToHuman}} Actions <span class="caret"></span>
|
|
5404
|
-
</button>
|
|
5405
|
-
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
|
|
5406
|
-
<li ng-if="ctrl.canEditServerGroup()">
|
|
5407
|
-
<a href ng-click="ctrl.editServerGroup()"> Edit </a>
|
|
5408
|
-
</li>
|
|
5409
|
-
<li ng-if="ctrl.canScaleServerGroup()">
|
|
5410
|
-
<a href ng-click="ctrl.scaleServerGroup()"> Scale </a>
|
|
5411
|
-
</li>
|
|
5412
|
-
<li ng-if="ctrl.canEnable()">
|
|
5413
|
-
<a href ng-click="ctrl.enableServerGroup()"> Enable </a>
|
|
5414
|
-
</li>
|
|
5415
|
-
<li ng-if="ctrl.canDisable()">
|
|
5416
|
-
<a href ng-click="ctrl.disableServerGroup()"> Disable </a>
|
|
5417
|
-
</li>
|
|
5418
|
-
<li>
|
|
5419
|
-
<a href ng-click="ctrl.deleteServerGroup()"> Delete </a>
|
|
5420
|
-
</li>
|
|
5421
|
-
<render-if-feature feature="entityTags">
|
|
5422
|
-
<add-entity-tag-links
|
|
5423
|
-
component="ctrl.serverGroup"
|
|
5424
|
-
application="ctrl.app"
|
|
5425
|
-
entity-type="serverGroup"
|
|
5426
|
-
owner-options="ctrl.entityTagTargets"
|
|
5427
|
-
on-update="ctrl.app.serverGroups.refresh"
|
|
5428
|
-
></add-entity-tag-links>
|
|
5429
|
-
</render-if-feature>
|
|
5430
|
-
</ul>
|
|
5431
|
-
</div>
|
|
5432
|
-
</div>
|
|
5433
|
-
</div>
|
|
5434
|
-
<div class="content" ng-if="!ctrl.state.loading">
|
|
5435
|
-
<kubernetes-manifest-status status="ctrl.manifest.status"></kubernetes-manifest-status>
|
|
5436
|
-
<div class="band band-info" ng-if="ctrl.serverGroup.isDisabled || ctrl.serverGroup.disabled">Disabled</div>
|
|
5437
|
-
<server-group-running-tasks-details
|
|
5438
|
-
server-group="ctrl.serverGroup"
|
|
5439
|
-
application="ctrl.app"
|
|
5440
|
-
></server-group-running-tasks-details>
|
|
5441
|
-
<collapsible-section heading="Information" expanded="true">
|
|
5442
|
-
<dl class="dl-horizontal dl-narrow">
|
|
5443
|
-
<dt>Created</dt>
|
|
5444
|
-
<dd>{{ctrl.serverGroup.createdTime | timestamp}}</dd>
|
|
5445
|
-
<dt>Account</dt>
|
|
5446
|
-
<dd><account-tag account="ctrl.serverGroup.account"></account-tag></dd>
|
|
5447
|
-
<dt>Namespace</dt>
|
|
5448
|
-
<dd>{{ctrl.serverGroup.namespace}}</dd>
|
|
5449
|
-
<dt>Kind</dt>
|
|
5450
|
-
<dd>{{ctrl.serverGroup.kind}}</dd>
|
|
5451
|
-
<dt ng-if="ctrl.manifestController()">Controller</dt>
|
|
5452
|
-
<dd>
|
|
5453
|
-
<a
|
|
5454
|
-
ui-sref="^.serverGroupManager({
|
|
5455
|
-
accountId: ctrl.serverGroup.account,
|
|
5456
|
-
region: ctrl.serverGroup.region,
|
|
5457
|
-
serverGroupManager: ctrl.manifestController(),
|
|
5458
|
-
provider: 'kubernetes'})"
|
|
5459
|
-
>
|
|
5460
|
-
{{ctrl.manifestController() | robotToHuman }}
|
|
5461
|
-
</a>
|
|
5462
|
-
</dd>
|
|
5463
|
-
</dl>
|
|
5464
|
-
</collapsible-section>
|
|
5465
|
-
|
|
5466
|
-
<kubernetes-annotation-custom-sections
|
|
5467
|
-
manifest="ctrl.manifest.manifest"
|
|
5468
|
-
resource="ctrl.serverGroup"
|
|
5469
|
-
></kubernetes-annotation-custom-sections>
|
|
5470
|
-
|
|
5471
|
-
<collapsible-section heading="Images" expanded="true">
|
|
5472
|
-
<kubernetes-manifest-image-details manifest="ctrl.manifest.manifest"></kubernetes-manifest-image-details>
|
|
5473
|
-
</collapsible-section>
|
|
5474
|
-
|
|
5475
|
-
<collapsible-section heading="Events" expanded="true">
|
|
5476
|
-
<kubernetes-manifest-events manifest="ctrl.manifest"></kubernetes-manifest-events>
|
|
5477
|
-
</collapsible-section>
|
|
5478
|
-
<collapsible-section heading="Labels" expanded="true">
|
|
5479
|
-
<kubernetes-manifest-labels manifest="ctrl.manifest.manifest"></kubernetes-manifest-labels>
|
|
5480
|
-
</collapsible-section>
|
|
5481
|
-
<collapsible-section heading="Size" expanded="true">
|
|
5482
|
-
<dl class="dl-horizontal dl-narrow" ng-if="ctrl.serverGroup.capacity.min == null">
|
|
5483
|
-
<dt>Current</dt>
|
|
5484
|
-
<dd>{{ctrl.serverGroup.instances.length}}</dd>
|
|
5485
|
-
</dl>
|
|
5486
|
-
<dl
|
|
5487
|
-
class="dl-horizontal dl-narrow"
|
|
5488
|
-
ng-if="ctrl.serverGroup.capacity.min != null && ctrl.serverGroup.capacity.min === ctrl.serverGroup.capacity.max"
|
|
5489
|
-
>
|
|
5490
|
-
<dt>Min/Max</dt>
|
|
5491
|
-
<dd>{{ctrl.serverGroup.capacity.min}}</dd>
|
|
5492
|
-
<dt>Current</dt>
|
|
5493
|
-
<dd>{{ctrl.serverGroup.instances.length}}</dd>
|
|
5494
|
-
</dl>
|
|
5495
|
-
<dl class="dl-horizontal dl-narrow" ng-if="ctrl.serverGroup.capacity.min !== ctrl.serverGroup.capacity.max">
|
|
5496
|
-
<dt>Min</dt>
|
|
5497
|
-
<dd>{{ctrl.serverGroup.capacity.min}}</dd>
|
|
5498
|
-
<dt>Max</dt>
|
|
5499
|
-
<dd>{{ctrl.serverGroup.capacity.max}}</dd>
|
|
5500
|
-
<dt>Current</dt>
|
|
5501
|
-
<dd>{{ctrl.serverGroup.instances.length}}</dd>
|
|
5502
|
-
</dl>
|
|
5503
|
-
</collapsible-section>
|
|
5504
|
-
<collapsible-section heading="Health" expanded="true">
|
|
5505
|
-
<dl class="dl-horizontal dl-narrow" ng-if="ctrl.serverGroup">
|
|
5506
|
-
<dt>Instances</dt>
|
|
5507
|
-
<dd>
|
|
5508
|
-
<health-counts container="ctrl.serverGroup.instanceCounts" class="pull-left"></health-counts>
|
|
5509
|
-
</dd>
|
|
5510
|
-
</dl>
|
|
5511
|
-
</collapsible-section>
|
|
5512
|
-
</div>
|
|
5513
|
-
</div>
|
|
5514
|
-
`);
|
|
5515
|
-
}]);
|
|
5516
|
-
window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
5517
|
-
templateCache.put("kubernetes/src/serverGroupManager/details/details.html", `<div class="details-panel">
|
|
5518
|
-
<div class="header" ng-if="ctrl.state.loading">
|
|
5519
|
-
<div class="close-button">
|
|
5520
|
-
<a class="btn btn-link" ui-sref="^">
|
|
5521
|
-
<span class="glyphicon glyphicon-remove"></span>
|
|
5522
|
-
</a>
|
|
5523
|
-
</div>
|
|
5524
|
-
<h4 class="text-center">
|
|
5525
|
-
<span us-spinner="{radius:20, width:6, length: 12}"></span>
|
|
5526
|
-
</h4>
|
|
5527
|
-
</div>
|
|
5528
|
-
|
|
5529
|
-
<div class="header" ng-if="!ctrl.state.loading">
|
|
5530
|
-
<div class="close-button">
|
|
5531
|
-
<a class="btn btn-link" ui-sref="^">
|
|
5532
|
-
<span class="glyphicon glyphicon-remove"></span>
|
|
5533
|
-
</a>
|
|
5534
|
-
</div>
|
|
5535
|
-
<div class="header-text horizontal middle">
|
|
5536
|
-
<cloud-provider-logo
|
|
5537
|
-
provider="ctrl.serverGroupManager.cloudProvider"
|
|
5538
|
-
height="'36px'"
|
|
5539
|
-
width="'36px'"
|
|
5540
|
-
></cloud-provider-logo>
|
|
5541
|
-
<h3 class="horizontal middle space-between flex-1" select-on-dbl-click>
|
|
5542
|
-
{{ctrl.serverGroupManager.displayName}}
|
|
5543
|
-
<render-if-feature feature="entityTags">
|
|
5544
|
-
<entity-notifications
|
|
5545
|
-
entity="ctrl.serverGroupManager"
|
|
5546
|
-
application="ctrl.app"
|
|
5547
|
-
placement="bottom"
|
|
5548
|
-
h-offset-percent="90%"
|
|
5549
|
-
entity-type="serverGroupManager"
|
|
5550
|
-
page-location="details"
|
|
5551
|
-
on-update="ctrl.app.serverGroupManagers.refresh()"
|
|
5552
|
-
></entity-notifications>
|
|
5553
|
-
</render-if-feature>
|
|
5554
|
-
</h3>
|
|
5555
|
-
</div>
|
|
5556
|
-
<div class="actions">
|
|
5557
|
-
<div class="dropdown" uib-dropdown dropdown-append-to-body>
|
|
5558
|
-
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle ng-hide="isDisabled">
|
|
5559
|
-
{{ctrl.serverGroupManager.kind | robotToHuman}} Actions <span class="caret"></span>
|
|
5560
|
-
</button>
|
|
5561
|
-
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
|
|
5562
|
-
<li>
|
|
5563
|
-
<a href ng-click="ctrl.scaleServerGroupManager()"> Scale </a>
|
|
5564
|
-
</li>
|
|
5565
|
-
<li ng-if="ctrl.canUndoRolloutServerGroupManager()">
|
|
5566
|
-
<a href ng-click="ctrl.undoRolloutServerGroupManager()"> Undo Rollout </a>
|
|
5567
|
-
</li>
|
|
5568
|
-
<li ng-if="ctrl.manifest.status.paused.state">
|
|
5569
|
-
<a href ng-click="ctrl.resumeRolloutServerGroupManager()"> Resume Rollout </a>
|
|
5570
|
-
</li>
|
|
5571
|
-
<li ng-if="!ctrl.manifest.status.paused.state && !ctrl.manifest.status.stable.state">
|
|
5572
|
-
<a href ng-click="ctrl.pauseRolloutServerGroupManager()"> Pause Rollout </a>
|
|
5573
|
-
</li>
|
|
5574
|
-
<kubernetes-rolling-restart
|
|
5575
|
-
ng-if="!ctrl.manifest.status.paused.state"
|
|
5576
|
-
application="ctrl.app"
|
|
5577
|
-
server-group-manager="ctrl.serverGroupManager"
|
|
5578
|
-
></kubernetes-rolling-restart>
|
|
5579
|
-
<li role="presentation" class="divider"></li>
|
|
5580
|
-
<li>
|
|
5581
|
-
<a href ng-click="ctrl.editServerGroupManager()"> Edit </a>
|
|
5582
|
-
</li>
|
|
5583
|
-
<li>
|
|
5584
|
-
<a href ng-click="ctrl.deleteServerGroupManager()"> Delete </a>
|
|
5585
|
-
</li>
|
|
5586
|
-
<render-if-feature feature="entityTags">
|
|
5587
|
-
<add-entity-tag-links
|
|
5588
|
-
component="ctrl.serverGroupManager"
|
|
5589
|
-
application="ctrl.app"
|
|
5590
|
-
entity-type="serverGroupManager"
|
|
5591
|
-
owner-options="ctrl.entityTagTargets"
|
|
5592
|
-
on-update="ctrl.app.serverGroupManagers.refresh"
|
|
5593
|
-
></add-entity-tag-links>
|
|
5594
|
-
</render-if-feature>
|
|
5595
|
-
</ul>
|
|
5596
|
-
</div>
|
|
5597
|
-
</div>
|
|
5598
|
-
</div>
|
|
5599
|
-
<div class="content" ng-if="!ctrl.state.loading">
|
|
5600
|
-
<kubernetes-manifest-status status="ctrl.manifest.status"></kubernetes-manifest-status>
|
|
5601
|
-
<collapsible-section heading="Information" expanded="true">
|
|
5602
|
-
<dl class="dl-horizontal dl-narrow">
|
|
5603
|
-
<dt>Created</dt>
|
|
5604
|
-
<dd>{{ctrl.serverGroupManager.createdTime | timestamp}}</dd>
|
|
5605
|
-
<dt>Account</dt>
|
|
5606
|
-
<dd><account-tag account="ctrl.serverGroupManager.account"></account-tag></dd>
|
|
5607
|
-
<dt>Namespace</dt>
|
|
5608
|
-
<dd>{{ctrl.serverGroupManager.namespace}}</dd>
|
|
5609
|
-
<dt>Kind</dt>
|
|
5610
|
-
<dd>{{ctrl.serverGroupManager.kind}}</dd>
|
|
5611
|
-
<dt ng-if="ctrl.serverGroupManager.serverGroups.length">Managing</dt>
|
|
5612
|
-
<dd>
|
|
5613
|
-
<ul ng-repeat="serverGroup in ctrl.serverGroupManager.serverGroups | orderBy: ['-name']">
|
|
5614
|
-
<a
|
|
5615
|
-
ui-sref="^.serverGroup({region: serverGroup.region,
|
|
5616
|
-
accountId: serverGroup.account,
|
|
5617
|
-
serverGroup: serverGroup.name,
|
|
5618
|
-
provider: 'kubernetes'})"
|
|
5619
|
-
>
|
|
5620
|
-
{{serverGroup.name}}
|
|
5621
|
-
</a>
|
|
5622
|
-
</ul>
|
|
5623
|
-
</dd>
|
|
5624
|
-
</dl>
|
|
5625
|
-
</collapsible-section>
|
|
5626
|
-
|
|
5627
|
-
<collapsible-section heading="Status" expanded="true">
|
|
5628
|
-
<ul ng-repeat="condition in ctrl.manifest.manifest.status.conditions">
|
|
5629
|
-
<kubernetes-manifest-condition condition="condition"></kubernetes-manifest-condition>
|
|
5630
|
-
</ul>
|
|
5631
|
-
</collapsible-section>
|
|
5632
|
-
|
|
5633
|
-
<kubernetes-annotation-custom-sections
|
|
5634
|
-
manifest="ctrl.manifest.manifest"
|
|
5635
|
-
resource="ctrl.serverGroupManager"
|
|
5636
|
-
></kubernetes-annotation-custom-sections>
|
|
5637
|
-
|
|
5638
|
-
<collapsible-section heading="Events" expanded="true">
|
|
5639
|
-
<kubernetes-manifest-events manifest="ctrl.manifest"></kubernetes-manifest-events>
|
|
5640
|
-
</collapsible-section>
|
|
5641
|
-
|
|
5642
|
-
<collapsible-section heading="Labels" expanded="true">
|
|
5643
|
-
<kubernetes-manifest-labels manifest="ctrl.manifest.manifest"></kubernetes-manifest-labels>
|
|
5644
|
-
</collapsible-section>
|
|
5645
|
-
|
|
5646
|
-
<collapsible-section heading="Artifacts" expanded="true">
|
|
5647
|
-
<ul ng-repeat="artifact in ctrl.manifest.artifacts">
|
|
5648
|
-
<kubernetes-manifest-artifact artifact="artifact"></kubernetes-manifest-artifact>
|
|
5649
|
-
</ul>
|
|
5650
|
-
</collapsible-section>
|
|
5651
|
-
</div>
|
|
5652
|
-
</div>
|
|
5653
|
-
`);
|
|
5654
|
-
}]);
|
|
5655
6192
|
window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
5656
6193
|
templateCache.put("kubernetes/src/loadBalancer/details/details.html", `<div class="details-panel">
|
|
5657
6194
|
<div ng-if="ctrl.state.loading" class="header">
|
|
@@ -6020,5 +6557,5 @@ window.angular.module("ng").run(["$templateCache", function(templateCache) {
|
|
|
6020
6557
|
`);
|
|
6021
6558
|
}]);
|
|
6022
6559
|
|
|
6023
|
-
export { KUBERNETES_LOAD_BALANCER_DETAILS_CTRL,
|
|
6560
|
+
export { KUBERNETES_LOAD_BALANCER_DETAILS_CTRL, KUBERNETES_MANIFEST_CONDITION, KUBERNETES_MANIFEST_DELETE_CTRL, KUBERNETES_MANIFEST_PAUSE_ROLLOUT_CTRL, KUBERNETES_MANIFEST_SCALE_CTRL, KUBERNETES_MANIFEST_STATUS, KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL, KUBERNETES_MODULE, KUBERNETES_SECURITY_GROUP_DETAILS_CTRL, KUBERNETS_RAW_RESOURCE_MODULE, KubernetesManifestCommandBuilder, KubernetesManifestService, KubernetesReactInject, KubernetesReactInjector, KubernetesV2ServerGroupCommandBuilder, KubernetesV2ServerGroupTransformer, ManifestArtifact, ServerGroupAnnotationCustomSection, ServerGroupEventsSection, ServerGroupHealthSection, ServerGroupImagesSection, ServerGroupInformationSection, ServerGroupLabelsSection, ServerGroupManagerAnnotationCustomSection, ServerGroupManagerArtifactsSection, ServerGroupManagerEventsSection, ServerGroupManagerInformationSection, ServerGroupManagerLabelsSection, ServerGroupManagerManifestConditionSection, ServerGroupManagerManifestStatusSection, ServerGroupManifestStatusSection, ServerGroupSizeSection };
|
|
6024
6561
|
//# sourceMappingURL=index.js.map
|