@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.
Files changed (289) hide show
  1. package/assets/images/providers/outscale.svg +19 -0
  2. package/assets/styles/app.scss +1 -1
  3. package/assets/styles/base/_basic.scss +18 -0
  4. package/assets/styles/base/_mixins.scss +0 -11
  5. package/assets/styles/base/_variables.scss +2 -4
  6. package/assets/styles/fonts/_fontstack.scss +11 -11
  7. package/assets/styles/global/_button.scss +12 -2
  8. package/assets/styles/vendor/vue-js-modal.scss +3 -3
  9. package/assets/translations/en-us.yaml +113 -22
  10. package/assets/translations/zh-hans.yaml +113 -24
  11. package/babel.config.js +13 -0
  12. package/chart/gatekeeper.vue +78 -0
  13. package/chart/istio.vue +135 -112
  14. package/chart/logging/index.vue +13 -4
  15. package/chart/monitoring/index.vue +15 -5
  16. package/chart/monitoring/steps/uninstall-v1.vue +2 -2
  17. package/chart/rancher-backup/index.vue +10 -3
  18. package/cloud-credential/aws.vue +1 -1
  19. package/cloud-credential/digitalocean.vue +1 -1
  20. package/cloud-credential/gcp.vue +1 -1
  21. package/cloud-credential/generic.vue +2 -2
  22. package/cloud-credential/linode.vue +1 -1
  23. package/cloud-credential/pnap.vue +1 -1
  24. package/components/ActionMenu.vue +3 -4
  25. package/components/AssignTo.vue +1 -1
  26. package/components/AsyncButton.vue +1 -1
  27. package/components/BannerGraphic.vue +1 -1
  28. package/components/BrandImage.vue +1 -4
  29. package/components/ButtonDropdown.vue +2 -3
  30. package/components/Carousel.vue +85 -37
  31. package/components/ChartPsp.vue +76 -0
  32. package/components/CruResource.vue +6 -2
  33. package/components/DashboardMetrics.vue +12 -10
  34. package/components/DetailText.vue +1 -1
  35. package/components/DisableAuthProviderModal.vue +1 -1
  36. package/components/EmberPage.vue +1 -1
  37. package/components/EtcdInfoBanner.vue +12 -7
  38. package/components/ExplorerMembers.vue +101 -6
  39. package/components/ExplorerProjectsNamespaces.vue +46 -3
  40. package/components/FileDiff.vue +6 -7
  41. package/components/GrafanaDashboard.vue +27 -23
  42. package/components/LazyImage.vue +10 -12
  43. package/components/LogItem.vue +1 -1
  44. package/components/Markdown.vue +1 -1
  45. package/components/PromptRemove.vue +2 -2
  46. package/components/PromptRestore.vue +1 -1
  47. package/components/ResourceDetail/Masthead.vue +16 -0
  48. package/components/ResourceDetail/index.vue +21 -4
  49. package/components/ResourceList/index.vue +1 -1
  50. package/components/ResourceTable.vue +4 -1
  51. package/components/SingleClusterInfo.vue +2 -2
  52. package/components/SortableTable/THead.vue +1 -1
  53. package/components/SortableTable/index.vue +28 -13
  54. package/components/SortableTable/selection.js +58 -50
  55. package/components/Wizard.vue +4 -2
  56. package/components/__tests__/AsyncButton.test.ts +3 -1
  57. package/components/__tests__/ChartPsp.test.ts +75 -0
  58. package/components/__tests__/CruResource.test.ts +3 -1
  59. package/components/auth/Principal.vue +1 -1
  60. package/components/auth/RoleDetailEdit.vue +2 -2
  61. package/components/fleet/FleetBundles.vue +3 -1
  62. package/components/fleet/FleetClusters.vue +1 -2
  63. package/components/fleet/FleetIntro.vue +9 -1
  64. package/components/fleet/FleetNoWorkspaces.vue +62 -0
  65. package/components/fleet/FleetSummary.vue +7 -1
  66. package/components/form/HookOption.vue +14 -10
  67. package/components/form/LabeledSelect.vue +14 -11
  68. package/components/form/Labels.vue +32 -27
  69. package/components/form/MatchExpressions.vue +19 -4
  70. package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
  71. package/components/form/NameNsDescription.vue +32 -46
  72. package/components/form/ProjectMemberEditor.vue +46 -21
  73. package/components/form/ResourceSelector.vue +1 -1
  74. package/components/form/SecretSelector.vue +5 -1
  75. package/components/form/ServiceNameSelect.vue +1 -1
  76. package/components/form/SimpleSecretSelector.vue +9 -9
  77. package/components/form/Tolerations.vue +4 -1
  78. package/components/form/ValueFromResource.vue +14 -9
  79. package/components/form/WorkloadPorts.vue +2 -2
  80. package/components/form/__tests__/LabeledSelect.test.ts +138 -0
  81. package/components/form/__tests__/NameNsDescription.ts +59 -0
  82. package/components/formatter/InternalExternalIP.vue +6 -0
  83. package/components/formatter/InvolvedObjectLink.vue +54 -0
  84. package/components/formatter/Link.vue +20 -4
  85. package/components/formatter/LinkName.vue +6 -1
  86. package/components/formatter/ServiceTargets.vue +1 -1
  87. package/components/formatter/WorkloadHealthScale.vue +8 -2
  88. package/components/nav/Group.vue +2 -2
  89. package/components/nav/NamespaceFilter.vue +23 -11
  90. package/components/nav/TopLevelMenu.vue +2 -4
  91. package/components/nav/Type.vue +1 -1
  92. package/components/nav/WorkspaceSwitcher.vue +46 -5
  93. package/components/nuxt/nuxt-build-indicator.vue +143 -0
  94. package/components/nuxt/nuxt-child.js +122 -0
  95. package/components/nuxt/nuxt-error.vue +98 -0
  96. package/components/nuxt/nuxt-link.client.js +98 -0
  97. package/components/nuxt/nuxt-link.server.js +16 -0
  98. package/components/nuxt/nuxt-loading.vue +154 -0
  99. package/components/nuxt/nuxt.js +101 -0
  100. package/config/labels-annotations.js +17 -0
  101. package/config/middleware.js +12 -0
  102. package/config/product/auth.js +3 -2
  103. package/config/product/explorer.js +34 -6
  104. package/config/product/fleet.js +2 -0
  105. package/config/query-params.js +1 -0
  106. package/config/router.js +414 -0
  107. package/config/store.js +181 -0
  108. package/config/table-headers.js +54 -12
  109. package/config/types.js +18 -8
  110. package/config/uiplugins.js +30 -0
  111. package/content/docs/en-us/whats-new.md +10 -0
  112. package/content/docs/zh-hans/whats-new.md +11 -1
  113. package/core/plugin-routes.ts +23 -0
  114. package/core/plugin.ts +4 -2
  115. package/core/types.ts +258 -1
  116. package/creators/app/app.package.json +2 -1
  117. package/creators/app/files/.eslintrc.js +1 -1
  118. package/creators/app/files/babel.config.js +1 -18
  119. package/creators/app/files/tsconfig.json +0 -1
  120. package/creators/app/files/vue.config.js +6 -0
  121. package/creators/app/init +5 -5
  122. package/creators/pkg/files/.github/workflows/build-extension.yml +110 -0
  123. package/creators/pkg/files/tsconfig.json +0 -1
  124. package/creators/pkg/init +35 -4
  125. package/creators/pkg/pkg.package.json +3 -3
  126. package/creators/update/init +1 -1
  127. package/detail/constraints.gatekeeper.sh.constraint.vue +34 -17
  128. package/detail/fleet.cattle.io.clustergroup.vue +7 -1
  129. package/detail/fleet.cattle.io.gitrepo.vue +19 -11
  130. package/detail/harvesterhci.io.management.cluster.vue +3 -3
  131. package/detail/provisioning.cattle.io.cluster.vue +54 -12
  132. package/detail/workload/index.vue +3 -3
  133. package/dialog/AddClusterMemberDialog.vue +1 -1
  134. package/dialog/AddProjectMemberDialog.vue +2 -2
  135. package/dialog/AddonConfigConfirmationDialog.vue +27 -15
  136. package/dialog/DiagnosticTimingsDialog.vue +1 -1
  137. package/dialog/ForceMachineRemoveDialog.vue +1 -1
  138. package/dialog/GenericPrompt.vue +18 -6
  139. package/dialog/RotateEncryptionKeyDialog.vue +1 -1
  140. package/dialog/SaveAsRKETemplateDialog.vue +1 -1
  141. package/dialog/ScaleMachineDownDialog.vue +1 -1
  142. package/edit/auth/github.vue +8 -8
  143. package/edit/auth/googleoauth.vue +5 -5
  144. package/edit/auth/ldap/index.vue +1 -1
  145. package/edit/auth/oidc.vue +1 -1
  146. package/edit/auth/saml.vue +1 -1
  147. package/edit/cis.cattle.io.clusterscan.vue +1 -1
  148. package/edit/fleet.cattle.io.clustergroup.vue +6 -4
  149. package/edit/fleet.cattle.io.gitrepo.vue +32 -4
  150. package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
  151. package/edit/logging.banzaicloud.io.output/index.vue +18 -5
  152. package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
  153. package/edit/management.cattle.io.fleetworkspace.vue +141 -6
  154. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +4 -1
  155. package/edit/management.cattle.io.setting.vue +1 -1
  156. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +2 -2
  157. package/edit/monitoring.coreos.com.receiver/tls.vue +18 -18
  158. package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +4 -4
  159. package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
  160. package/edit/namespace.vue +14 -10
  161. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +126 -45
  162. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  163. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +21 -4
  164. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -0
  165. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +202 -2
  166. package/edit/provisioning.cattle.io.cluster/import.vue +23 -25
  167. package/edit/provisioning.cattle.io.cluster/rke2.vue +344 -102
  168. package/edit/resources.cattle.io.backup.vue +1 -1
  169. package/edit/service.vue +1 -1
  170. package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
  171. package/edit/workload/__tests__/Job.test.ts +3 -1
  172. package/edit/workload/index.vue +8 -3
  173. package/edit/workload/mixins/workload.js +22 -7
  174. package/edit/workload/storage/Mount.vue +3 -3
  175. package/initialize/App.js +206 -0
  176. package/initialize/client.js +863 -0
  177. package/initialize/index.js +364 -0
  178. package/layouts/default.vue +7 -3
  179. package/layouts/standalone.vue +13 -0
  180. package/list/catalog.cattle.io.clusterrepo.vue +1 -0
  181. package/list/fleet.cattle.io.bundle.vue +6 -3
  182. package/list/fleet.cattle.io.clusterregistrationtoken.vue +3 -1
  183. package/list/fleet.cattle.io.gitrepo.vue +44 -5
  184. package/list/management.cattle.io.fleetworkspace.vue +45 -0
  185. package/list/node.vue +69 -16
  186. package/list/provisioning.cattle.io.cluster.vue +30 -1
  187. package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
  188. package/list/workload.vue +6 -4
  189. package/machine-config/azure.vue +97 -38
  190. package/middleware/authenticated.js +34 -0
  191. package/mixins/chart.js +101 -2
  192. package/mixins/fetch.client.js +95 -0
  193. package/mixins/fetch.server.js +73 -0
  194. package/mixins/labeled-form-element.ts +2 -2
  195. package/mixins/resource-fetch.js +2 -2
  196. package/models/apps.statefulset.js +28 -0
  197. package/models/cluster/node.js +23 -2
  198. package/models/cluster.x-k8s.io.machine.js +4 -2
  199. package/models/clusterroletemplatebinding.js +7 -0
  200. package/models/constraints.gatekeeper.sh.constraint.js +46 -0
  201. package/models/fleet.cattle.io.cluster.js +19 -10
  202. package/models/fleet.cattle.io.gitrepo.js +7 -2
  203. package/models/management.cattle.io.cluster.js +1 -1
  204. package/models/management.cattle.io.fleetworkspace.js +12 -0
  205. package/models/management.cattle.io.gitreporestriction.js +5 -0
  206. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
  207. package/models/pod.js +4 -0
  208. package/models/provisioning.cattle.io.cluster.js +7 -5
  209. package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
  210. package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
  211. package/package.json +13 -21
  212. package/pages/auth/setup.vue +2 -2
  213. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +33 -0
  214. package/pages/c/_cluster/apps/charts/chart.vue +4 -4
  215. package/pages/c/_cluster/apps/charts/install.helpers.js +26 -0
  216. package/pages/c/_cluster/apps/charts/install.vue +98 -102
  217. package/pages/c/_cluster/explorer/EventsTable.vue +5 -19
  218. package/pages/c/_cluster/explorer/index.vue +29 -25
  219. package/pages/c/_cluster/explorer/tools/index.vue +8 -8
  220. package/pages/c/_cluster/fleet/index.vue +95 -34
  221. package/pages/c/_cluster/gatekeeper/index.vue +1 -1
  222. package/pages/c/_cluster/istio/index.vue +5 -5
  223. package/pages/c/_cluster/manager/cloudCredential/index.vue +1 -1
  224. package/pages/c/_cluster/monitoring/index.vue +7 -0
  225. package/pages/c/_cluster/uiplugins/InstallDialog.vue +8 -8
  226. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +20 -7
  227. package/pages/c/_cluster/uiplugins/index.vue +49 -17
  228. package/pages/diagnostic.vue +32 -25
  229. package/pages/home.vue +9 -4
  230. package/pages/index.vue +10 -1
  231. package/pages/rio/mesh.vue +1 -2
  232. package/pkg/tsconfig.json +0 -1
  233. package/plugins/clean-html-directive.js +34 -0
  234. package/plugins/dashboard-store/actions.js +32 -9
  235. package/plugins/dashboard-store/index.js +1 -1
  236. package/plugins/dashboard-store/mutations.js +5 -2
  237. package/plugins/dashboard-store/resource-class.js +8 -1
  238. package/plugins/plugin.js +0 -14
  239. package/plugins/portal-vue.js +4 -0
  240. package/plugins/steve/mutations.js +3 -2
  241. package/plugins/steve/steve-description-class.js +5 -1
  242. package/plugins/steve/subscribe.js +63 -54
  243. package/plugins/steve-create-worker.js +14 -0
  244. package/promptRemove/management.cattle.io.globalrole.vue +2 -2
  245. package/promptRemove/management.cattle.io.project.vue +2 -2
  246. package/promptRemove/management.cattle.io.roletemplate.vue +2 -2
  247. package/promptRemove/pod.vue +1 -1
  248. package/public/index.html +65 -0
  249. package/rancher-components/components/Banner/Banner.test.ts +7 -1
  250. package/rancher-components/components/Banner/Banner.vue +2 -1
  251. package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
  252. package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
  253. package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
  254. package/scripts/build-pkg.sh +1 -0
  255. package/scripts/clean +6 -0
  256. package/scripts/extension/bundle +58 -0
  257. package/scripts/extension/helmpatch +89 -0
  258. package/scripts/extension/publish +333 -0
  259. package/scripts/serve-pkgs +6 -2
  260. package/scripts/test-plugins-build.sh +4 -0
  261. package/store/__tests__/index.test.ts +110 -0
  262. package/store/index.js +145 -58
  263. package/store/type-map.js +6 -2
  264. package/tsconfig.default.json +36 -0
  265. package/tsconfig.json +23 -0
  266. package/types/rancher/index.d.ts +2 -0
  267. package/types/shell/index.d.ts +466 -320
  268. package/utils/__tests__/grafana.test.ts +44 -0
  269. package/utils/__tests__/string.test.ts +12 -0
  270. package/utils/auth.js +65 -0
  271. package/utils/axios.js +190 -0
  272. package/utils/cookie-universal-nuxt.js +10 -0
  273. package/utils/dom.js +15 -0
  274. package/utils/grafana.js +35 -16
  275. package/utils/monitoring.js +2 -1
  276. package/utils/nuxt.js +659 -0
  277. package/utils/position.js +5 -8
  278. package/utils/router.scrollBehavior.js +80 -0
  279. package/utils/select.js +1 -3
  280. package/utils/socket.js +1 -0
  281. package/utils/string.js +13 -0
  282. package/utils/time.js +9 -0
  283. package/vue.config.js +690 -0
  284. package/chart/rancher-alerting-drivers.vue +0 -53
  285. package/chart/rancher-gatekeeper.vue +0 -37
  286. package/creators/app/files/nuxt.config.js +0 -6
  287. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +0 -4
  288. package/nuxt.config.js +0 -798
  289. package/plugins/dashboard-store/extensions.js +0 -22
@@ -0,0 +1,110 @@
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 gh-pages
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
+ ref: gh-pages
87
+
88
+ - name: Configure Git
89
+ run: |
90
+ git config user.name "$GITHUB_ACTOR"
91
+ git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
92
+
93
+ - name: Download build artifact
94
+ uses: actions/download-artifact@v3
95
+ with:
96
+ name: charts
97
+
98
+ - name: Commit build
99
+ run: |
100
+ git add ./{assets,charts,extensions,index.yaml}
101
+ git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
102
+ git push
103
+
104
+ - name: Run chart-releaser
105
+ uses: helm/chart-releaser-action@v1.4.1
106
+ with:
107
+ charts_dir: ./charts/*
108
+ env:
109
+ CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
110
+ CR_SKIP_EXISTING: true
@@ -23,7 +23,6 @@
23
23
  "@types/node",
24
24
  "@types/jest",
25
25
  "@types/lodash",
26
- "@nuxt/types",
27
26
  "rancher",
28
27
  "shell"
29
28
  ],
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);
@@ -9,9 +9,9 @@
9
9
  "node": ">=12"
10
10
  },
11
11
  "devDependencies": {
12
- "@vue/cli-plugin-babel": "~4.5.0",
13
- "@vue/cli-service": "~4.5.0",
14
- "@vue/cli-plugin-typescript": "^4.5.15"
12
+ "@vue/cli-plugin-babel": "4.5.18",
13
+ "@vue/cli-service": "4.5.18",
14
+ "@vue/cli-plugin-typescript": "4.5.18"
15
15
  },
16
16
  "browserslist": [
17
17
  "> 1%",
@@ -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,42 +1,59 @@
1
1
  <script>
2
2
  import CreateEditView from '@shell/mixins/create-edit-view';
3
3
  import SortableTable from '@shell/components/SortableTable';
4
- import { CONSTRAINT_VIOLATION_RESOURCE_LINK, CONSTRAINT_VIOLATION_MESSAGE, CONSTRAINT_VIOLATION_TYPE } from '@shell/config/table-headers';
4
+ import Banner from '@components/Banner/Banner.vue';
5
+ import {
6
+ CONSTRAINT_VIOLATION_RESOURCE_LINK,
7
+ CONSTRAINT_VIOLATION_MESSAGE,
8
+ CONSTRAINT_VIOLATION_TYPE,
9
+ CONSTRAINT_VIOLATION_NAMESPACE,
10
+ } from '@shell/config/table-headers';
5
11
 
6
12
  export default {
7
- components: { SortableTable },
13
+ components: { Banner, SortableTable },
8
14
  mixins: [CreateEditView],
9
- data(ctx) {
15
+ data() {
16
+ const headers = [
17
+ CONSTRAINT_VIOLATION_TYPE,
18
+ CONSTRAINT_VIOLATION_NAMESPACE,
19
+ CONSTRAINT_VIOLATION_RESOURCE_LINK,
20
+ CONSTRAINT_VIOLATION_MESSAGE
21
+ ];
22
+
10
23
  return {
11
- headers: [
12
- CONSTRAINT_VIOLATION_TYPE,
13
- CONSTRAINT_VIOLATION_RESOURCE_LINK,
14
- CONSTRAINT_VIOLATION_MESSAGE
15
- ],
16
- violations: this.value.violations
17
- .map((violation, i) => ({ ...violation, id: i }))
24
+ headers,
25
+ violations: this.value.violations.map((violation, i) => ({ ...violation, id: i }))
18
26
  };
19
27
  }
20
28
  };
21
29
  </script>
22
30
  <template>
23
31
  <div>
24
- <div
25
- v-if="value.spec.enforcementAction"
26
- class="row mt-40"
32
+ <div
33
+ v-if="value.spec.enforcementAction"
34
+ class="row mt-20"
27
35
  >
28
36
  <div class="col span-12">
29
- <h3>Enforcement Action</h3>
37
+ <h3>
38
+ {{ t('gatekeeperConstraint.enforcement.action') }}
39
+ </h3>
30
40
  {{ value.spec.enforcementAction }}
31
41
  </div>
32
42
  </div>
33
- <div class="row mt-40">
43
+ <div class="row mt-20">
34
44
  <div class="col span-12">
35
- <h3>{{ t('gatekeeperConstraint.violations.title') }}</h3>
45
+ <h3 class="mb-20">
46
+ {{ t('gatekeeperConstraint.violations.title', { total: value.totalViolations }) }}
47
+ </h3>
48
+ <Banner
49
+ v-if="value.totalViolations !== value.violations.length"
50
+ color="info"
51
+ >
52
+ {{ t('gatekeeperConstraint.violations.notAll', { shown: value.violations.length }) }}
53
+ </Banner>
36
54
  <SortableTable
37
55
  :headers="headers"
38
56
  :rows="violations"
39
- :search="false"
40
57
  :table-actions="false"
41
58
  :row-actions="false"
42
59
  :paging="true"
@@ -5,6 +5,7 @@ import FleetClusters from '@shell/components/fleet/FleetClusters';
5
5
  import ResourceTabs from '@shell/components/form/ResourceTabs';
6
6
  import Tab from '@shell/components/Tabbed/Tab';
7
7
  import { FLEET } from '@shell/config/types';
8
+ import { allHash } from '@shell/utils/promise';
8
9
 
9
10
  export default {
10
11
  name: 'DetailClusterGroup',
@@ -25,7 +26,12 @@ export default {
25
26
  },
26
27
 
27
28
  async fetch() {
28
- await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
29
+ const hash = {
30
+ workspaces: this.$store.dispatch('cluster/findAll', { type: FLEET.WORKSPACE }),
31
+ FleetClusters: this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER }),
32
+ };
33
+
34
+ await allHash(hash);
29
35
  },
30
36
 
31
37
  computed: {
@@ -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 }}
@@ -11,6 +11,7 @@ import { CAPI, MANAGEMENT, NORMAN, SNAPSHOT } from '@shell/config/types';
11
11
  import {
12
12
  STATE, NAME as NAME_COL, AGE, AGE_NORMAN, INTERNAL_EXTERNAL_IP, STATE_NORMAN, ROLES, MACHINE_NODE_OS, MANAGEMENT_NODE_OS, NAME,
13
13
  } from '@shell/config/table-headers';
14
+ import { STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
14
15
  import CustomCommand from '@shell/edit/provisioning.cattle.io.cluster/CustomCommand';
15
16
  import AsyncButton from '@shell/components/AsyncButton.vue';
16
17
  import AnsiUp from 'ansi_up';
@@ -30,6 +31,7 @@ import Socket, {
30
31
  import { get } from '@shell/utils/object';
31
32
  import CapiMachineDeployment from '@shell/models/cluster.x-k8s.io.machinedeployment';
32
33
  import { isAlternate } from '@shell/utils/platform';
34
+ import { defaultTableSortGenerationFn } from '@shell/components/ResourceTable.vue';
33
35
 
34
36
  let lastId = 1;
35
37
  const ansiup = new AnsiUp();
@@ -248,15 +250,33 @@ export default {
248
250
  },
249
251
 
250
252
  fakeMachines() {
253
+ const machineNameFn = (clusterName, machinePoolName) => `${ clusterName }-${ machinePoolName }`;
254
+
251
255
  // When we scale up, the quantity will change to N+1 - so from 0 to 1, the quantity changes,
252
256
  // but it takes tiem for the machine to appear, so the pool is empty, but if we just go off on a non-zero quqntity
253
257
  // then the pool would be hidden - so we find empty pool by checking the machines
254
258
  const emptyPools = (this.value.spec.rkeConfig?.machinePools || []).filter((mp) => {
255
- const machinePrefix = `${ this.value.name }-${ mp.name }`;
259
+ const machineFullName = machineNameFn(this.value.name, mp.name);
260
+
256
261
  const machines = this.value.machines.filter((machine) => {
257
262
  const isElementalCluster = machine.spec?.infrastructureRef?.apiVersion.startsWith('elemental.cattle.io');
263
+ const machinePoolInfName = machine.spec?.infrastructureRef?.name;
264
+
265
+ if (isElementalCluster) {
266
+ return machinePoolInfName.includes(machineFullName);
267
+ }
268
+
269
+ // if labels exist, then the machineFullName must unequivocally be equal to manchineLabelFullName (based on labels)
270
+ const machineLabelClusterName = machine.metadata?.labels?.['cluster.x-k8s.io/cluster-name'];
271
+ const machineLabelPoolName = machine.metadata?.labels?.['rke.cattle.io/rke-machine-pool-name'];
272
+
273
+ if (machineLabelClusterName && machineLabelPoolName) {
274
+ const manchineLabelFullName = machineNameFn(machineLabelClusterName, machineLabelPoolName);
275
+
276
+ return machineFullName === manchineLabelFullName;
277
+ }
258
278
 
259
- return !isElementalCluster ? machine.spec?.infrastructureRef?.name.startsWith(machinePrefix) : machine.spec?.infrastructureRef?.name.includes(machinePrefix);
279
+ return machinePoolInfName.startsWith(machineFullName);
260
280
  });
261
281
 
262
282
  return machines.length === 0;
@@ -335,7 +355,7 @@ export default {
335
355
  },
336
356
 
337
357
  showEksNodeGroupWarning() {
338
- if ( this.value.provisioner === 'EKS' ) {
358
+ if ( this.value.provisioner === 'EKS' && this.value.state !== STATES_ENUM.ACTIVE) {
339
359
  const desiredTotal = this.value.eksNodeGroups.filter(g => g.desiredSize === 0);
340
360
 
341
361
  if ( desiredTotal.length === this.value.eksNodeGroups.length ) {
@@ -620,6 +640,26 @@ export default {
620
640
  return day(time).format(this.dateTimeFormatStr);
621
641
  }
622
642
  },
643
+
644
+ machineSortGenerationFn() {
645
+ // The sort generation function creates a unique value and is used to create a key including sort details.
646
+ // The unique key determines if the list is redrawn or a cached version is shown.
647
+ // Because we ensure the 'not in a pool' group is there via a row, and timing issues, the unqiue key doesn't change
648
+ // after a machine is added/removed... so the list won't update... so we need to inject a string to ensure the key is fresh
649
+ const base = defaultTableSortGenerationFn(this.machineSchema, this.$store);
650
+
651
+ return base + (!!this.fakeMachines.length ? '-fake' : '');
652
+ },
653
+
654
+ nodeSortGenerationFn() {
655
+ // The sort generation function creates a unique value and is used to create a key including sort details.
656
+ // The unique key determines if the list is redrawn or a cached version is shown.
657
+ // Because we ensure the 'not in a pool' group is there via a row, and timing issues, the unqiue key doesn't change
658
+ // after a machine is added/removed... so the list won't update... so we need to inject a string to ensure the key is fresh
659
+ const base = defaultTableSortGenerationFn(this.mgmtNodeSchema, this.$store);
660
+
661
+ return base + (!!this.fakeNodes.length ? '-fake' : '');
662
+ },
623
663
  }
624
664
  };
625
665
  </script>
@@ -663,6 +703,7 @@ export default {
663
703
  :group-by="value.isCustom ? null : 'poolId'"
664
704
  group-ref="pool"
665
705
  :group-sort="['pool.nameDisplay']"
706
+ :sort-generation-fn="machineSortGenerationFn"
666
707
  >
667
708
  <template #main-row:isFake="{fullColspan}">
668
709
  <tr class="main-row">
@@ -686,11 +727,11 @@ export default {
686
727
  >
687
728
  <div
688
729
  v-if="group && group.ref"
689
- v-html="group.ref.groupByPoolShortLabel"
730
+ v-clean-html="group.ref.groupByPoolShortLabel"
690
731
  />
691
732
  <div
692
733
  v-else
693
- v-html="t('resourceTable.groupLabel.notInANodePool')"
734
+ v-clean-html="t('resourceTable.groupLabel.notInANodePool')"
694
735
  />
695
736
  <div
696
737
  v-if="group.ref && group.ref.template"
@@ -747,6 +788,7 @@ export default {
747
788
  :group-by="value.isCustom ? null : 'spec.nodePoolName'"
748
789
  group-ref="pool"
749
790
  :group-sort="['pool.nameDisplay']"
791
+ :sort-generation-fn="nodeSortGenerationFn"
750
792
  >
751
793
  <template #main-row:isFake="{fullColspan}">
752
794
  <tr class="main-row">
@@ -770,11 +812,11 @@ export default {
770
812
  >
771
813
  <div
772
814
  v-if="group.ref"
773
- v-html="t('resourceTable.groupLabel.nodePool', { name: group.ref.spec.hostnamePrefix}, true)"
815
+ v-clean-html="t('resourceTable.groupLabel.nodePool', { name: group.ref.spec.hostnamePrefix}, true)"
774
816
  />
775
817
  <div
776
818
  v-else
777
- v-html="t('resourceTable.groupLabel.notInANodePool')"
819
+ v-clean-html="t('resourceTable.groupLabel.notInANodePool')"
778
820
  />
779
821
  <div
780
822
  v-if="group.ref && group.ref.nodeTemplate"
@@ -846,13 +888,13 @@ export default {
846
888
  >
847
889
  <td
848
890
  :key="line.id + '-time'"
891
+ v-clean-html="format(line.time)"
849
892
  class="time"
850
- v-html="format(line.time)"
851
893
  />
852
894
  <td
853
895
  :key="line.id + '-msg'"
896
+ v-clean-html="line.msg"
854
897
  class="msg"
855
- v-html="line.msg"
856
898
  />
857
899
  </tr>
858
900
  </template>
@@ -890,22 +932,22 @@ export default {
890
932
  @copied-windows="hasWindowsMachine ? null : showWindowsWarning = true"
891
933
  />
892
934
  <template v-else>
893
- <h4 v-html="t('cluster.import.commandInstructions', null, true)" />
935
+ <h4 v-clean-html="t('cluster.import.commandInstructions', null, true)" />
894
936
  <CopyCode class="m-10 p-10">
895
937
  {{ clusterToken.command }}
896
938
  </CopyCode>
897
939
 
898
940
  <h4
941
+ v-clean-html="t('cluster.import.commandInstructionsInsecure', null, true)"
899
942
  class="mt-10"
900
- v-html="t('cluster.import.commandInstructionsInsecure', null, true)"
901
943
  />
902
944
  <CopyCode class="m-10 p-10">
903
945
  {{ clusterToken.insecureCommand }}
904
946
  </CopyCode>
905
947
 
906
948
  <h4
949
+ v-clean-html="t('cluster.import.clusterRoleBindingInstructions', null, true)"
907
950
  class="mt-10"
908
- v-html="t('cluster.import.clusterRoleBindingInstructions', null, true)"
909
951
  />
910
952
  <CopyCode class="m-10 p-10">
911
953
  {{ t('cluster.import.clusterRoleBindingCommand', null, true) }}
@@ -108,8 +108,8 @@ export default {
108
108
  computed: {
109
109
  ...mapGetters(['currentCluster']),
110
110
 
111
- isActive() {
112
- return this.value.metadata.state.name === 'active';
111
+ isScalable() {
112
+ return this.value?.canUpdate;
113
113
  },
114
114
 
115
115
  isJob() {
@@ -335,7 +335,7 @@ export default {
335
335
  class="text-right"
336
336
  :label="t('tableHeaders.scale')"
337
337
  :value="value.spec.replicas"
338
- :disabled="!isActive"
338
+ :disabled="!isScalable"
339
339
  @minus="scaleDown"
340
340
  @plus="scaleUp"
341
341
  />
@@ -39,8 +39,8 @@ export default {
39
39
  >
40
40
  <h4
41
41
  slot="title"
42
+ v-clean-html="t('addClusterMemberDialog.title')"
42
43
  class="text-default-text"
43
- v-html="t('addClusterMemberDialog.title')"
44
44
  />
45
45
 
46
46
  <div
@@ -63,7 +63,7 @@ export default {
63
63
  async principalProperty() {
64
64
  const principal = await this.principal;
65
65
 
66
- return principal.principalType === 'group' ? 'groupPrincipalId' : 'userPrincipalId';
66
+ return principal?.principalType === 'group' ? 'groupPrincipalId' : 'userPrincipalId';
67
67
  },
68
68
 
69
69
  close() {
@@ -114,8 +114,8 @@ export default {
114
114
  >
115
115
  <h4
116
116
  slot="title"
117
+ v-clean-html="t('addProjectMemberDialog.title')"
117
118
  class="text-default-text"
118
- v-html="t('addProjectMemberDialog.title')"
119
119
  />
120
120
 
121
121
  <div
@@ -46,7 +46,7 @@ export default {
46
46
 
47
47
  <template>
48
48
  <Card
49
- class="addon-config-confirmation"
49
+ class="prompt-restore"
50
50
  :show-highlight-border="false"
51
51
  >
52
52
  <h4
@@ -66,24 +66,36 @@ export default {
66
66
  slot="actions"
67
67
  class="bottom"
68
68
  >
69
- <button
70
- type="button"
71
- class="btn role-secondary mr-10"
72
- @click="close"
73
- >
74
- {{ t('generic.cancel') }}
75
- </button>
76
- <AsyncButton
77
- mode="continue"
78
- @click="apply"
79
- />
69
+ <div class="buttons">
70
+ <button
71
+ type="button"
72
+ class="btn role-secondary mr-10"
73
+ @click="close"
74
+ >
75
+ {{ t('generic.cancel') }}
76
+ </button>
77
+ <AsyncButton
78
+ mode="continue"
79
+ @click="apply"
80
+ />
81
+ </div>
80
82
  </div>
81
83
  </Card>
82
84
  </template>
83
85
  <style lang='scss' scoped>
84
- ::v-deep .card-actions {
86
+ .prompt-restore {
87
+ margin: 0;
88
+ }
89
+
90
+ .bottom {
91
+ display: flex;
92
+ flex-direction: column;
93
+ flex: 1;
94
+
95
+ .buttons {
85
96
  display: flex;
86
- flex-direction: row;
87
- justify-content: center;
97
+ justify-content: flex-end;
98
+ width: 100%;
88
99
  }
100
+ }
89
101
  </style>
@@ -68,8 +68,8 @@ export default {
68
68
  >
69
69
  <h4
70
70
  slot="title"
71
+ v-clean-html="title"
71
72
  class="text-default-text"
72
- v-html="title"
73
73
  />
74
74
 
75
75
  <template slot="body">