@rancher/shell 0.3.3 → 0.3.5

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 (249) hide show
  1. package/assets/styles/app.scss +1 -1
  2. package/assets/styles/fonts/_fontstack.scss +11 -11
  3. package/assets/styles/vendor/vue-js-modal.scss +3 -3
  4. package/assets/translations/en-us.yaml +92 -22
  5. package/assets/translations/zh-hans.yaml +84 -15
  6. package/babel.config.js +13 -0
  7. package/chart/gatekeeper.vue +77 -0
  8. package/chart/istio.vue +108 -111
  9. package/chart/logging/index.vue +13 -4
  10. package/chart/monitoring/index.vue +15 -5
  11. package/chart/monitoring/steps/uninstall-v1.vue +2 -2
  12. package/chart/rancher-backup/index.vue +10 -3
  13. package/cloud-credential/aws.vue +1 -1
  14. package/cloud-credential/digitalocean.vue +1 -1
  15. package/cloud-credential/gcp.vue +1 -1
  16. package/cloud-credential/generic.vue +2 -2
  17. package/cloud-credential/linode.vue +1 -1
  18. package/cloud-credential/pnap.vue +1 -1
  19. package/components/ActionMenu.vue +3 -4
  20. package/components/AssignTo.vue +1 -1
  21. package/components/AsyncButton.vue +1 -1
  22. package/components/BannerGraphic.vue +1 -1
  23. package/components/ButtonDropdown.vue +2 -3
  24. package/components/ChartPsp.vue +76 -0
  25. package/components/CruResource.vue +6 -2
  26. package/components/DashboardMetrics.vue +12 -10
  27. package/components/DetailText.vue +1 -1
  28. package/components/DisableAuthProviderModal.vue +1 -1
  29. package/components/EmberPage.vue +1 -1
  30. package/components/EtcdInfoBanner.vue +5 -4
  31. package/components/ExplorerMembers.vue +1 -1
  32. package/components/ExplorerProjectsNamespaces.vue +15 -2
  33. package/components/FileDiff.vue +6 -7
  34. package/components/GrafanaDashboard.vue +18 -21
  35. package/components/LazyImage.vue +10 -12
  36. package/components/LogItem.vue +1 -1
  37. package/components/Markdown.vue +1 -1
  38. package/components/PromptRemove.vue +2 -2
  39. package/components/PromptRestore.vue +1 -1
  40. package/components/ResourceDetail/Masthead.vue +16 -0
  41. package/components/ResourceDetail/index.vue +21 -4
  42. package/components/ResourceList/index.vue +1 -1
  43. package/components/ResourceTable.vue +4 -1
  44. package/components/SingleClusterInfo.vue +2 -2
  45. package/components/SortableTable/THead.vue +1 -1
  46. package/components/SortableTable/index.vue +5 -2
  47. package/components/__tests__/AsyncButton.test.ts +3 -1
  48. package/components/__tests__/ChartPsp.test.ts +75 -0
  49. package/components/__tests__/CruResource.test.ts +3 -1
  50. package/components/auth/Principal.vue +1 -1
  51. package/components/fleet/FleetBundles.vue +3 -1
  52. package/components/fleet/FleetClusters.vue +1 -2
  53. package/components/fleet/FleetIntro.vue +9 -1
  54. package/components/fleet/FleetNoWorkspaces.vue +62 -0
  55. package/components/fleet/FleetSummary.vue +7 -1
  56. package/components/form/LabeledSelect.vue +14 -11
  57. package/components/form/MatchExpressions.vue +17 -2
  58. package/components/form/NameNsDescription.vue +31 -45
  59. package/components/form/ResourceSelector.vue +1 -1
  60. package/components/form/SecretSelector.vue +5 -1
  61. package/components/form/ServiceNameSelect.vue +1 -1
  62. package/components/form/SimpleSecretSelector.vue +9 -9
  63. package/components/form/__tests__/LabeledSelect.test.ts +138 -0
  64. package/components/form/__tests__/NameNsDescription.ts +32 -0
  65. package/components/formatter/InternalExternalIP.vue +6 -0
  66. package/components/formatter/InvolvedObjectLink.vue +54 -0
  67. package/components/formatter/Link.vue +20 -4
  68. package/components/formatter/LinkName.vue +6 -1
  69. package/components/formatter/ServiceTargets.vue +1 -1
  70. package/components/nav/Group.vue +2 -2
  71. package/components/nav/NamespaceFilter.vue +15 -11
  72. package/components/nav/TopLevelMenu.vue +2 -4
  73. package/components/nav/Type.vue +1 -1
  74. package/components/nav/WorkspaceSwitcher.vue +46 -5
  75. package/config/labels-annotations.js +17 -0
  76. package/config/product/auth.js +3 -2
  77. package/config/product/explorer.js +11 -4
  78. package/config/product/fleet.js +2 -0
  79. package/config/router.js +414 -0
  80. package/config/table-headers.js +10 -2
  81. package/config/types.js +11 -8
  82. package/config/uiplugins.js +30 -0
  83. package/content/docs/en-us/whats-new.md +10 -0
  84. package/content/docs/zh-hans/whats-new.md +11 -1
  85. package/core/plugin-helpers.js +64 -61
  86. package/core/plugin-routes.ts +23 -0
  87. package/creators/app/app.package.json +2 -1
  88. package/creators/app/files/.eslintrc.js +1 -1
  89. package/creators/app/files/babel.config.js +1 -18
  90. package/creators/app/files/vue.config.js +7 -0
  91. package/creators/app/init +5 -5
  92. package/creators/pkg/files/.github/workflows/build-extension.yml +111 -0
  93. package/creators/pkg/init +35 -4
  94. package/creators/update/init +1 -1
  95. package/detail/constraints.gatekeeper.sh.constraint.vue +20 -10
  96. package/detail/fleet.cattle.io.gitrepo.vue +19 -11
  97. package/detail/harvesterhci.io.management.cluster.vue +3 -3
  98. package/detail/provisioning.cattle.io.cluster.vue +54 -12
  99. package/detail/workload/index.vue +3 -3
  100. package/dialog/AddClusterMemberDialog.vue +1 -1
  101. package/dialog/AddProjectMemberDialog.vue +2 -2
  102. package/dialog/AddonConfigConfirmationDialog.vue +27 -15
  103. package/dialog/DiagnosticTimingsDialog.vue +1 -1
  104. package/dialog/ForceMachineRemoveDialog.vue +1 -1
  105. package/dialog/GenericPrompt.vue +18 -6
  106. package/dialog/RotateEncryptionKeyDialog.vue +1 -1
  107. package/dialog/SaveAsRKETemplateDialog.vue +1 -1
  108. package/dialog/ScaleMachineDownDialog.vue +1 -1
  109. package/edit/auth/github.vue +8 -8
  110. package/edit/auth/googleoauth.vue +5 -5
  111. package/edit/auth/ldap/index.vue +1 -1
  112. package/edit/auth/oidc.vue +1 -1
  113. package/edit/auth/saml.vue +1 -1
  114. package/edit/cis.cattle.io.clusterscan.vue +1 -1
  115. package/edit/fleet.cattle.io.clustergroup.vue +6 -4
  116. package/edit/fleet.cattle.io.gitrepo.vue +16 -3
  117. package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
  118. package/edit/management.cattle.io.fleetworkspace.vue +141 -6
  119. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +4 -1
  120. package/edit/management.cattle.io.setting.vue +1 -1
  121. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +2 -2
  122. package/edit/monitoring.coreos.com.receiver/tls.vue +18 -18
  123. package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +4 -4
  124. package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
  125. package/edit/namespace.vue +2 -2
  126. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +126 -45
  127. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  128. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +10 -0
  129. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -0
  130. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +202 -2
  131. package/edit/provisioning.cattle.io.cluster/rke2.vue +248 -84
  132. package/edit/resources.cattle.io.backup.vue +1 -1
  133. package/edit/service.vue +1 -1
  134. package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
  135. package/edit/workload/__tests__/Job.test.ts +3 -1
  136. package/edit/workload/index.vue +8 -3
  137. package/edit/workload/mixins/workload.js +16 -0
  138. package/layouts/default.vue +7 -3
  139. package/list/fleet.cattle.io.bundle.vue +6 -3
  140. package/list/fleet.cattle.io.clusterregistrationtoken.vue +3 -1
  141. package/list/fleet.cattle.io.gitrepo.vue +44 -5
  142. package/list/management.cattle.io.fleetworkspace.vue +45 -0
  143. package/list/node.vue +69 -16
  144. package/list/provisioning.cattle.io.cluster.vue +30 -1
  145. package/machine-config/azure.vue +97 -38
  146. package/middleware/authenticated.js +34 -0
  147. package/mixins/chart.js +73 -2
  148. package/mixins/resource-fetch.js +2 -2
  149. package/models/apps.statefulset.js +28 -0
  150. package/models/cluster/node.js +23 -2
  151. package/models/cluster.x-k8s.io.machine.js +4 -2
  152. package/models/clusterroletemplatebinding.js +7 -0
  153. package/models/constraints.gatekeeper.sh.constraint.js +9 -0
  154. package/models/fleet.cattle.io.cluster.js +19 -10
  155. package/models/fleet.cattle.io.gitrepo.js +7 -2
  156. package/models/management.cattle.io.cluster.js +1 -1
  157. package/models/management.cattle.io.fleetworkspace.js +12 -0
  158. package/models/management.cattle.io.gitreporestriction.js +5 -0
  159. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
  160. package/models/namespace.js +5 -5
  161. package/models/provisioning.cattle.io.cluster.js +7 -5
  162. package/nuxt/App.js +210 -0
  163. package/nuxt/axios.js +186 -0
  164. package/nuxt/client.js +817 -0
  165. package/nuxt/components/nuxt-build-indicator.vue +143 -0
  166. package/nuxt/components/nuxt-child.js +122 -0
  167. package/nuxt/components/nuxt-error.vue +98 -0
  168. package/nuxt/components/nuxt-link.client.js +98 -0
  169. package/nuxt/components/nuxt-link.server.js +16 -0
  170. package/nuxt/components/nuxt-loading.vue +154 -0
  171. package/nuxt/components/nuxt.js +101 -0
  172. package/nuxt/cookie-universal-nuxt.js +9 -0
  173. package/nuxt/empty.js +1 -0
  174. package/nuxt/index.js +365 -0
  175. package/nuxt/jsonp.js +82 -0
  176. package/nuxt/loading.html +39 -0
  177. package/nuxt/middleware.js +12 -0
  178. package/nuxt/mixins/fetch.client.js +90 -0
  179. package/nuxt/mixins/fetch.server.js +69 -0
  180. package/nuxt/portal-vue.js +4 -0
  181. package/nuxt/server.js +312 -0
  182. package/nuxt/store.js +178 -0
  183. package/nuxt/utils.js +630 -0
  184. package/nuxt/views/app.template.html +9 -0
  185. package/nuxt/views/error.html +23 -0
  186. package/package.json +5 -9
  187. package/pages/auth/setup.vue +2 -2
  188. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +33 -0
  189. package/pages/c/_cluster/apps/charts/chart.vue +4 -4
  190. package/pages/c/_cluster/apps/charts/install.helpers.js +26 -0
  191. package/pages/c/_cluster/apps/charts/install.vue +40 -66
  192. package/pages/c/_cluster/explorer/EventsTable.vue +5 -19
  193. package/pages/c/_cluster/explorer/index.vue +29 -25
  194. package/pages/c/_cluster/explorer/tools/index.vue +8 -8
  195. package/pages/c/_cluster/fleet/index.vue +95 -34
  196. package/pages/c/_cluster/gatekeeper/index.vue +1 -1
  197. package/pages/c/_cluster/istio/index.vue +5 -5
  198. package/pages/c/_cluster/manager/cloudCredential/index.vue +1 -1
  199. package/pages/c/_cluster/monitoring/index.vue +7 -0
  200. package/pages/c/_cluster/uiplugins/InstallDialog.vue +8 -8
  201. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +20 -7
  202. package/pages/c/_cluster/uiplugins/index.vue +49 -17
  203. package/pages/home.vue +9 -4
  204. package/pages/index.vue +10 -1
  205. package/plugins/clean-html-directive.js +31 -0
  206. package/plugins/dashboard-store/actions.js +32 -9
  207. package/plugins/dashboard-store/mutations.js +5 -2
  208. package/plugins/dashboard-store/resource-class.js +8 -1
  209. package/plugins/steve/mutations.js +3 -2
  210. package/plugins/steve/steve-description-class.js +5 -1
  211. package/plugins/steve/subscribe.js +63 -54
  212. package/plugins/steve-create-worker.js +14 -0
  213. package/promptRemove/management.cattle.io.globalrole.vue +2 -2
  214. package/promptRemove/management.cattle.io.project.vue +2 -2
  215. package/promptRemove/management.cattle.io.roletemplate.vue +2 -2
  216. package/promptRemove/pod.vue +1 -1
  217. package/public/index.html +65 -0
  218. package/rancher-components/components/Banner/Banner.test.ts +9 -1
  219. package/rancher-components/components/Banner/Banner.vue +1 -1
  220. package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
  221. package/rancher-components/components/Form/Radio/RadioButton.vue +1 -1
  222. package/scripts/build-pkg.sh +1 -0
  223. package/scripts/clean +6 -0
  224. package/scripts/extension/bundle +58 -0
  225. package/scripts/extension/helmpatch +89 -0
  226. package/scripts/extension/publish +314 -0
  227. package/scripts/test-plugins-build.sh +4 -0
  228. package/store/__tests__/index.test.ts +110 -0
  229. package/store/index.js +145 -58
  230. package/store/type-map.js +26 -19
  231. package/tsconfig.default.json +36 -0
  232. package/tsconfig.json +24 -0
  233. package/types/shell/index.d.ts +420 -343
  234. package/utils/__tests__/string.test.ts +12 -0
  235. package/utils/auth.js +65 -0
  236. package/utils/monitoring.js +2 -1
  237. package/utils/position.js +5 -8
  238. package/utils/router.scrollBehavior.js +80 -0
  239. package/utils/select.js +1 -3
  240. package/utils/socket.js +1 -0
  241. package/utils/string.js +13 -0
  242. package/utils/time.js +9 -0
  243. package/vue.config.js +679 -0
  244. package/yarn-error.log +196 -0
  245. package/chart/rancher-alerting-drivers.vue +0 -53
  246. package/chart/rancher-gatekeeper.vue +0 -37
  247. package/creators/app/files/nuxt.config.js +0 -6
  248. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +0 -4
  249. package/nuxt.config.js +0 -798
@@ -94,78 +94,81 @@ function checkExtensionRouteBinding($route, locationConfig) {
94
94
  export function getApplicableExtensionEnhancements(pluginCtx, actionType, uiArea, currRoute, translationCtx = pluginCtx) {
95
95
  const extensionEnhancements = [];
96
96
 
97
- const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);
98
-
99
- actions.forEach((action, i) => {
100
- if (checkExtensionRouteBinding(currRoute, action.locationConfig)) {
101
- // ADD CARD PLUGIN UI ENHANCEMENT
102
- if (actionType === ExtensionPoint.CARD) {
103
- // intercept to apply translation
104
- if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {
105
- actions[i].label = translationCtx.t(action.labelKey);
106
- }
107
-
108
- // ADD ACTION PLUGIN UI ENHANCEMENT
109
- } else if (actionType === ExtensionPoint.ACTION) {
110
- // TABLE ACTION
111
- if (uiArea === ActionLocation.TABLE) {
97
+ // gate it so that we prevent errors on older versions of dashboard
98
+ if (pluginCtx.$plugin?.getUIConfig) {
99
+ const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);
100
+
101
+ actions.forEach((action, i) => {
102
+ if (checkExtensionRouteBinding(currRoute, action.locationConfig)) {
103
+ // ADD CARD PLUGIN UI ENHANCEMENT
104
+ if (actionType === ExtensionPoint.CARD) {
112
105
  // intercept to apply translation
113
- if (action.labelKey) {
106
+ if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {
114
107
  actions[i].label = translationCtx.t(action.labelKey);
115
108
  }
116
109
 
117
- // sets the enabled flag to true if omitted on the config
118
- if (!Object.keys(action).includes('enabled')) {
119
- actions[i].enabled = true;
120
- }
121
-
122
- // bulkable flag
123
- actions[i].bulkable = actions[i].multiple || actions[i].bulkable;
124
-
125
- // populate action identifier to prevent errors
126
- if (!actions[i].action) {
127
- actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;
110
+ // ADD ACTION PLUGIN UI ENHANCEMENT
111
+ } else if (actionType === ExtensionPoint.ACTION) {
112
+ // TABLE ACTION
113
+ if (uiArea === ActionLocation.TABLE) {
114
+ // intercept to apply translation
115
+ if (action.labelKey) {
116
+ actions[i].label = translationCtx.t(action.labelKey);
117
+ }
118
+
119
+ // sets the enabled flag to true if omitted on the config
120
+ if (!Object.keys(action).includes('enabled')) {
121
+ actions[i].enabled = true;
122
+ }
123
+
124
+ // bulkable flag
125
+ actions[i].bulkable = actions[i].multiple || actions[i].bulkable;
126
+
127
+ // populate action identifier to prevent errors
128
+ if (!actions[i].action) {
129
+ actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;
130
+ }
128
131
  }
129
- }
130
132
 
131
- // extract simplified shortcut definition on plugin - HEADER ACTION
132
- if (uiArea === ActionLocation.HEADER && action.shortcut) {
133
- // if it's a string, then assume CTRL for windows and META for mac
134
- if (typeof action.shortcut === 'string') {
135
- actions[i].shortcutLabel = () => {
136
- return isMac ? `(\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;
137
- };
138
- actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };
139
- // correct check for an Object type in JS... handle the object passed
140
- } else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {
141
- actions[i].shortcutKey = action.shortcut;
142
- const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];
143
- let scLabel = '';
144
-
145
- keyboardCombo.forEach((key, i) => {
146
- if (i < keyboardCombo.length - 1) {
147
- if (key === 'meta') {
148
- key = '\u2318';
133
+ // extract simplified shortcut definition on plugin - HEADER ACTION
134
+ if (uiArea === ActionLocation.HEADER && action.shortcut) {
135
+ // if it's a string, then assume CTRL for windows and META for mac
136
+ if (typeof action.shortcut === 'string') {
137
+ actions[i].shortcutLabel = () => {
138
+ return isMac ? `(\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;
139
+ };
140
+ actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };
141
+ // correct check for an Object type in JS... handle the object passed
142
+ } else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {
143
+ actions[i].shortcutKey = action.shortcut;
144
+ const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];
145
+ let scLabel = '';
146
+
147
+ keyboardCombo.forEach((key, i) => {
148
+ if (i < keyboardCombo.length - 1) {
149
+ if (key === 'meta') {
150
+ key = '\u2318';
151
+ } else {
152
+ key = ucFirst(key);
153
+ }
154
+ scLabel += `${ key }`;
155
+ scLabel += '-';
149
156
  } else {
150
- key = ucFirst(key);
157
+ scLabel += `${ key.toUpperCase() }`;
151
158
  }
152
- scLabel += `${ key }`;
153
- scLabel += '-';
154
- } else {
155
- scLabel += `${ key.toUpperCase() }`;
156
- }
157
- });
158
-
159
- actions[i].shortcutLabel = () => {
160
- return `(${ scLabel })`;
161
- };
159
+ });
160
+
161
+ actions[i].shortcutLabel = () => {
162
+ return `(${ scLabel })`;
163
+ };
164
+ }
162
165
  }
163
166
  }
164
- }
165
167
 
166
- extensionEnhancements.push(actions[i]);
167
- }
168
- });
168
+ extensionEnhancements.push(actions[i]);
169
+ }
170
+ });
171
+ }
169
172
 
170
173
  return extensionEnhancements;
171
174
  }
@@ -89,6 +89,29 @@ export class PluginRoutes {
89
89
  // Despite what the docs say, routes are not replaced, so we use a workaround
90
90
  // Remove all routes that are being replaced
91
91
  routes.forEach((r: RouteInfo) => {
92
+ // Patch colliding legacy routes that start /:product
93
+ if (r.route.path?.startsWith('/:product')) {
94
+ // Legacy pattern used by extensions - routes may collide, so modify them not to
95
+ let productName;
96
+
97
+ // If the route has a name (which is always the case for the extensions we have written), use it to get the product name
98
+ if (r.route.name) {
99
+ const nameParts = r.route.name.split('-');
100
+
101
+ // First part of the route name is the product name
102
+ productName = nameParts[0];
103
+ }
104
+
105
+ // Use the plugin name as the product, if the route does not have a name
106
+ productName = productName || plugin.name;
107
+
108
+ // Replace the path - removing :product and using the actual product name instead - this avoids route collisions
109
+ r.route.path = `/${ productName }${ r.route.path.substr(9) }`;
110
+ r.route.meta = r.route.meta || {};
111
+
112
+ r.route.meta.product = r.route.meta.product || productName;
113
+ }
114
+
92
115
  // See if the route exists
93
116
  let existing: any;
94
117
 
@@ -7,6 +7,7 @@
7
7
  },
8
8
  "dependencies": {},
9
9
  "resolutions": {
10
- "**/webpack": "4"
10
+ "**/webpack": "4",
11
+ "@types/node": "^16"
11
12
  }
12
13
  }
@@ -30,7 +30,7 @@ module.exports = {
30
30
  'unicorn/no-new-buffer': 'off',
31
31
  'vue/html-self-closing': 'off',
32
32
  'vue/no-unused-components': 'warn',
33
- 'vue/no-v-html': 'off',
33
+ 'vue/no-v-html': 'error',
34
34
  'wrap-iife': 'off',
35
35
 
36
36
  'array-bracket-spacing': 'warn',
@@ -1,18 +1 @@
1
- module.exports = {
2
- env: {
3
- test: {
4
- plugins: [
5
- [
6
- 'module-resolver',
7
- {
8
- root: ['.'],
9
- alias: {
10
- '@': '.',
11
- '~': '.',
12
- },
13
- },
14
- ],
15
- ],
16
- },
17
- },
18
- };
1
+ module.exports = require('@rancher/shell/babel.config.js');
@@ -0,0 +1,7 @@
1
+ const config = require('@rancher/shell/vue.config');
2
+
3
+ module.exports = config(__dirname, {
4
+ excludes: [],
5
+ // excludes: ['fleet', 'example']
6
+ // autoLoad: ['fleet', 'example']
7
+ });
package/creators/app/init CHANGED
@@ -4,14 +4,14 @@ const path = require('path');
4
4
  const fs = require('fs-extra');
5
5
 
6
6
  const targets = {
7
- dev: './node_modules/.bin/nuxt dev',
8
- nuxt: './node_modules/.bin/nuxt',
9
- build: './node_modules/.bin/nuxt build'
7
+ dev: 'NODE_ENV=dev ./node_modules/.bin/vue-cli-service serve',
8
+ build: './node_modules/.bin/vue-cli-service build',
9
+ clean: './node_modules/@rancher/shell/scripts/clean'
10
10
  };
11
11
 
12
12
  const files = [
13
13
  'tsconfig.json',
14
- 'nuxt.config.js',
14
+ 'vue.config.js',
15
15
  '.eslintignore',
16
16
  '.eslintrc.js',
17
17
  'babel.config.js',
@@ -24,7 +24,7 @@ console.log('Creating Skeleton Application');
24
24
  const args = process.argv;
25
25
  let appFolder = path.resolve('.');
26
26
 
27
- if (args.length == 3) {
27
+ if (args.length === 3) {
28
28
  const name = args[2];
29
29
  const folder = path.resolve('.');
30
30
 
@@ -0,0 +1,111 @@
1
+ name: Build and Release Extension
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ env:
12
+ ACTIONS_RUNNER_DEBUG: false
13
+ CI_COMMIT_MESSAGE: CI Build Artifacts
14
+
15
+ defaults:
16
+ run:
17
+ shell: bash
18
+ working-directory: ./
19
+
20
+ jobs:
21
+ build:
22
+ name: Build extension artifact
23
+ runs-on: ubuntu-latest
24
+ permissions: write-all
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@v3
28
+ with:
29
+ fetch-depth: 0
30
+
31
+ - name: Configure Git
32
+ run: |
33
+ git config user.name "$GITHUB_ACTOR"
34
+ git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
35
+
36
+ - name: Setup Helm
37
+ uses: azure/setup-helm@v3
38
+ with:
39
+ version: v3.8.0
40
+
41
+ - name: Setup yq
42
+ uses: chrisdickinson/setup-yq@v1.0.1
43
+ with:
44
+ yq-version: v4.28.2
45
+
46
+ - name: Setup Nodejs and npm
47
+ uses: actions/setup-node@v3
48
+ with:
49
+ node-version: '16'
50
+
51
+ - name: Setup yarn
52
+ run: npm install -g yarn
53
+
54
+ - name: Setup Nodejs with yarn caching
55
+ uses: actions/setup-node@v3
56
+ with:
57
+ node-version: '16'
58
+ cache: yarn
59
+
60
+ - name: Install dependencies
61
+ run: yarn
62
+
63
+ - name: Run build script
64
+ shell: bash
65
+ id: build_script
66
+ run: |
67
+ yarn publish-pkgs -s "${{ github.repository }}" -b main
68
+
69
+ - name: Upload charts artifact
70
+ if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
71
+ uses: actions/upload-artifact@v3
72
+ with:
73
+ name: charts
74
+ path: tmp
75
+
76
+ release:
77
+ name: Release Build
78
+ if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
79
+ needs: build
80
+ runs-on: ubuntu-latest
81
+ permissions: write-all
82
+ steps:
83
+ - name: Checkout
84
+ uses: actions/checkout@v3
85
+ with:
86
+ fetch-depth: 0
87
+ ref: main
88
+
89
+ - name: Configure Git
90
+ run: |
91
+ git config user.name "$GITHUB_ACTOR"
92
+ git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
93
+
94
+ - name: Download build artifact
95
+ uses: actions/download-artifact@v3
96
+ with:
97
+ name: charts
98
+
99
+ - name: Commit build
100
+ run: |
101
+ git add ./{assets,charts,extensions,index.yaml}
102
+ git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
103
+ git push
104
+
105
+ - name: Run chart-releaser
106
+ uses: helm/chart-releaser-action@v1.4.1
107
+ with:
108
+ charts_dir: ./charts
109
+ env:
110
+ CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
111
+ CR_SKIP_EXISTING: true
package/creators/pkg/init CHANGED
@@ -16,12 +16,13 @@ const files = [
16
16
  ];
17
17
 
18
18
  const topLevelScripts = {
19
- 'build-pkg': './node_modules/@rancher/shell/scripts/build-pkg.sh',
20
- 'serve-pkgs': './node_modules/@rancher/shell/scripts/serve-pkgs',
19
+ 'build-pkg': './node_modules/@rancher/shell/scripts/build-pkg.sh',
20
+ 'serve-pkgs': './node_modules/@rancher/shell/scripts/serve-pkgs',
21
+ 'publish-pkgs': './node_modules/@rancher/shell/scripts/extension/publish',
21
22
  };
22
23
 
23
24
  const typeFolders = [
24
- 'i18n',
25
+ 'l10n',
25
26
  'models',
26
27
  'edit',
27
28
  'list',
@@ -42,9 +43,21 @@ const folder = path.resolve('.');
42
43
  const pkgFolder = path.join(folder, 'pkg', name);
43
44
 
44
45
  let addTypeFolders = false;
46
+ let addWorkflowFolder = false;
45
47
 
46
48
  if (args.length > 3) {
47
- addTypeFolders = args[3] === '-t';
49
+ for (let i = 3; i < args.length; i++) {
50
+ switch (args[i]) {
51
+ case '-t':
52
+ addTypeFolders = true;
53
+ break;
54
+ case '-w':
55
+ addWorkflowFolder = true;
56
+ break;
57
+ default:
58
+ break;
59
+ }
60
+ }
48
61
  }
49
62
 
50
63
  const isNodeModulesShell = !fs.existsSync(path.join(folder, 'shell'));
@@ -93,6 +106,24 @@ if (addTypeFolders) {
93
106
  });
94
107
  }
95
108
 
109
+ // Add workflow folder if needed
110
+ if (addWorkflowFolder) {
111
+ const workflowDir = path.join(folder, '.github/workflows');
112
+
113
+ if (!fs.existsSync(workflowDir)) {
114
+ fs.mkdirSync(workflowDir, { recursive: true });
115
+ }
116
+
117
+ const workflowFile = path.join(workflowDir, 'build-extension.yml');
118
+
119
+ if (!fs.existsSync(workflowFile)) {
120
+ const src = path.join(__dirname, 'files/.github/workflows', 'build-extension.yml');
121
+
122
+ console.log(` Adding file 'build-extension.yml' to root workflows`);
123
+ fs.copySync(src, workflowFile);
124
+ }
125
+ }
126
+
96
127
  // Copy base files
97
128
  files.forEach((file) => {
98
129
  const src = path.join(__dirname, 'files', file);
@@ -38,7 +38,7 @@ Object.keys(latestPackage._pkgs).forEach((key) => {
38
38
  appPackage.dependencies[key] = latestPackage._pkgs[key];
39
39
  });
40
40
 
41
- // Add in the weback resolution
41
+ // Add in the webpack resolution
42
42
  appPackage.resolutions = appPackage.resolutions || {};
43
43
  appPackage.resolutions['**/webpack'] = '4';
44
44
 
@@ -1,38 +1,48 @@
1
1
  <script>
2
2
  import CreateEditView from '@shell/mixins/create-edit-view';
3
3
  import SortableTable from '@shell/components/SortableTable';
4
+ import Banner from '@components/Banner/Banner.vue';
4
5
  import { CONSTRAINT_VIOLATION_RESOURCE_LINK, CONSTRAINT_VIOLATION_MESSAGE, CONSTRAINT_VIOLATION_TYPE } from '@shell/config/table-headers';
5
6
 
6
7
  export default {
7
- components: { SortableTable },
8
+ components: { Banner, SortableTable },
8
9
  mixins: [CreateEditView],
9
- data(ctx) {
10
+ data() {
10
11
  return {
11
12
  headers: [
12
13
  CONSTRAINT_VIOLATION_TYPE,
13
14
  CONSTRAINT_VIOLATION_RESOURCE_LINK,
14
15
  CONSTRAINT_VIOLATION_MESSAGE
15
16
  ],
16
- violations: this.value.violations
17
- .map((violation, i) => ({ ...violation, id: i }))
17
+ violations: this.value.violations.map((violation, i) => ({ ...violation, id: i }))
18
18
  };
19
19
  }
20
20
  };
21
21
  </script>
22
22
  <template>
23
23
  <div>
24
- <div
25
- v-if="value.spec.enforcementAction"
26
- class="row mt-40"
24
+ <div
25
+ v-if="value.spec.enforcementAction"
26
+ class="row mt-20"
27
27
  >
28
28
  <div class="col span-12">
29
- <h3>Enforcement Action</h3>
29
+ <h3>
30
+ {{ t('gatekeeperConstraint.enforcement.action') }}
31
+ </h3>
30
32
  {{ value.spec.enforcementAction }}
31
33
  </div>
32
34
  </div>
33
- <div class="row mt-40">
35
+ <div class="row mt-20">
34
36
  <div class="col span-12">
35
- <h3>{{ t('gatekeeperConstraint.violations.title') }}</h3>
37
+ <h3 class="mb-20">
38
+ {{ t('gatekeeperConstraint.violations.title', { total: value.totalViolations }) }}
39
+ </h3>
40
+ <Banner
41
+ v-if="value.totalViolations !== value.violations.length"
42
+ color="info"
43
+ >
44
+ {{ t('gatekeeperConstraint.violations.notAll', { shown: value.violations.length }) }}
45
+ </Banner>
36
46
  <SortableTable
37
47
  :headers="headers"
38
48
  :rows="violations"
@@ -8,7 +8,7 @@ import { FLEET } from '@shell/config/types';
8
8
  import { isHarvesterCluster } from '@shell/utils/cluster';
9
9
  import FleetBundles from '@shell/components/fleet/FleetBundles.vue';
10
10
  import { resourceCounts } from '@shell/components/ResourceSummary.vue';
11
- import { allHash } from '~shell/utils/promise';
11
+ import { checkSchemasForFindAllHash } from '@shell/utils/auth';
12
12
 
13
13
  export default {
14
14
  name: 'DetailGitRepo',
@@ -74,16 +74,23 @@ export default {
74
74
  },
75
75
  },
76
76
  async fetch() {
77
- const { $store } = this;
78
-
79
- const allDispatches = await allHash({
80
- allBundles: $store.dispatch('management/findAll', { type: FLEET.BUNDLE }),
81
- allFleet: $store.dispatch('management/findAll', { type: FLEET.CLUSTER }),
82
- clusterGroups: $store.dispatch('management/findAll', { type: FLEET.CLUSTER_GROUP }),
83
- });
84
-
85
- this.allBundles = allDispatches.allBundles;
86
- this.allFleet = allDispatches.allFleet;
77
+ const allDispatches = await checkSchemasForFindAllHash({
78
+ allBundles: {
79
+ inStoreType: 'management',
80
+ type: FLEET.BUNDLE
81
+ },
82
+ allFleet: {
83
+ inStoreType: 'management',
84
+ type: FLEET.CLUSTER
85
+ },
86
+ clusterGroups: {
87
+ inStoreType: 'management',
88
+ type: FLEET.CLUSTER_GROUP
89
+ }
90
+ }, this.$store);
91
+
92
+ this.allBundles = allDispatches.allBundles || [];
93
+ this.allFleet = allDispatches.allFleet || [];
87
94
  },
88
95
 
89
96
  };
@@ -111,6 +118,7 @@ export default {
111
118
  :need-related="false"
112
119
  >
113
120
  <Tab
121
+ v-if="!!allBundles.length"
114
122
  label="Bundles"
115
123
  name="bundles"
116
124
  :weight="30"
@@ -81,17 +81,17 @@ export default {
81
81
  class="p-10"
82
82
  >
83
83
  <h4
84
- v-html="t('cluster.harvester.registration.step1', null, true)"
84
+ v-clean-html="t('cluster.harvester.registration.step1', null, true)"
85
85
  />
86
86
 
87
87
  <h4
88
+ v-clean-html="t('cluster.harvester.registration.step2', null, true)"
88
89
  class="mt-10"
89
- v-html="t('cluster.harvester.registration.step2', null, true)"
90
90
  />
91
91
 
92
92
  <h4
93
+ v-clean-html="t('cluster.harvester.registration.step3', null, true)"
93
94
  class="mt-10"
94
- v-html="t('cluster.harvester.registration.step3', null, true)"
95
95
  />
96
96
  <CopyCode class="m-10 p-10">
97
97
  {{ registrationURL }}