@rancher/shell 3.0.4 → 3.0.5-rc.2
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/assets/images/providers/sks.svg +1 -0
- package/assets/styles/base/_basic.scss +6 -0
- package/assets/styles/base/_helpers.scss +4 -0
- package/assets/styles/base/_variables.scss +1 -0
- package/assets/styles/global/_button.scss +1 -0
- package/assets/translations/en-us.yaml +65 -15
- package/assets/translations/zh-hans.yaml +4 -3
- package/chart/monitoring/index.vue +3 -1
- package/cloud-credential/aws.vue +2 -0
- package/components/ActionDropdownShell.vue +71 -0
- package/components/AppModal.vue +18 -4
- package/components/AsyncButton.vue +24 -7
- package/components/BannerGraphic.vue +1 -0
- package/components/CommunityLinks.vue +4 -59
- package/components/CopyToClipboardText.vue +2 -1
- package/components/CruResource.vue +6 -1
- package/components/DetailText.vue +5 -0
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +68 -18
- package/components/GlobalRoleBindings.vue +5 -1
- package/components/GrowlManager.vue +1 -0
- package/components/LandingPagePreference.vue +7 -3
- package/components/LocaleSelector.vue +39 -95
- package/components/ModalManager.vue +55 -0
- package/components/ModalWithCard.vue +1 -0
- package/components/PromptModal.vue +47 -8
- package/components/PromptRemove.vue +1 -0
- package/components/PromptRestore.vue +1 -0
- package/components/ResourceCancelModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +38 -12
- package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
- package/components/ResourceDetail/index.vue +47 -12
- package/components/ResourceTable.vue +54 -19
- package/components/SideNav.vue +5 -1
- package/components/SlideInPanelManager.vue +126 -0
- package/components/SortableTable/THead.vue +5 -2
- package/components/SortableTable/actions.js +1 -1
- package/components/SortableTable/index.vue +64 -51
- package/components/SortableTable/paging.js +16 -19
- package/components/SortableTable/selection.js +0 -11
- package/components/Wizard.vue +2 -2
- package/components/__tests__/AsyncButton.test.ts +2 -2
- package/components/__tests__/ModalManager.spec.ts +176 -0
- package/components/__tests__/PromptModal.test.ts +148 -0
- package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
- package/components/auth/AuthBanner.vue +13 -11
- package/components/auth/Principal.vue +1 -0
- package/components/auth/__tests__/RoleDetailEdit.test.ts +3 -2
- package/components/auth/login/ldap.vue +1 -1
- package/components/fleet/FleetResources.vue +21 -6
- package/components/form/ArrayList.vue +76 -60
- package/components/form/BannerSettings.vue +17 -2
- package/components/form/ColorInput.vue +35 -6
- package/components/form/Command.vue +6 -15
- package/components/form/EnvVars.vue +16 -8
- package/components/form/HealthCheck.vue +3 -3
- package/components/form/HookOption.vue +11 -16
- package/components/form/LabeledSelect.vue +18 -22
- package/components/form/LifecycleHooks.vue +3 -3
- package/components/form/MatchExpressions.vue +14 -8
- package/components/form/NameNsDescription.vue +128 -104
- package/components/form/Networking.vue +20 -12
- package/components/form/NodeAffinity.vue +31 -23
- package/components/form/NodeScheduling.vue +13 -3
- package/components/form/NotificationSettings.vue +15 -1
- package/components/form/Password.vue +1 -0
- package/components/form/PodAffinity.vue +43 -43
- package/components/form/Probe.vue +68 -66
- package/components/form/ResourceQuota/Project.vue +5 -1
- package/components/form/ResourceSelector.vue +7 -9
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +16 -24
- package/components/form/SSHKnownHosts/index.vue +30 -13
- package/components/form/Security.vue +54 -56
- package/components/form/Select.vue +32 -21
- package/components/form/ShellInput.vue +5 -1
- package/components/form/Tolerations.vue +5 -1
- package/components/form/ValueFromResource.vue +134 -121
- package/components/form/WorkloadPorts.vue +18 -18
- package/components/form/__tests__/ArrayList.test.ts +5 -2
- package/components/form/__tests__/ColorInput.test.ts +35 -0
- package/components/form/__tests__/LabeledSelect.test.ts +40 -0
- package/components/form/__tests__/MatchExpressions.test.ts +12 -12
- package/components/form/__tests__/NameNsDescription.test.ts +115 -14
- package/components/form/__tests__/Probe.test.ts +12 -8
- package/components/form/__tests__/SSHKnownHosts.test.ts +22 -2
- package/components/form/__tests__/Select.test.ts +37 -0
- package/components/formatter/InternalExternalIP.vue +2 -0
- package/components/formatter/SecretData.vue +20 -7
- package/components/nav/Group.vue +27 -5
- package/components/nav/Header.vue +17 -43
- package/components/nav/NamespaceFilter.vue +134 -86
- package/components/nav/TopLevelMenu.vue +4 -5
- package/components/nav/Type.vue +12 -1
- package/components/nav/WindowManager/ContainerLogs.vue +87 -61
- package/components/nav/WindowManager/ContainerLogsActions.vue +76 -0
- package/components/templates/blank.vue +4 -1
- package/components/templates/default.vue +8 -3
- package/components/templates/home.vue +10 -1
- package/components/templates/plain.vue +10 -4
- package/composables/focusTrap.ts +12 -4
- package/composables/useRuntimeFlag.ts +29 -0
- package/config/router/routes.js +20 -13
- package/config/store.js +4 -0
- package/config/uiplugins.js +5 -1
- package/core/types.ts +12 -6
- package/detail/catalog.cattle.io.app.vue +6 -1
- package/detail/fleet.cattle.io.bundle.vue +70 -6
- package/detail/fleet.cattle.io.gitrepo.vue +1 -1
- package/detail/namespace.vue +0 -3
- package/detail/node.vue +17 -13
- package/detail/provisioning.cattle.io.cluster.vue +72 -6
- package/dialog/AddCustomBadgeDialog.vue +1 -1
- package/{pages/c/_cluster/uiplugins/AddExtensionRepos.vue → dialog/AddExtensionReposDialog.vue} +72 -42
- package/{components/AssignTo.vue → dialog/AssignToDialog.vue} +71 -80
- package/dialog/ChangePasswordDialog.vue +106 -0
- package/dialog/DeactivateDriverDialog.vue +1 -0
- package/{pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue → dialog/DeveloperLoadExtensionDialog.vue} +74 -71
- package/dialog/DisableAuthProviderDialog.vue +101 -0
- package/dialog/DrainNode.vue +1 -1
- package/{pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue → dialog/ExtensionCatalogInstallDialog.vue} +100 -88
- package/{pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue → dialog/ExtensionCatalogUninstallDialog.vue} +69 -57
- package/dialog/FeatureFlagListDialog.vue +288 -0
- package/dialog/ForceMachineRemoveDialog.vue +5 -2
- package/{components/Import.vue → dialog/ImportDialog.vue} +0 -5
- package/{pages/c/_cluster/uiplugins/InstallDialog.vue → dialog/InstallExtensionDialog.vue} +124 -106
- package/{components/form/SSHKnownHosts → dialog}/KnownHostsEditDialog.vue +52 -59
- package/dialog/MoveNamespaceDialog.vue +157 -0
- package/dialog/ScalePoolDownDialog.vue +1 -1
- package/{components/nav/Jump.vue → dialog/SearchDialog.vue} +34 -14
- package/{pages/c/_cluster/uiplugins/UninstallDialog.vue → dialog/UninstallExtensionDialog.vue} +67 -58
- package/dialog/WechatDialog.vue +57 -0
- package/edit/__tests__/monitoring.coreos.com.prometheusrule.test.ts +16 -3
- package/edit/auth/__tests__/oidc.test.ts +152 -109
- package/edit/auth/azuread.vue +2 -1
- package/edit/auth/github.vue +1 -1
- package/edit/auth/googleoauth.vue +5 -1
- package/edit/auth/ldap/index.vue +1 -1
- package/edit/auth/oidc.vue +38 -5
- package/edit/auth/saml.vue +1 -1
- package/edit/cloudcredential.vue +24 -9
- package/edit/logging.banzaicloud.io.output/__tests__/logging.banzaicloud.io.output.test.ts +40 -9
- package/edit/management.cattle.io.user.vue +28 -3
- package/edit/namespace.vue +1 -4
- package/edit/networking.k8s.io.ingress/IngressClass.vue +7 -3
- package/edit/networking.k8s.io.ingress/__tests__/IngressClass.test.ts +58 -0
- package/edit/persistentvolume/__tests__/persistentvolume.test.ts +14 -2
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +26 -9
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +8 -8
- package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +26 -12
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +66 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/rke2-test-data.ts +58 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +49 -41
- package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +6 -1
- package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +5 -3
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +33 -2
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +2 -2
- package/edit/token.vue +2 -0
- package/edit/workload/index.vue +1 -0
- package/edit/workload/mixins/workload.js +0 -2
- package/initialize/install-plugins.js +2 -1
- package/list/harvesterhci.io.management.cluster.vue +4 -1
- package/list/management.cattle.io.feature.vue +4 -287
- package/list/provisioning.cattle.io.cluster.vue +20 -12
- package/machine-config/azure.vue +16 -4
- package/mixins/vue-select-overrides.js +0 -4
- package/models/__tests__/namespace.test.ts +25 -1
- package/models/cloudcredential.js +5 -0
- package/models/fleet.cattle.io.cluster.js +8 -2
- package/models/fleet.cattle.io.gitrepo.js +8 -34
- package/models/kontainerdriver.js +6 -3
- package/models/management.cattle.io.feature.js +7 -1
- package/models/management.cattle.io.node.js +3 -3
- package/models/namespace.js +11 -6
- package/models/nodedriver.js +6 -3
- package/models/workload.js +4 -1
- package/package.json +3 -3
- package/pages/about.vue +13 -3
- package/pages/account/index.vue +16 -6
- package/pages/auth/login.vue +18 -7
- package/pages/auth/logout.vue +4 -1
- package/pages/auth/setup.vue +2 -0
- package/pages/auth/verify.vue +13 -8
- package/pages/c/_cluster/apps/charts/chart.vue +1 -1
- package/pages/c/_cluster/apps/charts/install.vue +26 -26
- package/pages/c/_cluster/auth/config/index.vue +10 -12
- package/pages/c/_cluster/explorer/EventsTable.vue +38 -33
- package/pages/c/_cluster/explorer/index.vue +17 -15
- package/pages/c/_cluster/istio/index.vue +2 -2
- package/pages/c/_cluster/longhorn/index.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/monitoring/monitor/_namespace/_id.vue +4 -2
- package/pages/c/_cluster/monitoring/monitor/create.vue +4 -2
- package/pages/c/_cluster/monitoring/route-receiver/_id.vue +4 -2
- package/pages/c/_cluster/monitoring/route-receiver/create.vue +5 -2
- package/pages/c/_cluster/neuvector/index.vue +1 -1
- package/pages/c/_cluster/settings/banners.vue +4 -3
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +8 -10
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +4 -7
- package/pages/c/_cluster/uiplugins/index.vue +98 -55
- package/pages/diagnostic.vue +59 -11
- package/pages/fail-whale.vue +14 -8
- package/pages/home.vue +24 -18
- package/pages/prefs.vue +7 -6
- package/pages/support/index.vue +4 -1
- package/plugins/internal-api/index.ts +37 -0
- package/plugins/internal-api/shared/base-api.ts +13 -0
- package/plugins/internal-api/shell/shell.api.ts +108 -0
- package/plugins/steve/actions.js +0 -12
- package/public/index.html +1 -0
- package/rancher-components/Card/Card.vue +1 -1
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +59 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +27 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +47 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +20 -2
- package/rancher-components/Form/Radio/RadioButton.test.ts +36 -1
- package/rancher-components/Form/Radio/RadioButton.vue +20 -4
- package/rancher-components/Form/Radio/RadioGroup.test.ts +60 -0
- package/rancher-components/Form/Radio/RadioGroup.vue +52 -10
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +17 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +5 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +10 -1
- package/rancher-components/RcButton/RcButton.vue +2 -1
- package/rancher-components/RcButton/types.ts +1 -0
- package/rancher-components/RcDropdown/RcDropdown.vue +18 -6
- package/rancher-components/RcDropdown/RcDropdownItem.vue +3 -56
- package/rancher-components/RcDropdown/RcDropdownItemCheckbox.vue +68 -0
- package/rancher-components/RcDropdown/RcDropdownItemSelect.vue +92 -0
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +10 -0
- package/rancher-components/RcDropdown/index.ts +2 -0
- package/rancher-components/RcDropdown/useDropdownCollection.ts +8 -0
- package/rancher-components/RcDropdown/useDropdownContext.ts +9 -3
- package/rancher-components/RcDropdown/useDropdownItem.ts +63 -0
- package/scripts/extension/bundle +20 -0
- package/scripts/extension/helm/charts/ui-plugin-server/templates/cr.yaml +2 -1
- package/scripts/extension/helm/charts/ui-plugin-server/values.yaml +2 -0
- package/scripts/extension/helmpatch +44 -31
- package/scripts/extension/publish +12 -12
- package/scripts/typegen.sh +2 -4
- package/server/har-file.js +25 -3
- package/store/action-menu.js +26 -56
- package/store/features.js +2 -1
- package/store/index.js +5 -0
- package/store/modal.ts +71 -0
- package/store/slideInPanel.ts +47 -0
- package/store/type-map.js +12 -1
- package/store/type-map.utils.ts +4 -4
- package/types/global-vue.d.ts +5 -0
- package/types/internal-api/shell/growl.d.ts +25 -0
- package/types/internal-api/shell/modal.d.ts +77 -0
- package/types/internal-api/shell/slideIn.d.ts +15 -0
- package/types/resources/fleet.d.ts +0 -14
- package/types/shell/index.d.ts +43 -24
- package/types/vue-shim.d.ts +4 -1
- package/utils/__mocks__/tabbable.js +13 -0
- package/utils/__tests__/object.test.ts +38 -4
- package/utils/cluster.js +35 -0
- package/utils/fleet.ts +15 -73
- package/utils/object.js +48 -5
- package/utils/validators/formRules/__tests__/index.test.ts +10 -1
- package/utils/validators/formRules/index.ts +27 -3
- package/utils/validators/machine-pool.ts +20 -0
- package/components/DisableAuthProviderModal.vue +0 -114
- package/components/MoveModal.vue +0 -166
- package/components/PromptChangePassword.vue +0 -123
- package/components/fleet/FleetBundleResources.vue +0 -86
- package/components/formatter/ExtensionCache.vue +0 -74
- package/components/formatter/Port.vue +0 -24
- package/components/formatter/SecretType.vue +0 -41
- package/types/vue-shim.d +0 -20
|
@@ -62,8 +62,21 @@ export interface ValidationOptions {
|
|
|
62
62
|
key?: string,
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @param t the function name we use for getting a translated string
|
|
67
|
+
* @param key the argument passed to the translation to reference the label
|
|
68
|
+
* @returns { Validator<any> | ValidatorFactory } A dictionary of actual validation functions or factories (require parameter)
|
|
69
|
+
* @description
|
|
70
|
+
* This function returns a set of validators that can be used in the form validation process.
|
|
71
|
+
* @example
|
|
72
|
+
* const validators = formRulesGenerator(t, { key: 'MyLabel' });
|
|
73
|
+
* validators.required(); // '"MyLabel" is required'
|
|
74
|
+
* validators.minLength(5)('123'); // '"MyLabel" must contain more than 5 characters'
|
|
75
|
+
*/
|
|
76
|
+
export default function(
|
|
77
|
+
t: Translation,
|
|
78
|
+
{ key = 'Value' }: ValidationOptions
|
|
79
|
+
): { [key: string]: Validator<any> | ValidatorFactory } {
|
|
67
80
|
// utility validators these validators only get used by other validators
|
|
68
81
|
const startDot: ValidatorFactory = (label: string): Validator => (val: string) => val?.slice(0, 1) === '.' ? t(`validation.dns.${ label }.startDot`, { key }) : undefined;
|
|
69
82
|
|
|
@@ -157,7 +170,18 @@ export default function(t: Translation, { key = 'Value' }: ValidationOptions): {
|
|
|
157
170
|
|
|
158
171
|
const url: Validator = (val: string) => val && !isUrl(val) ? t('validation.setting.serverUrl.url') : undefined;
|
|
159
172
|
|
|
160
|
-
const gitRepository: Validator = (
|
|
173
|
+
const gitRepository: Validator = (url: string) => {
|
|
174
|
+
const regexPart1 = /^((http|git|ssh|http(s)|file|\/?)|(git@[\w\.]+))(:(\/\/)?)/gm;
|
|
175
|
+
const regexPart2 = /^([\w\.@\:\/\-]+)([\d\/\w.-]+?)(.git){0,1}(\/)?$/gm;
|
|
176
|
+
|
|
177
|
+
if (url) {
|
|
178
|
+
const urlPart2 = url.replaceAll(regexPart1, '');
|
|
179
|
+
|
|
180
|
+
return !urlPart2 || url === urlPart2 || !regexPart2.test(urlPart2.replaceAll('%20', '')) ? t('validation.git.repository') : undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return undefined;
|
|
184
|
+
};
|
|
161
185
|
|
|
162
186
|
const alphanumeric: Validator = (val: string) => val && !/^[a-zA-Z0-9]+$/.test(val) ? t('validation.alphanumeric', { key }) : undefined;
|
|
163
187
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const FIELDS = {
|
|
2
|
+
NAME: 'pool.name',
|
|
3
|
+
QUANTITY: 'pool.quantity'
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
const RULESETS = [
|
|
7
|
+
{
|
|
8
|
+
path: FIELDS.QUANTITY,
|
|
9
|
+
rules: ['requiredInt', 'isPositive'],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
path: FIELDS.NAME,
|
|
13
|
+
rules: ['required'],
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export const MACHINE_POOL_VALIDATION = {
|
|
18
|
+
FIELDS,
|
|
19
|
+
RULESETS
|
|
20
|
+
};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Card } from '@components/Card';
|
|
3
|
-
import AppModal from '@shell/components/AppModal.vue';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
name: 'PromptRemove',
|
|
7
|
-
|
|
8
|
-
emits: ['disable'],
|
|
9
|
-
|
|
10
|
-
components: { Card, AppModal },
|
|
11
|
-
props: {
|
|
12
|
-
/**
|
|
13
|
-
* Inherited global identifier prefix for tests
|
|
14
|
-
* Define a term based on the parent component to avoid conflicts on multiple components
|
|
15
|
-
*/
|
|
16
|
-
componentTestid: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: 'disable-auth-provider'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
data() {
|
|
22
|
-
return { showModal: false };
|
|
23
|
-
},
|
|
24
|
-
methods: {
|
|
25
|
-
show() {
|
|
26
|
-
this.showModal = true;
|
|
27
|
-
},
|
|
28
|
-
close() {
|
|
29
|
-
this.showModal = false;
|
|
30
|
-
},
|
|
31
|
-
disable() {
|
|
32
|
-
this.showModal = false;
|
|
33
|
-
this.$emit('disable');
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<template>
|
|
40
|
-
<app-modal
|
|
41
|
-
v-if="showModal"
|
|
42
|
-
custom-class="remove-modal"
|
|
43
|
-
name="disableAuthProviderModal"
|
|
44
|
-
:width="400"
|
|
45
|
-
height="auto"
|
|
46
|
-
styles="max-height: 100vh;"
|
|
47
|
-
@close="close"
|
|
48
|
-
>
|
|
49
|
-
<Card
|
|
50
|
-
class="disable-auth-provider"
|
|
51
|
-
:show-highlight-border="false"
|
|
52
|
-
>
|
|
53
|
-
<template #title>
|
|
54
|
-
<h4 class="text-default-text">
|
|
55
|
-
{{ t('promptRemove.title') }}
|
|
56
|
-
</h4>
|
|
57
|
-
</template>
|
|
58
|
-
<template #body>
|
|
59
|
-
<div class="mb-10">
|
|
60
|
-
<p v-clean-html="t('promptRemove.attemptingToRemoveAuthConfig', null, true)" />
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
<template #actions>
|
|
64
|
-
<button
|
|
65
|
-
class="btn role-secondary"
|
|
66
|
-
@click="close"
|
|
67
|
-
>
|
|
68
|
-
{{ t('generic.cancel') }}
|
|
69
|
-
</button>
|
|
70
|
-
<div class="spacer" />
|
|
71
|
-
<button
|
|
72
|
-
class="btn role-primary bg-error ml-10"
|
|
73
|
-
:data-testid="componentTestid + '-confirm-button'"
|
|
74
|
-
@click="disable"
|
|
75
|
-
>
|
|
76
|
-
{{ t('generic.disable') }}
|
|
77
|
-
</button>
|
|
78
|
-
</template>
|
|
79
|
-
</Card>
|
|
80
|
-
</app-modal>
|
|
81
|
-
</template>
|
|
82
|
-
|
|
83
|
-
<style lang='scss'>
|
|
84
|
-
.disable-auth-provider {
|
|
85
|
-
&.card-container {
|
|
86
|
-
box-shadow: none;
|
|
87
|
-
}
|
|
88
|
-
#confirm {
|
|
89
|
-
width: 90%;
|
|
90
|
-
margin-left: 3px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.remove-modal {
|
|
94
|
-
border-radius: var(--border-radius);
|
|
95
|
-
overflow: scroll;
|
|
96
|
-
max-height: 100vh;
|
|
97
|
-
& ::-webkit-scrollbar-corner {
|
|
98
|
-
background: rgba(0,0,0,0);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.actions {
|
|
103
|
-
text-align: right;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.card-actions {
|
|
107
|
-
display: flex;
|
|
108
|
-
|
|
109
|
-
.spacer {
|
|
110
|
-
flex: 1;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
</style>
|
package/components/MoveModal.vue
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { mapState, mapGetters } from 'vuex';
|
|
3
|
-
import { Card } from '@components/Card';
|
|
4
|
-
import AsyncButton from '@shell/components/AsyncButton';
|
|
5
|
-
import AppModal from '@shell/components/AppModal.vue';
|
|
6
|
-
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
7
|
-
import { MANAGEMENT } from '@shell/config/types';
|
|
8
|
-
import Loading from '@shell/components/Loading';
|
|
9
|
-
import { PROJECT } from '@shell/config/labels-annotations';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
emits: ['moving'],
|
|
13
|
-
|
|
14
|
-
components: {
|
|
15
|
-
AsyncButton, Card, LabeledSelect, Loading, AppModal
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
async fetch() {
|
|
19
|
-
this.projects = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.PROJECT });
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
data() {
|
|
23
|
-
return {
|
|
24
|
-
modalName: 'move-modal', projects: [], targetProject: null, showModal: false
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
computed: {
|
|
29
|
-
...mapState('action-menu', ['showPromptMove', 'toMove']),
|
|
30
|
-
...mapGetters(['currentCluster']),
|
|
31
|
-
|
|
32
|
-
excludedProjects() {
|
|
33
|
-
return this.toMove.filter((namespace) => !!namespace.project).map((namespace) => namespace.project.shortId);
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
projectOptions() {
|
|
37
|
-
return this.projects.reduce((inCluster, project) => {
|
|
38
|
-
if (!this.excludedProjects.includes(project.shortId) && project.spec?.clusterName === this.currentCluster.id) {
|
|
39
|
-
inCluster.push({
|
|
40
|
-
value: project.shortId,
|
|
41
|
-
label: project.nameDisplay
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return inCluster;
|
|
46
|
-
}, []);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
watch: {
|
|
51
|
-
showPromptMove(show) {
|
|
52
|
-
if (show) {
|
|
53
|
-
this.showModal = true;
|
|
54
|
-
} else {
|
|
55
|
-
this.showModal = false;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
methods: {
|
|
61
|
-
close() {
|
|
62
|
-
this.$store.commit('action-menu/togglePromptMove');
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
async move(finish) {
|
|
66
|
-
const cluster = this.$store.getters['currentCluster'];
|
|
67
|
-
const clusterWithProjectId = `${ cluster.id }:${ this.targetProject }`;
|
|
68
|
-
|
|
69
|
-
const promises = this.toMove.map((namespace) => {
|
|
70
|
-
namespace.setLabel(PROJECT, this.targetProject);
|
|
71
|
-
namespace.setAnnotation(PROJECT, clusterWithProjectId);
|
|
72
|
-
|
|
73
|
-
return namespace.save();
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
this.$emit('moving');
|
|
78
|
-
await Promise.all(promises);
|
|
79
|
-
finish(true);
|
|
80
|
-
this.targetProject = null;
|
|
81
|
-
this.close();
|
|
82
|
-
} catch (ex) {
|
|
83
|
-
finish(false);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
</script>
|
|
89
|
-
<template>
|
|
90
|
-
<app-modal
|
|
91
|
-
v-if="showModal"
|
|
92
|
-
class="move-modal"
|
|
93
|
-
:name="modalName"
|
|
94
|
-
:width="440"
|
|
95
|
-
height="auto"
|
|
96
|
-
@close="close"
|
|
97
|
-
>
|
|
98
|
-
<Loading v-if="$fetchState.pending" />
|
|
99
|
-
<Card
|
|
100
|
-
v-else
|
|
101
|
-
class="move-modal-card"
|
|
102
|
-
:show-highlight-border="false"
|
|
103
|
-
>
|
|
104
|
-
<template #title>
|
|
105
|
-
<h4 class="text-default-text">
|
|
106
|
-
{{ t('moveModal.title') }}
|
|
107
|
-
</h4>
|
|
108
|
-
</template>
|
|
109
|
-
<template #body>
|
|
110
|
-
<div>
|
|
111
|
-
{{ t('moveModal.description') }}
|
|
112
|
-
<ul class="namespaces">
|
|
113
|
-
<li
|
|
114
|
-
v-for="(namespace, i) in toMove"
|
|
115
|
-
:key="i"
|
|
116
|
-
>
|
|
117
|
-
{{ namespace.nameDisplay }}
|
|
118
|
-
</li>
|
|
119
|
-
</ul>
|
|
120
|
-
</div>
|
|
121
|
-
<LabeledSelect
|
|
122
|
-
v-model:value="targetProject"
|
|
123
|
-
:options="projectOptions"
|
|
124
|
-
:label="t('moveModal.targetProject')"
|
|
125
|
-
/>
|
|
126
|
-
</template>
|
|
127
|
-
<template #actions>
|
|
128
|
-
<button
|
|
129
|
-
class="btn role-secondary"
|
|
130
|
-
@click="close"
|
|
131
|
-
>
|
|
132
|
-
{{ t('generic.cancel') }}
|
|
133
|
-
</button>
|
|
134
|
-
<AsyncButton
|
|
135
|
-
:action-label="t('moveModal.moveButtonLabel')"
|
|
136
|
-
class="btn bg-primary ml-10"
|
|
137
|
-
:disabled="!targetProject"
|
|
138
|
-
@click="move"
|
|
139
|
-
/>
|
|
140
|
-
</template>
|
|
141
|
-
</Card>
|
|
142
|
-
</app-modal>
|
|
143
|
-
</template>
|
|
144
|
-
|
|
145
|
-
<style lang='scss'>
|
|
146
|
-
.move-modal {
|
|
147
|
-
.namespaces {
|
|
148
|
-
max-height: 200px;
|
|
149
|
-
overflow-y: scroll;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.move-modal-card {
|
|
153
|
-
box-shadow: none;
|
|
154
|
-
|
|
155
|
-
border-radius: var(--border-radius);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.actions {
|
|
159
|
-
text-align: right;
|
|
160
|
-
}
|
|
161
|
-
.card-actions {
|
|
162
|
-
display: flex;
|
|
163
|
-
justify-content: center;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
</style>
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { mapGetters } from 'vuex';
|
|
3
|
-
import ChangePassword from '@shell/components/form/ChangePassword';
|
|
4
|
-
import { Card } from '@components/Card';
|
|
5
|
-
import AsyncButton from '@shell/components/AsyncButton';
|
|
6
|
-
import AppModal from '@shell/components/AppModal.vue';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
components: {
|
|
10
|
-
Card, AsyncButton, ChangePassword, AppModal
|
|
11
|
-
},
|
|
12
|
-
data() {
|
|
13
|
-
return {
|
|
14
|
-
valid: false, password: '', showModal: false
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
computed: { ...mapGetters({ t: 'i18n/t' }) },
|
|
18
|
-
methods: {
|
|
19
|
-
show(show) {
|
|
20
|
-
if (show) {
|
|
21
|
-
this.showModal = true;
|
|
22
|
-
} else {
|
|
23
|
-
this.showModal = false;
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
async submit(buttonCb) {
|
|
27
|
-
try {
|
|
28
|
-
await this.$refs.changePassword.save();
|
|
29
|
-
this.show(false);
|
|
30
|
-
buttonCb(true);
|
|
31
|
-
} catch (err) {
|
|
32
|
-
buttonCb(false);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<template>
|
|
40
|
-
<app-modal
|
|
41
|
-
v-if="showModal"
|
|
42
|
-
custom-class="change-password-modal"
|
|
43
|
-
data-testid="change-password__modal"
|
|
44
|
-
name="password-modal"
|
|
45
|
-
:width="500"
|
|
46
|
-
:height="465"
|
|
47
|
-
:trigger-focus-trap="true"
|
|
48
|
-
@close="show(false)"
|
|
49
|
-
>
|
|
50
|
-
<Card
|
|
51
|
-
class="prompt-password"
|
|
52
|
-
:show-highlight-border="false"
|
|
53
|
-
>
|
|
54
|
-
<template #title>
|
|
55
|
-
<h4 class="text-default-text">
|
|
56
|
-
{{ t("changePassword.title") }}
|
|
57
|
-
</h4>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<template #body>
|
|
61
|
-
<form @submit.prevent>
|
|
62
|
-
<ChangePassword
|
|
63
|
-
ref="changePassword"
|
|
64
|
-
@valid="valid = $event"
|
|
65
|
-
/>
|
|
66
|
-
</form>
|
|
67
|
-
</template>
|
|
68
|
-
|
|
69
|
-
<template #actions>
|
|
70
|
-
<!-- type reset is required by lastpass -->
|
|
71
|
-
<button
|
|
72
|
-
class="btn role-secondary"
|
|
73
|
-
role="button"
|
|
74
|
-
:aria-label="t('changePassword.cancel')"
|
|
75
|
-
type="reset"
|
|
76
|
-
@click="show(false)"
|
|
77
|
-
>
|
|
78
|
-
{{ t("changePassword.cancel") }}
|
|
79
|
-
</button>
|
|
80
|
-
<AsyncButton
|
|
81
|
-
type="submit"
|
|
82
|
-
mode="apply"
|
|
83
|
-
class="btn bg-error ml-10"
|
|
84
|
-
:disabled="!valid"
|
|
85
|
-
value="LOGIN"
|
|
86
|
-
@click="submit"
|
|
87
|
-
/>
|
|
88
|
-
</template>
|
|
89
|
-
</Card>
|
|
90
|
-
</app-modal>
|
|
91
|
-
</template>
|
|
92
|
-
|
|
93
|
-
<style lang="scss" scoped>
|
|
94
|
-
.prompt-password {
|
|
95
|
-
:deep() .card-wrap {
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-direction: column;
|
|
98
|
-
|
|
99
|
-
.card-body {
|
|
100
|
-
flex: 1;
|
|
101
|
-
justify-content: start;
|
|
102
|
-
& > div {
|
|
103
|
-
flex: 1;
|
|
104
|
-
display: flex;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.card-actions {
|
|
109
|
-
display: flex;
|
|
110
|
-
justify-content: flex-end;
|
|
111
|
-
width: 100%;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.prompt-password {
|
|
117
|
-
flex: 1;
|
|
118
|
-
display: flex;
|
|
119
|
-
form {
|
|
120
|
-
flex: 1;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
</style>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { colorForState, stateDisplay, stateSort } from '@shell/plugins/dashboard-store/resource-class';
|
|
3
|
-
import SortableTable from '@shell/components/SortableTable';
|
|
4
|
-
import { randomStr } from '@shell/utils/string';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
name: 'FleetBundleResources',
|
|
8
|
-
|
|
9
|
-
components: { SortableTable },
|
|
10
|
-
|
|
11
|
-
props: {
|
|
12
|
-
value: {
|
|
13
|
-
type: Array,
|
|
14
|
-
default: () => [],
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
computed: {
|
|
19
|
-
computedResources() {
|
|
20
|
-
return this.value.map((item) => {
|
|
21
|
-
const { state } = item;
|
|
22
|
-
const color = colorForState(state).replace('text-', 'bg-');
|
|
23
|
-
const display = stateDisplay(state);
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
...item,
|
|
27
|
-
tableKey: randomStr(),
|
|
28
|
-
stateBackground: color,
|
|
29
|
-
stateDisplay: display,
|
|
30
|
-
stateSort: stateSort(color, display),
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
resourceHeaders() {
|
|
36
|
-
return [
|
|
37
|
-
{
|
|
38
|
-
name: 'state',
|
|
39
|
-
value: 'state',
|
|
40
|
-
label: 'State',
|
|
41
|
-
sort: 'stateSort',
|
|
42
|
-
formatter: 'BadgeStateFormatter',
|
|
43
|
-
width: 100,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'apiVersion',
|
|
47
|
-
value: 'apiVersion',
|
|
48
|
-
sort: 'apiVersion',
|
|
49
|
-
label: 'API Version',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'kind',
|
|
53
|
-
value: 'kind',
|
|
54
|
-
sort: 'kind',
|
|
55
|
-
label: 'Kind',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'name',
|
|
59
|
-
value: 'name',
|
|
60
|
-
sort: 'name',
|
|
61
|
-
label: 'Name',
|
|
62
|
-
formatter: 'LinkDetail',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'namespace',
|
|
66
|
-
value: 'namespace',
|
|
67
|
-
sort: 'namespace',
|
|
68
|
-
label: 'Namespace',
|
|
69
|
-
},
|
|
70
|
-
];
|
|
71
|
-
},
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
</script>
|
|
75
|
-
|
|
76
|
-
<template>
|
|
77
|
-
<SortableTable
|
|
78
|
-
:rows="computedResources"
|
|
79
|
-
:headers="resourceHeaders"
|
|
80
|
-
:table-actions="false"
|
|
81
|
-
:row-actions="false"
|
|
82
|
-
key-field="tableKey"
|
|
83
|
-
default-sort-by="state"
|
|
84
|
-
:paged="true"
|
|
85
|
-
/>
|
|
86
|
-
</template>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { BadgeState } from '@components/BadgeState';
|
|
3
|
-
import { stateDisplay } from '@shell/plugins/dashboard-store/resource-class';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
props: {
|
|
7
|
-
value: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: ''
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
components: { BadgeState },
|
|
14
|
-
|
|
15
|
-
data() {
|
|
16
|
-
const STATES = {
|
|
17
|
-
cached: {
|
|
18
|
-
color: 'info', icon: 'dot-open', label: 'Cached', compoundIcon: 'checkmark'
|
|
19
|
-
},
|
|
20
|
-
pending: {
|
|
21
|
-
color: 'warning', icon: 'tag', label: 'In Progress', compoundIcon: 'info'
|
|
22
|
-
},
|
|
23
|
-
disabled: {
|
|
24
|
-
color: 'error', icon: 'dot-half', label: 'Cache Disabled', compoundIcon: 'info'
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
STATES,
|
|
30
|
-
stateDisplay: '',
|
|
31
|
-
stateBackground: ''
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
watch: {
|
|
36
|
-
value: {
|
|
37
|
-
handler() {
|
|
38
|
-
const out = this.value || 'pending';
|
|
39
|
-
const color = this.colorForState(out);
|
|
40
|
-
|
|
41
|
-
this.stateDisplay = stateDisplay(out);
|
|
42
|
-
this.stateBackground = color.replace('text-', 'bg-');
|
|
43
|
-
},
|
|
44
|
-
immediate: true
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
methods: {
|
|
49
|
-
colorForState(state) {
|
|
50
|
-
const key = (state).toLowerCase();
|
|
51
|
-
let color;
|
|
52
|
-
|
|
53
|
-
if ( this.STATES[key] && this.STATES[key].color ) {
|
|
54
|
-
color = this.STATES[key].color;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if ( !color ) {
|
|
58
|
-
color = 'info';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return `text-${ color }`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<template>
|
|
68
|
-
<div>
|
|
69
|
-
<BadgeState
|
|
70
|
-
:color="stateBackground"
|
|
71
|
-
:label="stateDisplay"
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
props: {
|
|
4
|
-
value: {
|
|
5
|
-
type: Array,
|
|
6
|
-
default: () => []
|
|
7
|
-
}
|
|
8
|
-
},
|
|
9
|
-
data() {
|
|
10
|
-
const { hostPort = '', protocol = '' } = this.value[0] || {};
|
|
11
|
-
|
|
12
|
-
return { hostPort, protocol };
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<div v-if="hostPort">
|
|
19
|
-
{{ hostPort+'/'+protocol }}
|
|
20
|
-
</div>
|
|
21
|
-
<div v-else>
|
|
22
|
-
—
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { SERVICE_ACCOUNT } from '@shell/config/types';
|
|
3
|
-
export default {
|
|
4
|
-
props: {
|
|
5
|
-
value: {
|
|
6
|
-
type: [String, Object],
|
|
7
|
-
default: 'Opaque'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
data() {
|
|
11
|
-
if (this.value.typeDisplay) {
|
|
12
|
-
this.findServiceAccount();
|
|
13
|
-
|
|
14
|
-
return { typeDisplay: this.value.typeDisplay, serviceAccountLink: null };
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return { typeDisplay: this.value, serviceAccountLink: null };
|
|
18
|
-
},
|
|
19
|
-
methods: {
|
|
20
|
-
async findServiceAccount() {
|
|
21
|
-
const serviceAccount = await this.$store.dispatch('cluster/find', { type: SERVICE_ACCOUNT, id: this.value.serviceAccountID });
|
|
22
|
-
|
|
23
|
-
if (serviceAccount) {
|
|
24
|
-
this.serviceAccountLink = serviceAccount.detailLocation;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
</script>>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<router-link
|
|
33
|
-
v-if="serviceAccountLink"
|
|
34
|
-
:to="serviceAccountLink"
|
|
35
|
-
>
|
|
36
|
-
{{ typeDisplay }}
|
|
37
|
-
</router-link>
|
|
38
|
-
<div v-else>
|
|
39
|
-
{{ typeDisplay }}
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|