@rancher/shell 0.3.4 → 0.3.6
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/outscale.svg +19 -0
- package/assets/styles/app.scss +1 -1
- package/assets/styles/base/_basic.scss +18 -0
- package/assets/styles/base/_mixins.scss +0 -11
- package/assets/styles/base/_variables.scss +2 -4
- package/assets/styles/fonts/_fontstack.scss +11 -11
- package/assets/styles/global/_button.scss +12 -2
- package/assets/styles/vendor/vue-js-modal.scss +3 -3
- package/assets/translations/en-us.yaml +113 -22
- package/assets/translations/zh-hans.yaml +113 -24
- package/babel.config.js +13 -0
- package/chart/gatekeeper.vue +78 -0
- package/chart/istio.vue +135 -112
- package/chart/logging/index.vue +13 -4
- package/chart/monitoring/index.vue +15 -5
- package/chart/monitoring/steps/uninstall-v1.vue +2 -2
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/aws.vue +1 -1
- package/cloud-credential/digitalocean.vue +1 -1
- package/cloud-credential/gcp.vue +1 -1
- package/cloud-credential/generic.vue +2 -2
- package/cloud-credential/linode.vue +1 -1
- package/cloud-credential/pnap.vue +1 -1
- package/components/ActionMenu.vue +3 -4
- package/components/AssignTo.vue +1 -1
- package/components/AsyncButton.vue +1 -1
- package/components/BannerGraphic.vue +1 -1
- package/components/BrandImage.vue +1 -4
- package/components/ButtonDropdown.vue +2 -3
- package/components/Carousel.vue +85 -37
- package/components/ChartPsp.vue +76 -0
- package/components/CruResource.vue +6 -2
- package/components/DashboardMetrics.vue +12 -10
- package/components/DetailText.vue +1 -1
- package/components/DisableAuthProviderModal.vue +1 -1
- package/components/EmberPage.vue +1 -1
- package/components/EtcdInfoBanner.vue +12 -7
- package/components/ExplorerMembers.vue +101 -6
- package/components/ExplorerProjectsNamespaces.vue +46 -3
- package/components/FileDiff.vue +6 -7
- package/components/GrafanaDashboard.vue +27 -23
- package/components/LazyImage.vue +10 -12
- package/components/LogItem.vue +1 -1
- package/components/Markdown.vue +1 -1
- package/components/PromptRemove.vue +2 -2
- package/components/PromptRestore.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +16 -0
- package/components/ResourceDetail/index.vue +21 -4
- package/components/ResourceList/index.vue +1 -1
- package/components/ResourceTable.vue +4 -1
- package/components/SingleClusterInfo.vue +2 -2
- package/components/SortableTable/THead.vue +1 -1
- package/components/SortableTable/index.vue +28 -13
- package/components/SortableTable/selection.js +58 -50
- package/components/Wizard.vue +4 -2
- package/components/__tests__/AsyncButton.test.ts +3 -1
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CruResource.test.ts +3 -1
- package/components/auth/Principal.vue +1 -1
- package/components/auth/RoleDetailEdit.vue +2 -2
- package/components/fleet/FleetBundles.vue +3 -1
- package/components/fleet/FleetClusters.vue +1 -2
- package/components/fleet/FleetIntro.vue +9 -1
- package/components/fleet/FleetNoWorkspaces.vue +62 -0
- package/components/fleet/FleetSummary.vue +7 -1
- package/components/form/HookOption.vue +14 -10
- package/components/form/LabeledSelect.vue +14 -11
- package/components/form/Labels.vue +32 -27
- package/components/form/MatchExpressions.vue +19 -4
- package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
- package/components/form/NameNsDescription.vue +32 -46
- package/components/form/ProjectMemberEditor.vue +46 -21
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/SecretSelector.vue +5 -1
- package/components/form/ServiceNameSelect.vue +1 -1
- package/components/form/SimpleSecretSelector.vue +9 -9
- package/components/form/Tolerations.vue +4 -1
- package/components/form/ValueFromResource.vue +14 -9
- package/components/form/WorkloadPorts.vue +2 -2
- package/components/form/__tests__/LabeledSelect.test.ts +138 -0
- package/components/form/__tests__/NameNsDescription.ts +59 -0
- package/components/formatter/InternalExternalIP.vue +6 -0
- package/components/formatter/InvolvedObjectLink.vue +54 -0
- package/components/formatter/Link.vue +20 -4
- package/components/formatter/LinkName.vue +6 -1
- package/components/formatter/ServiceTargets.vue +1 -1
- package/components/formatter/WorkloadHealthScale.vue +8 -2
- package/components/nav/Group.vue +2 -2
- package/components/nav/NamespaceFilter.vue +23 -11
- package/components/nav/TopLevelMenu.vue +2 -4
- package/components/nav/Type.vue +1 -1
- package/components/nav/WorkspaceSwitcher.vue +46 -5
- package/components/nuxt/nuxt-build-indicator.vue +143 -0
- package/components/nuxt/nuxt-child.js +122 -0
- package/components/nuxt/nuxt-error.vue +98 -0
- package/components/nuxt/nuxt-link.client.js +98 -0
- package/components/nuxt/nuxt-link.server.js +16 -0
- package/components/nuxt/nuxt-loading.vue +154 -0
- package/components/nuxt/nuxt.js +101 -0
- package/config/labels-annotations.js +17 -0
- package/config/middleware.js +12 -0
- package/config/product/auth.js +3 -2
- package/config/product/explorer.js +34 -6
- package/config/product/fleet.js +2 -0
- package/config/query-params.js +1 -0
- package/config/router.js +414 -0
- package/config/store.js +181 -0
- package/config/table-headers.js +54 -12
- package/config/types.js +18 -8
- package/config/uiplugins.js +30 -0
- package/content/docs/en-us/whats-new.md +10 -0
- package/content/docs/zh-hans/whats-new.md +11 -1
- package/core/plugin-routes.ts +23 -0
- package/core/plugin.ts +4 -2
- package/core/types.ts +258 -1
- package/creators/app/app.package.json +2 -1
- package/creators/app/files/.eslintrc.js +1 -1
- package/creators/app/files/babel.config.js +1 -18
- package/creators/app/files/tsconfig.json +0 -1
- package/creators/app/files/vue.config.js +6 -0
- package/creators/app/init +5 -5
- package/creators/pkg/files/.github/workflows/build-extension.yml +110 -0
- package/creators/pkg/files/tsconfig.json +0 -1
- package/creators/pkg/init +35 -4
- package/creators/pkg/pkg.package.json +3 -3
- package/creators/update/init +1 -1
- package/detail/constraints.gatekeeper.sh.constraint.vue +34 -17
- package/detail/fleet.cattle.io.clustergroup.vue +7 -1
- package/detail/fleet.cattle.io.gitrepo.vue +19 -11
- package/detail/harvesterhci.io.management.cluster.vue +3 -3
- package/detail/provisioning.cattle.io.cluster.vue +54 -12
- package/detail/workload/index.vue +3 -3
- package/dialog/AddClusterMemberDialog.vue +1 -1
- package/dialog/AddProjectMemberDialog.vue +2 -2
- package/dialog/AddonConfigConfirmationDialog.vue +27 -15
- package/dialog/DiagnosticTimingsDialog.vue +1 -1
- package/dialog/ForceMachineRemoveDialog.vue +1 -1
- package/dialog/GenericPrompt.vue +18 -6
- package/dialog/RotateEncryptionKeyDialog.vue +1 -1
- package/dialog/SaveAsRKETemplateDialog.vue +1 -1
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/edit/auth/github.vue +8 -8
- package/edit/auth/googleoauth.vue +5 -5
- package/edit/auth/ldap/index.vue +1 -1
- package/edit/auth/oidc.vue +1 -1
- package/edit/auth/saml.vue +1 -1
- package/edit/cis.cattle.io.clusterscan.vue +1 -1
- package/edit/fleet.cattle.io.clustergroup.vue +6 -4
- package/edit/fleet.cattle.io.gitrepo.vue +32 -4
- package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
- package/edit/logging.banzaicloud.io.output/index.vue +18 -5
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
- package/edit/management.cattle.io.fleetworkspace.vue +141 -6
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +4 -1
- package/edit/management.cattle.io.setting.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/tls.vue +18 -18
- package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +4 -4
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
- package/edit/namespace.vue +14 -10
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +126 -45
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +21 -4
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +202 -2
- package/edit/provisioning.cattle.io.cluster/import.vue +23 -25
- package/edit/provisioning.cattle.io.cluster/rke2.vue +344 -102
- package/edit/resources.cattle.io.backup.vue +1 -1
- package/edit/service.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
- package/edit/workload/__tests__/Job.test.ts +3 -1
- package/edit/workload/index.vue +8 -3
- package/edit/workload/mixins/workload.js +22 -7
- package/edit/workload/storage/Mount.vue +3 -3
- package/initialize/App.js +206 -0
- package/initialize/client.js +863 -0
- package/initialize/index.js +364 -0
- package/layouts/default.vue +7 -3
- package/layouts/standalone.vue +13 -0
- package/list/catalog.cattle.io.clusterrepo.vue +1 -0
- package/list/fleet.cattle.io.bundle.vue +6 -3
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +3 -1
- package/list/fleet.cattle.io.gitrepo.vue +44 -5
- package/list/management.cattle.io.fleetworkspace.vue +45 -0
- package/list/node.vue +69 -16
- package/list/provisioning.cattle.io.cluster.vue +30 -1
- package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
- package/list/workload.vue +6 -4
- package/machine-config/azure.vue +97 -38
- package/middleware/authenticated.js +34 -0
- package/mixins/chart.js +101 -2
- package/mixins/fetch.client.js +95 -0
- package/mixins/fetch.server.js +73 -0
- package/mixins/labeled-form-element.ts +2 -2
- package/mixins/resource-fetch.js +2 -2
- package/models/apps.statefulset.js +28 -0
- package/models/cluster/node.js +23 -2
- package/models/cluster.x-k8s.io.machine.js +4 -2
- package/models/clusterroletemplatebinding.js +7 -0
- package/models/constraints.gatekeeper.sh.constraint.js +46 -0
- package/models/fleet.cattle.io.cluster.js +19 -10
- package/models/fleet.cattle.io.gitrepo.js +7 -2
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.fleetworkspace.js +12 -0
- package/models/management.cattle.io.gitreporestriction.js +5 -0
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
- package/models/pod.js +4 -0
- package/models/provisioning.cattle.io.cluster.js +7 -5
- package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
- package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
- package/package.json +13 -21
- package/pages/auth/setup.vue +2 -2
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +33 -0
- package/pages/c/_cluster/apps/charts/chart.vue +4 -4
- package/pages/c/_cluster/apps/charts/install.helpers.js +26 -0
- package/pages/c/_cluster/apps/charts/install.vue +98 -102
- package/pages/c/_cluster/explorer/EventsTable.vue +5 -19
- package/pages/c/_cluster/explorer/index.vue +29 -25
- package/pages/c/_cluster/explorer/tools/index.vue +8 -8
- package/pages/c/_cluster/fleet/index.vue +95 -34
- package/pages/c/_cluster/gatekeeper/index.vue +1 -1
- package/pages/c/_cluster/istio/index.vue +5 -5
- package/pages/c/_cluster/manager/cloudCredential/index.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +7 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +8 -8
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +20 -7
- package/pages/c/_cluster/uiplugins/index.vue +49 -17
- package/pages/diagnostic.vue +32 -25
- package/pages/home.vue +9 -4
- package/pages/index.vue +10 -1
- package/pages/rio/mesh.vue +1 -2
- package/pkg/tsconfig.json +0 -1
- package/plugins/clean-html-directive.js +34 -0
- package/plugins/dashboard-store/actions.js +32 -9
- package/plugins/dashboard-store/index.js +1 -1
- package/plugins/dashboard-store/mutations.js +5 -2
- package/plugins/dashboard-store/resource-class.js +8 -1
- package/plugins/plugin.js +0 -14
- package/plugins/portal-vue.js +4 -0
- package/plugins/steve/mutations.js +3 -2
- package/plugins/steve/steve-description-class.js +5 -1
- package/plugins/steve/subscribe.js +63 -54
- package/plugins/steve-create-worker.js +14 -0
- package/promptRemove/management.cattle.io.globalrole.vue +2 -2
- package/promptRemove/management.cattle.io.project.vue +2 -2
- package/promptRemove/management.cattle.io.roletemplate.vue +2 -2
- package/promptRemove/pod.vue +1 -1
- package/public/index.html +65 -0
- package/rancher-components/components/Banner/Banner.test.ts +7 -1
- package/rancher-components/components/Banner/Banner.vue +2 -1
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
- package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
- package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
- package/scripts/build-pkg.sh +1 -0
- package/scripts/clean +6 -0
- package/scripts/extension/bundle +58 -0
- package/scripts/extension/helmpatch +89 -0
- package/scripts/extension/publish +333 -0
- package/scripts/serve-pkgs +6 -2
- package/scripts/test-plugins-build.sh +4 -0
- package/store/__tests__/index.test.ts +110 -0
- package/store/index.js +145 -58
- package/store/type-map.js +6 -2
- package/tsconfig.default.json +36 -0
- package/tsconfig.json +23 -0
- package/types/rancher/index.d.ts +2 -0
- package/types/shell/index.d.ts +466 -320
- package/utils/__tests__/grafana.test.ts +44 -0
- package/utils/__tests__/string.test.ts +12 -0
- package/utils/auth.js +65 -0
- package/utils/axios.js +190 -0
- package/utils/cookie-universal-nuxt.js +10 -0
- package/utils/dom.js +15 -0
- package/utils/grafana.js +35 -16
- package/utils/monitoring.js +2 -1
- package/utils/nuxt.js +659 -0
- package/utils/position.js +5 -8
- package/utils/router.scrollBehavior.js +80 -0
- package/utils/select.js +1 -3
- package/utils/socket.js +1 -0
- package/utils/string.js +13 -0
- package/utils/time.js +9 -0
- package/vue.config.js +690 -0
- package/chart/rancher-alerting-drivers.vue +0 -53
- package/chart/rancher-gatekeeper.vue +0 -37
- package/creators/app/files/nuxt.config.js +0 -6
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +0 -4
- package/nuxt.config.js +0 -798
- package/plugins/dashboard-store/extensions.js +0 -22
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Meta from 'vue-meta';
|
|
3
|
+
import ClientOnly from 'vue-client-only';
|
|
4
|
+
import NoSsr from 'vue-no-ssr';
|
|
5
|
+
import { createRouter } from '../config/router.js';
|
|
6
|
+
import NuxtChild from '../components/nuxt/nuxt-child.js';
|
|
7
|
+
import NuxtError from '../layouts/error.vue';
|
|
8
|
+
import Nuxt from '../components/nuxt/nuxt.js';
|
|
9
|
+
import App from './App.js';
|
|
10
|
+
import { setContext, getLocation, getRouteData, normalizeError } from '../utils/nuxt';
|
|
11
|
+
import { createStore } from '../config/store.js';
|
|
12
|
+
|
|
13
|
+
/* Plugins */
|
|
14
|
+
|
|
15
|
+
import '../plugins/portal-vue.js';
|
|
16
|
+
import cookieUniversalNuxt from '../utils/cookie-universal-nuxt.js';
|
|
17
|
+
import axios from '../utils/axios.js';
|
|
18
|
+
import plugins from '../core/plugins.js';
|
|
19
|
+
import pluginsLoader from '../core/plugins-loader.js';
|
|
20
|
+
import axiosShell from '../plugins/axios';
|
|
21
|
+
import '../plugins/tooltip';
|
|
22
|
+
import '../plugins/vue-clipboard2';
|
|
23
|
+
import '../plugins/v-select';
|
|
24
|
+
import '../plugins/directives';
|
|
25
|
+
import '../plugins/clean-html-directive';
|
|
26
|
+
import '../plugins/transitions';
|
|
27
|
+
import '../plugins/vue-js-modal';
|
|
28
|
+
import '../plugins/js-yaml';
|
|
29
|
+
import '../plugins/resize';
|
|
30
|
+
import '../plugins/shortkey';
|
|
31
|
+
import '../plugins/i18n';
|
|
32
|
+
import '../plugins/global-formatters';
|
|
33
|
+
import '../plugins/trim-whitespace';
|
|
34
|
+
import '../plugins/extend-router';
|
|
35
|
+
|
|
36
|
+
import consolePlugin from '../plugins/console';
|
|
37
|
+
import intNumber from '../plugins/int-number';
|
|
38
|
+
import nuxtClientInit from '../plugins/nuxt-client-init';
|
|
39
|
+
import replaceAll from '../plugins/replaceall';
|
|
40
|
+
import backButton from '../plugins/back-button';
|
|
41
|
+
import plugin from '../plugins/plugin';
|
|
42
|
+
import codeMirror from '../plugins/codemirror-loader';
|
|
43
|
+
import '../plugins/formatters';
|
|
44
|
+
import version from '../plugins/version';
|
|
45
|
+
import steveCreateWorker from '../plugins/steve-create-worker';
|
|
46
|
+
|
|
47
|
+
// Component: <ClientOnly>
|
|
48
|
+
Vue.component(ClientOnly.name, ClientOnly);
|
|
49
|
+
|
|
50
|
+
// TODO: Remove in Nuxt 3: <NoSsr>
|
|
51
|
+
Vue.component(NoSsr.name, {
|
|
52
|
+
...NoSsr,
|
|
53
|
+
render(h, ctx) {
|
|
54
|
+
if (process.client && !NoSsr._warned) {
|
|
55
|
+
NoSsr._warned = true;
|
|
56
|
+
|
|
57
|
+
console.warn('<no-ssr> has been deprecated and will be removed in Nuxt 3, please use <client-only> instead'); // eslint-disable-line no-console
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return NoSsr.render(h, ctx);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Component: <NuxtChild>
|
|
65
|
+
Vue.component(NuxtChild.name, NuxtChild);
|
|
66
|
+
Vue.component('NChild', NuxtChild);
|
|
67
|
+
|
|
68
|
+
// Component NuxtLink is imported in server.js or client.js
|
|
69
|
+
|
|
70
|
+
// Component: <Nuxt>
|
|
71
|
+
Vue.component(Nuxt.name, Nuxt);
|
|
72
|
+
|
|
73
|
+
Object.defineProperty(Vue.prototype, '$nuxt', {
|
|
74
|
+
get() {
|
|
75
|
+
const globalNuxt = this.$root.$options.$nuxt;
|
|
76
|
+
|
|
77
|
+
if (process.client && !globalNuxt && typeof window !== 'undefined') {
|
|
78
|
+
return window.$nuxt;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return globalNuxt;
|
|
82
|
+
},
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
Vue.use(Meta, {
|
|
87
|
+
keyName: 'head', attribute: 'data-n-head', ssrAttribute: 'data-n-head-ssr', tagIDKeyName: 'hid'
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const defaultTransition = {
|
|
91
|
+
name: 'page', mode: 'out-in', appear: true, appearClass: 'appear', appearActiveClass: 'appear-active', appearToClass: 'appear-to'
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
async function createApp(ssrContext, config = {}) {
|
|
95
|
+
const router = await createRouter(ssrContext, config);
|
|
96
|
+
|
|
97
|
+
const store = createStore(ssrContext);
|
|
98
|
+
|
|
99
|
+
// Add this.$router into store actions/mutations
|
|
100
|
+
store.$router = router;
|
|
101
|
+
|
|
102
|
+
// Create Root instance
|
|
103
|
+
|
|
104
|
+
// here we inject the router and store to all child components,
|
|
105
|
+
// making them available everywhere as `this.$router` and `this.$store`.
|
|
106
|
+
const app = {
|
|
107
|
+
head: {
|
|
108
|
+
title: 'dashboard',
|
|
109
|
+
meta: [{ charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, {
|
|
110
|
+
hid: 'description', name: 'description', content: 'Rancher Dashboard'
|
|
111
|
+
}],
|
|
112
|
+
link: [{
|
|
113
|
+
hid: 'icon', rel: 'icon', type: 'image\u002Fx-icon', href: '\u002Ffavicon.png'
|
|
114
|
+
}],
|
|
115
|
+
style: [],
|
|
116
|
+
script: []
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
store,
|
|
120
|
+
router,
|
|
121
|
+
nuxt: {
|
|
122
|
+
defaultTransition,
|
|
123
|
+
transitions: [defaultTransition],
|
|
124
|
+
setTransitions(transitions) {
|
|
125
|
+
if (!Array.isArray(transitions)) {
|
|
126
|
+
transitions = [transitions];
|
|
127
|
+
}
|
|
128
|
+
transitions = transitions.map((transition) => {
|
|
129
|
+
if (!transition) {
|
|
130
|
+
transition = defaultTransition;
|
|
131
|
+
} else if (typeof transition === 'string') {
|
|
132
|
+
transition = Object.assign({}, defaultTransition, { name: transition });
|
|
133
|
+
} else {
|
|
134
|
+
transition = Object.assign({}, defaultTransition, transition);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return transition;
|
|
138
|
+
});
|
|
139
|
+
this.$options.nuxt.transitions = transitions;
|
|
140
|
+
|
|
141
|
+
return transitions;
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
err: null,
|
|
145
|
+
dateErr: null,
|
|
146
|
+
error(err) {
|
|
147
|
+
err = err || null;
|
|
148
|
+
app.context._errored = Boolean(err);
|
|
149
|
+
err = err ? normalizeError(err) : null;
|
|
150
|
+
let nuxt = app.nuxt; // to work with @vue/composition-api, see https://github.com/nuxt/nuxt.js/issues/6517#issuecomment-573280207
|
|
151
|
+
|
|
152
|
+
if (this) {
|
|
153
|
+
nuxt = this.nuxt || this.$options.nuxt;
|
|
154
|
+
}
|
|
155
|
+
nuxt.dateErr = Date.now();
|
|
156
|
+
nuxt.err = err;
|
|
157
|
+
// Used in src/server.js
|
|
158
|
+
if (ssrContext) {
|
|
159
|
+
ssrContext.nuxt.error = err;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return err;
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
...App
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// Make app available into store via this.app
|
|
169
|
+
store.app = app;
|
|
170
|
+
|
|
171
|
+
const next = ssrContext ? ssrContext.next : location => app.router.push(location);
|
|
172
|
+
// Resolve route
|
|
173
|
+
let route;
|
|
174
|
+
|
|
175
|
+
if (ssrContext) {
|
|
176
|
+
route = router.resolve(ssrContext.url).route;
|
|
177
|
+
} else {
|
|
178
|
+
const path = getLocation(router.options.base, router.options.mode);
|
|
179
|
+
|
|
180
|
+
route = router.resolve(path).route;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Set context to app.context
|
|
184
|
+
await setContext(app, {
|
|
185
|
+
store,
|
|
186
|
+
route,
|
|
187
|
+
next,
|
|
188
|
+
error: app.nuxt.error.bind(app),
|
|
189
|
+
payload: ssrContext ? ssrContext.payload : undefined,
|
|
190
|
+
req: ssrContext ? ssrContext.req : undefined,
|
|
191
|
+
res: ssrContext ? ssrContext.res : undefined,
|
|
192
|
+
beforeRenderFns: ssrContext ? ssrContext.beforeRenderFns : undefined,
|
|
193
|
+
ssrContext
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
function inject(key, value) {
|
|
197
|
+
if (!key) {
|
|
198
|
+
throw new Error('inject(key, value) has no key provided');
|
|
199
|
+
}
|
|
200
|
+
if (value === undefined) {
|
|
201
|
+
throw new Error(`inject('${ key }', value) has no value provided`);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
key = `$${ key }`;
|
|
205
|
+
// Add into app
|
|
206
|
+
app[key] = value;
|
|
207
|
+
// Add into context
|
|
208
|
+
if (!app.context[key]) {
|
|
209
|
+
app.context[key] = value;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Add into store
|
|
213
|
+
store[key] = app[key];
|
|
214
|
+
|
|
215
|
+
// Check if plugin not already installed
|
|
216
|
+
const installKey = `__nuxt_${ key }_installed__`;
|
|
217
|
+
|
|
218
|
+
if (Vue[installKey]) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
Vue[installKey] = true;
|
|
222
|
+
// Call Vue.use() to install the plugin into vm
|
|
223
|
+
Vue.use(() => {
|
|
224
|
+
if (!Object.prototype.hasOwnProperty.call(Vue.prototype, key)) {
|
|
225
|
+
Object.defineProperty(Vue.prototype, key, {
|
|
226
|
+
get() {
|
|
227
|
+
return this.$root.$options[key];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Inject runtime config as $config
|
|
235
|
+
inject('config', config);
|
|
236
|
+
|
|
237
|
+
if (process.client) {
|
|
238
|
+
// Replace store state before plugins execution
|
|
239
|
+
if (window.__NUXT__ && window.__NUXT__.state) {
|
|
240
|
+
store.replaceState(window.__NUXT__.state);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Add enablePreview(previewData = {}) in context for plugins
|
|
245
|
+
if (process.static && process.client) {
|
|
246
|
+
app.context.enablePreview = function(previewData = {}) {
|
|
247
|
+
app.previewData = Object.assign({}, previewData);
|
|
248
|
+
inject('preview', previewData);
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
// Plugin execution
|
|
252
|
+
|
|
253
|
+
// if (typeof nuxt_plugin_portalvue_6babae27 === 'function') {
|
|
254
|
+
// await nuxt_plugin_portalvue_6babae27(app.context, inject);
|
|
255
|
+
// }
|
|
256
|
+
|
|
257
|
+
if (typeof cookieUniversalNuxt === 'function') {
|
|
258
|
+
await cookieUniversalNuxt(app.context, inject);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (typeof axios === 'function') {
|
|
262
|
+
await axios(app.context, inject);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (typeof plugins === 'function') {
|
|
266
|
+
await plugins(app.context, inject);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (typeof pluginsLoader === 'function') {
|
|
270
|
+
await pluginsLoader(app.context, inject);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (typeof axiosShell === 'function') {
|
|
274
|
+
await axiosShell(app.context, inject);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (process.client && typeof consolePlugin === 'function') {
|
|
278
|
+
await consolePlugin(app.context, inject);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (process.client && typeof intNumber === 'function') {
|
|
282
|
+
await intNumber(app.context, inject);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (process.client && typeof nuxtClientInit === 'function') {
|
|
286
|
+
await nuxtClientInit(app.context, inject);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (typeof replaceAll === 'function') {
|
|
290
|
+
await replaceAll(app.context, inject);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (typeof backButton === 'function') {
|
|
294
|
+
await backButton(app.context, inject);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (process.client && typeof plugin === 'function') {
|
|
298
|
+
await plugin(app.context, inject);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (process.client && typeof codeMirror === 'function') {
|
|
302
|
+
await codeMirror(app.context, inject);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (process.client && typeof version === 'function') {
|
|
306
|
+
await version(app.context, inject);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (process.client && typeof steveCreateWorker === 'function') {
|
|
310
|
+
await steveCreateWorker(app.context, inject);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// if (process.client && typeof formatters === 'function') {
|
|
314
|
+
// await formatters(app.context, inject);
|
|
315
|
+
// }
|
|
316
|
+
|
|
317
|
+
// Lock enablePreview in context
|
|
318
|
+
if (process.static && process.client) {
|
|
319
|
+
app.context.enablePreview = function() {
|
|
320
|
+
console.warn('You cannot call enablePreview() outside a plugin.'); // eslint-disable-line no-console
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Wait for async component to be resolved first
|
|
325
|
+
await new Promise((resolve, reject) => {
|
|
326
|
+
// Ignore 404s rather than blindly replacing URL in browser
|
|
327
|
+
if (process.client) {
|
|
328
|
+
const { route } = router.resolve(app.context.route.fullPath);
|
|
329
|
+
|
|
330
|
+
if (!route.matched.length) {
|
|
331
|
+
return resolve();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
router.replace(app.context.route.fullPath, resolve, (err) => {
|
|
335
|
+
// https://github.com/vuejs/vue-router/blob/v3.4.3/src/util/errors.js
|
|
336
|
+
if (!err._isRouter) {
|
|
337
|
+
return reject(err);
|
|
338
|
+
}
|
|
339
|
+
if (err.type !== 2 /* NavigationFailureType.redirected */) {
|
|
340
|
+
return resolve();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// navigated to a different route in router guard
|
|
344
|
+
const unregister = router.afterEach(async(to, from) => {
|
|
345
|
+
if (process.server && ssrContext && ssrContext.url) {
|
|
346
|
+
ssrContext.url = to.fullPath;
|
|
347
|
+
}
|
|
348
|
+
app.context.route = await getRouteData(to);
|
|
349
|
+
app.context.params = to.params || {};
|
|
350
|
+
app.context.query = to.query || {};
|
|
351
|
+
unregister();
|
|
352
|
+
resolve();
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
return {
|
|
358
|
+
store,
|
|
359
|
+
app,
|
|
360
|
+
router
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export { createApp, NuxtError };
|
package/layouts/default.vue
CHANGED
|
@@ -35,8 +35,9 @@ import { getVersionInfo, markSeenReleaseNotes } from '@shell/utils/version';
|
|
|
35
35
|
import { sortBy } from '@shell/utils/sort';
|
|
36
36
|
import PageHeaderActions from '@shell/mixins/page-actions';
|
|
37
37
|
import BrowserTabVisibility from '@shell/mixins/browser-tab-visibility';
|
|
38
|
-
import { getProductFromRoute } from '@shell/middleware/authenticated';
|
|
38
|
+
import { getClusterFromRoute, getProductFromRoute } from '@shell/middleware/authenticated';
|
|
39
39
|
import { BOTTOM } from '@shell/utils/position';
|
|
40
|
+
import { BLANK_CLUSTER } from '@shell/store';
|
|
40
41
|
|
|
41
42
|
const SET_LOGIN_ACTION = 'set-as-login';
|
|
42
43
|
|
|
@@ -201,7 +202,7 @@ export default {
|
|
|
201
202
|
*/
|
|
202
203
|
clusterAndRouteReady() {
|
|
203
204
|
return this.clusterReady &&
|
|
204
|
-
this.clusterId === this.$route
|
|
205
|
+
this.clusterId === getClusterFromRoute(this.$route) &&
|
|
205
206
|
this.currentProduct?.name === getProductFromRoute(this.$route);
|
|
206
207
|
},
|
|
207
208
|
|
|
@@ -286,7 +287,7 @@ export default {
|
|
|
286
287
|
|
|
287
288
|
async currentProduct(a, b) {
|
|
288
289
|
if ( !isEqual(a, b) ) {
|
|
289
|
-
if (a.inStore !== b.inStore || a.inStore !== 'cluster' ) {
|
|
290
|
+
if ((a.inStore !== b.inStore || a.inStore !== 'cluster') && this.clusterId && a.name) {
|
|
290
291
|
const route = {
|
|
291
292
|
name: 'c-cluster-product',
|
|
292
293
|
params: {
|
|
@@ -333,6 +334,9 @@ export default {
|
|
|
333
334
|
|
|
334
335
|
methods: {
|
|
335
336
|
async setClusterAsLastRoute() {
|
|
337
|
+
if (!this.clusterId || this.clusterId === BLANK_CLUSTER) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
336
340
|
const route = {
|
|
337
341
|
name: this.$route.name,
|
|
338
342
|
params: {
|
|
@@ -31,7 +31,9 @@ export default {
|
|
|
31
31
|
|
|
32
32
|
async fetch() {
|
|
33
33
|
await this.$fetchType(this.resource);
|
|
34
|
-
|
|
34
|
+
if (this.$store.getters['management/schemaFor']( FLEET.CLUSTER )) {
|
|
35
|
+
this.allFleet = await this.$store.getters['management/all'](FLEET.CLUSTER);
|
|
36
|
+
}
|
|
35
37
|
},
|
|
36
38
|
|
|
37
39
|
data() {
|
|
@@ -113,11 +115,12 @@ export default {
|
|
|
113
115
|
>
|
|
114
116
|
<template #cell:deploymentsReady="{row}">
|
|
115
117
|
<span
|
|
116
|
-
v-if="row.status.summary.desiredReady
|
|
118
|
+
v-if="row.status && (row.status.summary.desiredReady !== row.status.summary.ready)"
|
|
117
119
|
class="text-warning"
|
|
118
120
|
>
|
|
119
121
|
{{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
|
|
120
|
-
<span v-else>{{ row.status.summary.desiredReady }}</span>
|
|
122
|
+
<span v-else-if="row.status">{{ row.status.summary.desiredReady }}</span>
|
|
123
|
+
<span v-else>-</span>
|
|
121
124
|
</template>
|
|
122
125
|
</ResourceTable>
|
|
123
126
|
</div>
|
|
@@ -26,7 +26,9 @@ export default {
|
|
|
26
26
|
|
|
27
27
|
async fetch() {
|
|
28
28
|
await this.$fetchType(this.resource);
|
|
29
|
-
|
|
29
|
+
if (this.$store.getters['management/schemaFor']( FLEET.CLUSTER )) {
|
|
30
|
+
this.allFleet = await this.$store.getters['management/all'](FLEET.CLUSTER);
|
|
31
|
+
}
|
|
30
32
|
},
|
|
31
33
|
|
|
32
34
|
data() {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import FleetRepos from '@shell/components/fleet/FleetRepos';
|
|
3
3
|
import Masthead from '@shell/components/ResourceList/Masthead';
|
|
4
|
+
import FleetNoWorkspaces from '@shell/components/fleet/FleetNoWorkspaces.vue';
|
|
4
5
|
import { FLEET } from '@shell/config/types';
|
|
5
6
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
|
7
|
+
import { checkPermissions, checkSchemasForFindAllHash } from '@shell/utils/auth';
|
|
6
8
|
|
|
7
9
|
export default {
|
|
8
10
|
name: 'ListGitRepo',
|
|
9
11
|
components: {
|
|
10
12
|
FleetRepos,
|
|
11
13
|
Masthead,
|
|
14
|
+
FleetNoWorkspaces,
|
|
12
15
|
},
|
|
13
16
|
mixins: [ResourceFetch],
|
|
14
17
|
props: {
|
|
@@ -39,17 +42,50 @@ export default {
|
|
|
39
42
|
},
|
|
40
43
|
|
|
41
44
|
async fetch() {
|
|
42
|
-
|
|
45
|
+
try {
|
|
46
|
+
const hash = await checkSchemasForFindAllHash({
|
|
47
|
+
cluster: {
|
|
48
|
+
inStoreType: 'management',
|
|
49
|
+
type: FLEET.CLUSTER
|
|
50
|
+
},
|
|
51
|
+
clusterGroups: {
|
|
52
|
+
inStoreType: 'management',
|
|
53
|
+
type: FLEET.CLUSTER_GROUP
|
|
54
|
+
},
|
|
43
55
|
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
gitRepos: {
|
|
57
|
+
inStoreType: 'management',
|
|
58
|
+
type: FLEET.GIT_REPO
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
workspaces: {
|
|
62
|
+
inStoreType: 'management',
|
|
63
|
+
type: FLEET.WORKSPACE
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
}, this.$store);
|
|
67
|
+
|
|
68
|
+
this.hasWorkspaces = !!hash.workspaces;
|
|
69
|
+
} catch (e) {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const permissions = await checkPermissions({ workspaces: { type: FLEET.WORKSPACE }, gitRepos: { type: FLEET.GIT_REPO } }, this.$store.getters);
|
|
74
|
+
|
|
75
|
+
this.permissions = permissions;
|
|
76
|
+
} catch (e) {
|
|
77
|
+
}
|
|
46
78
|
await this.$fetchType(this.resource);
|
|
47
|
-
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
data() {
|
|
82
|
+
return { hasWorkspaces: false, permissions: {} };
|
|
83
|
+
},
|
|
48
84
|
};
|
|
49
85
|
</script>
|
|
50
86
|
|
|
51
87
|
<template>
|
|
52
|
-
<div>
|
|
88
|
+
<div v-if="hasWorkspaces">
|
|
53
89
|
<Masthead
|
|
54
90
|
:schema="schema"
|
|
55
91
|
:resource="resource"
|
|
@@ -66,4 +102,7 @@ export default {
|
|
|
66
102
|
:force-update-live-and-delayed="forceUpdateLiveAndDelayed"
|
|
67
103
|
/>
|
|
68
104
|
</div>
|
|
105
|
+
<div v-else>
|
|
106
|
+
<FleetNoWorkspaces :can-view="permissions.workspaces" />
|
|
107
|
+
</div>
|
|
69
108
|
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ResourceTable from '@shell/components/ResourceTable';
|
|
3
|
+
import resourceFetch from '@shell/mixins/resource-fetch';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'ListWorkspace',
|
|
7
|
+
components: { ResourceTable },
|
|
8
|
+
mixins: [resourceFetch],
|
|
9
|
+
props: {
|
|
10
|
+
resource: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
schema: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
useQueryParamsForSimpleFiltering: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
async fetch() {
|
|
25
|
+
try {
|
|
26
|
+
await this.$fetchType(this.resource);
|
|
27
|
+
} catch (e) {}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
$loadingResources() {
|
|
31
|
+
return { loadIndeterminate: true };
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<ResourceTable
|
|
38
|
+
v-bind="$attrs"
|
|
39
|
+
:rows="rows"
|
|
40
|
+
:schema="schema"
|
|
41
|
+
:loading="loading"
|
|
42
|
+
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
43
|
+
v-on="$listeners"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|