@rancher/shell 0.3.5 → 0.3.7
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/base/_basic.scss +18 -0
- package/assets/styles/base/_mixins.scss +0 -11
- package/assets/styles/base/_variables.scss +2 -4
- package/assets/styles/global/_button.scss +12 -2
- package/assets/translations/en-us.yaml +35 -1
- package/assets/translations/zh-hans.yaml +30 -10
- package/chart/gatekeeper.vue +3 -2
- package/chart/istio.vue +29 -3
- package/components/BrandImage.vue +1 -4
- package/components/Carousel.vue +85 -37
- package/components/EtcdInfoBanner.vue +7 -3
- package/components/ExplorerMembers.vue +100 -5
- package/components/ExplorerProjectsNamespaces.vue +32 -2
- package/components/GrafanaDashboard.vue +9 -2
- package/components/SortableTable/index.vue +23 -11
- package/components/SortableTable/selection.js +58 -50
- package/components/Wizard.vue +4 -2
- package/components/auth/AuthBanner.vue +6 -0
- package/components/auth/RoleDetailEdit.vue +2 -2
- package/components/form/HookOption.vue +14 -10
- package/components/form/Labels.vue +32 -27
- package/components/form/MatchExpressions.vue +2 -2
- package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/ProjectMemberEditor.vue +46 -21
- 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__/NameNsDescription.ts +27 -0
- package/components/formatter/WorkloadHealthScale.vue +8 -2
- package/components/nav/NamespaceFilter.vue +8 -0
- package/{nuxt/components → components/nuxt}/nuxt.js +1 -1
- package/{nuxt → config}/middleware.js +8 -8
- package/config/product/explorer.js +24 -3
- package/config/query-params.js +1 -0
- package/config/router.js +1 -1
- package/{nuxt → config}/store.js +82 -79
- package/config/table-headers.js +46 -12
- package/config/types.js +7 -0
- package/core/plugin.ts +4 -2
- package/core/types.ts +258 -1
- package/creators/app/files/tsconfig.json +0 -1
- package/creators/app/files/vue.config.js +0 -1
- package/creators/pkg/files/.github/workflows/build-extension.yml +3 -4
- package/creators/pkg/files/tsconfig.json +0 -1
- package/creators/pkg/pkg.package.json +3 -3
- package/detail/constraints.gatekeeper.sh.constraint.vue +14 -7
- package/detail/fleet.cattle.io.clustergroup.vue +7 -1
- package/edit/auth/ldap/config.vue +21 -1
- package/edit/auth/saml.vue +132 -37
- package/edit/fleet.cattle.io.gitrepo.vue +16 -1
- package/edit/logging.banzaicloud.io.output/index.vue +18 -5
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
- package/edit/namespace.vue +12 -8
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -4
- package/edit/provisioning.cattle.io.cluster/import.vue +23 -25
- package/edit/provisioning.cattle.io.cluster/rke2.vue +96 -18
- package/edit/workload/mixins/workload.js +6 -7
- package/edit/workload/storage/Mount.vue +3 -3
- package/initialize/App.js +206 -0
- package/{nuxt → initialize}/client.js +406 -360
- package/{nuxt → initialize}/index.js +21 -22
- package/layouts/standalone.vue +13 -0
- package/list/catalog.cattle.io.clusterrepo.vue +1 -0
- package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
- package/list/workload.vue +6 -4
- package/mixins/chart.js +29 -1
- package/mixins/fetch.client.js +95 -0
- package/{nuxt/mixins → mixins}/fetch.server.js +30 -26
- package/mixins/labeled-form-element.ts +2 -2
- package/models/constraints.gatekeeper.sh.constraint.js +37 -0
- package/models/pod.js +4 -0
- package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
- package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
- package/package.json +9 -13
- package/pages/c/_cluster/apps/charts/install.vue +61 -39
- package/pages/diagnostic.vue +32 -25
- package/pages/rio/mesh.vue +1 -2
- package/pkg/tsconfig.json +0 -1
- package/plugins/clean-html-directive.js +3 -0
- package/plugins/dashboard-store/index.js +1 -1
- package/plugins/plugin.js +0 -14
- package/plugins/portal-vue.js +4 -0
- package/rancher-components/components/Banner/Banner.test.ts +3 -5
- package/rancher-components/components/Banner/Banner.vue +1 -0
- package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
- package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
- package/scripts/extension/publish +42 -23
- package/scripts/serve-pkgs +6 -2
- package/store/type-map.js +1 -1
- package/tsconfig.json +0 -1
- package/types/rancher/index.d.ts +2 -0
- package/types/shell/index.d.ts +353 -284
- package/utils/__tests__/grafana.test.ts +44 -0
- package/utils/axios.js +190 -0
- package/{nuxt → utils}/cookie-universal-nuxt.js +7 -6
- package/utils/dom.js +15 -0
- package/utils/gc/gc.ts +1 -1
- package/utils/grafana.js +35 -16
- package/{nuxt/utils.js → utils/nuxt.js} +265 -236
- package/utils/router.scrollBehavior.js +1 -1
- package/vue.config.js +30 -19
- package/nuxt/App.js +0 -210
- package/nuxt/axios.js +0 -186
- package/nuxt/empty.js +0 -1
- package/nuxt/jsonp.js +0 -82
- package/nuxt/loading.html +0 -39
- package/nuxt/mixins/fetch.client.js +0 -90
- package/nuxt/portal-vue.js +0 -4
- package/nuxt/server.js +0 -312
- package/nuxt/views/app.template.html +0 -9
- package/nuxt/views/error.html +0 -23
- package/plugins/dashboard-store/extensions.js +0 -22
- /package/{nuxt/components → components/nuxt}/nuxt-build-indicator.vue +0 -0
- /package/{nuxt/components → components/nuxt}/nuxt-child.js +0 -0
- /package/{nuxt/components → components/nuxt}/nuxt-error.vue +0 -0
- /package/{nuxt/components → components/nuxt}/nuxt-link.client.js +0 -0
- /package/{nuxt/components → components/nuxt}/nuxt-link.server.js +0 -0
- /package/{nuxt/components → components/nuxt}/nuxt-loading.vue +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
getMatchedComponentsInstances, getChildrenComponentInstancesUsingFetch, promisify, globalHandleError, sanitizeComponent
|
|
5
|
+
} from '../utils/nuxt';
|
|
6
|
+
import NuxtError from '../layouts/error.vue';
|
|
7
|
+
import NuxtLoading from '../components/nav/GlobalLoading.vue';
|
|
8
|
+
|
|
9
|
+
import '../assets/styles/app.scss';
|
|
10
|
+
|
|
11
|
+
import blank from '../layouts/blank.vue';
|
|
12
|
+
import defaultLayout from '../layouts/default.vue';
|
|
13
|
+
import home from '../layouts/home.vue';
|
|
14
|
+
import plain from '../layouts/plain.vue';
|
|
15
|
+
import unauthenticated from '../layouts/unauthenticated.vue';
|
|
16
|
+
import standalone from '../layouts/standalone.vue';
|
|
17
|
+
|
|
18
|
+
const layouts = {
|
|
19
|
+
_blank: sanitizeComponent(blank), _default: sanitizeComponent(defaultLayout), _home: sanitizeComponent(home), _plain: sanitizeComponent(plain), _unauthenticated: sanitizeComponent(unauthenticated), _standalone: sanitizeComponent(standalone)
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
render(h) {
|
|
24
|
+
const loadingEl = h('NuxtLoading', { ref: 'loading' });
|
|
25
|
+
|
|
26
|
+
const layoutEl = h(this.layout || 'nuxt');
|
|
27
|
+
const templateEl = h('div', {
|
|
28
|
+
domProps: { id: '__layout' },
|
|
29
|
+
key: this.layoutName
|
|
30
|
+
}, [layoutEl]);
|
|
31
|
+
|
|
32
|
+
const transitionEl = h('transition', {
|
|
33
|
+
props: {
|
|
34
|
+
name: 'layout',
|
|
35
|
+
mode: 'out-in'
|
|
36
|
+
},
|
|
37
|
+
on: {
|
|
38
|
+
beforeEnter(el) {
|
|
39
|
+
// Ensure to trigger scroll event after calling scrollBehavior
|
|
40
|
+
window.$nuxt.$nextTick(() => {
|
|
41
|
+
window.$nuxt.$emit('triggerScroll');
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, [templateEl]);
|
|
46
|
+
|
|
47
|
+
return h('div', { domProps: { id: '__nuxt' } }, [
|
|
48
|
+
loadingEl,
|
|
49
|
+
// 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
|
|
50
|
+
transitionEl
|
|
51
|
+
]);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
data: () => ({
|
|
55
|
+
isOnline: true,
|
|
56
|
+
|
|
57
|
+
layout: null,
|
|
58
|
+
layoutName: '',
|
|
59
|
+
|
|
60
|
+
nbFetching: 0
|
|
61
|
+
}),
|
|
62
|
+
|
|
63
|
+
beforeCreate() {
|
|
64
|
+
Vue.util.defineReactive(this, 'nuxt', this.$options.nuxt);
|
|
65
|
+
},
|
|
66
|
+
created() {
|
|
67
|
+
// Add this.$nuxt in child instances
|
|
68
|
+
this.$root.$options.$nuxt = this;
|
|
69
|
+
|
|
70
|
+
if (process.client) {
|
|
71
|
+
// add to window so we can listen when ready
|
|
72
|
+
window.$nuxt = this;
|
|
73
|
+
|
|
74
|
+
this.refreshOnlineStatus();
|
|
75
|
+
// Setup the listeners
|
|
76
|
+
window.addEventListener('online', this.refreshOnlineStatus);
|
|
77
|
+
window.addEventListener('offline', this.refreshOnlineStatus);
|
|
78
|
+
}
|
|
79
|
+
// Add $nuxt.error()
|
|
80
|
+
this.error = this.nuxt.error;
|
|
81
|
+
// Add $nuxt.context
|
|
82
|
+
this.context = this.$options.context;
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
mounted() {
|
|
86
|
+
this.$loading = this.$refs.loading;
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
watch: { 'nuxt.err': 'errorChanged' },
|
|
90
|
+
|
|
91
|
+
computed: {
|
|
92
|
+
isOffline() {
|
|
93
|
+
return !this.isOnline;
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
isFetching() {
|
|
97
|
+
return this.nbFetching > 0;
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
methods: {
|
|
102
|
+
refreshOnlineStatus() {
|
|
103
|
+
if (process.client) {
|
|
104
|
+
if (typeof window.navigator.onLine === 'undefined') {
|
|
105
|
+
// If the browser doesn't support connection status reports
|
|
106
|
+
// assume that we are online because most apps' only react
|
|
107
|
+
// when they now that the connection has been interrupted
|
|
108
|
+
this.isOnline = true;
|
|
109
|
+
} else {
|
|
110
|
+
this.isOnline = window.navigator.onLine;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
async refresh() {
|
|
116
|
+
const pages = getMatchedComponentsInstances(this.$route);
|
|
117
|
+
|
|
118
|
+
if (!pages.length) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.$loading.start();
|
|
122
|
+
|
|
123
|
+
const promises = pages.map((page) => {
|
|
124
|
+
const p = [];
|
|
125
|
+
|
|
126
|
+
// Old fetch
|
|
127
|
+
if (page.$options.fetch && page.$options.fetch.length) {
|
|
128
|
+
p.push(promisify(page.$options.fetch, this.context));
|
|
129
|
+
}
|
|
130
|
+
if (page.$fetch) {
|
|
131
|
+
p.push(page.$fetch());
|
|
132
|
+
} else {
|
|
133
|
+
// Get all component instance to call $fetch
|
|
134
|
+
for (const component of getChildrenComponentInstancesUsingFetch(page.$vnode.componentInstance)) {
|
|
135
|
+
p.push(component.$fetch());
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (page.$options.asyncData) {
|
|
140
|
+
p.push(
|
|
141
|
+
promisify(page.$options.asyncData, this.context)
|
|
142
|
+
.then((newData) => {
|
|
143
|
+
for (const key in newData) {
|
|
144
|
+
Vue.set(page.$data, key, newData[key]);
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return Promise.all(p);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
try {
|
|
154
|
+
await Promise.all(promises);
|
|
155
|
+
} catch (error) {
|
|
156
|
+
this.$loading.fail(error);
|
|
157
|
+
globalHandleError(error);
|
|
158
|
+
this.error(error);
|
|
159
|
+
}
|
|
160
|
+
this.$loading.finish();
|
|
161
|
+
},
|
|
162
|
+
errorChanged() {
|
|
163
|
+
if (this.nuxt.err) {
|
|
164
|
+
if (this.$loading) {
|
|
165
|
+
if (this.$loading.fail) {
|
|
166
|
+
this.$loading.fail(this.nuxt.err);
|
|
167
|
+
}
|
|
168
|
+
if (this.$loading.finish) {
|
|
169
|
+
this.$loading.finish();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
let errorLayout = (NuxtError.options || NuxtError).layout;
|
|
174
|
+
|
|
175
|
+
if (typeof errorLayout === 'function') {
|
|
176
|
+
errorLayout = errorLayout(this.context);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
this.setLayout(errorLayout);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
setLayout(layout) {
|
|
184
|
+
if (layout && typeof layout !== 'string') {
|
|
185
|
+
throw new Error('[nuxt] Avoid using non-string value as layout property.');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (!layout || !layouts[`_${ layout }`]) {
|
|
189
|
+
layout = 'default';
|
|
190
|
+
}
|
|
191
|
+
this.layoutName = layout;
|
|
192
|
+
this.layout = layouts[`_${ layout }`];
|
|
193
|
+
|
|
194
|
+
return this.layout;
|
|
195
|
+
},
|
|
196
|
+
loadLayout(layout) {
|
|
197
|
+
if (!layout || !layouts[`_${ layout }`]) {
|
|
198
|
+
layout = 'default';
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return Promise.resolve(layouts[`_${ layout }`]);
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
components: { NuxtLoading }
|
|
206
|
+
};
|