@rancher/shell 0.5.2 → 1.2.0
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/.DS_Store +0 -0
- package/assets/images/providers/aks-black.svg +28 -0
- package/assets/images/providers/aks.svg +31 -0
- package/assets/styles/global/_labeled-input.scss +1 -0
- package/assets/styles/global/_layout.scss +0 -99
- package/assets/translations/en-us.yaml +77 -71
- package/assets/translations/zh-hans.yaml +25 -23
- package/babel.config.js +1 -7
- package/chart/gatekeeper.vue +11 -2
- package/chart/istio.vue +10 -1
- package/chart/logging/index.vue +11 -2
- package/chart/monitoring/alerting/index.vue +21 -7
- package/chart/monitoring/grafana/index.vue +2 -57
- package/chart/monitoring/index.vue +26 -52
- package/chart/monitoring/prometheus/index.vue +43 -37
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/azure.vue +17 -4
- package/components/AsyncButton.vue +0 -9
- package/components/Carousel.vue +0 -1
- package/components/ChartPsp.vue +76 -0
- package/components/CodeMirror.vue +21 -19
- package/components/CopyCode.vue +2 -6
- package/components/CopyToClipboard.vue +1 -2
- package/components/CopyToClipboardText.vue +9 -14
- package/components/CruResource.vue +0 -1
- package/components/EtcdInfoBanner.vue +5 -5
- package/components/ExplorerProjectsNamespaces.vue +1 -25
- package/components/IconOrSvg.vue +1 -1
- package/components/Markdown.vue +12 -16
- package/components/Questions/index.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +9 -25
- package/components/ResourceList/Masthead.vue +18 -1
- package/components/ResourceTable.vue +2 -14
- package/components/ResourceYaml.vue +0 -5
- package/components/SideNav.vue +1 -1
- package/components/SortableTable/THead.vue +9 -7
- package/components/SortableTable/index.vue +3 -2
- package/components/StatusTable.vue +1 -5
- package/components/TabTitle.vue +84 -0
- package/components/Tabbed/index.vue +0 -12
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CopyCode.test.ts +4 -5
- package/components/fleet/FleetBundles.vue +11 -5
- package/components/fleet/FleetRepos.vue +27 -62
- package/components/fleet/FleetResources.vue +1 -6
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/FleetSummary.vue +30 -35
- package/components/form/ArrayList.vue +8 -1
- package/components/form/ArrayListSelect.vue +9 -9
- package/components/form/KeyValue.vue +0 -1
- package/components/form/LabeledSelect.vue +0 -4
- package/components/form/Password.vue +1 -3
- package/components/form/Select.vue +1 -1
- package/components/form/SelectOrCreateAuthSecret.vue +4 -4
- package/components/form/__tests__/KeyValue.test.ts +1 -1
- package/components/formatter/Checked.vue +3 -11
- package/components/formatter/ClusterProvider.vue +18 -1
- package/components/formatter/FleetSummaryGraph.vue +11 -23
- package/components/formatter/LiveDate.vue +16 -0
- package/components/formatter/LiveDuration.vue +1 -1
- package/components/formatter/PercentageBar.vue +1 -1
- package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
- package/components/nav/Group.vue +2 -2
- package/components/nav/Header.vue +2 -1
- package/components/nav/TopLevelMenu.vue +3 -29
- package/components/nav/Type.vue +3 -1
- package/components/nav/WindowManager/ContainerLogs.vue +19 -120
- package/components/nav/WindowManager/ContainerShell.vue +1 -6
- package/components/nav/WindowManager/index.vue +10 -11
- package/components/nav/__tests__/TopLevelMenu.test.ts +0 -33
- package/components/nav/__tests__/Type.test.ts +1 -1
- package/components/nuxt/nuxt-child.js +78 -14
- package/components/nuxt/nuxt.js +1 -1
- package/components/user.retention/user-retention-header.vue +34 -0
- package/composables/useI18n.ts +26 -0
- package/composables/useStore.ts +16 -0
- package/config/harvester-manager-types.js +0 -2
- package/config/home-links.js +32 -2
- package/config/private-label.js +0 -22
- package/config/product/explorer.js +4 -4
- package/config/product/fleet.js +1 -6
- package/config/product/legacy.js +1 -84
- package/config/product/manager.js +15 -8
- package/config/query-params.js +0 -1
- package/config/router.js +368 -385
- package/config/settings.ts +9 -2
- package/config/store.js +1 -1
- package/config/system-namespaces.js +0 -3
- package/config/table-headers.js +27 -47
- package/config/types.js +5 -0
- package/config/uiplugins.js +1 -1
- package/core/plugin-helpers.js +5 -3
- package/core/plugin-routes.ts +114 -56
- package/core/plugin.ts +10 -16
- package/core/plugins-loader.js +9 -7
- package/core/plugins.js +3 -0
- package/core/types-provisioning.ts +0 -7
- package/creators/app/init +0 -19
- package/detail/fleet.cattle.io.cluster.vue +1 -11
- package/detail/node.vue +0 -42
- package/detail/pod.vue +1 -68
- package/detail/provisioning.cattle.io.cluster.vue +4 -6
- package/detail/workload/index.vue +1 -15
- package/dialog/ScaleMachineDownDialog.vue +17 -34
- package/edit/auth/googleoauth.vue +5 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
- package/edit/cloudcredential.vue +0 -2
- package/edit/fleet.cattle.io.gitrepo.vue +4 -3
- package/edit/management.cattle.io.project.vue +52 -1
- package/edit/management.cattle.io.setting.vue +2 -31
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +126 -109
- package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +3 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +37 -99
- package/edit/provisioning.cattle.io.cluster/rke2.vue +690 -181
- package/edit/service.vue +0 -12
- package/edit/workload/Upgrading.vue +2 -3
- package/edit/workload/index.vue +1 -2
- package/edit/workload/mixins/workload.js +1 -1
- package/initialize/App.js +71 -25
- package/initialize/client.js +162 -21
- package/initialize/index.js +124 -47
- package/initialize/layouts.ts +26 -0
- package/{components/templates → layouts}/blank.vue +1 -1
- package/{components/templates → layouts}/default.vue +98 -8
- package/{components/templates → layouts}/error.vue +19 -10
- package/{components/templates → layouts}/home.vue +1 -4
- package/{components/templates → layouts}/plain.vue +1 -4
- package/{components/templates → layouts}/standalone.vue +1 -1
- package/{components/templates → layouts}/unauthenticated.vue +1 -1
- package/list/management.cattle.io.feature.vue +7 -1
- package/list/management.cattle.io.user.vue +25 -1
- package/list/node.vue +0 -1
- package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
- package/machine-config/amazonec2.vue +1 -0
- package/machine-config/azure.vue +37 -21
- package/machine-config/vmwarevsphere.vue +47 -42
- package/middleware/authenticated.js +19 -14
- package/mixins/auth-config.js +7 -2
- package/mixins/brand.js +41 -29
- package/mixins/fetch.server.js +73 -0
- package/mixins/labeled-form-element.ts +1 -6
- package/models/__tests__/management.cattle.io.node.ts +0 -85
- package/models/__tests__/namespace.test.ts +9 -49
- package/models/cluster/node.js +4 -4
- package/models/cluster.x-k8s.io.machine.js +1 -1
- package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
- package/models/fleet.cattle.io.cluster.js +0 -4
- package/models/fleet.cattle.io.gitrepo.js +13 -56
- package/models/management.cattle.io.cluster.js +3 -11
- package/models/management.cattle.io.kontainerdriver.js +0 -1
- package/models/management.cattle.io.node.js +14 -18
- package/models/management.cattle.io.nodepool.js +0 -17
- package/models/management.cattle.io.project.js +36 -0
- package/models/management.cattle.io.setting.js +7 -11
- package/models/management.cattle.io.user.js +65 -0
- package/models/namespace.js +1 -1
- package/models/pod.js +0 -20
- package/models/provisioning.cattle.io.cluster.js +8 -55
- package/models/secret.js +18 -117
- package/models/workload.js +0 -16
- package/models/workload.service.js +0 -18
- package/package.json +10 -12
- package/pages/about.vue +1 -0
- package/pages/account/create-key.vue +1 -0
- package/pages/account/index.vue +1 -0
- package/pages/auth/login.vue +1 -0
- package/pages/auth/logout.vue +2 -0
- package/pages/auth/setup.vue +4 -37
- package/pages/auth/verify.vue +8 -14
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
- package/pages/c/_cluster/apps/charts/index.vue +58 -64
- package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
- package/pages/c/_cluster/apps/charts/install.vue +5 -5
- package/pages/c/_cluster/apps/index.vue +2 -0
- package/pages/c/_cluster/auth/index.vue +2 -0
- package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
- package/pages/c/_cluster/ecm/index.vue +2 -0
- package/pages/c/_cluster/explorer/index.vue +53 -56
- package/pages/c/_cluster/explorer/tools/index.vue +3 -171
- package/pages/c/_cluster/fleet/index.vue +1 -1
- package/pages/c/_cluster/index.vue +2 -0
- package/pages/c/_cluster/manager/pages/_page.vue +5 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -17
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -0
- package/pages/c/_cluster/settings/banners.vue +2 -0
- package/pages/c/_cluster/settings/brand.vue +2 -0
- package/pages/c/_cluster/settings/index.vue +2 -0
- package/pages/c/_cluster/settings/links.vue +3 -2
- package/pages/c/_cluster/settings/performance.vue +1 -0
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +4 -4
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +5 -2
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +96 -0
- package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +128 -0
- package/pages/c/_cluster/uiplugins/index.vue +2 -0
- package/pages/c/index.vue +9 -0
- package/pages/diagnostic.vue +2 -1
- package/pages/fail-whale.vue +1 -0
- package/pages/prefs.vue +1 -0
- package/pages/rio/mesh.vue +508 -0
- package/pages/support/index.vue +8 -2
- package/pkg/auto-import.js +1 -1
- package/plugins/axios.js +36 -0
- package/plugins/back-button.js +5 -3
- package/plugins/clean-html-directive.js +19 -1
- package/plugins/clean-tooltip-directive.js +1 -1
- package/plugins/codemirror-loader.js +1 -1
- package/plugins/codemirror.js +0 -41
- package/plugins/dashboard-store/__tests__/actions.spec.ts +250 -0
- package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
- package/plugins/dashboard-store/actions.js +21 -22
- package/plugins/dashboard-store/classify.js +18 -1
- package/plugins/dashboard-store/getters.js +5 -10
- package/plugins/dashboard-store/index.js +12 -0
- package/plugins/dashboard-store/mutations.js +4 -0
- package/plugins/dashboard-store/resource-class.js +18 -59
- package/plugins/i18n.js +1 -1
- package/plugins/steve/__tests__/getters.spec.ts +56 -24
- package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
- package/plugins/steve/getters.js +30 -7
- package/plugins/steve/mutations.js +5 -2
- package/plugins/steve/norman-class.js +0 -19
- package/plugins/steve/steve-class.js +0 -22
- package/plugins/steve/subscribe.js +34 -13
- package/plugins/transitions.js +4 -0
- package/plugins/vue-clipboard2.js +4 -0
- package/rancher-components/Accordion/Accordion.vue +3 -2
- package/rancher-components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/Banner/Banner.test.ts +1 -5
- package/rancher-components/Banner/Banner.vue +2 -2
- package/rancher-components/Card/Card.vue +4 -4
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
- package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
- package/rancher-components/Form/Radio/RadioButton.vue +13 -7
- package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/StringList/StringList.vue +8 -8
- package/rancher-components/components/Accordion/Accordion.vue +3 -2
- package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
- package/rancher-components/components/StringList/StringList.test.ts +0 -270
- package/rancher-components/components/StringList/StringList.vue +18 -57
- package/scripts/extension/bundle +7 -19
- package/scripts/extension/helm/scripts/package +3 -11
- package/scripts/extension/parse-tag-name +4 -4
- package/scripts/extension/publish +9 -20
- package/scripts/publish-shell.sh +1 -11
- package/scripts/test-plugins-build.sh +9 -85
- package/store/catalog.js +1 -1
- package/store/features.js +0 -1
- package/store/i18n.js +0 -11
- package/store/index.js +11 -8
- package/store/prefs.js +38 -33
- package/store/type-map.js +8 -13
- package/tsconfig.default.json +46 -0
- package/tsconfig.json +9 -35
- package/types/shell/index.d.ts +404 -463
- package/utils/__tests__/create-yaml.test.ts +10 -0
- package/utils/axios.js +19 -0
- package/utils/create-yaml.js +6 -6
- package/utils/custom-validators.js +2 -0
- package/utils/error.js +1 -16
- package/utils/monitoring.js +2 -37
- package/utils/nuxt.js +39 -18
- package/utils/object.js +0 -14
- package/utils/router.scrollBehavior.js +14 -12
- package/utils/socket.js +1 -0
- package/utils/time.js +1 -1
- package/utils/title.ts +3 -0
- package/utils/url.ts +1 -1
- package/utils/validators/formRules/__tests__/index.test.ts +4 -49
- package/utils/validators/formRules/index.ts +9 -12
- package/utils/validators/setting.js +10 -6
- package/vue.config.js +3 -24
- package/chart/monitoring/steps/uninstall-v1.vue +0 -135
- package/components/Certificates.vue +0 -164
- package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
- package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
- package/components/formatter/__tests__/Checked.test.ts +0 -19
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
- package/composables/useCompactInput.ts +0 -20
- package/composables/useLabeledFormElement.ts +0 -138
- package/creators/app/files/.gitlab-ci.yml +0 -14
- package/edit/__tests__/service.test.ts +0 -89
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -144
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
- package/mixins/v1-workload-metrics.js +0 -43
- package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
- package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -90
- package/models/__tests__/workload.test.ts +0 -91
- package/plugins/clean-html.js +0 -53
- package/plugins/dashboard-store/__tests__/actions.test.ts +0 -165
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
- package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
- package/plugins/index.js +0 -11
- package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
- package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
- package/server/har-file.js +0 -183
- package/tsconfig.paths.json +0 -18
- package/utils/azure.js +0 -24
- package/utils/clipboard.js +0 -5
- /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
- /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
- /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
- /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
package/edit/service.vue
CHANGED
|
@@ -26,7 +26,6 @@ import { HARVESTER_NAME as HARVESTER } from '@shell/config/features';
|
|
|
26
26
|
import { allHash } from '@shell/utils/promise';
|
|
27
27
|
import { isHarvesterSatisfiesVersion } from '@shell/utils/cluster';
|
|
28
28
|
import { Port } from '@shell/utils/validators/formRules';
|
|
29
|
-
import { _CLONE } from '@shell/config/query-params';
|
|
30
29
|
|
|
31
30
|
const SESSION_AFFINITY_ACTION_VALUES = {
|
|
32
31
|
NONE: 'None',
|
|
@@ -76,17 +75,6 @@ export default {
|
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
// Set clusterIP to an empty string, if it exists and the value is not None when clone a service
|
|
80
|
-
// Remove clusterIPs if it exists when clone a service
|
|
81
|
-
if (this.realMode === _CLONE) {
|
|
82
|
-
if (this.value?.spec?.clusterIP && this.value?.spec?.clusterIP !== 'None') {
|
|
83
|
-
this.value.spec.clusterIP = '';
|
|
84
|
-
}
|
|
85
|
-
if (this.value?.spec?.clusterIPs) {
|
|
86
|
-
this.$delete(this.value.spec, 'clusterIPs');
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
78
|
const matchingPods = {
|
|
91
79
|
matched: 0,
|
|
92
80
|
matches: [],
|
|
@@ -40,13 +40,12 @@ export default {
|
|
|
40
40
|
data() {
|
|
41
41
|
const {
|
|
42
42
|
strategy:strategyObj = {},
|
|
43
|
-
updateStrategy: updateStrategyObj = {},
|
|
44
43
|
minReadySeconds = 0,
|
|
45
44
|
progressDeadlineSeconds = 600,
|
|
46
45
|
revisionHistoryLimit = 10,
|
|
47
46
|
podManagementPolicy = 'OrderedReady'
|
|
48
47
|
} = this.value;
|
|
49
|
-
const strategy = strategyObj.type ||
|
|
48
|
+
const strategy = strategyObj.type || 'RollingUpdate';
|
|
50
49
|
let maxSurge = '25';
|
|
51
50
|
let maxUnavailable = '25';
|
|
52
51
|
let surgeUnits = '%';
|
|
@@ -98,7 +97,7 @@ export default {
|
|
|
98
97
|
case WORKLOAD_TYPES.DAEMON_SET:
|
|
99
98
|
case WORKLOAD_TYPES.STATEFUL_SET:
|
|
100
99
|
return {
|
|
101
|
-
options: ['RollingUpdate', '
|
|
100
|
+
options: ['RollingUpdate', 'Delete'],
|
|
102
101
|
labels: [this.t('workload.upgrading.strategies.labels.rollingUpdate'), this.t('workload.upgrading.strategies.labels.delete')]
|
|
103
102
|
};
|
|
104
103
|
default:
|
package/edit/workload/index.vue
CHANGED
|
@@ -235,7 +235,7 @@ export default {
|
|
|
235
235
|
<div class="col span-6">
|
|
236
236
|
<LabeledSelect
|
|
237
237
|
v-model="imagePullSecrets"
|
|
238
|
-
:label="t('workload.container.imagePullSecrets
|
|
238
|
+
:label="t('workload.container.imagePullSecrets')"
|
|
239
239
|
:multiple="true"
|
|
240
240
|
:taggable="true"
|
|
241
241
|
:options="imagePullNamespacedSecrets"
|
|
@@ -243,7 +243,6 @@ export default {
|
|
|
243
243
|
option-label="metadata.name"
|
|
244
244
|
:reduce="service=>service.metadata.name"
|
|
245
245
|
:create-option="createOption"
|
|
246
|
-
:tooltip="t('workload.container.imagePullSecrets.tooltip')"
|
|
247
246
|
/>
|
|
248
247
|
</div>
|
|
249
248
|
</div>
|
|
@@ -707,7 +707,7 @@ export default {
|
|
|
707
707
|
return Promise.all([
|
|
708
708
|
...toSave.map((svc) => svc.save()),
|
|
709
709
|
...toRemove.map((svc) => {
|
|
710
|
-
const ui = svc?.metadata?.annotations
|
|
710
|
+
const ui = svc?.metadata?.annotations[UI_MANAGED];
|
|
711
711
|
|
|
712
712
|
if (ui) {
|
|
713
713
|
svc.remove();
|
package/initialize/App.js
CHANGED
|
@@ -2,34 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
import Vue from 'vue';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
} from '../utils/nuxt';
|
|
8
|
-
import NuxtError from '../components/templates/error.vue';
|
|
5
|
+
import { getMatchedComponentsInstances, getChildrenComponentInstancesUsingFetch, promisify, globalHandleError } from '../utils/nuxt';
|
|
6
|
+
import NuxtError from '../layouts/error.vue';
|
|
9
7
|
import NuxtLoading from '../components/nav/GlobalLoading.vue';
|
|
10
8
|
|
|
11
9
|
import '../assets/styles/app.scss';
|
|
10
|
+
import { getLayouts } from './layouts';
|
|
11
|
+
|
|
12
|
+
const layouts = getLayouts();
|
|
12
13
|
|
|
13
14
|
export default {
|
|
14
15
|
render(h) {
|
|
15
16
|
const loadingEl = h('NuxtLoading', { ref: 'loading' });
|
|
16
17
|
|
|
18
|
+
const layoutEl = h(this.layout || 'nuxt');
|
|
17
19
|
const templateEl = h('div', {
|
|
18
20
|
domProps: { id: '__layout' },
|
|
19
|
-
key: this.
|
|
20
|
-
}, [
|
|
21
|
+
key: this.layoutName
|
|
22
|
+
}, [layoutEl]);
|
|
23
|
+
|
|
24
|
+
const transitionEl = h('transition', {
|
|
25
|
+
props: {
|
|
26
|
+
name: 'layout',
|
|
27
|
+
mode: 'out-in'
|
|
28
|
+
},
|
|
29
|
+
on: {
|
|
30
|
+
beforeEnter(el) {
|
|
31
|
+
// Ensure to trigger scroll event after calling scrollBehavior
|
|
32
|
+
window.$nuxt.$nextTick(() => {
|
|
33
|
+
window.$nuxt.$emit('triggerScroll');
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}, [templateEl]);
|
|
21
38
|
|
|
22
39
|
return h('div', { domProps: { id: '__nuxt' } }, [
|
|
23
40
|
loadingEl,
|
|
24
41
|
// h(NuxtBuildIndicator), // The build indicator doesn't work as is right now and emits an error in the console so I'm leaving it out for now
|
|
25
|
-
|
|
42
|
+
transitionEl
|
|
26
43
|
]);
|
|
27
44
|
},
|
|
28
45
|
|
|
29
46
|
data: () => ({
|
|
30
47
|
isOnline: true,
|
|
31
48
|
|
|
32
|
-
|
|
49
|
+
layout: null,
|
|
50
|
+
layoutName: '',
|
|
33
51
|
|
|
34
52
|
nbFetching: 0
|
|
35
53
|
}),
|
|
@@ -41,14 +59,15 @@ export default {
|
|
|
41
59
|
// Add this.$nuxt in child instances
|
|
42
60
|
this.$root.$options.$nuxt = this;
|
|
43
61
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.refreshOnlineStatus();
|
|
48
|
-
// Setup the listeners
|
|
49
|
-
window.addEventListener('online', this.refreshOnlineStatus);
|
|
50
|
-
window.addEventListener('offline', this.refreshOnlineStatus);
|
|
62
|
+
if (process.client) {
|
|
63
|
+
// add to window so we can listen when ready
|
|
64
|
+
window.$nuxt = this;
|
|
51
65
|
|
|
66
|
+
this.refreshOnlineStatus();
|
|
67
|
+
// Setup the listeners
|
|
68
|
+
window.addEventListener('online', this.refreshOnlineStatus);
|
|
69
|
+
window.addEventListener('offline', this.refreshOnlineStatus);
|
|
70
|
+
}
|
|
52
71
|
// Add $nuxt.error()
|
|
53
72
|
this.error = this.nuxt.error;
|
|
54
73
|
// Add $nuxt.context
|
|
@@ -73,13 +92,15 @@ export default {
|
|
|
73
92
|
|
|
74
93
|
methods: {
|
|
75
94
|
refreshOnlineStatus() {
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
95
|
+
if (process.client) {
|
|
96
|
+
if (typeof window.navigator.onLine === 'undefined') {
|
|
97
|
+
// If the browser doesn't support connection status reports
|
|
98
|
+
// assume that we are online because most apps' only react
|
|
99
|
+
// when they now that the connection has been interrupted
|
|
100
|
+
this.isOnline = true;
|
|
101
|
+
} else {
|
|
102
|
+
this.isOnline = window.navigator.onLine;
|
|
103
|
+
}
|
|
83
104
|
}
|
|
84
105
|
},
|
|
85
106
|
|
|
@@ -141,11 +162,36 @@ export default {
|
|
|
141
162
|
}
|
|
142
163
|
}
|
|
143
164
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
165
|
+
let errorLayout = (NuxtError.options || NuxtError).layout;
|
|
166
|
+
|
|
167
|
+
if (typeof errorLayout === 'function') {
|
|
168
|
+
errorLayout = errorLayout(this.context);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
this.setLayout(errorLayout);
|
|
147
172
|
}
|
|
148
173
|
},
|
|
174
|
+
|
|
175
|
+
setLayout(layout) {
|
|
176
|
+
if (layout && typeof layout !== 'string') {
|
|
177
|
+
throw new Error('[nuxt] Avoid using non-string value as layout property.');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (!layout || !layouts[`_${ layout }`]) {
|
|
181
|
+
layout = 'default';
|
|
182
|
+
}
|
|
183
|
+
this.layoutName = layout;
|
|
184
|
+
this.layout = layouts[`_${ layout }`];
|
|
185
|
+
|
|
186
|
+
return this.layout;
|
|
187
|
+
},
|
|
188
|
+
loadLayout(layout) {
|
|
189
|
+
if (!layout || !layouts[`_${ layout }`]) {
|
|
190
|
+
layout = 'default';
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return Promise.resolve(layouts[`_${ layout }`]);
|
|
194
|
+
},
|
|
149
195
|
},
|
|
150
196
|
|
|
151
197
|
components: { NuxtLoading }
|
package/initialize/client.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isSamePath,
|
|
20
20
|
urlJoin
|
|
21
21
|
} from '../utils/nuxt.js';
|
|
22
|
-
import { createApp } from './index.js';
|
|
22
|
+
import { createApp, NuxtError } from './index.js';
|
|
23
23
|
import fetchMixin from '../mixins/fetch.client';
|
|
24
24
|
import NuxtLink from '../components/nuxt/nuxt-link.client.js'; // should be included after ./index.js
|
|
25
25
|
|
|
@@ -92,6 +92,17 @@ if (debug) {
|
|
|
92
92
|
if (nuxtApp && vm.$root[nuxtApp].error && info !== 'render function') {
|
|
93
93
|
const currentApp = vm.$root[nuxtApp];
|
|
94
94
|
|
|
95
|
+
// Load error layout
|
|
96
|
+
let layout = (NuxtError.options || NuxtError).layout;
|
|
97
|
+
|
|
98
|
+
if (typeof layout === 'function') {
|
|
99
|
+
layout = layout(currentApp.context);
|
|
100
|
+
}
|
|
101
|
+
if (layout) {
|
|
102
|
+
await currentApp.loadLayout(layout).catch(() => {});
|
|
103
|
+
}
|
|
104
|
+
currentApp.setLayout(layout);
|
|
105
|
+
|
|
95
106
|
currentApp.error(err);
|
|
96
107
|
}
|
|
97
108
|
}
|
|
@@ -115,7 +126,50 @@ if (debug) {
|
|
|
115
126
|
const errorHandler = Vue.config.errorHandler || console.error; // eslint-disable-line no-console
|
|
116
127
|
|
|
117
128
|
// Create and mount App
|
|
118
|
-
createApp(nuxt.publicRuntimeConfig).then(mountApp).catch(errorHandler); // eslint-disable-line no-undef
|
|
129
|
+
createApp(null, nuxt.publicRuntimeConfig).then(mountApp).catch(errorHandler); // eslint-disable-line no-undef
|
|
130
|
+
|
|
131
|
+
function componentOption(component, key, ...args) {
|
|
132
|
+
if (!component || !component.options || !component.options[key]) {
|
|
133
|
+
return {};
|
|
134
|
+
}
|
|
135
|
+
const option = component.options[key];
|
|
136
|
+
|
|
137
|
+
if (typeof option === 'function') {
|
|
138
|
+
return option(...args);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return option;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function mapTransitions(toComponents, to, from) {
|
|
145
|
+
const componentTransitions = (component) => {
|
|
146
|
+
const transition = componentOption(component, 'transition', to, from) || {};
|
|
147
|
+
|
|
148
|
+
return (typeof transition === 'string' ? { name: transition } : transition);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const fromComponents = from ? getMatchedComponents(from) : [];
|
|
152
|
+
const maxDepth = Math.max(toComponents.length, fromComponents.length);
|
|
153
|
+
|
|
154
|
+
const mergedTransitions = [];
|
|
155
|
+
|
|
156
|
+
for (let i = 0; i < maxDepth; i++) {
|
|
157
|
+
// Clone original objects to prevent overrides
|
|
158
|
+
const toTransitions = Object.assign({}, componentTransitions(toComponents[i]));
|
|
159
|
+
const transitions = Object.assign({}, componentTransitions(fromComponents[i]));
|
|
160
|
+
|
|
161
|
+
// Combine transitions & prefer `leave` properties of "from" route
|
|
162
|
+
Object.keys(toTransitions)
|
|
163
|
+
.filter((key) => typeof toTransitions[key] !== 'undefined' && !key.toLowerCase().includes('leave'))
|
|
164
|
+
.forEach((key) => {
|
|
165
|
+
transitions[key] = toTransitions[key];
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
mergedTransitions.push(transitions);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return mergedTransitions;
|
|
172
|
+
}
|
|
119
173
|
|
|
120
174
|
async function loadAsyncComponents(to, from, next) {
|
|
121
175
|
// Check if route changed (this._routeChanged), only if the page is not an error (for validate())
|
|
@@ -176,6 +230,16 @@ async function loadAsyncComponents(to, from, next) {
|
|
|
176
230
|
}
|
|
177
231
|
}
|
|
178
232
|
|
|
233
|
+
function applySSRData(Component, ssrData) {
|
|
234
|
+
if (NUXT.serverRendered && ssrData) {
|
|
235
|
+
applyAsyncData(Component, ssrData);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
Component._Ctor = Component;
|
|
239
|
+
|
|
240
|
+
return Component;
|
|
241
|
+
}
|
|
242
|
+
|
|
179
243
|
// Get matched components
|
|
180
244
|
function resolveComponents(route) {
|
|
181
245
|
return flatMapComponents(route, async(Component, _, match, key, index) => {
|
|
@@ -183,25 +247,32 @@ function resolveComponents(route) {
|
|
|
183
247
|
if (typeof Component === 'function' && !Component.options) {
|
|
184
248
|
Component = await Component();
|
|
185
249
|
}
|
|
186
|
-
|
|
187
250
|
// Sanitize it and save it
|
|
188
|
-
|
|
251
|
+
const _Component = applySSRData(sanitizeComponent(Component), NUXT.data ? NUXT.data[index] : null);
|
|
189
252
|
|
|
190
|
-
match.components[key] =
|
|
253
|
+
match.components[key] = _Component;
|
|
191
254
|
|
|
192
|
-
return
|
|
255
|
+
return _Component;
|
|
193
256
|
});
|
|
194
257
|
}
|
|
195
258
|
|
|
196
|
-
function callMiddleware(Components, context) {
|
|
259
|
+
function callMiddleware(Components, context, layout) {
|
|
197
260
|
let midd = ['i18n'];
|
|
198
261
|
let unknownMiddleware = false;
|
|
199
262
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
263
|
+
// If layout is undefined, only call global middleware
|
|
264
|
+
if (typeof layout !== 'undefined') {
|
|
265
|
+
midd = []; // Exclude global middleware if layout defined (already called before)
|
|
266
|
+
layout = sanitizeComponent(layout);
|
|
267
|
+
if (layout.options.middleware) {
|
|
268
|
+
midd = midd.concat(layout.options.middleware);
|
|
203
269
|
}
|
|
204
|
-
|
|
270
|
+
Components.forEach((Component) => {
|
|
271
|
+
if (Component.options.middleware) {
|
|
272
|
+
midd = midd.concat(Component.options.middleware);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
205
276
|
|
|
206
277
|
midd = midd.map((name) => {
|
|
207
278
|
if (typeof name === 'function') {
|
|
@@ -271,20 +342,25 @@ async function render(to, from, next) {
|
|
|
271
342
|
|
|
272
343
|
// If no Components matched, generate 404
|
|
273
344
|
if (!Components.length) {
|
|
274
|
-
//
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
// We should really make authenticated middleware do less...
|
|
280
|
-
await callMiddleware.call(this, [{ options: { middleware: ['authenticated'] } }], app.context);
|
|
345
|
+
// Default layout
|
|
346
|
+
await callMiddleware.call(this, Components, app.context);
|
|
347
|
+
if (nextCalled) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
281
350
|
|
|
351
|
+
// Load layout for error page
|
|
352
|
+
const errorLayout = (NuxtError.options || NuxtError).layout;
|
|
353
|
+
const layout = await this.loadLayout(
|
|
354
|
+
typeof errorLayout === 'function' ? errorLayout.call(NuxtError, app.context) : errorLayout
|
|
355
|
+
);
|
|
356
|
+
|
|
357
|
+
await callMiddleware.call(this, Components, app.context, layout);
|
|
282
358
|
if (nextCalled) {
|
|
283
359
|
return;
|
|
284
360
|
}
|
|
285
361
|
|
|
286
362
|
// Show error page
|
|
287
|
-
|
|
363
|
+
app.context.error({ statusCode: 404, message: 'This page could not be found' });
|
|
288
364
|
|
|
289
365
|
return next();
|
|
290
366
|
}
|
|
@@ -297,6 +373,9 @@ async function render(to, from, next) {
|
|
|
297
373
|
}
|
|
298
374
|
});
|
|
299
375
|
|
|
376
|
+
// Apply transitions
|
|
377
|
+
this.setTransitions(mapTransitions(Components, to, from));
|
|
378
|
+
|
|
300
379
|
try {
|
|
301
380
|
// Call middleware
|
|
302
381
|
await callMiddleware.call(this, Components, app.context);
|
|
@@ -307,8 +386,16 @@ async function render(to, from, next) {
|
|
|
307
386
|
return next();
|
|
308
387
|
}
|
|
309
388
|
|
|
389
|
+
// Set layout
|
|
390
|
+
let layout = Components[0].options.layout;
|
|
391
|
+
|
|
392
|
+
if (typeof layout === 'function') {
|
|
393
|
+
layout = layout(app.context);
|
|
394
|
+
}
|
|
395
|
+
layout = await this.loadLayout(layout);
|
|
396
|
+
|
|
310
397
|
// Call middleware for layout
|
|
311
|
-
await callMiddleware.call(this, Components, app.context);
|
|
398
|
+
await callMiddleware.call(this, Components, app.context, layout);
|
|
312
399
|
if (nextCalled) {
|
|
313
400
|
return;
|
|
314
401
|
}
|
|
@@ -449,6 +536,14 @@ async function render(to, from, next) {
|
|
|
449
536
|
|
|
450
537
|
globalHandleError(error);
|
|
451
538
|
|
|
539
|
+
// Load error layout
|
|
540
|
+
let layout = (NuxtError.options || NuxtError).layout;
|
|
541
|
+
|
|
542
|
+
if (typeof layout === 'function') {
|
|
543
|
+
layout = layout(app.context);
|
|
544
|
+
}
|
|
545
|
+
await this.loadLayout(layout);
|
|
546
|
+
|
|
452
547
|
this.error(error);
|
|
453
548
|
this.$nuxt.$emit('routeChanged', to, from, error);
|
|
454
549
|
next();
|
|
@@ -469,6 +564,22 @@ function normalizeComponents(to, ___) {
|
|
|
469
564
|
});
|
|
470
565
|
}
|
|
471
566
|
|
|
567
|
+
function setLayoutForNextPage(to) {
|
|
568
|
+
// Set layout
|
|
569
|
+
let hasError = Boolean(this.$options.nuxt.err);
|
|
570
|
+
|
|
571
|
+
if (this._hadError && this._dateLastError === this.$options.nuxt.dateErr) {
|
|
572
|
+
hasError = false;
|
|
573
|
+
}
|
|
574
|
+
let layout = hasError ? (NuxtError.options || NuxtError).layout : to.matched[0].components.default.options.layout;
|
|
575
|
+
|
|
576
|
+
if (typeof layout === 'function') {
|
|
577
|
+
layout = layout(app.context);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
this.setLayout(layout);
|
|
581
|
+
}
|
|
582
|
+
|
|
472
583
|
function checkForErrors(app) {
|
|
473
584
|
// Hide error component if no error
|
|
474
585
|
if (app._hadError && app._dateLastError === app.$options.nuxt.dateErr) {
|
|
@@ -612,7 +723,31 @@ function addHotReload($component, depth) {
|
|
|
612
723
|
|
|
613
724
|
callMiddleware.call(this, Components, context)
|
|
614
725
|
.then(() => {
|
|
615
|
-
|
|
726
|
+
// If layout changed
|
|
727
|
+
if (depth !== 0) {
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
let layout = Component.options.layout || 'default';
|
|
732
|
+
|
|
733
|
+
if (typeof layout === 'function') {
|
|
734
|
+
layout = layout(context);
|
|
735
|
+
}
|
|
736
|
+
if (this.layoutName === layout) {
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
const promise = this.loadLayout(layout);
|
|
740
|
+
|
|
741
|
+
promise.then(() => {
|
|
742
|
+
this.setLayout(layout);
|
|
743
|
+
Vue.nextTick(() => hotReloadAPI(this));
|
|
744
|
+
});
|
|
745
|
+
|
|
746
|
+
return promise;
|
|
747
|
+
})
|
|
748
|
+
|
|
749
|
+
.then(() => {
|
|
750
|
+
return callMiddleware.call(this, Components, context, this.layout);
|
|
616
751
|
})
|
|
617
752
|
|
|
618
753
|
.then(() => {
|
|
@@ -660,6 +795,8 @@ async function mountApp(__app) {
|
|
|
660
795
|
// Add afterEach router hooks
|
|
661
796
|
router.afterEach(normalizeComponents);
|
|
662
797
|
|
|
798
|
+
router.afterEach(setLayoutForNextPage.bind(_app));
|
|
799
|
+
|
|
663
800
|
router.afterEach(fixPrepatch.bind(_app));
|
|
664
801
|
|
|
665
802
|
// Listen for first Vue update
|
|
@@ -677,7 +814,10 @@ async function mountApp(__app) {
|
|
|
677
814
|
// Resolve route components
|
|
678
815
|
const Components = await Promise.all(resolveComponents(app.context.route));
|
|
679
816
|
|
|
817
|
+
// Enable transitions
|
|
818
|
+
_app.setTransitions = _app.$options.nuxt.setTransitions.bind(_app);
|
|
680
819
|
if (Components.length) {
|
|
820
|
+
_app.setTransitions(mapTransitions(Components, router.currentRoute));
|
|
681
821
|
_lastPaths = router.currentRoute.matched.map((route) => compile(route.path)(router.currentRoute.params));
|
|
682
822
|
}
|
|
683
823
|
|
|
@@ -702,6 +842,7 @@ async function mountApp(__app) {
|
|
|
702
842
|
// First render on client-side
|
|
703
843
|
const clientFirstMount = () => {
|
|
704
844
|
normalizeComponents(router.currentRoute, router.currentRoute);
|
|
845
|
+
setLayoutForNextPage.call(_app, router.currentRoute);
|
|
705
846
|
checkForErrors(_app);
|
|
706
847
|
// Don't call fixPrepatch.call(_app, router.currentRoute, router.currentRoute) since it's first render
|
|
707
848
|
mount();
|