@rancher/shell 0.5.2 → 1.2.0

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 (338) hide show
  1. package/.DS_Store +0 -0
  2. package/assets/images/providers/aks-black.svg +28 -0
  3. package/assets/images/providers/aks.svg +31 -0
  4. package/assets/styles/global/_labeled-input.scss +1 -0
  5. package/assets/styles/global/_layout.scss +0 -99
  6. package/assets/translations/en-us.yaml +77 -71
  7. package/assets/translations/zh-hans.yaml +25 -23
  8. package/babel.config.js +1 -7
  9. package/chart/gatekeeper.vue +11 -2
  10. package/chart/istio.vue +10 -1
  11. package/chart/logging/index.vue +11 -2
  12. package/chart/monitoring/alerting/index.vue +21 -7
  13. package/chart/monitoring/grafana/index.vue +2 -57
  14. package/chart/monitoring/index.vue +26 -52
  15. package/chart/monitoring/prometheus/index.vue +43 -37
  16. package/chart/rancher-backup/index.vue +10 -3
  17. package/cloud-credential/azure.vue +17 -4
  18. package/components/AsyncButton.vue +0 -9
  19. package/components/Carousel.vue +0 -1
  20. package/components/ChartPsp.vue +76 -0
  21. package/components/CodeMirror.vue +21 -19
  22. package/components/CopyCode.vue +2 -6
  23. package/components/CopyToClipboard.vue +1 -2
  24. package/components/CopyToClipboardText.vue +9 -14
  25. package/components/CruResource.vue +0 -1
  26. package/components/EtcdInfoBanner.vue +5 -5
  27. package/components/ExplorerProjectsNamespaces.vue +1 -25
  28. package/components/IconOrSvg.vue +1 -1
  29. package/components/Markdown.vue +12 -16
  30. package/components/Questions/index.vue +1 -1
  31. package/components/ResourceDetail/Masthead.vue +9 -25
  32. package/components/ResourceList/Masthead.vue +18 -1
  33. package/components/ResourceTable.vue +2 -14
  34. package/components/ResourceYaml.vue +0 -5
  35. package/components/SideNav.vue +1 -1
  36. package/components/SortableTable/THead.vue +9 -7
  37. package/components/SortableTable/index.vue +3 -2
  38. package/components/StatusTable.vue +1 -5
  39. package/components/TabTitle.vue +84 -0
  40. package/components/Tabbed/index.vue +0 -12
  41. package/components/__tests__/ChartPsp.test.ts +75 -0
  42. package/components/__tests__/CopyCode.test.ts +4 -5
  43. package/components/fleet/FleetBundles.vue +11 -5
  44. package/components/fleet/FleetRepos.vue +27 -62
  45. package/components/fleet/FleetResources.vue +1 -6
  46. package/components/fleet/FleetStatus.vue +3 -3
  47. package/components/fleet/FleetSummary.vue +30 -35
  48. package/components/form/ArrayList.vue +8 -1
  49. package/components/form/ArrayListSelect.vue +9 -9
  50. package/components/form/KeyValue.vue +0 -1
  51. package/components/form/LabeledSelect.vue +0 -4
  52. package/components/form/Password.vue +1 -3
  53. package/components/form/Select.vue +1 -1
  54. package/components/form/SelectOrCreateAuthSecret.vue +4 -4
  55. package/components/form/__tests__/KeyValue.test.ts +1 -1
  56. package/components/formatter/Checked.vue +3 -11
  57. package/components/formatter/ClusterProvider.vue +18 -1
  58. package/components/formatter/FleetSummaryGraph.vue +11 -23
  59. package/components/formatter/LiveDate.vue +16 -0
  60. package/components/formatter/LiveDuration.vue +1 -1
  61. package/components/formatter/PercentageBar.vue +1 -1
  62. package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
  63. package/components/nav/Group.vue +2 -2
  64. package/components/nav/Header.vue +2 -1
  65. package/components/nav/TopLevelMenu.vue +3 -29
  66. package/components/nav/Type.vue +3 -1
  67. package/components/nav/WindowManager/ContainerLogs.vue +19 -120
  68. package/components/nav/WindowManager/ContainerShell.vue +1 -6
  69. package/components/nav/WindowManager/index.vue +10 -11
  70. package/components/nav/__tests__/TopLevelMenu.test.ts +0 -33
  71. package/components/nav/__tests__/Type.test.ts +1 -1
  72. package/components/nuxt/nuxt-child.js +78 -14
  73. package/components/nuxt/nuxt.js +1 -1
  74. package/components/user.retention/user-retention-header.vue +34 -0
  75. package/composables/useI18n.ts +26 -0
  76. package/composables/useStore.ts +16 -0
  77. package/config/harvester-manager-types.js +0 -2
  78. package/config/home-links.js +32 -2
  79. package/config/private-label.js +0 -22
  80. package/config/product/explorer.js +4 -4
  81. package/config/product/fleet.js +1 -6
  82. package/config/product/legacy.js +1 -84
  83. package/config/product/manager.js +15 -8
  84. package/config/query-params.js +0 -1
  85. package/config/router.js +368 -385
  86. package/config/settings.ts +9 -2
  87. package/config/store.js +1 -1
  88. package/config/system-namespaces.js +0 -3
  89. package/config/table-headers.js +27 -47
  90. package/config/types.js +5 -0
  91. package/config/uiplugins.js +1 -1
  92. package/core/plugin-helpers.js +5 -3
  93. package/core/plugin-routes.ts +114 -56
  94. package/core/plugin.ts +10 -16
  95. package/core/plugins-loader.js +9 -7
  96. package/core/plugins.js +3 -0
  97. package/core/types-provisioning.ts +0 -7
  98. package/creators/app/init +0 -19
  99. package/detail/fleet.cattle.io.cluster.vue +1 -11
  100. package/detail/node.vue +0 -42
  101. package/detail/pod.vue +1 -68
  102. package/detail/provisioning.cattle.io.cluster.vue +4 -6
  103. package/detail/workload/index.vue +1 -15
  104. package/dialog/ScaleMachineDownDialog.vue +17 -34
  105. package/edit/auth/googleoauth.vue +5 -1
  106. package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
  107. package/edit/cloudcredential.vue +0 -2
  108. package/edit/fleet.cattle.io.gitrepo.vue +4 -3
  109. package/edit/management.cattle.io.project.vue +52 -1
  110. package/edit/management.cattle.io.setting.vue +2 -31
  111. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
  112. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
  113. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
  114. package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +126 -109
  115. package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
  116. package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +3 -1
  117. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
  118. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
  119. package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
  120. package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
  121. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
  122. package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
  123. package/edit/provisioning.cattle.io.cluster/index.vue +37 -99
  124. package/edit/provisioning.cattle.io.cluster/rke2.vue +690 -181
  125. package/edit/service.vue +0 -12
  126. package/edit/workload/Upgrading.vue +2 -3
  127. package/edit/workload/index.vue +1 -2
  128. package/edit/workload/mixins/workload.js +1 -1
  129. package/initialize/App.js +71 -25
  130. package/initialize/client.js +162 -21
  131. package/initialize/index.js +124 -47
  132. package/initialize/layouts.ts +26 -0
  133. package/{components/templates → layouts}/blank.vue +1 -1
  134. package/{components/templates → layouts}/default.vue +98 -8
  135. package/{components/templates → layouts}/error.vue +19 -10
  136. package/{components/templates → layouts}/home.vue +1 -4
  137. package/{components/templates → layouts}/plain.vue +1 -4
  138. package/{components/templates → layouts}/standalone.vue +1 -1
  139. package/{components/templates → layouts}/unauthenticated.vue +1 -1
  140. package/list/management.cattle.io.feature.vue +7 -1
  141. package/list/management.cattle.io.user.vue +25 -1
  142. package/list/node.vue +0 -1
  143. package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
  144. package/machine-config/amazonec2.vue +1 -0
  145. package/machine-config/azure.vue +37 -21
  146. package/machine-config/vmwarevsphere.vue +47 -42
  147. package/middleware/authenticated.js +19 -14
  148. package/mixins/auth-config.js +7 -2
  149. package/mixins/brand.js +41 -29
  150. package/mixins/fetch.server.js +73 -0
  151. package/mixins/labeled-form-element.ts +1 -6
  152. package/models/__tests__/management.cattle.io.node.ts +0 -85
  153. package/models/__tests__/namespace.test.ts +9 -49
  154. package/models/cluster/node.js +4 -4
  155. package/models/cluster.x-k8s.io.machine.js +1 -1
  156. package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
  157. package/models/fleet.cattle.io.cluster.js +0 -4
  158. package/models/fleet.cattle.io.gitrepo.js +13 -56
  159. package/models/management.cattle.io.cluster.js +3 -11
  160. package/models/management.cattle.io.kontainerdriver.js +0 -1
  161. package/models/management.cattle.io.node.js +14 -18
  162. package/models/management.cattle.io.nodepool.js +0 -17
  163. package/models/management.cattle.io.project.js +36 -0
  164. package/models/management.cattle.io.setting.js +7 -11
  165. package/models/management.cattle.io.user.js +65 -0
  166. package/models/namespace.js +1 -1
  167. package/models/pod.js +0 -20
  168. package/models/provisioning.cattle.io.cluster.js +8 -55
  169. package/models/secret.js +18 -117
  170. package/models/workload.js +0 -16
  171. package/models/workload.service.js +0 -18
  172. package/package.json +10 -12
  173. package/pages/about.vue +1 -0
  174. package/pages/account/create-key.vue +1 -0
  175. package/pages/account/index.vue +1 -0
  176. package/pages/auth/login.vue +1 -0
  177. package/pages/auth/logout.vue +2 -0
  178. package/pages/auth/setup.vue +4 -37
  179. package/pages/auth/verify.vue +8 -14
  180. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
  181. package/pages/c/_cluster/apps/charts/index.vue +58 -64
  182. package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
  183. package/pages/c/_cluster/apps/charts/install.vue +5 -5
  184. package/pages/c/_cluster/apps/index.vue +2 -0
  185. package/pages/c/_cluster/auth/index.vue +2 -0
  186. package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
  187. package/pages/c/_cluster/ecm/index.vue +2 -0
  188. package/pages/c/_cluster/explorer/index.vue +53 -56
  189. package/pages/c/_cluster/explorer/tools/index.vue +3 -171
  190. package/pages/c/_cluster/fleet/index.vue +1 -1
  191. package/pages/c/_cluster/index.vue +2 -0
  192. package/pages/c/_cluster/manager/pages/_page.vue +5 -4
  193. package/pages/c/_cluster/monitoring/index.vue +1 -17
  194. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -0
  195. package/pages/c/_cluster/settings/banners.vue +2 -0
  196. package/pages/c/_cluster/settings/brand.vue +2 -0
  197. package/pages/c/_cluster/settings/index.vue +2 -0
  198. package/pages/c/_cluster/settings/links.vue +3 -2
  199. package/pages/c/_cluster/settings/performance.vue +1 -0
  200. package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +4 -4
  201. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
  202. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
  203. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +5 -2
  204. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +96 -0
  205. package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +128 -0
  206. package/pages/c/_cluster/uiplugins/index.vue +2 -0
  207. package/pages/c/index.vue +9 -0
  208. package/pages/diagnostic.vue +2 -1
  209. package/pages/fail-whale.vue +1 -0
  210. package/pages/prefs.vue +1 -0
  211. package/pages/rio/mesh.vue +508 -0
  212. package/pages/support/index.vue +8 -2
  213. package/pkg/auto-import.js +1 -1
  214. package/plugins/axios.js +36 -0
  215. package/plugins/back-button.js +5 -3
  216. package/plugins/clean-html-directive.js +19 -1
  217. package/plugins/clean-tooltip-directive.js +1 -1
  218. package/plugins/codemirror-loader.js +1 -1
  219. package/plugins/codemirror.js +0 -41
  220. package/plugins/dashboard-store/__tests__/actions.spec.ts +250 -0
  221. package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
  222. package/plugins/dashboard-store/actions.js +21 -22
  223. package/plugins/dashboard-store/classify.js +18 -1
  224. package/plugins/dashboard-store/getters.js +5 -10
  225. package/plugins/dashboard-store/index.js +12 -0
  226. package/plugins/dashboard-store/mutations.js +4 -0
  227. package/plugins/dashboard-store/resource-class.js +18 -59
  228. package/plugins/i18n.js +1 -1
  229. package/plugins/steve/__tests__/getters.spec.ts +56 -24
  230. package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
  231. package/plugins/steve/getters.js +30 -7
  232. package/plugins/steve/mutations.js +5 -2
  233. package/plugins/steve/norman-class.js +0 -19
  234. package/plugins/steve/steve-class.js +0 -22
  235. package/plugins/steve/subscribe.js +34 -13
  236. package/plugins/transitions.js +4 -0
  237. package/plugins/vue-clipboard2.js +4 -0
  238. package/rancher-components/Accordion/Accordion.vue +3 -2
  239. package/rancher-components/BadgeState/BadgeState.vue +3 -3
  240. package/rancher-components/Banner/Banner.test.ts +1 -5
  241. package/rancher-components/Banner/Banner.vue +2 -2
  242. package/rancher-components/Card/Card.vue +4 -4
  243. package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
  244. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
  245. package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
  246. package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
  247. package/rancher-components/Form/Radio/RadioButton.vue +13 -7
  248. package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
  249. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
  250. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
  251. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
  252. package/rancher-components/StringList/StringList.vue +8 -8
  253. package/rancher-components/components/Accordion/Accordion.vue +3 -2
  254. package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
  255. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
  256. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
  257. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
  258. package/rancher-components/components/StringList/StringList.test.ts +0 -270
  259. package/rancher-components/components/StringList/StringList.vue +18 -57
  260. package/scripts/extension/bundle +7 -19
  261. package/scripts/extension/helm/scripts/package +3 -11
  262. package/scripts/extension/parse-tag-name +4 -4
  263. package/scripts/extension/publish +9 -20
  264. package/scripts/publish-shell.sh +1 -11
  265. package/scripts/test-plugins-build.sh +9 -85
  266. package/store/catalog.js +1 -1
  267. package/store/features.js +0 -1
  268. package/store/i18n.js +0 -11
  269. package/store/index.js +11 -8
  270. package/store/prefs.js +38 -33
  271. package/store/type-map.js +8 -13
  272. package/tsconfig.default.json +46 -0
  273. package/tsconfig.json +9 -35
  274. package/types/shell/index.d.ts +404 -463
  275. package/utils/__tests__/create-yaml.test.ts +10 -0
  276. package/utils/axios.js +19 -0
  277. package/utils/create-yaml.js +6 -6
  278. package/utils/custom-validators.js +2 -0
  279. package/utils/error.js +1 -16
  280. package/utils/monitoring.js +2 -37
  281. package/utils/nuxt.js +39 -18
  282. package/utils/object.js +0 -14
  283. package/utils/router.scrollBehavior.js +14 -12
  284. package/utils/socket.js +1 -0
  285. package/utils/time.js +1 -1
  286. package/utils/title.ts +3 -0
  287. package/utils/url.ts +1 -1
  288. package/utils/validators/formRules/__tests__/index.test.ts +4 -49
  289. package/utils/validators/formRules/index.ts +9 -12
  290. package/utils/validators/setting.js +10 -6
  291. package/vue.config.js +3 -24
  292. package/chart/monitoring/steps/uninstall-v1.vue +0 -135
  293. package/components/Certificates.vue +0 -164
  294. package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
  295. package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
  296. package/components/formatter/__tests__/Checked.test.ts +0 -19
  297. package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
  298. package/composables/useCompactInput.ts +0 -20
  299. package/composables/useLabeledFormElement.ts +0 -138
  300. package/creators/app/files/.gitlab-ci.yml +0 -14
  301. package/edit/__tests__/service.test.ts +0 -89
  302. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
  303. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
  304. package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
  305. package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
  306. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
  307. package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
  308. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
  309. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
  310. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -144
  311. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
  312. package/mixins/v1-workload-metrics.js +0 -43
  313. package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
  314. package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
  315. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -90
  316. package/models/__tests__/workload.test.ts +0 -91
  317. package/plugins/clean-html.js +0 -53
  318. package/plugins/dashboard-store/__tests__/actions.test.ts +0 -165
  319. package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
  320. package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
  321. package/plugins/index.js +0 -11
  322. package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
  323. package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
  324. package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
  325. package/server/har-file.js +0 -183
  326. package/tsconfig.paths.json +0 -18
  327. package/utils/azure.js +0 -24
  328. package/utils/clipboard.js +0 -5
  329. /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
  330. /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
  331. /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
  332. /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
  333. /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
  334. /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
  335. /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
  336. /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
  337. /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
  338. /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
package/models/pod.js CHANGED
@@ -3,7 +3,6 @@ import { colorForState, stateDisplay } from '@shell/plugins/dashboard-store/reso
3
3
  import { NODE, WORKLOAD_TYPES } from '@shell/config/types';
4
4
  import { escapeHtml, shortenedImage } from '@shell/utils/string';
5
5
  import WorkloadService from '@shell/models/workload.service';
6
- import { deleteProperty } from '@shell/utils/object';
7
6
 
8
7
  export const WORKLOAD_PRIORITY = {
9
8
  [WORKLOAD_TYPES.DEPLOYMENT]: 1,
@@ -257,23 +256,4 @@ export default class Pod extends WorkloadService {
257
256
  return Promise.reject(e);
258
257
  });
259
258
  }
260
-
261
- cleanForSave(data) {
262
- const val = super.cleanForSave(data);
263
-
264
- // remove fields from containers
265
- val.spec?.containers?.forEach((container) => {
266
- this.cleanContainerForSave(container);
267
- });
268
-
269
- // remove fields from initContainers
270
- val.spec?.initContainers?.forEach((container) => {
271
- this.cleanContainerForSave(container);
272
- });
273
-
274
- // This is probably added by generic workload components that shouldn't be added to pods
275
- deleteProperty(val, 'spec.selector');
276
-
277
- return val;
278
- }
279
259
  }
@@ -1,5 +1,5 @@
1
1
  import {
2
- CAPI, MANAGEMENT, NAMESPACE, NORMAN, SNAPSHOT, HCI, LOCAL_CLUSTER
2
+ CAPI, MANAGEMENT, NORMAN, SNAPSHOT, HCI
3
3
  } from '@shell/config/types';
4
4
  import SteveModel from '@shell/plugins/steve/steve-class';
5
5
  import { findBy } from '@shell/utils/array';
@@ -180,16 +180,6 @@ export default class ProvCluster extends SteveModel {
180
180
  return out;
181
181
  }
182
182
 
183
- async findNormanCluster() {
184
- const name = this.status?.clusterName;
185
-
186
- if ( !name ) {
187
- return null;
188
- }
189
-
190
- return await this.$dispatch('rancher/find', { type: NORMAN.CLUSTER, id: name }, { root: true });
191
- }
192
-
193
183
  explore() {
194
184
  const location = {
195
185
  name: 'c-cluster',
@@ -249,24 +239,10 @@ export default class ProvCluster extends SteveModel {
249
239
  return providers.includes(this.provisioner);
250
240
  }
251
241
 
252
- get isLocal() {
253
- return this.mgmt?.isLocal;
254
- }
255
-
256
242
  get isImported() {
257
243
  // As of Rancher v2.6.7, this returns false for imported K3s clusters,
258
244
  // in which this.provisioner is `k3s`.
259
-
260
- const isImportedProvisioner = this.provisioner === 'imported';
261
- const isImportedSpecialCases = this.mgmt?.providerForEmberParam === 'import' ||
262
- // when imported cluster is GKE
263
- !!this.mgmt?.spec?.gkeConfig?.imported ||
264
- // or AKS
265
- !!this.mgmt?.spec?.aksConfig?.imported ||
266
- // or EKS
267
- !!this.mgmt?.spec?.eksConfig?.imported;
268
-
269
- return !this.isLocal && (isImportedProvisioner || (!this.isRke2 && !this.mgmt?.machineProvider && isImportedSpecialCases));
245
+ return this.provisioner === 'imported';
270
246
  }
271
247
 
272
248
  get isCustom() {
@@ -286,6 +262,8 @@ export default class ProvCluster extends SteveModel {
286
262
  }
287
263
 
288
264
  get isImportedK3s() {
265
+ // As of Rancher v2.6.7, this returns false for imported K3s clusters,
266
+ // in which this.provisioner is `k3s`.
289
267
  return this.isImported && this.isK3s;
290
268
  }
291
269
 
@@ -294,7 +272,7 @@ export default class ProvCluster extends SteveModel {
294
272
  }
295
273
 
296
274
  get isK3s() {
297
- return this.mgmt?.status ? this.mgmt?.status.provider === 'k3s' : (this.spec?.kubernetesVersion || '').includes('k3s') ;
275
+ return this.mgmt?.status?.provider === 'k3s';
298
276
  }
299
277
 
300
278
  get isRke2() {
@@ -302,7 +280,7 @@ export default class ProvCluster extends SteveModel {
302
280
  }
303
281
 
304
282
  get isRke1() {
305
- return !!this.mgmt?.spec?.rancherKubernetesEngineConfig || this.labels['provider.cattle.io'] === 'rke';
283
+ return !!this.mgmt?.spec?.rancherKubernetesEngineConfig;
306
284
  }
307
285
 
308
286
  get isHarvester() {
@@ -837,11 +815,11 @@ export default class ProvCluster extends SteveModel {
837
815
  get agentConfig() {
838
816
  // The one we want is the first one with no selector.
839
817
  // If there are multiple with no selector, that will fall under the unsupported message below.
840
- return this.spec.rkeConfig.machineSelectorConfig.find((x) => !x.machineLabelSelector)?.config;
818
+ return this.spec.rkeConfig.machineSelectorConfig.find((x) => !x.machineLabelSelector).config;
841
819
  }
842
820
 
843
821
  get cloudProvider() {
844
- return this.agentConfig?.['cloud-provider-name'];
822
+ return this.agentConfig['cloud-provider-name'];
845
823
  }
846
824
 
847
825
  get canClone() {
@@ -893,29 +871,4 @@ export default class ProvCluster extends SteveModel {
893
871
  get hasError() {
894
872
  return this.status?.conditions?.some((condition) => condition.error === true);
895
873
  }
896
-
897
- get namespaceLocation() {
898
- const localCluster = this.$rootGetters['management/byId'](MANAGEMENT.CLUSTER, LOCAL_CLUSTER);
899
-
900
- if (localCluster) {
901
- return {
902
- name: 'c-cluster-product-resource-id',
903
- params: {
904
- cluster: localCluster.id,
905
- product: this.$rootGetters['productId'],
906
- resource: NAMESPACE,
907
- id: this.namespace
908
- }
909
- };
910
- }
911
-
912
- return null;
913
- }
914
-
915
- // JSON Paths that should be folded in the YAML editor by default
916
- get yamlFolding() {
917
- return [
918
- 'spec.rkeConfig.machinePools.dynamicSchemaSpec',
919
- ];
920
- }
921
874
  }
package/models/secret.js CHANGED
@@ -6,9 +6,6 @@ import { SERVICE_ACCOUNT } from '@shell/config/types';
6
6
  import { set } from '@shell/utils/object';
7
7
  import { NAME as MANAGER } from '@shell/config/product/manager';
8
8
  import SteveModel from '@shell/plugins/steve/steve-class';
9
- import { colorForState, stateDisplay, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
10
- import { diffFrom } from '@shell/utils/time';
11
- import day from 'dayjs';
12
9
 
13
10
  export const TYPES = {
14
11
  OPAQUE: 'Opaque',
@@ -26,12 +23,7 @@ export const TYPES = {
26
23
  RKE_AUTH_CONFIG: 'rke.cattle.io/auth-config'
27
24
  };
28
25
 
29
- /** Class a cert as expiring if in eight days */
30
- const certExpiringPeriod = 1000 * 60 * 60 * 24 * 8;
31
-
32
26
  export default class Secret extends SteveModel {
33
- _cachedCertInfo;
34
-
35
27
  get hasSensitiveData() {
36
28
  return true;
37
29
  }
@@ -54,7 +46,7 @@ export default class Secret extends SteveModel {
54
46
  if (annotations[CERTMANAGER.ISSUER]) {
55
47
  return annotations[CERTMANAGER.ISSUER];
56
48
  } else if (this.isCertificate) {
57
- return this.cachedCertInfo?.issuer;
49
+ return this.certInfo?.issuer;
58
50
  } else {
59
51
  return null;
60
52
  }
@@ -62,7 +54,7 @@ export default class Secret extends SteveModel {
62
54
 
63
55
  get notAfter() {
64
56
  if (this.isCertificate) {
65
- return this.cachedCertInfo?.notAfter;
57
+ return this.certInfo?.notAfter;
66
58
  } else {
67
59
  return null;
68
60
  }
@@ -70,7 +62,7 @@ export default class Secret extends SteveModel {
70
62
 
71
63
  get cn() {
72
64
  if (this.isCertificate) {
73
- return this.cachedCertInfo?.cn;
65
+ return this.certInfo?.cn;
74
66
  }
75
67
 
76
68
  return null;
@@ -88,13 +80,14 @@ export default class Secret extends SteveModel {
88
80
  // use text-warning' or 'text-error' if cert is expiring within 8 days or is expired
89
81
  get dateClass() {
90
82
  if (this.isCertificate) {
91
- switch (this.certState) {
92
- case STATES_ENUM.EXPIRING:
83
+ const eightDays = 691200000;
84
+
85
+ if (this.timeTilExpiration > eightDays ) {
86
+ return '';
87
+ } else if (this.timeTilExpiration > 0) {
93
88
  return 'text-warning';
94
- case STATES_ENUM.EXPIRED:
89
+ } else {
95
90
  return 'text-error';
96
- default:
97
- return '';
98
91
  }
99
92
  }
100
93
 
@@ -255,7 +248,7 @@ export default class Secret extends SteveModel {
255
248
  // parse TLS certs and return issuer, notAfter, cn, sans
256
249
  get certInfo() {
257
250
  const pem = base64Decode(this.data['tls.crt']);
258
- let issuer, notBefore, notAfter, cn, sans, x;
251
+ let issuer, notAfter, cn, sans, x;
259
252
  const END_MARKER = '-----END CERTIFICATE-----';
260
253
 
261
254
  if (pem) {
@@ -273,7 +266,6 @@ export default class Secret extends SteveModel {
273
266
  const issuerString = x.getIssuerString();
274
267
 
275
268
  issuer = issuerString.slice(issuerString.indexOf('CN=') + 3);
276
- notBefore = r.zulutodate(x.getNotBefore());
277
269
  notAfter = r.zulutodate(x.getNotAfter());
278
270
 
279
271
  const cnString = x.getSubjectString();
@@ -289,39 +281,25 @@ export default class Secret extends SteveModel {
289
281
  sans = [];
290
282
  }
291
283
 
292
- const certInfo = {
293
- issuer, notBefore, notAfter, cn, sans
284
+ return {
285
+ issuer, notAfter, cn, sans
294
286
  };
295
-
296
- return certInfo;
297
287
  }
298
288
 
299
289
  return null;
300
290
  }
301
291
 
302
- get cachedCertInfo() {
303
- if (!this._cachedCertInfo) {
304
- this._cachedCertInfo = this.certInfo;
305
- }
306
-
307
- return this._cachedCertInfo;
308
- }
309
-
310
292
  // use for + n more name display
311
293
  get unrepeatedSans() {
312
294
  if (this._type === TYPES.TLS ) {
313
- const certInfo = this.cachedCertInfo;
314
-
315
- if (certInfo?.sans?.filter) {
316
- const commonBases = certInfo?.sans
317
- .filter((name) => name.indexOf('*.') === 0 || name.indexOf('www.') === 0)
318
- .map((name) => name.substr(name.indexOf('.')));
319
- const displaySans = removeObjects(certInfo?.sans, commonBases);
295
+ if (this.certInfo?.sans?.filter) {
296
+ const commonBases = this.certInfo?.sans.filter((name) => name.indexOf('*.') === 0 || name.indexOf('www.') === 0).map((name) => name.substr(name.indexOf('.')));
297
+ const displaySans = removeObjects(this.certInfo?.sans, commonBases);
320
298
 
321
299
  return displaySans;
322
300
  }
323
301
 
324
- return certInfo?.sans?.array || certInfo?.sans || [];
302
+ return this.certInfo?.sans || [];
325
303
  }
326
304
 
327
305
  return null;
@@ -329,28 +307,16 @@ export default class Secret extends SteveModel {
329
307
 
330
308
  get timeTilExpiration() {
331
309
  if (this._type === TYPES.TLS) {
332
- const certInfo = this.cachedCertInfo;
333
-
334
- if (!certInfo?.notAfter) {
335
- return null;
336
- }
337
-
338
- const expiration = certInfo.notAfter;
310
+ const expiration = this.certInfo.notAfter;
339
311
  const timeThen = expiration.valueOf();
340
312
  const timeNow = Date.now();
341
313
 
342
- const timeTilExpiration = timeThen - timeNow;
343
-
344
- return timeTilExpiration < 0 ? 0 : timeTilExpiration;
314
+ return timeThen - timeNow;
345
315
  }
346
316
 
347
317
  return null;
348
318
  }
349
319
 
350
- get timeTilExpirationDate() {
351
- return this.timeTilExpiration > 0 ? this.cachedCertInfo?.notAfter?.valueOf() : null;
352
- }
353
-
354
320
  get decodedData() {
355
321
  const out = {};
356
322
 
@@ -391,69 +357,4 @@ export default class Secret extends SteveModel {
391
357
  return 'c-cluster-product-resource';
392
358
  }
393
359
  }
394
-
395
- get certLifetime() {
396
- if (this._type === TYPES.TLS) {
397
- const certInfo = this.cachedCertInfo;
398
-
399
- if (certInfo) {
400
- return diffFrom(day(certInfo.notBefore), day(certInfo.notAfter), (key, args) => this.t(key, args)).string;
401
- }
402
- }
403
-
404
- return null;
405
- }
406
-
407
- /**
408
- * Get the model `state` for secrets of type cert
409
- */
410
- get certState() {
411
- if (this._type !== TYPES.TLS) {
412
- return undefined;
413
- }
414
-
415
- if (typeof this.timeTilExpiration !== 'number' || this.timeTilExpiration > certExpiringPeriod ) {
416
- return '';
417
- } else if (this.timeTilExpiration > 0) {
418
- return STATES_ENUM.EXPIRING;
419
- } else {
420
- return STATES_ENUM.EXPIRED;
421
- }
422
- }
423
-
424
- /**
425
- * Get the model `state display` for secrets of type cert
426
- */
427
- get certStateDisplay() {
428
- if (this._type !== TYPES.TLS) {
429
- return undefined;
430
- }
431
-
432
- return stateDisplay(this.certState);
433
- }
434
-
435
- /**
436
- * Get the model `state background` for secrets of type cert
437
- */
438
- get certStateBackground() {
439
- if (this._type !== TYPES.TLS) {
440
- return undefined;
441
- }
442
-
443
- const color = colorForState(this.certState);
444
-
445
- return color.replace('text-', 'bg-');
446
- }
447
-
448
- cleanForSave(data, forNew) {
449
- const val = super.cleanForSave(data, forNew);
450
-
451
- // Secrets on create with _type will return validation error
452
- // Secrets on edit without _type will return http error
453
- if (forNew) {
454
- delete val._type;
455
- }
456
-
457
- return val;
458
- }
459
360
  }
@@ -649,20 +649,4 @@ export default class Workload extends WorkloadService {
649
649
 
650
650
  return matching(allInNamespace, selector);
651
651
  }
652
-
653
- cleanForSave(data) {
654
- const val = super.cleanForSave(data);
655
-
656
- // remove fields from containers
657
- val.spec?.template?.spec?.containers?.forEach((container) => {
658
- this.cleanContainerForSave(container);
659
- });
660
-
661
- // remove fields from initContainers
662
- val.spec?.template?.spec?.initContainers?.forEach((container) => {
663
- this.cleanContainerForSave(container);
664
- });
665
-
666
- return val;
667
- }
668
652
  }
@@ -320,22 +320,4 @@ export default class WorkloadService extends SteveModel {
320
320
 
321
321
  return { toSave, toRemove };
322
322
  }
323
-
324
- cleanForSave(data) {
325
- const val = super.cleanForSave(data);
326
-
327
- delete val.__active;
328
- delete val.type;
329
-
330
- return val;
331
- }
332
-
333
- cleanContainerForSave(container) {
334
- delete container.__active;
335
- delete container.active;
336
- delete container._init;
337
- delete container.error;
338
-
339
- return container;
340
- }
341
323
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rancher/shell",
3
- "version": "0.5.2",
3
+ "version": "1.2.0",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,6 @@
41
41
  "@nuxtjs/eslint-config-typescript": "6.0.1",
42
42
  "@nuxtjs/webpack-profile": "0.1.0",
43
43
  "@popperjs/core": "2.4.4",
44
- "@types/is-url": "1.2.30",
45
44
  "@types/node": "16.4.3",
46
45
  "@typescript-eslint/eslint-plugin": "4.33.0",
47
46
  "@typescript-eslint/parser": "4.33.0",
@@ -116,11 +115,11 @@
116
115
  "start-server-and-test": "1.13.1",
117
116
  "style-loader": "1.2.1",
118
117
  "ts-node": "8.10.2",
119
- "typescript": "4.5.5",
118
+ "typescript": "4.1.6",
120
119
  "url-parse": "1.5.10",
121
120
  "v-tooltip": "2.0.3",
122
121
  "vue": "2.7.14",
123
- "clipboard-polyfill": "4.0.1",
122
+ "vue-clipboard2": "0.3.1",
124
123
  "vue-codemirror": "4.0.6",
125
124
  "vue-js-modal": "1.3.35",
126
125
  "vue-resize": "0.4.5",
@@ -129,16 +128,16 @@
129
128
  "vue-shortkey": "3.1.7",
130
129
  "vue-template-compiler": "2.7.14",
131
130
  "vue-virtual-scroll-list": "^2.3.4",
131
+ "vue2-transitions": "0.3.0",
132
132
  "vuedraggable": "2.24.3",
133
133
  "vuex": "3.6.2",
134
134
  "webpack-bundle-analyzer": "4.5.0",
135
135
  "webpack-virtual-modules": "0.4.3",
136
- "xterm": "5.2.1",
137
- "xterm-addon-canvas": "^0.5.0",
138
- "xterm-addon-fit": "0.8.0",
139
- "xterm-addon-search": "0.13.0",
140
- "xterm-addon-web-links": "0.9.0",
141
- "xterm-addon-webgl": "0.16.0",
136
+ "xterm": "5.0.0",
137
+ "xterm-addon-fit": "0.6.0",
138
+ "xterm-addon-search": "0.10.0",
139
+ "xterm-addon-web-links": "0.7.0",
140
+ "xterm-addon-webgl": "0.13.0",
142
141
  "worker-loader": "3.0.8",
143
142
  "yarn": "1.22.18"
144
143
  },
@@ -151,8 +150,7 @@
151
150
  "qs": ">=6.7.3",
152
151
  "nth-check": ">=2.0.1",
153
152
  "follow-redirects": ">=1.14.7",
154
- "merge": ">=2.1.1",
155
- "semver": ">=7.5.2"
153
+ "merge": ">=2.1.1"
156
154
  },
157
155
  "nyc": {
158
156
  "extension": [
package/pages/about.vue CHANGED
@@ -9,6 +9,7 @@ import { downloadFile } from '@shell/utils/download';
9
9
  import { mapGetters } from 'vuex';
10
10
 
11
11
  export default {
12
+ layout: 'plain',
12
13
  components: { BackLink, Loading },
13
14
  mixins: [BackRoute],
14
15
  async fetch() {
@@ -3,6 +3,7 @@ import ResourceDetail from '@shell/components/ResourceDetail';
3
3
 
4
4
  export default {
5
5
  name: 'APIKeyCreate',
6
+ layout: 'plain',
6
7
  components: { ResourceDetail },
7
8
  };
8
9
  </script>
@@ -15,6 +15,7 @@ import CopyToClipboardText from '@shell/components/CopyToClipboardText';
15
15
  const API_ENDPOINT = '/v3';
16
16
 
17
17
  export default {
18
+ layout: 'plain',
18
19
  components: {
19
20
  CopyToClipboardText, BackLink, Banner, PromptChangePassword, Loading, ResourceTable, Principal
20
21
  },
@@ -29,6 +29,7 @@ import loadPlugins from '@shell/plugins/plugin';
29
29
 
30
30
  export default {
31
31
  name: 'Login',
32
+ layout: 'unauthenticated',
32
33
  components: {
33
34
  LabeledInput, AsyncButton, Checkbox, BrandImage, Banner, InfoBox, CopyCode, Password, LocaleSelector
34
35
  },
@@ -1,6 +1,8 @@
1
1
  <script>
2
2
 
3
3
  export default {
4
+ layout: 'unauthenticated',
5
+
4
6
  async asyncData({ redirect, store, router }) {
5
7
  await store.dispatch('auth/logout', null, { root: true });
6
8
  }
@@ -18,10 +18,6 @@ import Password from '@shell/components/form/Password';
18
18
  import { applyProducts } from '@shell/store/type-map';
19
19
  import BrandImage from '@shell/components/BrandImage';
20
20
  import { waitFor } from '@shell/utils/async';
21
- import { Banner } from '@components/Banner';
22
- import FormValidation from '@shell/mixins/form-validation';
23
- import isUrl from 'is-url';
24
- import { isLocalhost } from '@shell/utils/validators/setting';
25
21
 
26
22
  const calcIsFirstLogin = (store) => {
27
23
  const firstLoginSetting = store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.FIRST_LOGIN);
@@ -38,18 +34,13 @@ const calcMustChangePassword = async(store) => {
38
34
  };
39
35
 
40
36
  export default {
41
- mixins: [FormValidation],
37
+ layout: 'unauthenticated',
42
38
 
43
39
  data() {
44
40
  return {
45
41
  passwordOptions: [
46
42
  { label: this.t('setup.useRandom'), value: true },
47
43
  { label: this.t('setup.useManual'), value: false }],
48
- fvFormRuleSets: [{
49
- path: 'serverUrl',
50
- rootObject: this,
51
- rules: ['required', 'https', 'url', 'trailingForwardSlash']
52
- }]
53
44
  };
54
45
  },
55
46
 
@@ -87,7 +78,7 @@ export default {
87
78
  },
88
79
 
89
80
  components: {
90
- AsyncButton, LabeledInput, CopyToClipboard, Checkbox, RadioGroup, Password, BrandImage, Banner
81
+ AsyncButton, LabeledInput, CopyToClipboard, Checkbox, RadioGroup, Password, BrandImage
91
82
  },
92
83
 
93
84
  async asyncData({ route, req, store }) {
@@ -144,6 +135,8 @@ export default {
144
135
 
145
136
  if (serverUrlSetting?.value) {
146
137
  serverUrl = serverUrlSetting.value;
138
+ } else if ( process.server ) {
139
+ serverUrl = req.headers.host;
147
140
  } else {
148
141
  serverUrl = window.location.origin;
149
142
  }
@@ -198,10 +191,6 @@ export default {
198
191
  }
199
192
  }
200
193
 
201
- if (!isUrl(this.serverUrl) || this.fvGetPathErrors(['serverUrl']).length > 0) {
202
- return false;
203
- }
204
-
205
194
  return true;
206
195
  },
207
196
 
@@ -209,10 +198,6 @@ export default {
209
198
  const out = findBy(this.principals, 'me', true);
210
199
 
211
200
  return out;
212
- },
213
-
214
- showLocalhostWarning() {
215
- return isLocalhost(this.serverUrl);
216
201
  }
217
202
  },
218
203
 
@@ -280,10 +265,6 @@ export default {
280
265
  done() {
281
266
  this.$router.replace('/');
282
267
  },
283
-
284
- onServerUrlChange(value) {
285
- this.serverUrl = value.trim();
286
- },
287
268
  },
288
269
  };
289
270
  </script>
@@ -387,24 +368,10 @@ export default {
387
368
  />
388
369
  </p>
389
370
  <div class="mt-20">
390
- <Banner
391
- v-if="showLocalhostWarning"
392
- color="warning"
393
- :label="t('validation.setting.serverUrl.localhost')"
394
- />
395
- <Banner
396
- v-for="(err, i) in fvGetPathErrors(['serverUrl'])"
397
- :key="i"
398
- color="error"
399
- :label="err"
400
- />
401
371
  <LabeledInput
402
372
  v-model="serverUrl"
403
373
  :label="t('setup.serverUrl.label')"
404
374
  data-testid="setup-server-url"
405
- :rules="fvGetAndReportPathRules('serverUrl')"
406
- :required="true"
407
- @input="onServerUrlChange"
408
375
  />
409
376
  </div>
410
377
  </template>
@@ -17,14 +17,9 @@ function reply(err, code) {
17
17
  }
18
18
  }
19
19
 
20
- function isSaml($route) {
21
- const { query } = $route;
22
- const configQuery = get(query, 'config');
23
-
24
- return samlProviders.includes(configQuery);
25
- }
26
-
27
20
  export default {
21
+ layout: 'unauthenticated',
22
+
28
23
  async fetch({ store, route, redirect }) {
29
24
  const code = route.query[GITHUB_CODE];
30
25
  const stateStr = route.query[GITHUB_NONCE];
@@ -48,14 +43,9 @@ export default {
48
43
  try {
49
44
  parsed = JSON.parse(base64Decode((stateStr)));
50
45
  } catch (err) {
51
- if (isSaml(route)) {
52
- // This is an ok failure. SAML has no state string so a failure is fine (see similar check in mounted).
53
- // This whole file could be re-written with that in mind, but this change keeps things simple and fixes a breaking addition
54
- return;
55
- }
56
46
  const out = store.getters['i18n/t'](`login.error`);
57
47
 
58
- console.error('Failed to parse nonce', stateStr, err); // eslint-disable-line no-console
48
+ console.error('Failed to parse nonce'); // eslint-disable-line no-console
59
49
 
60
50
  redirect(`/auth/login?err=${ escape(out) }`);
61
51
 
@@ -127,8 +117,12 @@ export default {
127
117
  window.close();
128
118
  }
129
119
  } else {
120
+ const { query } = this.$route;
121
+
130
122
  if ( window.opener ) {
131
- if (isSaml(this.$route)) {
123
+ const configQuery = get(query, 'config');
124
+
125
+ if ( samlProviders.includes(configQuery) ) {
132
126
  if ( window.opener.window.onAuthTest ) {
133
127
  reply(null, null);
134
128
  } else {