@rancher/shell 0.5.3 → 1.2.1

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 (356) 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 +76 -74
  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/ClusterIconMenu.vue +9 -24
  22. package/components/CodeMirror.vue +16 -75
  23. package/components/CopyCode.vue +2 -6
  24. package/components/CopyToClipboard.vue +1 -2
  25. package/components/CopyToClipboardText.vue +9 -14
  26. package/components/CruResource.vue +0 -1
  27. package/components/EtcdInfoBanner.vue +5 -5
  28. package/components/ExplorerProjectsNamespaces.vue +1 -25
  29. package/components/FixedBanner.vue +0 -1
  30. package/components/IconOrSvg.vue +1 -1
  31. package/components/Markdown.vue +12 -16
  32. package/components/Questions/index.vue +1 -1
  33. package/components/ResourceDetail/Masthead.vue +9 -25
  34. package/components/ResourceDetail/index.vue +4 -1
  35. package/components/ResourceList/Masthead.vue +18 -1
  36. package/components/ResourceTable.vue +2 -14
  37. package/components/ResourceYaml.vue +5 -34
  38. package/components/SideNav.vue +65 -43
  39. package/components/SortableTable/THead.vue +9 -7
  40. package/components/SortableTable/index.vue +2 -1
  41. package/components/StatusTable.vue +1 -5
  42. package/components/TabTitle.vue +84 -0
  43. package/components/Tabbed/index.vue +0 -12
  44. package/components/YamlEditor.vue +0 -1
  45. package/components/__tests__/ChartPsp.test.ts +75 -0
  46. package/components/__tests__/CopyCode.test.ts +4 -5
  47. package/components/fleet/FleetBundles.vue +11 -5
  48. package/components/fleet/FleetRepos.vue +27 -62
  49. package/components/fleet/FleetResources.vue +1 -6
  50. package/components/fleet/FleetStatus.vue +3 -3
  51. package/components/fleet/FleetSummary.vue +30 -35
  52. package/components/form/ArrayList.vue +8 -1
  53. package/components/form/ArrayListSelect.vue +9 -9
  54. package/components/form/BannerSettings.vue +0 -3
  55. package/components/form/FileSelector.vue +0 -1
  56. package/components/form/KeyValue.vue +0 -2
  57. package/components/form/LabeledSelect.vue +0 -4
  58. package/components/form/Password.vue +1 -3
  59. package/components/form/Select.vue +1 -1
  60. package/components/form/SelectOrCreateAuthSecret.vue +4 -4
  61. package/components/form/__tests__/KeyValue.test.ts +1 -1
  62. package/components/formatter/Checked.vue +3 -11
  63. package/components/formatter/ClusterProvider.vue +18 -1
  64. package/components/formatter/FleetSummaryGraph.vue +11 -23
  65. package/components/formatter/LiveDate.vue +16 -0
  66. package/components/formatter/LiveDuration.vue +1 -1
  67. package/components/formatter/PercentageBar.vue +1 -1
  68. package/components/formatter/WorkloadDetailEndpoints.vue +22 -12
  69. package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
  70. package/components/nav/Group.vue +2 -2
  71. package/components/nav/Header.vue +2 -2
  72. package/components/nav/Jump.vue +9 -19
  73. package/components/nav/TopLevelMenu.vue +18 -66
  74. package/components/nav/Type.vue +7 -16
  75. package/components/nav/WindowManager/ContainerLogs.vue +19 -120
  76. package/components/nav/WindowManager/ContainerShell.vue +1 -6
  77. package/components/nav/WindowManager/index.vue +10 -11
  78. package/components/nav/__tests__/TopLevelMenu.test.ts +1 -34
  79. package/components/nav/__tests__/Type.test.ts +1 -31
  80. package/components/nuxt/nuxt-child.js +78 -14
  81. package/components/nuxt/nuxt.js +1 -1
  82. package/components/user.retention/user-retention-header.vue +34 -0
  83. package/composables/useI18n.ts +26 -0
  84. package/composables/useStore.ts +16 -0
  85. package/config/harvester-manager-types.js +0 -2
  86. package/config/home-links.js +32 -2
  87. package/config/private-label.js +0 -22
  88. package/config/product/explorer.js +4 -4
  89. package/config/product/fleet.js +1 -6
  90. package/config/product/legacy.js +1 -84
  91. package/config/product/manager.js +15 -8
  92. package/config/query-params.js +0 -1
  93. package/config/router.js +368 -385
  94. package/config/settings.ts +9 -2
  95. package/config/store.js +1 -1
  96. package/config/system-namespaces.js +0 -3
  97. package/config/table-headers.js +27 -47
  98. package/config/types.js +5 -0
  99. package/config/uiplugins.js +1 -1
  100. package/core/plugin-helpers.js +5 -3
  101. package/core/plugin-routes.ts +114 -56
  102. package/core/plugin.ts +10 -16
  103. package/core/plugins-loader.js +9 -7
  104. package/core/plugins.js +3 -0
  105. package/core/types-provisioning.ts +0 -7
  106. package/creators/app/init +0 -19
  107. package/detail/fleet.cattle.io.bundle.vue +1 -1
  108. package/detail/fleet.cattle.io.cluster.vue +1 -11
  109. package/detail/node.vue +0 -42
  110. package/detail/pod.vue +1 -68
  111. package/detail/provisioning.cattle.io.cluster.vue +8 -25
  112. package/detail/workload/index.vue +1 -15
  113. package/dialog/ScaleMachineDownDialog.vue +17 -34
  114. package/edit/auth/googleoauth.vue +5 -1
  115. package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
  116. package/edit/cloudcredential.vue +0 -2
  117. package/edit/fleet.cattle.io.gitrepo.vue +4 -3
  118. package/edit/management.cattle.io.project.vue +52 -1
  119. package/edit/management.cattle.io.setting.vue +2 -32
  120. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +1 -1
  121. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +2 -1
  122. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +1 -1
  123. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
  124. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
  125. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
  126. package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +125 -106
  127. package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
  128. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
  129. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
  130. package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
  131. package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
  132. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
  133. package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
  134. package/edit/provisioning.cattle.io.cluster/index.vue +40 -109
  135. package/edit/provisioning.cattle.io.cluster/rke2.vue +689 -152
  136. package/edit/service.vue +0 -12
  137. package/edit/token.vue +0 -1
  138. package/edit/workload/Upgrading.vue +2 -3
  139. package/edit/workload/index.vue +1 -2
  140. package/edit/workload/mixins/workload.js +1 -1
  141. package/initialize/App.js +71 -25
  142. package/initialize/client.js +162 -21
  143. package/initialize/index.js +124 -47
  144. package/initialize/layouts.ts +26 -0
  145. package/{components/templates → layouts}/blank.vue +1 -1
  146. package/{components/templates → layouts}/default.vue +98 -8
  147. package/{components/templates → layouts}/error.vue +19 -10
  148. package/{components/templates → layouts}/home.vue +1 -4
  149. package/{components/templates → layouts}/plain.vue +1 -4
  150. package/{components/templates → layouts}/standalone.vue +1 -1
  151. package/{components/templates → layouts}/unauthenticated.vue +1 -1
  152. package/list/catalog.cattle.io.app.vue +0 -1
  153. package/list/management.cattle.io.feature.vue +7 -1
  154. package/list/management.cattle.io.setting.vue +0 -1
  155. package/list/management.cattle.io.user.vue +25 -1
  156. package/list/node.vue +0 -1
  157. package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
  158. package/machine-config/azure.vue +37 -21
  159. package/machine-config/vmwarevsphere.vue +47 -42
  160. package/middleware/authenticated.js +19 -14
  161. package/mixins/auth-config.js +7 -2
  162. package/mixins/brand.js +41 -29
  163. package/mixins/fetch.server.js +73 -0
  164. package/mixins/labeled-form-element.ts +1 -6
  165. package/models/__tests__/management.cattle.io.node.ts +0 -85
  166. package/models/__tests__/namespace.test.ts +9 -49
  167. package/models/cluster/node.js +4 -4
  168. package/models/cluster.x-k8s.io.machine.js +1 -1
  169. package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
  170. package/models/fleet.cattle.io.cluster.js +0 -4
  171. package/models/fleet.cattle.io.gitrepo.js +13 -56
  172. package/models/management.cattle.io.cluster.js +3 -11
  173. package/models/management.cattle.io.kontainerdriver.js +0 -1
  174. package/models/management.cattle.io.node.js +14 -18
  175. package/models/management.cattle.io.nodepool.js +0 -17
  176. package/models/management.cattle.io.project.js +36 -0
  177. package/models/management.cattle.io.setting.js +7 -11
  178. package/models/management.cattle.io.user.js +65 -0
  179. package/models/namespace.js +1 -1
  180. package/models/pod.js +0 -20
  181. package/models/provisioning.cattle.io.cluster.js +9 -91
  182. package/models/secret.js +18 -126
  183. package/models/storage.k8s.io.storageclass.js +1 -1
  184. package/models/workload.js +0 -16
  185. package/models/workload.service.js +0 -18
  186. package/package.json +10 -12
  187. package/pages/about.vue +1 -0
  188. package/pages/account/create-key.vue +1 -0
  189. package/pages/account/index.vue +1 -0
  190. package/pages/auth/login.vue +1 -0
  191. package/pages/auth/logout.vue +2 -0
  192. package/pages/auth/setup.vue +4 -37
  193. package/pages/auth/verify.vue +8 -14
  194. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
  195. package/pages/c/_cluster/apps/charts/index.vue +58 -64
  196. package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
  197. package/pages/c/_cluster/apps/charts/install.vue +5 -5
  198. package/pages/c/_cluster/apps/index.vue +2 -0
  199. package/pages/c/_cluster/auth/index.vue +2 -0
  200. package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
  201. package/pages/c/_cluster/ecm/index.vue +2 -0
  202. package/pages/c/_cluster/explorer/index.vue +53 -56
  203. package/pages/c/_cluster/explorer/tools/index.vue +3 -171
  204. package/pages/c/_cluster/fleet/index.vue +1 -1
  205. package/pages/c/_cluster/index.vue +2 -0
  206. package/pages/c/_cluster/manager/pages/_page.vue +5 -4
  207. package/pages/c/_cluster/monitoring/index.vue +1 -17
  208. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -1
  209. package/pages/c/_cluster/settings/banners.vue +2 -0
  210. package/pages/c/_cluster/settings/brand.vue +2 -3
  211. package/pages/c/_cluster/settings/index.vue +2 -0
  212. package/pages/c/_cluster/settings/links.vue +3 -2
  213. package/pages/c/_cluster/settings/performance.vue +1 -0
  214. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
  215. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
  216. package/pages/c/_cluster/uiplugins/index.vue +2 -0
  217. package/pages/c/index.vue +9 -0
  218. package/pages/diagnostic.vue +2 -1
  219. package/pages/fail-whale.vue +1 -0
  220. package/pages/prefs.vue +1 -0
  221. package/pages/rio/mesh.vue +508 -0
  222. package/pages/support/index.vue +8 -2
  223. package/pkg/auto-import.js +1 -1
  224. package/plugins/axios.js +36 -0
  225. package/plugins/back-button.js +5 -3
  226. package/plugins/clean-html-directive.js +19 -1
  227. package/plugins/clean-tooltip-directive.js +1 -1
  228. package/plugins/codemirror-loader.js +1 -1
  229. package/plugins/codemirror.js +0 -41
  230. package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
  231. package/plugins/dashboard-store/actions.js +17 -16
  232. package/plugins/dashboard-store/classify.js +18 -1
  233. package/plugins/dashboard-store/getters.js +7 -70
  234. package/plugins/dashboard-store/index.js +12 -0
  235. package/plugins/dashboard-store/mutations.js +4 -0
  236. package/plugins/dashboard-store/resource-class.js +20 -65
  237. package/plugins/i18n.js +1 -1
  238. package/plugins/steve/__tests__/getters.spec.ts +48 -26
  239. package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
  240. package/plugins/steve/actions.js +37 -3
  241. package/plugins/steve/getters.js +24 -7
  242. package/plugins/steve/mutations.js +5 -2
  243. package/plugins/steve/norman-class.js +0 -19
  244. package/plugins/steve/steve-class.js +0 -22
  245. package/plugins/steve/subscribe.js +34 -13
  246. package/plugins/transitions.js +4 -0
  247. package/plugins/vue-clipboard2.js +4 -0
  248. package/rancher-components/Accordion/Accordion.vue +3 -2
  249. package/rancher-components/BadgeState/BadgeState.vue +3 -3
  250. package/rancher-components/Banner/Banner.test.ts +1 -5
  251. package/rancher-components/Banner/Banner.vue +2 -2
  252. package/rancher-components/Card/Card.vue +4 -4
  253. package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
  254. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
  255. package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
  256. package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
  257. package/rancher-components/Form/Radio/RadioButton.vue +13 -7
  258. package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
  259. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
  260. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
  261. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
  262. package/rancher-components/StringList/StringList.vue +8 -8
  263. package/rancher-components/components/Accordion/Accordion.vue +3 -2
  264. package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
  265. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
  266. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
  267. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
  268. package/rancher-components/components/StringList/StringList.test.ts +0 -270
  269. package/rancher-components/components/StringList/StringList.vue +18 -57
  270. package/scripts/extension/bundle +7 -19
  271. package/scripts/extension/helm/scripts/package +3 -11
  272. package/scripts/extension/parse-tag-name +4 -4
  273. package/scripts/extension/publish +9 -20
  274. package/scripts/publish-shell.sh +1 -11
  275. package/scripts/test-plugins-build.sh +9 -85
  276. package/store/catalog.js +1 -1
  277. package/store/features.js +0 -1
  278. package/store/i18n.js +0 -11
  279. package/store/index.js +13 -11
  280. package/store/prefs.js +38 -33
  281. package/store/type-map.js +82 -157
  282. package/tsconfig.default.json +46 -0
  283. package/tsconfig.json +9 -35
  284. package/types/shell/index.d.ts +407 -468
  285. package/utils/axios.js +19 -0
  286. package/utils/create-yaml.js +1 -5
  287. package/utils/custom-validators.js +2 -0
  288. package/utils/error.js +1 -16
  289. package/utils/monitoring.js +2 -37
  290. package/utils/nuxt.js +39 -18
  291. package/utils/object.js +0 -24
  292. package/utils/router.scrollBehavior.js +14 -12
  293. package/utils/socket.js +1 -0
  294. package/utils/time.js +1 -1
  295. package/utils/title.ts +3 -0
  296. package/utils/url.ts +1 -1
  297. package/utils/validators/formRules/__tests__/index.test.ts +4 -49
  298. package/utils/validators/formRules/index.ts +9 -12
  299. package/utils/validators/setting.js +10 -6
  300. package/vue.config.js +3 -24
  301. package/chart/monitoring/steps/uninstall-v1.vue +0 -135
  302. package/components/Certificates.vue +0 -164
  303. package/components/__tests__/CodeMirror.spec.ts +0 -99
  304. package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
  305. package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
  306. package/components/formatter/__tests__/Checked.test.ts +0 -19
  307. package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +0 -81
  308. package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
  309. package/composables/useCompactInput.ts +0 -20
  310. package/composables/useLabeledFormElement.ts +0 -138
  311. package/creators/app/files/.gitlab-ci.yml +0 -14
  312. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +0 -77
  313. package/edit/__tests__/service.test.ts +0 -89
  314. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
  315. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
  316. package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
  317. package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
  318. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
  319. package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
  320. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
  321. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
  322. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -147
  323. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
  324. package/mixins/v1-workload-metrics.js +0 -43
  325. package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
  326. package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
  327. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -241
  328. package/models/__tests__/secret.test.ts +0 -37
  329. package/models/__tests__/storage.k8s.io.storageclass.test.ts +0 -22
  330. package/models/__tests__/workload.test.ts +0 -91
  331. package/plugins/clean-html.js +0 -53
  332. package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
  333. package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
  334. package/plugins/index.js +0 -11
  335. package/plugins/steve/__tests__/resource-utils.test.ts +0 -159
  336. package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
  337. package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
  338. package/plugins/steve/resource-utils.ts +0 -38
  339. package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
  340. package/server/har-file.js +0 -183
  341. package/store/__tests__/type-map.test.ts +0 -1122
  342. package/tsconfig.paths.json +0 -18
  343. package/utils/azure.js +0 -24
  344. package/utils/clipboard.js +0 -5
  345. /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
  346. /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
  347. /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
  348. /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
  349. /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
  350. /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
  351. /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +0 -0
  352. /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
  353. /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
  354. /package/plugins/dashboard-store/__tests__/{actions.test.ts → actions.spec.ts} +0 -0
  355. /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
  356. /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,39 +239,10 @@ export default class ProvCluster extends SteveModel {
249
239
  return providers.includes(this.provisioner);
250
240
  }
251
241
 
252
- get isPrivateHostedProvider() {
253
- if (this.isHostedKubernetesProvider && this.mgmt && this.provisioner) {
254
- switch (this.provisioner.toLowerCase()) {
255
- case 'gke':
256
- return this.mgmt.spec?.gkeConfig?.privateClusterConfig?.enablePrivateEndpoint;
257
- case 'eks':
258
- return this.mgmt.spec?.eksConfig?.privateAccess;
259
- case 'aks':
260
- return this.mgmt.spec?.aksConfig?.privateCluster;
261
- }
262
- }
263
-
264
- return false;
265
- }
266
-
267
- get isLocal() {
268
- return this.mgmt?.isLocal;
269
- }
270
-
271
242
  get isImported() {
272
243
  // As of Rancher v2.6.7, this returns false for imported K3s clusters,
273
244
  // in which this.provisioner is `k3s`.
274
-
275
- const isImportedProvisioner = this.provisioner === 'imported';
276
- const isImportedSpecialCases = this.mgmt?.providerForEmberParam === 'import' ||
277
- // when imported cluster is GKE
278
- !!this.mgmt?.spec?.gkeConfig?.imported ||
279
- // or AKS
280
- !!this.mgmt?.spec?.aksConfig?.imported ||
281
- // or EKS
282
- !!this.mgmt?.spec?.eksConfig?.imported;
283
-
284
- return !this.isLocal && (isImportedProvisioner || (!this.isRke2 && !this.mgmt?.machineProvider && isImportedSpecialCases));
245
+ return this.provisioner === 'imported';
285
246
  }
286
247
 
287
248
  get isCustom() {
@@ -301,6 +262,8 @@ export default class ProvCluster extends SteveModel {
301
262
  }
302
263
 
303
264
  get isImportedK3s() {
265
+ // As of Rancher v2.6.7, this returns false for imported K3s clusters,
266
+ // in which this.provisioner is `k3s`.
304
267
  return this.isImported && this.isK3s;
305
268
  }
306
269
 
@@ -309,7 +272,7 @@ export default class ProvCluster extends SteveModel {
309
272
  }
310
273
 
311
274
  get isK3s() {
312
- return this.mgmt?.status ? this.mgmt?.status.provider === 'k3s' : (this.spec?.kubernetesVersion || '').includes('k3s') ;
275
+ return this.mgmt?.status?.provider === 'k3s';
313
276
  }
314
277
 
315
278
  get isRke2() {
@@ -317,7 +280,7 @@ export default class ProvCluster extends SteveModel {
317
280
  }
318
281
 
319
282
  get isRke1() {
320
- return !!this.mgmt?.spec?.rancherKubernetesEngineConfig || this.labels['provider.cattle.io'] === 'rke';
283
+ return !!this.mgmt?.spec?.rancherKubernetesEngineConfig;
321
284
  }
322
285
 
323
286
  get isHarvester() {
@@ -852,11 +815,11 @@ export default class ProvCluster extends SteveModel {
852
815
  get agentConfig() {
853
816
  // The one we want is the first one with no selector.
854
817
  // If there are multiple with no selector, that will fall under the unsupported message below.
855
- return this.spec.rkeConfig.machineSelectorConfig.find((x) => !x.machineLabelSelector)?.config;
818
+ return this.spec.rkeConfig.machineSelectorConfig.find((x) => !x.machineLabelSelector).config;
856
819
  }
857
820
 
858
821
  get cloudProvider() {
859
- return this.agentConfig?.['cloud-provider-name'];
822
+ return this.agentConfig['cloud-provider-name'];
860
823
  }
861
824
 
862
825
  get canClone() {
@@ -906,51 +869,6 @@ export default class ProvCluster extends SteveModel {
906
869
  }
907
870
 
908
871
  get hasError() {
909
- // Before we were just checking for this.status?.conditions?.some((condition) => condition.error === true)
910
- // but this is wrong as an error might exist but it might not be meaningful in the context of readiness of a cluster
911
- // which is what this 'hasError' is used for.
912
- // We now check if there's a ready condition after an error, which helps dictate the readiness of a cluster
913
- // Based on the findings in https://github.com/rancher/dashboard/issues/10043
914
- if (this.status?.conditions && this.status?.conditions.length) {
915
- // if there are errors, we compare with how recent the "Ready" condition is compared to that error, otherwise we just move on
916
- if (this.status?.conditions.some((c) => c.error === true)) {
917
- // there's no ready condition and has an error, mark it
918
- if (!this.status?.conditions.some((c) => c.type === 'Ready')) {
919
- return true;
920
- }
921
-
922
- const filteredConditions = this.status?.conditions.filter((c) => c.error === true || c.type === 'Ready');
923
- const mostRecentCondition = filteredConditions.reduce((a, b) => ((a.lastUpdateTime > b.lastUpdateTime) ? a : b));
924
-
925
- return mostRecentCondition.error;
926
- }
927
- }
928
-
929
- return false;
930
- }
931
-
932
- get namespaceLocation() {
933
- const localCluster = this.$rootGetters['management/byId'](MANAGEMENT.CLUSTER, LOCAL_CLUSTER);
934
-
935
- if (localCluster) {
936
- return {
937
- name: 'c-cluster-product-resource-id',
938
- params: {
939
- cluster: localCluster.id,
940
- product: this.$rootGetters['productId'],
941
- resource: NAMESPACE,
942
- id: this.namespace
943
- }
944
- };
945
- }
946
-
947
- return null;
948
- }
949
-
950
- // JSON Paths that should be folded in the YAML editor by default
951
- get yamlFolding() {
952
- return [
953
- 'spec.rkeConfig.machinePools.dynamicSchemaSpec',
954
- ];
872
+ return this.status?.conditions?.some((condition) => condition.error === true);
955
873
  }
956
874
  }
package/models/secret.js CHANGED
@@ -6,10 +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
- import { steveCleanForDownload } from '@shell/plugins/steve/resource-utils';
13
9
 
14
10
  export const TYPES = {
15
11
  OPAQUE: 'Opaque',
@@ -27,12 +23,7 @@ export const TYPES = {
27
23
  RKE_AUTH_CONFIG: 'rke.cattle.io/auth-config'
28
24
  };
29
25
 
30
- /** Class a cert as expiring if in eight days */
31
- const certExpiringPeriod = 1000 * 60 * 60 * 24 * 8;
32
-
33
26
  export default class Secret extends SteveModel {
34
- _cachedCertInfo;
35
-
36
27
  get hasSensitiveData() {
37
28
  return true;
38
29
  }
@@ -55,7 +46,7 @@ export default class Secret extends SteveModel {
55
46
  if (annotations[CERTMANAGER.ISSUER]) {
56
47
  return annotations[CERTMANAGER.ISSUER];
57
48
  } else if (this.isCertificate) {
58
- return this.cachedCertInfo?.issuer;
49
+ return this.certInfo?.issuer;
59
50
  } else {
60
51
  return null;
61
52
  }
@@ -63,7 +54,7 @@ export default class Secret extends SteveModel {
63
54
 
64
55
  get notAfter() {
65
56
  if (this.isCertificate) {
66
- return this.cachedCertInfo?.notAfter;
57
+ return this.certInfo?.notAfter;
67
58
  } else {
68
59
  return null;
69
60
  }
@@ -71,7 +62,7 @@ export default class Secret extends SteveModel {
71
62
 
72
63
  get cn() {
73
64
  if (this.isCertificate) {
74
- return this.cachedCertInfo?.cn;
65
+ return this.certInfo?.cn;
75
66
  }
76
67
 
77
68
  return null;
@@ -89,13 +80,14 @@ export default class Secret extends SteveModel {
89
80
  // use text-warning' or 'text-error' if cert is expiring within 8 days or is expired
90
81
  get dateClass() {
91
82
  if (this.isCertificate) {
92
- switch (this.certState) {
93
- case STATES_ENUM.EXPIRING:
83
+ const eightDays = 691200000;
84
+
85
+ if (this.timeTilExpiration > eightDays ) {
86
+ return '';
87
+ } else if (this.timeTilExpiration > 0) {
94
88
  return 'text-warning';
95
- case STATES_ENUM.EXPIRED:
89
+ } else {
96
90
  return 'text-error';
97
- default:
98
- return '';
99
91
  }
100
92
  }
101
93
 
@@ -256,7 +248,7 @@ export default class Secret extends SteveModel {
256
248
  // parse TLS certs and return issuer, notAfter, cn, sans
257
249
  get certInfo() {
258
250
  const pem = base64Decode(this.data['tls.crt']);
259
- let issuer, notBefore, notAfter, cn, sans, x;
251
+ let issuer, notAfter, cn, sans, x;
260
252
  const END_MARKER = '-----END CERTIFICATE-----';
261
253
 
262
254
  if (pem) {
@@ -274,7 +266,6 @@ export default class Secret extends SteveModel {
274
266
  const issuerString = x.getIssuerString();
275
267
 
276
268
  issuer = issuerString.slice(issuerString.indexOf('CN=') + 3);
277
- notBefore = r.zulutodate(x.getNotBefore());
278
269
  notAfter = r.zulutodate(x.getNotAfter());
279
270
 
280
271
  const cnString = x.getSubjectString();
@@ -290,39 +281,25 @@ export default class Secret extends SteveModel {
290
281
  sans = [];
291
282
  }
292
283
 
293
- const certInfo = {
294
- issuer, notBefore, notAfter, cn, sans
284
+ return {
285
+ issuer, notAfter, cn, sans
295
286
  };
296
-
297
- return certInfo;
298
287
  }
299
288
 
300
289
  return null;
301
290
  }
302
291
 
303
- get cachedCertInfo() {
304
- if (!this._cachedCertInfo) {
305
- this._cachedCertInfo = this.certInfo;
306
- }
307
-
308
- return this._cachedCertInfo;
309
- }
310
-
311
292
  // use for + n more name display
312
293
  get unrepeatedSans() {
313
294
  if (this._type === TYPES.TLS ) {
314
- const certInfo = this.cachedCertInfo;
315
-
316
- if (certInfo?.sans?.filter) {
317
- const commonBases = certInfo?.sans
318
- .filter((name) => name.indexOf('*.') === 0 || name.indexOf('www.') === 0)
319
- .map((name) => name.substr(name.indexOf('.')));
320
- 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);
321
298
 
322
299
  return displaySans;
323
300
  }
324
301
 
325
- return certInfo?.sans?.array || certInfo?.sans || [];
302
+ return this.certInfo?.sans || [];
326
303
  }
327
304
 
328
305
  return null;
@@ -330,28 +307,16 @@ export default class Secret extends SteveModel {
330
307
 
331
308
  get timeTilExpiration() {
332
309
  if (this._type === TYPES.TLS) {
333
- const certInfo = this.cachedCertInfo;
334
-
335
- if (!certInfo?.notAfter) {
336
- return null;
337
- }
338
-
339
- const expiration = certInfo.notAfter;
310
+ const expiration = this.certInfo.notAfter;
340
311
  const timeThen = expiration.valueOf();
341
312
  const timeNow = Date.now();
342
313
 
343
- const timeTilExpiration = timeThen - timeNow;
344
-
345
- return timeTilExpiration < 0 ? 0 : timeTilExpiration;
314
+ return timeThen - timeNow;
346
315
  }
347
316
 
348
317
  return null;
349
318
  }
350
319
 
351
- get timeTilExpirationDate() {
352
- return this.timeTilExpiration > 0 ? this.cachedCertInfo?.notAfter?.valueOf() : null;
353
- }
354
-
355
320
  get decodedData() {
356
321
  const out = {};
357
322
 
@@ -392,77 +357,4 @@ export default class Secret extends SteveModel {
392
357
  return 'c-cluster-product-resource';
393
358
  }
394
359
  }
395
-
396
- get certLifetime() {
397
- if (this._type === TYPES.TLS) {
398
- const certInfo = this.cachedCertInfo;
399
-
400
- if (certInfo) {
401
- return diffFrom(day(certInfo.notBefore), day(certInfo.notAfter), (key, args) => this.t(key, args)).string;
402
- }
403
- }
404
-
405
- return null;
406
- }
407
-
408
- /**
409
- * Get the model `state` for secrets of type cert
410
- */
411
- get certState() {
412
- if (this._type !== TYPES.TLS) {
413
- return undefined;
414
- }
415
-
416
- if (typeof this.timeTilExpiration !== 'number' || this.timeTilExpiration > certExpiringPeriod ) {
417
- return '';
418
- } else if (this.timeTilExpiration > 0) {
419
- return STATES_ENUM.EXPIRING;
420
- } else {
421
- return STATES_ENUM.EXPIRED;
422
- }
423
- }
424
-
425
- /**
426
- * Get the model `state display` for secrets of type cert
427
- */
428
- get certStateDisplay() {
429
- if (this._type !== TYPES.TLS) {
430
- return undefined;
431
- }
432
-
433
- return stateDisplay(this.certState);
434
- }
435
-
436
- /**
437
- * Get the model `state background` for secrets of type cert
438
- */
439
- get certStateBackground() {
440
- if (this._type !== TYPES.TLS) {
441
- return undefined;
442
- }
443
-
444
- const color = colorForState(this.certState);
445
-
446
- return color.replace('text-', 'bg-');
447
- }
448
-
449
- cleanForSave(data, forNew) {
450
- const val = super.cleanForSave(data, forNew);
451
-
452
- // Secrets on create with _type will return validation error
453
- // Secrets on edit without _type will return http error
454
- if (forNew) {
455
- delete val._type;
456
- }
457
-
458
- return val;
459
- }
460
-
461
- async cleanForDownload(yaml) {
462
- // secret resource contains the type attribute
463
- // ref: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/secret-v1/
464
- // ref: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
465
-
466
- return steveCleanForDownload(yaml, { rootKeys: ['id', 'links', 'actions'] });
467
- }
468
360
  }
@@ -84,7 +84,7 @@ export const PROVISIONER_OPTIONS = [
84
84
  export default class extends SteveModel {
85
85
  get provisionerDisplay() {
86
86
  const option = PROVISIONER_OPTIONS.find((o) => o.value === this.provisioner);
87
- const fallback = `${ this.provisioner } ${ this.t('persistentVolume.csi.suffix') }`;
87
+ const fallback = `${ this.provisioner } ${ this.t('persistentVolume.csi.drivers.suffix') }`;
88
88
 
89
89
  return option ? this.t(option.labelKey) : this.$rootGetters['i18n/withFallback'](`persistentVolume.csi.drivers.${ this.provisioner.replaceAll('.', '-') }`, null, fallback);
90
90
  }
@@ -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.3",
3
+ "version": "1.2.1",
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
  }