@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/models/pod.js
CHANGED
|
@@ -3,7 +3,6 @@ import { colorForState, stateDisplay } from '@shell/plugins/dashboard-store/reso
|
|
|
3
3
|
import { NODE, WORKLOAD_TYPES } from '@shell/config/types';
|
|
4
4
|
import { escapeHtml, shortenedImage } from '@shell/utils/string';
|
|
5
5
|
import WorkloadService from '@shell/models/workload.service';
|
|
6
|
-
import { deleteProperty } from '@shell/utils/object';
|
|
7
6
|
|
|
8
7
|
export const WORKLOAD_PRIORITY = {
|
|
9
8
|
[WORKLOAD_TYPES.DEPLOYMENT]: 1,
|
|
@@ -257,23 +256,4 @@ export default class Pod extends WorkloadService {
|
|
|
257
256
|
return Promise.reject(e);
|
|
258
257
|
});
|
|
259
258
|
}
|
|
260
|
-
|
|
261
|
-
cleanForSave(data) {
|
|
262
|
-
const val = super.cleanForSave(data);
|
|
263
|
-
|
|
264
|
-
// remove fields from containers
|
|
265
|
-
val.spec?.containers?.forEach((container) => {
|
|
266
|
-
this.cleanContainerForSave(container);
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
// remove fields from initContainers
|
|
270
|
-
val.spec?.initContainers?.forEach((container) => {
|
|
271
|
-
this.cleanContainerForSave(container);
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
// This is probably added by generic workload components that shouldn't be added to pods
|
|
275
|
-
deleteProperty(val, 'spec.selector');
|
|
276
|
-
|
|
277
|
-
return val;
|
|
278
|
-
}
|
|
279
259
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CAPI, MANAGEMENT,
|
|
2
|
+
CAPI, MANAGEMENT, NORMAN, SNAPSHOT, HCI
|
|
3
3
|
} from '@shell/config/types';
|
|
4
4
|
import SteveModel from '@shell/plugins/steve/steve-class';
|
|
5
5
|
import { findBy } from '@shell/utils/array';
|
|
@@ -180,16 +180,6 @@ export default class ProvCluster extends SteveModel {
|
|
|
180
180
|
return out;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
async findNormanCluster() {
|
|
184
|
-
const name = this.status?.clusterName;
|
|
185
|
-
|
|
186
|
-
if ( !name ) {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return await this.$dispatch('rancher/find', { type: NORMAN.CLUSTER, id: name }, { root: true });
|
|
191
|
-
}
|
|
192
|
-
|
|
193
183
|
explore() {
|
|
194
184
|
const location = {
|
|
195
185
|
name: 'c-cluster',
|
|
@@ -249,24 +239,10 @@ export default class ProvCluster extends SteveModel {
|
|
|
249
239
|
return providers.includes(this.provisioner);
|
|
250
240
|
}
|
|
251
241
|
|
|
252
|
-
get isLocal() {
|
|
253
|
-
return this.mgmt?.isLocal;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
242
|
get isImported() {
|
|
257
243
|
// As of Rancher v2.6.7, this returns false for imported K3s clusters,
|
|
258
244
|
// in which this.provisioner is `k3s`.
|
|
259
|
-
|
|
260
|
-
const isImportedProvisioner = this.provisioner === 'imported';
|
|
261
|
-
const isImportedSpecialCases = this.mgmt?.providerForEmberParam === 'import' ||
|
|
262
|
-
// when imported cluster is GKE
|
|
263
|
-
!!this.mgmt?.spec?.gkeConfig?.imported ||
|
|
264
|
-
// or AKS
|
|
265
|
-
!!this.mgmt?.spec?.aksConfig?.imported ||
|
|
266
|
-
// or EKS
|
|
267
|
-
!!this.mgmt?.spec?.eksConfig?.imported;
|
|
268
|
-
|
|
269
|
-
return !this.isLocal && (isImportedProvisioner || (!this.isRke2 && !this.mgmt?.machineProvider && isImportedSpecialCases));
|
|
245
|
+
return this.provisioner === 'imported';
|
|
270
246
|
}
|
|
271
247
|
|
|
272
248
|
get isCustom() {
|
|
@@ -286,6 +262,8 @@ export default class ProvCluster extends SteveModel {
|
|
|
286
262
|
}
|
|
287
263
|
|
|
288
264
|
get isImportedK3s() {
|
|
265
|
+
// As of Rancher v2.6.7, this returns false for imported K3s clusters,
|
|
266
|
+
// in which this.provisioner is `k3s`.
|
|
289
267
|
return this.isImported && this.isK3s;
|
|
290
268
|
}
|
|
291
269
|
|
|
@@ -294,7 +272,7 @@ export default class ProvCluster extends SteveModel {
|
|
|
294
272
|
}
|
|
295
273
|
|
|
296
274
|
get isK3s() {
|
|
297
|
-
return this.mgmt?.status
|
|
275
|
+
return this.mgmt?.status?.provider === 'k3s';
|
|
298
276
|
}
|
|
299
277
|
|
|
300
278
|
get isRke2() {
|
|
@@ -302,7 +280,7 @@ export default class ProvCluster extends SteveModel {
|
|
|
302
280
|
}
|
|
303
281
|
|
|
304
282
|
get isRke1() {
|
|
305
|
-
return !!this.mgmt?.spec?.rancherKubernetesEngineConfig
|
|
283
|
+
return !!this.mgmt?.spec?.rancherKubernetesEngineConfig;
|
|
306
284
|
}
|
|
307
285
|
|
|
308
286
|
get isHarvester() {
|
|
@@ -837,11 +815,11 @@ export default class ProvCluster extends SteveModel {
|
|
|
837
815
|
get agentConfig() {
|
|
838
816
|
// The one we want is the first one with no selector.
|
|
839
817
|
// If there are multiple with no selector, that will fall under the unsupported message below.
|
|
840
|
-
return this.spec.rkeConfig.machineSelectorConfig.find((x) => !x.machineLabelSelector)
|
|
818
|
+
return this.spec.rkeConfig.machineSelectorConfig.find((x) => !x.machineLabelSelector).config;
|
|
841
819
|
}
|
|
842
820
|
|
|
843
821
|
get cloudProvider() {
|
|
844
|
-
return this.agentConfig
|
|
822
|
+
return this.agentConfig['cloud-provider-name'];
|
|
845
823
|
}
|
|
846
824
|
|
|
847
825
|
get canClone() {
|
|
@@ -893,29 +871,4 @@ export default class ProvCluster extends SteveModel {
|
|
|
893
871
|
get hasError() {
|
|
894
872
|
return this.status?.conditions?.some((condition) => condition.error === true);
|
|
895
873
|
}
|
|
896
|
-
|
|
897
|
-
get namespaceLocation() {
|
|
898
|
-
const localCluster = this.$rootGetters['management/byId'](MANAGEMENT.CLUSTER, LOCAL_CLUSTER);
|
|
899
|
-
|
|
900
|
-
if (localCluster) {
|
|
901
|
-
return {
|
|
902
|
-
name: 'c-cluster-product-resource-id',
|
|
903
|
-
params: {
|
|
904
|
-
cluster: localCluster.id,
|
|
905
|
-
product: this.$rootGetters['productId'],
|
|
906
|
-
resource: NAMESPACE,
|
|
907
|
-
id: this.namespace
|
|
908
|
-
}
|
|
909
|
-
};
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
return null;
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
// JSON Paths that should be folded in the YAML editor by default
|
|
916
|
-
get yamlFolding() {
|
|
917
|
-
return [
|
|
918
|
-
'spec.rkeConfig.machinePools.dynamicSchemaSpec',
|
|
919
|
-
];
|
|
920
|
-
}
|
|
921
874
|
}
|
package/models/secret.js
CHANGED
|
@@ -6,9 +6,6 @@ import { SERVICE_ACCOUNT } from '@shell/config/types';
|
|
|
6
6
|
import { set } from '@shell/utils/object';
|
|
7
7
|
import { NAME as MANAGER } from '@shell/config/product/manager';
|
|
8
8
|
import SteveModel from '@shell/plugins/steve/steve-class';
|
|
9
|
-
import { colorForState, stateDisplay, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
|
10
|
-
import { diffFrom } from '@shell/utils/time';
|
|
11
|
-
import day from 'dayjs';
|
|
12
9
|
|
|
13
10
|
export const TYPES = {
|
|
14
11
|
OPAQUE: 'Opaque',
|
|
@@ -26,12 +23,7 @@ export const TYPES = {
|
|
|
26
23
|
RKE_AUTH_CONFIG: 'rke.cattle.io/auth-config'
|
|
27
24
|
};
|
|
28
25
|
|
|
29
|
-
/** Class a cert as expiring if in eight days */
|
|
30
|
-
const certExpiringPeriod = 1000 * 60 * 60 * 24 * 8;
|
|
31
|
-
|
|
32
26
|
export default class Secret extends SteveModel {
|
|
33
|
-
_cachedCertInfo;
|
|
34
|
-
|
|
35
27
|
get hasSensitiveData() {
|
|
36
28
|
return true;
|
|
37
29
|
}
|
|
@@ -54,7 +46,7 @@ export default class Secret extends SteveModel {
|
|
|
54
46
|
if (annotations[CERTMANAGER.ISSUER]) {
|
|
55
47
|
return annotations[CERTMANAGER.ISSUER];
|
|
56
48
|
} else if (this.isCertificate) {
|
|
57
|
-
return this.
|
|
49
|
+
return this.certInfo?.issuer;
|
|
58
50
|
} else {
|
|
59
51
|
return null;
|
|
60
52
|
}
|
|
@@ -62,7 +54,7 @@ export default class Secret extends SteveModel {
|
|
|
62
54
|
|
|
63
55
|
get notAfter() {
|
|
64
56
|
if (this.isCertificate) {
|
|
65
|
-
return this.
|
|
57
|
+
return this.certInfo?.notAfter;
|
|
66
58
|
} else {
|
|
67
59
|
return null;
|
|
68
60
|
}
|
|
@@ -70,7 +62,7 @@ export default class Secret extends SteveModel {
|
|
|
70
62
|
|
|
71
63
|
get cn() {
|
|
72
64
|
if (this.isCertificate) {
|
|
73
|
-
return this.
|
|
65
|
+
return this.certInfo?.cn;
|
|
74
66
|
}
|
|
75
67
|
|
|
76
68
|
return null;
|
|
@@ -88,13 +80,14 @@ export default class Secret extends SteveModel {
|
|
|
88
80
|
// use text-warning' or 'text-error' if cert is expiring within 8 days or is expired
|
|
89
81
|
get dateClass() {
|
|
90
82
|
if (this.isCertificate) {
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
const eightDays = 691200000;
|
|
84
|
+
|
|
85
|
+
if (this.timeTilExpiration > eightDays ) {
|
|
86
|
+
return '';
|
|
87
|
+
} else if (this.timeTilExpiration > 0) {
|
|
93
88
|
return 'text-warning';
|
|
94
|
-
|
|
89
|
+
} else {
|
|
95
90
|
return 'text-error';
|
|
96
|
-
default:
|
|
97
|
-
return '';
|
|
98
91
|
}
|
|
99
92
|
}
|
|
100
93
|
|
|
@@ -255,7 +248,7 @@ export default class Secret extends SteveModel {
|
|
|
255
248
|
// parse TLS certs and return issuer, notAfter, cn, sans
|
|
256
249
|
get certInfo() {
|
|
257
250
|
const pem = base64Decode(this.data['tls.crt']);
|
|
258
|
-
let issuer,
|
|
251
|
+
let issuer, notAfter, cn, sans, x;
|
|
259
252
|
const END_MARKER = '-----END CERTIFICATE-----';
|
|
260
253
|
|
|
261
254
|
if (pem) {
|
|
@@ -273,7 +266,6 @@ export default class Secret extends SteveModel {
|
|
|
273
266
|
const issuerString = x.getIssuerString();
|
|
274
267
|
|
|
275
268
|
issuer = issuerString.slice(issuerString.indexOf('CN=') + 3);
|
|
276
|
-
notBefore = r.zulutodate(x.getNotBefore());
|
|
277
269
|
notAfter = r.zulutodate(x.getNotAfter());
|
|
278
270
|
|
|
279
271
|
const cnString = x.getSubjectString();
|
|
@@ -289,39 +281,25 @@ export default class Secret extends SteveModel {
|
|
|
289
281
|
sans = [];
|
|
290
282
|
}
|
|
291
283
|
|
|
292
|
-
|
|
293
|
-
issuer,
|
|
284
|
+
return {
|
|
285
|
+
issuer, notAfter, cn, sans
|
|
294
286
|
};
|
|
295
|
-
|
|
296
|
-
return certInfo;
|
|
297
287
|
}
|
|
298
288
|
|
|
299
289
|
return null;
|
|
300
290
|
}
|
|
301
291
|
|
|
302
|
-
get cachedCertInfo() {
|
|
303
|
-
if (!this._cachedCertInfo) {
|
|
304
|
-
this._cachedCertInfo = this.certInfo;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return this._cachedCertInfo;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
292
|
// use for + n more name display
|
|
311
293
|
get unrepeatedSans() {
|
|
312
294
|
if (this._type === TYPES.TLS ) {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
const commonBases = certInfo?.sans
|
|
317
|
-
.filter((name) => name.indexOf('*.') === 0 || name.indexOf('www.') === 0)
|
|
318
|
-
.map((name) => name.substr(name.indexOf('.')));
|
|
319
|
-
const displaySans = removeObjects(certInfo?.sans, commonBases);
|
|
295
|
+
if (this.certInfo?.sans?.filter) {
|
|
296
|
+
const commonBases = this.certInfo?.sans.filter((name) => name.indexOf('*.') === 0 || name.indexOf('www.') === 0).map((name) => name.substr(name.indexOf('.')));
|
|
297
|
+
const displaySans = removeObjects(this.certInfo?.sans, commonBases);
|
|
320
298
|
|
|
321
299
|
return displaySans;
|
|
322
300
|
}
|
|
323
301
|
|
|
324
|
-
return certInfo?.sans
|
|
302
|
+
return this.certInfo?.sans || [];
|
|
325
303
|
}
|
|
326
304
|
|
|
327
305
|
return null;
|
|
@@ -329,28 +307,16 @@ export default class Secret extends SteveModel {
|
|
|
329
307
|
|
|
330
308
|
get timeTilExpiration() {
|
|
331
309
|
if (this._type === TYPES.TLS) {
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
if (!certInfo?.notAfter) {
|
|
335
|
-
return null;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
const expiration = certInfo.notAfter;
|
|
310
|
+
const expiration = this.certInfo.notAfter;
|
|
339
311
|
const timeThen = expiration.valueOf();
|
|
340
312
|
const timeNow = Date.now();
|
|
341
313
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return timeTilExpiration < 0 ? 0 : timeTilExpiration;
|
|
314
|
+
return timeThen - timeNow;
|
|
345
315
|
}
|
|
346
316
|
|
|
347
317
|
return null;
|
|
348
318
|
}
|
|
349
319
|
|
|
350
|
-
get timeTilExpirationDate() {
|
|
351
|
-
return this.timeTilExpiration > 0 ? this.cachedCertInfo?.notAfter?.valueOf() : null;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
320
|
get decodedData() {
|
|
355
321
|
const out = {};
|
|
356
322
|
|
|
@@ -391,69 +357,4 @@ export default class Secret extends SteveModel {
|
|
|
391
357
|
return 'c-cluster-product-resource';
|
|
392
358
|
}
|
|
393
359
|
}
|
|
394
|
-
|
|
395
|
-
get certLifetime() {
|
|
396
|
-
if (this._type === TYPES.TLS) {
|
|
397
|
-
const certInfo = this.cachedCertInfo;
|
|
398
|
-
|
|
399
|
-
if (certInfo) {
|
|
400
|
-
return diffFrom(day(certInfo.notBefore), day(certInfo.notAfter), (key, args) => this.t(key, args)).string;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
return null;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Get the model `state` for secrets of type cert
|
|
409
|
-
*/
|
|
410
|
-
get certState() {
|
|
411
|
-
if (this._type !== TYPES.TLS) {
|
|
412
|
-
return undefined;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
if (typeof this.timeTilExpiration !== 'number' || this.timeTilExpiration > certExpiringPeriod ) {
|
|
416
|
-
return '';
|
|
417
|
-
} else if (this.timeTilExpiration > 0) {
|
|
418
|
-
return STATES_ENUM.EXPIRING;
|
|
419
|
-
} else {
|
|
420
|
-
return STATES_ENUM.EXPIRED;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Get the model `state display` for secrets of type cert
|
|
426
|
-
*/
|
|
427
|
-
get certStateDisplay() {
|
|
428
|
-
if (this._type !== TYPES.TLS) {
|
|
429
|
-
return undefined;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
return stateDisplay(this.certState);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Get the model `state background` for secrets of type cert
|
|
437
|
-
*/
|
|
438
|
-
get certStateBackground() {
|
|
439
|
-
if (this._type !== TYPES.TLS) {
|
|
440
|
-
return undefined;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
const color = colorForState(this.certState);
|
|
444
|
-
|
|
445
|
-
return color.replace('text-', 'bg-');
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
cleanForSave(data, forNew) {
|
|
449
|
-
const val = super.cleanForSave(data, forNew);
|
|
450
|
-
|
|
451
|
-
// Secrets on create with _type will return validation error
|
|
452
|
-
// Secrets on edit without _type will return http error
|
|
453
|
-
if (forNew) {
|
|
454
|
-
delete val._type;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
return val;
|
|
458
|
-
}
|
|
459
360
|
}
|
package/models/workload.js
CHANGED
|
@@ -649,20 +649,4 @@ export default class Workload extends WorkloadService {
|
|
|
649
649
|
|
|
650
650
|
return matching(allInNamespace, selector);
|
|
651
651
|
}
|
|
652
|
-
|
|
653
|
-
cleanForSave(data) {
|
|
654
|
-
const val = super.cleanForSave(data);
|
|
655
|
-
|
|
656
|
-
// remove fields from containers
|
|
657
|
-
val.spec?.template?.spec?.containers?.forEach((container) => {
|
|
658
|
-
this.cleanContainerForSave(container);
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
// remove fields from initContainers
|
|
662
|
-
val.spec?.template?.spec?.initContainers?.forEach((container) => {
|
|
663
|
-
this.cleanContainerForSave(container);
|
|
664
|
-
});
|
|
665
|
-
|
|
666
|
-
return val;
|
|
667
|
-
}
|
|
668
652
|
}
|
|
@@ -320,22 +320,4 @@ export default class WorkloadService extends SteveModel {
|
|
|
320
320
|
|
|
321
321
|
return { toSave, toRemove };
|
|
322
322
|
}
|
|
323
|
-
|
|
324
|
-
cleanForSave(data) {
|
|
325
|
-
const val = super.cleanForSave(data);
|
|
326
|
-
|
|
327
|
-
delete val.__active;
|
|
328
|
-
delete val.type;
|
|
329
|
-
|
|
330
|
-
return val;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
cleanContainerForSave(container) {
|
|
334
|
-
delete container.__active;
|
|
335
|
-
delete container.active;
|
|
336
|
-
delete container._init;
|
|
337
|
-
delete container.error;
|
|
338
|
-
|
|
339
|
-
return container;
|
|
340
|
-
}
|
|
341
323
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rancher/shell",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Rancher Dashboard Shell",
|
|
5
5
|
"repository": "https://github.com/rancherlabs/dashboard",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"@nuxtjs/eslint-config-typescript": "6.0.1",
|
|
42
42
|
"@nuxtjs/webpack-profile": "0.1.0",
|
|
43
43
|
"@popperjs/core": "2.4.4",
|
|
44
|
-
"@types/is-url": "1.2.30",
|
|
45
44
|
"@types/node": "16.4.3",
|
|
46
45
|
"@typescript-eslint/eslint-plugin": "4.33.0",
|
|
47
46
|
"@typescript-eslint/parser": "4.33.0",
|
|
@@ -116,11 +115,11 @@
|
|
|
116
115
|
"start-server-and-test": "1.13.1",
|
|
117
116
|
"style-loader": "1.2.1",
|
|
118
117
|
"ts-node": "8.10.2",
|
|
119
|
-
"typescript": "4.
|
|
118
|
+
"typescript": "4.1.6",
|
|
120
119
|
"url-parse": "1.5.10",
|
|
121
120
|
"v-tooltip": "2.0.3",
|
|
122
121
|
"vue": "2.7.14",
|
|
123
|
-
"
|
|
122
|
+
"vue-clipboard2": "0.3.1",
|
|
124
123
|
"vue-codemirror": "4.0.6",
|
|
125
124
|
"vue-js-modal": "1.3.35",
|
|
126
125
|
"vue-resize": "0.4.5",
|
|
@@ -129,16 +128,16 @@
|
|
|
129
128
|
"vue-shortkey": "3.1.7",
|
|
130
129
|
"vue-template-compiler": "2.7.14",
|
|
131
130
|
"vue-virtual-scroll-list": "^2.3.4",
|
|
131
|
+
"vue2-transitions": "0.3.0",
|
|
132
132
|
"vuedraggable": "2.24.3",
|
|
133
133
|
"vuex": "3.6.2",
|
|
134
134
|
"webpack-bundle-analyzer": "4.5.0",
|
|
135
135
|
"webpack-virtual-modules": "0.4.3",
|
|
136
|
-
"xterm": "5.
|
|
137
|
-
"xterm-addon-
|
|
138
|
-
"xterm-addon-
|
|
139
|
-
"xterm-addon-
|
|
140
|
-
"xterm-addon-
|
|
141
|
-
"xterm-addon-webgl": "0.16.0",
|
|
136
|
+
"xterm": "5.0.0",
|
|
137
|
+
"xterm-addon-fit": "0.6.0",
|
|
138
|
+
"xterm-addon-search": "0.10.0",
|
|
139
|
+
"xterm-addon-web-links": "0.7.0",
|
|
140
|
+
"xterm-addon-webgl": "0.13.0",
|
|
142
141
|
"worker-loader": "3.0.8",
|
|
143
142
|
"yarn": "1.22.18"
|
|
144
143
|
},
|
|
@@ -151,8 +150,7 @@
|
|
|
151
150
|
"qs": ">=6.7.3",
|
|
152
151
|
"nth-check": ">=2.0.1",
|
|
153
152
|
"follow-redirects": ">=1.14.7",
|
|
154
|
-
"merge": ">=2.1.1"
|
|
155
|
-
"semver": ">=7.5.2"
|
|
153
|
+
"merge": ">=2.1.1"
|
|
156
154
|
},
|
|
157
155
|
"nyc": {
|
|
158
156
|
"extension": [
|
package/pages/about.vue
CHANGED
package/pages/account/index.vue
CHANGED
|
@@ -15,6 +15,7 @@ import CopyToClipboardText from '@shell/components/CopyToClipboardText';
|
|
|
15
15
|
const API_ENDPOINT = '/v3';
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
|
+
layout: 'plain',
|
|
18
19
|
components: {
|
|
19
20
|
CopyToClipboardText, BackLink, Banner, PromptChangePassword, Loading, ResourceTable, Principal
|
|
20
21
|
},
|
package/pages/auth/login.vue
CHANGED
package/pages/auth/logout.vue
CHANGED
package/pages/auth/setup.vue
CHANGED
|
@@ -18,10 +18,6 @@ import Password from '@shell/components/form/Password';
|
|
|
18
18
|
import { applyProducts } from '@shell/store/type-map';
|
|
19
19
|
import BrandImage from '@shell/components/BrandImage';
|
|
20
20
|
import { waitFor } from '@shell/utils/async';
|
|
21
|
-
import { Banner } from '@components/Banner';
|
|
22
|
-
import FormValidation from '@shell/mixins/form-validation';
|
|
23
|
-
import isUrl from 'is-url';
|
|
24
|
-
import { isLocalhost } from '@shell/utils/validators/setting';
|
|
25
21
|
|
|
26
22
|
const calcIsFirstLogin = (store) => {
|
|
27
23
|
const firstLoginSetting = store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.FIRST_LOGIN);
|
|
@@ -38,18 +34,13 @@ const calcMustChangePassword = async(store) => {
|
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
export default {
|
|
41
|
-
|
|
37
|
+
layout: 'unauthenticated',
|
|
42
38
|
|
|
43
39
|
data() {
|
|
44
40
|
return {
|
|
45
41
|
passwordOptions: [
|
|
46
42
|
{ label: this.t('setup.useRandom'), value: true },
|
|
47
43
|
{ label: this.t('setup.useManual'), value: false }],
|
|
48
|
-
fvFormRuleSets: [{
|
|
49
|
-
path: 'serverUrl',
|
|
50
|
-
rootObject: this,
|
|
51
|
-
rules: ['required', 'https', 'url', 'trailingForwardSlash']
|
|
52
|
-
}]
|
|
53
44
|
};
|
|
54
45
|
},
|
|
55
46
|
|
|
@@ -87,7 +78,7 @@ export default {
|
|
|
87
78
|
},
|
|
88
79
|
|
|
89
80
|
components: {
|
|
90
|
-
AsyncButton, LabeledInput, CopyToClipboard, Checkbox, RadioGroup, Password, BrandImage
|
|
81
|
+
AsyncButton, LabeledInput, CopyToClipboard, Checkbox, RadioGroup, Password, BrandImage
|
|
91
82
|
},
|
|
92
83
|
|
|
93
84
|
async asyncData({ route, req, store }) {
|
|
@@ -144,6 +135,8 @@ export default {
|
|
|
144
135
|
|
|
145
136
|
if (serverUrlSetting?.value) {
|
|
146
137
|
serverUrl = serverUrlSetting.value;
|
|
138
|
+
} else if ( process.server ) {
|
|
139
|
+
serverUrl = req.headers.host;
|
|
147
140
|
} else {
|
|
148
141
|
serverUrl = window.location.origin;
|
|
149
142
|
}
|
|
@@ -198,10 +191,6 @@ export default {
|
|
|
198
191
|
}
|
|
199
192
|
}
|
|
200
193
|
|
|
201
|
-
if (!isUrl(this.serverUrl) || this.fvGetPathErrors(['serverUrl']).length > 0) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
194
|
return true;
|
|
206
195
|
},
|
|
207
196
|
|
|
@@ -209,10 +198,6 @@ export default {
|
|
|
209
198
|
const out = findBy(this.principals, 'me', true);
|
|
210
199
|
|
|
211
200
|
return out;
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
showLocalhostWarning() {
|
|
215
|
-
return isLocalhost(this.serverUrl);
|
|
216
201
|
}
|
|
217
202
|
},
|
|
218
203
|
|
|
@@ -280,10 +265,6 @@ export default {
|
|
|
280
265
|
done() {
|
|
281
266
|
this.$router.replace('/');
|
|
282
267
|
},
|
|
283
|
-
|
|
284
|
-
onServerUrlChange(value) {
|
|
285
|
-
this.serverUrl = value.trim();
|
|
286
|
-
},
|
|
287
268
|
},
|
|
288
269
|
};
|
|
289
270
|
</script>
|
|
@@ -387,24 +368,10 @@ export default {
|
|
|
387
368
|
/>
|
|
388
369
|
</p>
|
|
389
370
|
<div class="mt-20">
|
|
390
|
-
<Banner
|
|
391
|
-
v-if="showLocalhostWarning"
|
|
392
|
-
color="warning"
|
|
393
|
-
:label="t('validation.setting.serverUrl.localhost')"
|
|
394
|
-
/>
|
|
395
|
-
<Banner
|
|
396
|
-
v-for="(err, i) in fvGetPathErrors(['serverUrl'])"
|
|
397
|
-
:key="i"
|
|
398
|
-
color="error"
|
|
399
|
-
:label="err"
|
|
400
|
-
/>
|
|
401
371
|
<LabeledInput
|
|
402
372
|
v-model="serverUrl"
|
|
403
373
|
:label="t('setup.serverUrl.label')"
|
|
404
374
|
data-testid="setup-server-url"
|
|
405
|
-
:rules="fvGetAndReportPathRules('serverUrl')"
|
|
406
|
-
:required="true"
|
|
407
|
-
@input="onServerUrlChange"
|
|
408
375
|
/>
|
|
409
376
|
</div>
|
|
410
377
|
</template>
|
package/pages/auth/verify.vue
CHANGED
|
@@ -17,14 +17,9 @@ function reply(err, code) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function isSaml($route) {
|
|
21
|
-
const { query } = $route;
|
|
22
|
-
const configQuery = get(query, 'config');
|
|
23
|
-
|
|
24
|
-
return samlProviders.includes(configQuery);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
20
|
export default {
|
|
21
|
+
layout: 'unauthenticated',
|
|
22
|
+
|
|
28
23
|
async fetch({ store, route, redirect }) {
|
|
29
24
|
const code = route.query[GITHUB_CODE];
|
|
30
25
|
const stateStr = route.query[GITHUB_NONCE];
|
|
@@ -48,14 +43,9 @@ export default {
|
|
|
48
43
|
try {
|
|
49
44
|
parsed = JSON.parse(base64Decode((stateStr)));
|
|
50
45
|
} catch (err) {
|
|
51
|
-
if (isSaml(route)) {
|
|
52
|
-
// This is an ok failure. SAML has no state string so a failure is fine (see similar check in mounted).
|
|
53
|
-
// This whole file could be re-written with that in mind, but this change keeps things simple and fixes a breaking addition
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
46
|
const out = store.getters['i18n/t'](`login.error`);
|
|
57
47
|
|
|
58
|
-
console.error('Failed to parse nonce'
|
|
48
|
+
console.error('Failed to parse nonce'); // eslint-disable-line no-console
|
|
59
49
|
|
|
60
50
|
redirect(`/auth/login?err=${ escape(out) }`);
|
|
61
51
|
|
|
@@ -127,8 +117,12 @@ export default {
|
|
|
127
117
|
window.close();
|
|
128
118
|
}
|
|
129
119
|
} else {
|
|
120
|
+
const { query } = this.$route;
|
|
121
|
+
|
|
130
122
|
if ( window.opener ) {
|
|
131
|
-
|
|
123
|
+
const configQuery = get(query, 'config');
|
|
124
|
+
|
|
125
|
+
if ( samlProviders.includes(configQuery) ) {
|
|
132
126
|
if ( window.opener.window.onAuthTest ) {
|
|
133
127
|
reply(null, null);
|
|
134
128
|
} else {
|