@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.
Files changed (120) hide show
  1. package/assets/images/providers/outscale.svg +19 -0
  2. package/assets/styles/base/_basic.scss +18 -0
  3. package/assets/styles/base/_mixins.scss +0 -11
  4. package/assets/styles/base/_variables.scss +2 -4
  5. package/assets/styles/global/_button.scss +12 -2
  6. package/assets/translations/en-us.yaml +35 -1
  7. package/assets/translations/zh-hans.yaml +30 -10
  8. package/chart/gatekeeper.vue +3 -2
  9. package/chart/istio.vue +29 -3
  10. package/components/BrandImage.vue +1 -4
  11. package/components/Carousel.vue +85 -37
  12. package/components/EtcdInfoBanner.vue +7 -3
  13. package/components/ExplorerMembers.vue +100 -5
  14. package/components/ExplorerProjectsNamespaces.vue +32 -2
  15. package/components/GrafanaDashboard.vue +9 -2
  16. package/components/SortableTable/index.vue +23 -11
  17. package/components/SortableTable/selection.js +58 -50
  18. package/components/Wizard.vue +4 -2
  19. package/components/auth/AuthBanner.vue +6 -0
  20. package/components/auth/RoleDetailEdit.vue +2 -2
  21. package/components/form/HookOption.vue +14 -10
  22. package/components/form/Labels.vue +32 -27
  23. package/components/form/MatchExpressions.vue +2 -2
  24. package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
  25. package/components/form/NameNsDescription.vue +1 -1
  26. package/components/form/ProjectMemberEditor.vue +46 -21
  27. package/components/form/Tolerations.vue +4 -1
  28. package/components/form/ValueFromResource.vue +14 -9
  29. package/components/form/WorkloadPorts.vue +2 -2
  30. package/components/form/__tests__/NameNsDescription.ts +27 -0
  31. package/components/formatter/WorkloadHealthScale.vue +8 -2
  32. package/components/nav/NamespaceFilter.vue +8 -0
  33. package/{nuxt/components → components/nuxt}/nuxt.js +1 -1
  34. package/{nuxt → config}/middleware.js +8 -8
  35. package/config/product/explorer.js +24 -3
  36. package/config/query-params.js +1 -0
  37. package/config/router.js +1 -1
  38. package/{nuxt → config}/store.js +82 -79
  39. package/config/table-headers.js +46 -12
  40. package/config/types.js +7 -0
  41. package/core/plugin.ts +4 -2
  42. package/core/types.ts +258 -1
  43. package/creators/app/files/tsconfig.json +0 -1
  44. package/creators/app/files/vue.config.js +0 -1
  45. package/creators/pkg/files/.github/workflows/build-extension.yml +3 -4
  46. package/creators/pkg/files/tsconfig.json +0 -1
  47. package/creators/pkg/pkg.package.json +3 -3
  48. package/detail/constraints.gatekeeper.sh.constraint.vue +14 -7
  49. package/detail/fleet.cattle.io.clustergroup.vue +7 -1
  50. package/edit/auth/ldap/config.vue +21 -1
  51. package/edit/auth/saml.vue +132 -37
  52. package/edit/fleet.cattle.io.gitrepo.vue +16 -1
  53. package/edit/logging.banzaicloud.io.output/index.vue +18 -5
  54. package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
  55. package/edit/namespace.vue +12 -8
  56. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -4
  57. package/edit/provisioning.cattle.io.cluster/import.vue +23 -25
  58. package/edit/provisioning.cattle.io.cluster/rke2.vue +96 -18
  59. package/edit/workload/mixins/workload.js +6 -7
  60. package/edit/workload/storage/Mount.vue +3 -3
  61. package/initialize/App.js +206 -0
  62. package/{nuxt → initialize}/client.js +406 -360
  63. package/{nuxt → initialize}/index.js +21 -22
  64. package/layouts/standalone.vue +13 -0
  65. package/list/catalog.cattle.io.clusterrepo.vue +1 -0
  66. package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
  67. package/list/workload.vue +6 -4
  68. package/mixins/chart.js +29 -1
  69. package/mixins/fetch.client.js +95 -0
  70. package/{nuxt/mixins → mixins}/fetch.server.js +30 -26
  71. package/mixins/labeled-form-element.ts +2 -2
  72. package/models/constraints.gatekeeper.sh.constraint.js +37 -0
  73. package/models/pod.js +4 -0
  74. package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
  75. package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
  76. package/package.json +9 -13
  77. package/pages/c/_cluster/apps/charts/install.vue +61 -39
  78. package/pages/diagnostic.vue +32 -25
  79. package/pages/rio/mesh.vue +1 -2
  80. package/pkg/tsconfig.json +0 -1
  81. package/plugins/clean-html-directive.js +3 -0
  82. package/plugins/dashboard-store/index.js +1 -1
  83. package/plugins/plugin.js +0 -14
  84. package/plugins/portal-vue.js +4 -0
  85. package/rancher-components/components/Banner/Banner.test.ts +3 -5
  86. package/rancher-components/components/Banner/Banner.vue +1 -0
  87. package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
  88. package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
  89. package/scripts/extension/publish +42 -23
  90. package/scripts/serve-pkgs +6 -2
  91. package/store/type-map.js +1 -1
  92. package/tsconfig.json +0 -1
  93. package/types/rancher/index.d.ts +2 -0
  94. package/types/shell/index.d.ts +353 -284
  95. package/utils/__tests__/grafana.test.ts +44 -0
  96. package/utils/axios.js +190 -0
  97. package/{nuxt → utils}/cookie-universal-nuxt.js +7 -6
  98. package/utils/dom.js +15 -0
  99. package/utils/gc/gc.ts +1 -1
  100. package/utils/grafana.js +35 -16
  101. package/{nuxt/utils.js → utils/nuxt.js} +265 -236
  102. package/utils/router.scrollBehavior.js +1 -1
  103. package/vue.config.js +30 -19
  104. package/nuxt/App.js +0 -210
  105. package/nuxt/axios.js +0 -186
  106. package/nuxt/empty.js +0 -1
  107. package/nuxt/jsonp.js +0 -82
  108. package/nuxt/loading.html +0 -39
  109. package/nuxt/mixins/fetch.client.js +0 -90
  110. package/nuxt/portal-vue.js +0 -4
  111. package/nuxt/server.js +0 -312
  112. package/nuxt/views/app.template.html +0 -9
  113. package/nuxt/views/error.html +0 -23
  114. package/plugins/dashboard-store/extensions.js +0 -22
  115. /package/{nuxt/components → components/nuxt}/nuxt-build-indicator.vue +0 -0
  116. /package/{nuxt/components → components/nuxt}/nuxt-child.js +0 -0
  117. /package/{nuxt/components → components/nuxt}/nuxt-error.vue +0 -0
  118. /package/{nuxt/components → components/nuxt}/nuxt-link.client.js +0 -0
  119. /package/{nuxt/components → components/nuxt}/nuxt-link.server.js +0 -0
  120. /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
+ };