@rancher/shell 0.3.14 → 0.3.16

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 (400) hide show
  1. package/assets/images/providers/nutanix.svg +1 -0
  2. package/assets/translations/en-us.yaml +84 -3
  3. package/assets/translations/zh-hans.yaml +68 -26
  4. package/chart/gatekeeper.vue +2 -2
  5. package/chart/monitoring/alerting/index.vue +3 -3
  6. package/chart/monitoring/index.vue +2 -2
  7. package/chart/monitoring/prometheus/index.vue +1 -1
  8. package/chart/rancher-backup/index.vue +2 -2
  9. package/cloud-credential/generic.vue +1 -1
  10. package/cloud-credential/harvester.vue +2 -2
  11. package/components/AssignTo.vue +1 -1
  12. package/components/AwsComplianceBanner.vue +1 -1
  13. package/components/BackLink.vue +7 -0
  14. package/components/BannerGraphic.vue +1 -0
  15. package/components/BrandImage.vue +3 -3
  16. package/components/ClusterProviderIcon.vue +1 -1
  17. package/components/CommunityLinks.vue +2 -2
  18. package/components/ConsumptionGauge.vue +17 -2
  19. package/components/CruResource.vue +3 -2
  20. package/components/DashboardMetrics.vue +8 -0
  21. package/components/DetailTop.vue +1 -1
  22. package/components/EmberPage.vue +1 -0
  23. package/components/ExplorerMembers.vue +8 -8
  24. package/components/ExplorerProjectsNamespaces.vue +9 -9
  25. package/components/FixedBanner.vue +1 -1
  26. package/components/GlobalRoleBindings.vue +11 -11
  27. package/components/GrafanaDashboard.vue +14 -2
  28. package/components/GrowlManager.vue +1 -1
  29. package/components/HarvesterServiceAddOnConfig.vue +4 -3
  30. package/components/IconOrSvg.vue +10 -3
  31. package/components/LandingPagePreference.vue +2 -2
  32. package/components/MoveModal.vue +1 -1
  33. package/components/PodSecurityAdmission.vue +3 -3
  34. package/components/ProgressBarMulti.vue +2 -2
  35. package/components/PromptRemove.vue +52 -28
  36. package/components/PromptRestore.vue +3 -3
  37. package/components/Questions/index.vue +5 -5
  38. package/components/RelatedWorkloadsTable.vue +1 -1
  39. package/components/ResourceList/Masthead.vue +1 -1
  40. package/components/ResourceTable.vue +3 -3
  41. package/components/ResourceYaml.vue +1 -1
  42. package/components/RoleBindings.vue +2 -2
  43. package/components/SimpleBox.vue +1 -0
  44. package/components/SingleClusterInfo.vue +1 -1
  45. package/components/SortableTable/actions.js +3 -3
  46. package/components/SortableTable/advanced-filtering.js +7 -7
  47. package/components/SortableTable/filtering.js +1 -1
  48. package/components/SortableTable/index.vue +14 -10
  49. package/components/SortableTable/selection.js +5 -5
  50. package/components/SortableTable/sorting.js +5 -5
  51. package/components/Tabbed/index.vue +7 -7
  52. package/components/TableSparkLine.vue +1 -1
  53. package/components/Wizard.vue +11 -23
  54. package/components/__tests__/Collapse.spec.ts +1 -1
  55. package/components/__tests__/CruResource.test.ts +74 -0
  56. package/components/__tests__/SimpleBox.spec.ts +1 -1
  57. package/components/auth/RoleDetailEdit.vue +7 -3
  58. package/components/auth/SelectPrincipal.vue +3 -3
  59. package/components/fleet/FleetResources.vue +1 -1
  60. package/components/fleet/FleetStatus.vue +4 -4
  61. package/components/fleet/FleetSummary.vue +1 -1
  62. package/components/fleet/ForceDirectedTreeChart/chartIcons.js +1 -1
  63. package/components/fleet/ForceDirectedTreeChart/index.vue +1 -1
  64. package/components/form/ArrayList.vue +11 -3
  65. package/components/form/ArrayListSelect.vue +2 -2
  66. package/components/form/FileSelector.vue +6 -0
  67. package/components/form/GitPicker.vue +528 -0
  68. package/components/form/KeyValue.vue +82 -41
  69. package/components/form/LabeledSelect.vue +2 -2
  70. package/components/form/MatchExpressions.vue +2 -2
  71. package/components/form/Members/ClusterMembershipEditor.vue +1 -2
  72. package/components/form/Members/ClusterPermissionsEditor.vue +6 -5
  73. package/components/form/Members/MembershipEditor.vue +4 -4
  74. package/components/form/Members/ProjectMembershipEditor.vue +1 -2
  75. package/components/form/NameNsDescription.vue +13 -6
  76. package/components/form/Networking.vue +2 -2
  77. package/components/form/NodeScheduling.vue +1 -1
  78. package/components/form/PodAffinity.vue +7 -2
  79. package/components/form/ProjectMemberEditor.vue +4 -4
  80. package/components/form/ResourceQuota/Namespace.vue +2 -2
  81. package/components/form/ResourceQuota/NamespaceRow.vue +2 -2
  82. package/components/form/ResourceQuota/Project.vue +1 -1
  83. package/components/form/ResourceQuota/shared.js +2 -2
  84. package/components/form/ResourceSelector.vue +1 -1
  85. package/components/form/ResourceTabs/index.vue +1 -1
  86. package/components/form/RuleSelector.vue +1 -1
  87. package/components/form/SecretSelector.vue +4 -4
  88. package/components/form/Select.vue +2 -2
  89. package/components/form/SelectOrCreateAuthSecret.vue +3 -3
  90. package/components/form/ServiceNameSelect.vue +1 -1
  91. package/components/form/ServicePorts.vue +1 -1
  92. package/components/form/ShellInput.vue +1 -1
  93. package/components/form/SimpleSecretSelector.vue +4 -4
  94. package/components/form/Taints.vue +1 -1
  95. package/components/form/ValueFromResource.vue +3 -3
  96. package/components/form/WorkloadPorts.vue +8 -7
  97. package/components/form/__tests__/Error.test.ts +1 -1
  98. package/components/form/__tests__/KeyValue.test.ts +21 -0
  99. package/components/formatter/ClusterLink.vue +1 -1
  100. package/components/formatter/ClusterProvider.vue +13 -2
  101. package/components/formatter/Endpoints.vue +1 -1
  102. package/components/formatter/FleetSummaryGraph.vue +2 -2
  103. package/components/formatter/IngressTarget.vue +2 -2
  104. package/components/formatter/PodImages.vue +1 -1
  105. package/components/formatter/PrincipalGroupBindings.vue +1 -1
  106. package/components/formatter/ReceiverIcons.vue +3 -3
  107. package/components/formatter/ServiceType.vue +1 -1
  108. package/components/formatter/WorkloadDetailEndpoints.vue +1 -1
  109. package/components/formatter/WorkloadHealthScale.vue +1 -1
  110. package/components/formatter/__tests__/LiveDate.test.ts +1 -1
  111. package/components/graph/Bar.vue +1 -1
  112. package/components/graph/LinePlot.vue +3 -3
  113. package/components/nav/Group.vue +2 -2
  114. package/components/nav/Header.vue +5 -5
  115. package/components/nav/NamespaceFilter.vue +14 -14
  116. package/components/nav/TopLevelMenu.vue +76 -11
  117. package/components/nav/WindowManager/ContainerLogs.vue +2 -2
  118. package/components/nav/WindowManager/ContainerShell.vue +1 -1
  119. package/components/nav/WorkspaceSwitcher.vue +1 -1
  120. package/config/home-links.js +4 -4
  121. package/config/labels-annotations.js +8 -9
  122. package/config/pod-security-admission.ts +1 -1
  123. package/config/product/auth.js +5 -5
  124. package/config/product/explorer.js +14 -0
  125. package/config/store.js +2 -0
  126. package/config/table-headers.js +13 -13
  127. package/config/uiplugins.js +8 -1
  128. package/core/plugin-routes.ts +3 -2
  129. package/core/plugin.ts +3 -3
  130. package/core/plugins.js +7 -7
  131. package/creators/pkg/files/index.ts +1 -1
  132. package/detail/catalog.cattle.io.clusterrepo.vue +8 -1
  133. package/detail/cis.cattle.io.clusterscan.vue +3 -3
  134. package/detail/fleet.cattle.io.bundle.vue +1 -1
  135. package/detail/helm.cattle.io.projecthelmchart.vue +16 -29
  136. package/detail/management.cattle.io.user.vue +12 -12
  137. package/detail/namespace.vue +4 -4
  138. package/detail/networking.k8s.io.ingress.vue +3 -3
  139. package/detail/node.vue +2 -2
  140. package/detail/provisioning.cattle.io.cluster.vue +9 -10
  141. package/detail/service.vue +1 -1
  142. package/detail/workload/index.vue +3 -3
  143. package/dialog/AddProjectMemberDialog.vue +2 -2
  144. package/dialog/DrainNode.vue +1 -1
  145. package/dialog/GenericPrompt.vue +9 -5
  146. package/dialog/RotateEncryptionKeyDialog.vue +2 -2
  147. package/dialog/ScaleMachineDownDialog.vue +2 -2
  148. package/edit/__tests__/monitoring.coreos.com.prometheusrule.test.ts +56 -0
  149. package/edit/auth/azuread.vue +3 -3
  150. package/edit/autoscaling.horizontalpodautoscaler/index.vue +5 -5
  151. package/edit/cis.cattle.io.clusterscan.vue +5 -5
  152. package/edit/cloudcredential.vue +4 -4
  153. package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +1 -1
  154. package/edit/constraints.gatekeeper.sh.constraint/index.vue +4 -4
  155. package/edit/fleet.cattle.io.gitrepo.vue +6 -6
  156. package/edit/helm.cattle.io.projecthelmchart.vue +3 -3
  157. package/edit/logging-flow/index.vue +4 -4
  158. package/edit/logging.banzaicloud.io.output/index.vue +3 -3
  159. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +1 -1
  160. package/edit/logging.banzaicloud.io.output/providers/forward.vue +1 -1
  161. package/edit/logging.banzaicloud.io.output/providers/logz.vue +1 -1
  162. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +1 -1
  163. package/edit/logging.banzaicloud.io.output/providers/redis.vue +1 -1
  164. package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +1 -1
  165. package/edit/management.cattle.io.clusterroletemplatebinding.vue +1 -1
  166. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +1 -1
  167. package/edit/management.cattle.io.project.vue +3 -3
  168. package/edit/management.cattle.io.projectroletemplatebinding.vue +2 -2
  169. package/edit/management.cattle.io.setting.vue +1 -1
  170. package/edit/management.cattle.io.user.vue +2 -2
  171. package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +2 -2
  172. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
  173. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +1 -1
  174. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +3 -3
  175. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +5 -5
  176. package/edit/monitoring.coreos.com.prometheusrule/duration.js +1 -1
  177. package/edit/monitoring.coreos.com.prometheusrule/index.vue +8 -3
  178. package/edit/monitoring.coreos.com.receiver/auth.vue +2 -2
  179. package/edit/monitoring.coreos.com.receiver/tls.vue +3 -4
  180. package/edit/monitoring.coreos.com.receiver/types/__tests__/email.test.ts +53 -0
  181. package/edit/monitoring.coreos.com.receiver/types/email.vue +2 -0
  182. package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +3 -3
  183. package/edit/monitoring.coreos.com.receiver/types/webhook.add.vue +1 -1
  184. package/edit/monitoring.coreos.com.route.vue +2 -2
  185. package/edit/namespace.vue +21 -13
  186. package/edit/networking.k8s.io.ingress/Certificate.vue +2 -2
  187. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
  188. package/edit/networking.k8s.io.ingress/RulePath.vue +2 -2
  189. package/edit/networking.k8s.io.ingress/Rules.vue +2 -2
  190. package/edit/networking.k8s.io.ingress/index.vue +4 -4
  191. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +3 -3
  192. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  193. package/edit/persistentvolume/index.vue +4 -4
  194. package/edit/persistentvolumeclaim.vue +3 -3
  195. package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +1 -1
  196. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +2 -2
  197. package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
  198. package/edit/provisioning.cattle.io.cluster/index.vue +7 -7
  199. package/edit/provisioning.cattle.io.cluster/rke2.vue +28 -29
  200. package/edit/resources.cattle.io.backup.vue +2 -2
  201. package/edit/resources.cattle.io.restore.vue +3 -3
  202. package/edit/secret/generic.vue +1 -1
  203. package/edit/secret/index.vue +3 -3
  204. package/edit/service.vue +3 -21
  205. package/edit/serviceaccount.vue +2 -2
  206. package/edit/storage.k8s.io.storageclass/index.vue +4 -4
  207. package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +1 -1
  208. package/edit/token.vue +5 -5
  209. package/edit/workload/index.vue +1 -1
  210. package/edit/workload/mixins/workload.js +8 -8
  211. package/edit/workload/storage/ContainerMountPaths.vue +9 -9
  212. package/edit/workload/storage/Mount.vue +2 -2
  213. package/edit/workload/storage/csi/index.vue +1 -1
  214. package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
  215. package/edit/workload/storage/index.vue +6 -6
  216. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +2 -2
  217. package/initialize/client.js +8 -8
  218. package/initialize/index.js +1 -4
  219. package/layouts/default.vue +38 -11
  220. package/list/catalog.cattle.io.clusterrepo.vue +9 -1
  221. package/list/cis.cattle.io.clusterscan.vue +1 -1
  222. package/list/fleet.cattle.io.cluster.vue +2 -2
  223. package/list/group.principal.vue +1 -1
  224. package/list/helm.cattle.io.projecthelmchart.vue +2 -2
  225. package/list/management.cattle.io.cluster.vue +1 -1
  226. package/list/management.cattle.io.feature.vue +1 -1
  227. package/list/management.cattle.io.user.vue +2 -2
  228. package/list/node.vue +5 -5
  229. package/list/provisioning.cattle.io.cluster.vue +4 -5
  230. package/machine-config/amazonec2.vue +2 -2
  231. package/machine-config/digitalocean.vue +4 -4
  232. package/machine-config/linode.vue +4 -4
  233. package/machine-config/vmwarevsphere.vue +12 -12
  234. package/middleware/authenticated.js +7 -6
  235. package/mixins/brand.js +1 -1
  236. package/mixins/chart.js +6 -6
  237. package/mixins/fetch.client.js +2 -2
  238. package/mixins/form-validation.js +7 -7
  239. package/mixins/resource-fetch-namespaced.js +1 -1
  240. package/mixins/resource-fetch.js +2 -2
  241. package/models/apps.statefulset.js +2 -2
  242. package/models/batch.cronjob.js +1 -1
  243. package/models/catalog.cattle.io.app.js +4 -4
  244. package/models/cis.cattle.io.clusterscan.js +1 -1
  245. package/models/cis.cattle.io.clusterscanbenchmark.js +1 -1
  246. package/models/cis.cattle.io.clusterscanreport.js +1 -1
  247. package/models/cloudcredential.js +1 -1
  248. package/models/cluster/node.js +5 -5
  249. package/models/cluster.x-k8s.io.machinedeployment.js +2 -2
  250. package/models/fleet.cattle.io.gitrepo.js +3 -3
  251. package/models/group.principal.js +4 -4
  252. package/models/helm.cattle.io.projecthelmchart.js +2 -2
  253. package/models/logging.banzaicloud.io.clusterflow.js +2 -2
  254. package/models/logging.banzaicloud.io.flow.js +5 -5
  255. package/models/logging.banzaicloud.io.output.js +2 -2
  256. package/models/management.cattle.io.cluster.js +10 -14
  257. package/models/management.cattle.io.globalrole.js +4 -4
  258. package/models/management.cattle.io.node.js +2 -2
  259. package/models/management.cattle.io.nodepool.js +3 -3
  260. package/models/management.cattle.io.nodetemplate.js +4 -4
  261. package/models/management.cattle.io.project.js +2 -2
  262. package/models/management.cattle.io.roletemplate.js +1 -1
  263. package/models/management.cattle.io.setting.js +1 -1
  264. package/models/management.cattle.io.user.js +5 -5
  265. package/models/monitoring.coreos.com.receiver.js +9 -9
  266. package/models/namespace.js +1 -1
  267. package/models/networking.k8s.io.ingress.js +5 -5
  268. package/models/persistentvolume.js +3 -3
  269. package/models/pod.js +3 -3
  270. package/models/provisioning.cattle.io.cluster.js +39 -27
  271. package/models/rbac.authorization.k8s.io.clusterrole.js +2 -2
  272. package/models/rbac.authorization.k8s.io.role.js +3 -3
  273. package/models/secret.js +1 -1
  274. package/models/service.js +2 -2
  275. package/models/storage.k8s.io.storageclass.js +2 -2
  276. package/models/token.js +1 -1
  277. package/models/workload.js +6 -6
  278. package/models/workload.service.js +5 -21
  279. package/package.json +3 -2
  280. package/pages/about.vue +9 -9
  281. package/pages/account/index.vue +2 -2
  282. package/pages/auth/login.vue +25 -12
  283. package/pages/auth/setup.vue +4 -0
  284. package/pages/auth/verify.vue +6 -0
  285. package/pages/c/_cluster/apps/charts/index.vue +4 -4
  286. package/pages/c/_cluster/apps/charts/install.vue +28 -20
  287. package/pages/c/_cluster/auth/roles/index.vue +10 -10
  288. package/pages/c/_cluster/explorer/index.vue +41 -16
  289. package/pages/c/_cluster/explorer/tools/index.vue +8 -8
  290. package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +1 -1
  291. package/pages/c/_cluster/fleet/index.vue +11 -11
  292. package/pages/c/_cluster/monitoring/index.vue +1 -1
  293. package/pages/c/_cluster/settings/links.vue +3 -3
  294. package/pages/c/_cluster/settings/performance.vue +1 -1
  295. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +6 -6
  296. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +3 -3
  297. package/pages/c/_cluster/uiplugins/InstallDialog.vue +3 -3
  298. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
  299. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +3 -3
  300. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +6 -6
  301. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +4 -4
  302. package/pages/c/_cluster/uiplugins/index.vue +22 -19
  303. package/pages/diagnostic.vue +6 -6
  304. package/pages/home.vue +8 -3
  305. package/pages/prefs.vue +2 -2
  306. package/pages/rio/mesh.vue +3 -3
  307. package/pages/support/index.vue +10 -1
  308. package/pkg/auto-import.js +1 -1
  309. package/pkg/tsconfig.json +1 -0
  310. package/pkg/vue.config.js +1 -1
  311. package/plugins/axios.js +1 -1
  312. package/plugins/clean-html-directive.js +1 -1
  313. package/plugins/dashboard-store/__tests__/mutations.spec.js +4 -4
  314. package/plugins/dashboard-store/actions.js +4 -4
  315. package/plugins/dashboard-store/getters.js +1 -1
  316. package/plugins/dashboard-store/index.js +1 -1
  317. package/plugins/dashboard-store/mutations.js +2 -2
  318. package/plugins/dashboard-store/resource-class.js +8 -8
  319. package/plugins/i18n.js +1 -1
  320. package/plugins/plugin.js +5 -1
  321. package/plugins/steve/actions.js +25 -3
  322. package/plugins/steve/getters.js +3 -3
  323. package/plugins/steve/hybrid-class.js +1 -1
  324. package/plugins/steve/mutations.js +1 -1
  325. package/plugins/steve/performanceTesting.js +1 -1
  326. package/plugins/steve/resourceWatcher.js +1 -1
  327. package/plugins/steve/subscribe.js +6 -6
  328. package/plugins/steve/worker/web-worker.basic.js +1 -1
  329. package/promptRemove/management.cattle.io.project.vue +3 -3
  330. package/promptRemove/mixin/roleDeletionCheck.js +4 -4
  331. package/promptRemove/pod.vue +1 -1
  332. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +2 -2
  333. package/rancher-components/components/Form/Checkbox/Checkbox.vue +1 -1
  334. package/rancher-components/components/Form/Radio/RadioButton.test.ts +1 -1
  335. package/rancher-components/components/Form/Radio/RadioButton.vue +2 -2
  336. package/rancher-components/components/Form/Radio/RadioGroup.vue +2 -2
  337. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
  338. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +1 -1
  339. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +7 -7
  340. package/rancher-components/components/StringList/StringList.test.ts +10 -9
  341. package/rancher-components/components/StringList/StringList.vue +5 -5
  342. package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +1 -1
  343. package/store/action-menu.js +4 -4
  344. package/store/auth.js +40 -7
  345. package/store/aws.js +1 -1
  346. package/store/catalog.js +12 -11
  347. package/store/digitalocean.js +4 -4
  348. package/store/features.js +1 -0
  349. package/store/github.js +70 -213
  350. package/store/gitlab.js +159 -0
  351. package/store/growl.js +1 -1
  352. package/store/i18n.js +7 -7
  353. package/store/index.js +63 -22
  354. package/store/linode.js +1 -1
  355. package/store/plugins.js +5 -5
  356. package/store/pnap.js +1 -1
  357. package/store/prefs.js +6 -6
  358. package/store/resource-fetch.js +3 -3
  359. package/store/type-map.js +61 -42
  360. package/store/uiplugins.ts +2 -1
  361. package/store/wm.js +5 -4
  362. package/tsconfig.default.json +10 -0
  363. package/tsconfig.json +2 -9
  364. package/types/shell/index.d.ts +10 -2
  365. package/utils/__tests__/version.test.ts +28 -0
  366. package/utils/alertmanagerconfig.js +4 -4
  367. package/utils/array.ts +4 -4
  368. package/utils/async.ts +1 -1
  369. package/utils/auth.js +3 -3
  370. package/utils/axios.js +5 -5
  371. package/utils/cluster.js +4 -3
  372. package/utils/color.js +10 -0
  373. package/utils/create-yaml.js +4 -4
  374. package/utils/crypto/browserHashUtils.js +1 -1
  375. package/utils/crypto/browserMd5.js +1 -1
  376. package/utils/crypto/browserSha1.js +1 -1
  377. package/utils/crypto/browserSha256.js +1 -1
  378. package/utils/crypto/index.js +3 -3
  379. package/utils/favicon.js +2 -3
  380. package/utils/gatekeeper/util.js +3 -3
  381. package/utils/gc/gc.ts +2 -2
  382. package/utils/git.ts +92 -0
  383. package/utils/grafana.js +4 -4
  384. package/utils/monitoring.js +2 -2
  385. package/utils/nuxt.js +2 -2
  386. package/utils/object.js +5 -5
  387. package/utils/pod-security-admission.ts +1 -1
  388. package/utils/projectAndNamespaceFiltering.utils.ts +1 -1
  389. package/utils/select.js +2 -2
  390. package/utils/selector.js +2 -2
  391. package/utils/settings.ts +17 -2
  392. package/utils/socket.js +30 -6
  393. package/utils/sort.js +1 -1
  394. package/utils/string.js +1 -1
  395. package/utils/url.ts +1 -1
  396. package/utils/validators/formRules/index.ts +3 -3
  397. package/utils/validators/role-template.js +4 -4
  398. package/utils/version.js +14 -1
  399. package/vue.config.js +19 -13
  400. package/components/form/GithubPicker.vue +0 -390
package/store/catalog.js CHANGED
@@ -75,7 +75,7 @@ export const getters = {
75
75
  },
76
76
 
77
77
  charts(state, getters, rootState, rootGetters) {
78
- const repoKeys = getters.repos.map(x => x._key);
78
+ const repoKeys = getters.repos.map((x) => x._key);
79
79
  let cluster = rootGetters['currentCluster'];
80
80
 
81
81
  if ( rootGetters['currentProduct']?.inStore === 'management' ) {
@@ -120,7 +120,7 @@ export const getters = {
120
120
  });
121
121
 
122
122
  if ( includeHidden === false ) {
123
- matching = matching.filter(x => !x.hidden);
123
+ matching = matching.filter((x) => !x.hidden);
124
124
  }
125
125
 
126
126
  if ( !matching.length ) {
@@ -176,7 +176,7 @@ export const getters = {
176
176
  name = name.toLowerCase().trim();
177
177
  chartVersion = normalizeVersion(chartVersion);
178
178
 
179
- const matching = getters.charts.filter(chart => chart.chartName.toLowerCase().trim() === name);
179
+ const matching = getters.charts.filter((chart) => chart.chartName.toLowerCase().trim() === name);
180
180
 
181
181
  if ( !matching.length ) {
182
182
  return;
@@ -192,9 +192,9 @@ export const getters = {
192
192
  if ( wantVersion === 'latest' ) {
193
193
  version = chart.versions[0];
194
194
  } else if ( wantVersion === 'match' || wantVersion === 'matching' ) {
195
- version = chart.versions.find(v => normalizeVersion(v.version) === chartVersion);
195
+ version = chart.versions.find((v) => normalizeVersion(v.version) === chartVersion);
196
196
  } else {
197
- version = chart.versions.find(v => normalizeVersion(v.version) === wantVersion);
197
+ version = chart.versions.find((v) => normalizeVersion(v.version) === wantVersion);
198
198
  }
199
199
 
200
200
  if ( version ) {
@@ -205,7 +205,7 @@ export const getters = {
205
205
 
206
206
  versionProviding(state, getters) {
207
207
  return ({ repoType, repoName, gvr }) => {
208
- const matching = getters.charts.filter(chart => chart.provides.includes(gvr) );
208
+ const matching = getters.charts.filter((chart) => chart.provides.includes(gvr) );
209
209
 
210
210
  if ( !matching.length ) {
211
211
  return;
@@ -215,7 +215,7 @@ export const getters = {
215
215
  preferSameRepo(matching, repoType, repoName);
216
216
  }
217
217
 
218
- const version = matching[0].versions.find(version => version.annotations?.[CATALOG_ANNOTATIONS.PROVIDES] === gvr);
218
+ const version = matching[0].versions.find((version) => version.annotations?.[CATALOG_ANNOTATIONS.PROVIDES] === gvr);
219
219
 
220
220
  if ( version ) {
221
221
  return clone(version);
@@ -274,7 +274,7 @@ export const getters = {
274
274
  const allPaths = require.context('@shell/chart', true, /\.vue$/).keys();
275
275
 
276
276
  allPaths
277
- .filter(path => path.startsWith(stepsPath))
277
+ .filter((path) => path.startsWith(stepsPath))
278
278
  .forEach((path) => {
279
279
  try {
280
280
  steps.push({
@@ -354,6 +354,7 @@ export const actions = {
354
354
 
355
355
  // As per comment above, when there are no clusters this will be management. Store it such that it can be used for those cases
356
356
  commit('setInStore', inStore);
357
+ hash.cluster = hash.cluster.filter((repo) => !(repo?.metadata?.annotations?.[CATALOG_ANNOTATIONS.HIDDEN_REPO] === 'true'));
357
358
 
358
359
  commit('setRepos', hash);
359
360
 
@@ -399,7 +400,7 @@ export const actions = {
399
400
  },
400
401
 
401
402
  async refresh({ getters, commit, dispatch }) {
402
- const promises = getters.repos.map(x => x.refresh());
403
+ const promises = getters.repos.map((x) => x.refresh());
403
404
 
404
405
  // @TODO wait for repo state to indicate they're done once the API has that
405
406
 
@@ -567,7 +568,7 @@ function normalizeVersion(v) {
567
568
  }
568
569
 
569
570
  function filterCategories(categories) {
570
- categories = (categories || []).map(x => normalizeCategory(x));
571
+ categories = (categories || []).map((x) => normalizeCategory(x));
571
572
 
572
573
  const out = [];
573
574
 
@@ -650,7 +651,7 @@ export function filterAndArrangeCharts(charts, {
650
651
 
651
652
  if ( searchQuery ) {
652
653
  // The search filter doesn't match
653
- const searchTokens = searchQuery.split(/\s*[, ]\s*/).map(x => ensureRegex(x, false));
654
+ const searchTokens = searchQuery.split(/\s*[, ]\s*/).map((x) => ensureRegex(x, false));
654
655
 
655
656
  for ( const token of searchTokens ) {
656
657
  const chartDescription = c.chartDescription || '';
@@ -39,7 +39,7 @@ export const mutations = {
39
39
  };
40
40
 
41
41
  export const getters = {
42
- fromCache: state => ({ credentialId, key }) => {
42
+ fromCache: (state) => ({ credentialId, key }) => {
43
43
  return state.cache[credentialId]?.[key];
44
44
  },
45
45
  };
@@ -64,8 +64,8 @@ export const actions = {
64
64
  const regions = await dispatch('cachedCommand', { credentialId, command: 'regions' });
65
65
  const sizes = await dispatch('cachedCommand', { credentialId, command: 'sizes' });
66
66
 
67
- const regionInfo = regions.regions.find(x => x.slug === region);
68
- const available = sizes.sizes.filter(size => regionInfo.sizes.includes(size.slug)).map((size) => {
67
+ const regionInfo = regions.regions.find((x) => x.slug === region);
68
+ const available = sizes.sizes.filter((size) => regionInfo.sizes.includes(size.slug)).map((size) => {
69
69
  const match = size.slug.match(/^(so|gd|g|c|m|s).*-/);
70
70
  const plan = match ? match[1] : (size.slug.includes('-') ? 'standard' : 'other');
71
71
 
@@ -81,7 +81,7 @@ export const actions = {
81
81
  out.label = rootGetters['i18n/t']('cluster.machineConfig.digitalocean.sizeLabel', out);
82
82
 
83
83
  return out;
84
- }).filter(size => size.plan !== 'other');
84
+ }).filter((size) => size.plan !== 'other');
85
85
 
86
86
  return sortBy(available, ['planSort', 'memoryGb', 'vcpus', 'disk']);
87
87
  },
package/store/features.js CHANGED
@@ -30,6 +30,7 @@ export const RKE2 = create('rke2', true);
30
30
  export const UNSUPPORTED_STORAGE_DRIVERS = create('unsupported-storage-drivers', false);
31
31
  export const FLEET = create('continuous-delivery', true);
32
32
  export const HARVESTER = create('harvester', true);
33
+ export const HARVESTER_CONTAINER = create('harvester-baremetal-container-workload', false);
33
34
 
34
35
  // Not currently used.. no point defining ones we don't use
35
36
  // export const EMBEDDED_CLUSTER_API = create('embedded-cluster-api', true);
package/store/github.js CHANGED
@@ -1,252 +1,109 @@
1
- import dayjs from 'dayjs';
2
- import { addParam, parseLinkHeader } from '@shell/utils/url';
3
- import { addObjects, isArray } from '@shell/utils/array';
4
- import { GITHUB_REPOS, GITHUB_SCOPES, _DATE } from '@shell/config/local-storage';
1
+ const GITHUB_BASE_API = 'https://api.github.com';
2
+ const MAX_RESULTS = 100; // max number of results is 100
5
3
 
6
- const API_BASE = 'https://api.github.com/';
4
+ const fetchGithubAPI = async(endpoint) => {
5
+ const response = await fetch(`${ GITHUB_BASE_API }/${ endpoint }`);
7
6
 
8
- export const EXTENDED_SCOPES = ['repo'];
7
+ // If rate-limit is exceeded, we should wait until the rate limit is reset
8
+ if (response.status === 403) {
9
+ const resetTime = new Date(response.headers.get('X-RateLimit-Reset') * 1000);
9
10
 
10
- export const DOCKERFILE = /^Dockerfile(\..*)?$/i;
11
- export const YAML_FILE = /^.*\.ya?ml$/i;
12
-
13
- function getFromStorage(key) {
14
- if ( process.server ) {
15
- return null;
16
- }
17
-
18
- const cached = window.localStorage.getItem(key);
19
-
20
- if ( cached ) {
21
- try {
22
- const parsed = JSON.parse(cached);
23
-
24
- return parsed;
25
- } catch (e) {}
11
+ throw new Error(`Rate limit exceeded. Try again at ${ resetTime }`);
26
12
  }
27
- }
28
-
29
- function getCachedRepos() {
30
- const cached = getFromStorage(GITHUB_REPOS);
31
-
32
- return cached || [];
33
- }
34
-
35
- function getCachedScopes() {
36
- const cached = getFromStorage(GITHUB_SCOPES);
37
-
38
- return cached;
39
- }
40
13
 
41
- function hasCached() {
42
- if ( process.server ) {
43
- return false;
14
+ if (!response.ok) {
15
+ throw response;
44
16
  }
45
17
 
46
- const cached = window.localStorage.getItem(GITHUB_REPOS);
47
-
48
- return !!cached;
49
- }
50
-
51
- function cacheExpired() {
52
- if ( process.server ) {
53
- return false;
54
- }
55
-
56
- const updated = window.localStorage.getItem(GITHUB_REPOS + _DATE);
57
-
58
- if ( updated && dayjs().diff(updated) <= 60 * 60 * 1000 ) {
59
- return false;
60
- }
61
-
62
- return true;
63
- }
64
-
65
- function setCache(repos, scopes) {
66
- if ( repos ) {
67
- window.localStorage.setItem(GITHUB_REPOS, JSON.stringify(repos));
68
- window.localStorage.setItem(GITHUB_REPOS + _DATE, (new Date()).toISOString());
69
- }
70
-
71
- if ( scopes ) {
72
- window.localStorage.setItem(GITHUB_SCOPES, JSON.stringify(scopes));
73
- }
74
- }
75
-
76
- function forgetCache() {
77
- window.localStorage.removeItem(GITHUB_REPOS);
78
- window.localStorage.removeItem(GITHUB_REPOS + _DATE);
79
- window.localStorage.removeItem(GITHUB_SCOPES);
80
- }
81
-
82
- function proxifyUrl(url) {
83
- // Strip off absolute links to github API
84
- if ( url.startsWith(API_BASE) ) {
85
- url = url.substr(API_BASE.length);
86
- }
87
-
88
- // Add our proxy prefix
89
- url = `/v1/github/${ url.replace(/^\/+/, '') }`;
90
-
91
- // Less pages please
92
- addParam(url, 'per_page', 100);
93
-
94
- return url;
95
- }
96
-
97
- export const state = function() {
98
- return {
99
- repos: [],
100
- scopes: []
101
- };
18
+ return await response.json();
102
19
  };
103
20
 
21
+ export const getters = {};
22
+
104
23
  export const actions = {
105
- async apiList({ commit, dispatch }, {
106
- url = null,
107
- single = false,
108
- depaginate = true,
109
- onPageFn = null,
110
- objectKey = 'items',
111
- } = {}) {
112
- const out = [];
113
-
114
- url = proxifyUrl(url);
115
-
116
- while ( true ) {
117
- console.log('Github Request:', url); // eslint-disable-line no-console
118
- const res = await dispatch('rancher/request', { url }, { root: true });
119
- const links = parseLinkHeader(res._headers['link']);
120
-
121
- const scopes = res._headers['x-oauth-scopes'];
122
-
123
- if ( scopes ) {
124
- commit('setScopes', scopes.split(/\s*,\s*/));
24
+ async apiList(ctx, {
25
+ username, endpoint, repo, branch
26
+ }) {
27
+ try {
28
+ switch (endpoint) {
29
+ case 'branches': {
30
+ return await fetchGithubAPI(`repos/${ username }/${ repo }/branches?per_page=${ MAX_RESULTS }`);
125
31
  }
126
-
127
- if ( single ) {
128
- return res;
32
+ case 'repo': {
33
+ return await fetchGithubAPI(`repos/${ username }/${ repo }`);
129
34
  }
130
-
131
- addObjects(out, isArray(res) ? res : res[objectKey]);
132
-
133
- if ( onPageFn ) {
134
- onPageFn(out);
35
+ case 'commits': {
36
+ return await fetchGithubAPI(`repos/${ username }/${ repo }/commits?sha=${ branch }&sort=updated&per_page=${ MAX_RESULTS }`);
135
37
  }
136
-
137
- if ( depaginate && links.next ) {
138
- url = proxifyUrl(links.next);
139
- } else {
140
- break;
38
+ case 'recentRepos': {
39
+ return await fetchGithubAPI(`users/${ username }/repos?per_page=${ MAX_RESULTS }`);
141
40
  }
142
- }
41
+ case 'search': {
42
+ // Fetch for a specific branches
43
+ if (username && repo && branch) {
44
+ const response = await fetchGithubAPI(`repos/${ username }/${ repo }/branches/${ branch }`);
143
45
 
144
- return out;
145
- },
146
-
147
- forgetCache() {
148
- forgetCache();
149
- },
46
+ return [response];
47
+ }
150
48
 
151
- async fetchRecentRepos({ commit, dispatch }, { allowCache = true } = {}) {
152
- const cachedScopes = getCachedScopes();
49
+ // Fetch for repos
50
+ const response = await fetchGithubAPI(`search/repositories?q=repo:${ username }/${ repo }`);
153
51
 
154
- if ( cachedScopes ) {
155
- commit('setScopes', cachedScopes);
156
- }
157
-
158
- if ( allowCache && hasCached() ) {
159
- const cached = getCachedRepos();
160
-
161
- if ( cacheExpired() ) {
162
- dispatch('fetchRecentRepos', { allowCache: false });
52
+ if (response) {
53
+ return response.items;
54
+ }
163
55
  }
164
-
165
- return cached;
56
+ }
57
+ } catch (error) {
58
+ throw await error.json() ?? Error(`Error fetching ${ endpoint }`);
166
59
  }
167
-
168
- const res = await dispatch('apiList', { url: '/user/repos?sort=updated', depaginate: false });
169
- const more = await dispatch('apiList', { url: '/user/repos?affiliation=owner,collaborator' });
170
- const out = [...res, ...more];
171
-
172
- commit('setRepos', out);
173
-
174
- return out;
175
60
  },
176
61
 
177
- async searchRepos({ state, dispatch }, { search }) {
178
- if ( !search ) {
179
- return state.repos.slice();
180
- }
181
-
182
- const res = await dispatch('apiList', {
183
- url: `/search/repositories?q=${ escape(search) }`,
184
- depaginate: false
185
- });
62
+ async fetchRecentRepos({ commit, dispatch }, { username } = {}) {
63
+ const res = await dispatch('apiList', { username, endpoint: 'recentRepos' });
186
64
 
187
65
  return res;
188
66
  },
189
67
 
190
- async fetchRepoByUrl({ dispatch }, url) {
191
- url = url.replace(/.git$/i, '');
192
- url = url.replace(/https:\/\/github.com\//, '');
193
- url = `/repos/${ url }`;
194
- const res = await dispatch('apiList', { url, single: true });
68
+ async fetchRepoDetails({ commit, dispatch }, { username, repo } = {}) {
69
+ const res = await dispatch('apiList', {
70
+ username, endpoint: 'repo', repo: repo.name
71
+ });
195
72
 
196
73
  return res;
197
74
  },
198
75
 
199
- async fetchBranches({ dispatch }, { repo }) {
200
- const url = repo.branches_url.replace('{/branch}', '');
201
- const res = await dispatch('apiList', { url });
76
+ async fetchBranches({ commit, dispatch }, { repo, username }) {
77
+ const res = await dispatch('apiList', {
78
+ username, endpoint: 'branches', repo: repo.name
79
+ });
202
80
 
203
81
  return res;
204
82
  },
205
83
 
206
- async fetchBranch({ dispatch }, { repo, name }) {
207
- name = name || 'master';
208
-
209
- const url = repo.branches_url.replace('{/branch}', `/${ name }`);
210
- const res = await dispatch('apiList', { url, single: true });
84
+ async fetchCommits(ctx, { repo, username, branch }) {
85
+ const { dispatch } = ctx;
86
+ const res = await dispatch('apiList', {
87
+ username, endpoint: 'commits', repo: repo.name, branch: branch.name
88
+ });
211
89
 
212
90
  return res;
213
91
  },
214
-
215
- async fetchFiles({ dispatch }, { repo, branch, pattern = null }) {
216
- let url = repo.trees_url.replace('{/sha}', `/${ branch.commit.sha }`);
217
-
218
- url = addParam(url, 'recursive', 1);
219
-
220
- const res = await dispatch('apiList', { url, objectKey: 'tree' });
221
-
222
- if ( !pattern ) {
223
- return res;
92
+ async search({ dispatch }, { repo, username, branch }) {
93
+ try {
94
+ const res = await dispatch('apiList', {
95
+ username, endpoint: 'search', repo: repo?.name, branch: branch?.name
96
+ });
97
+
98
+ return {
99
+ ...res,
100
+ hasError: false,
101
+ };
102
+ } catch (error) {
103
+ return {
104
+ message: error.message,
105
+ hasError: true
106
+ };
224
107
  }
225
-
226
- const out = res.filter(file => file.type === 'blob' && file.path.match(pattern));
227
-
228
- return out;
229
- },
230
-
231
- async fetchFile({ dispatch }, { repo, branch, file }) {
232
- let url = repo.contents_url.replace('{+path}', file);
233
-
234
- url = addParam(url, 'ref', branch.commit.sha);
235
-
236
- const res = await dispatch('apiList', { url, single: true });
237
-
238
- return res;
239
- },
240
- };
241
-
242
- export const mutations = {
243
- setScopes(state, scopes) {
244
- state.scopes = scopes;
245
- setCache(null, scopes);
246
- },
247
-
248
- setRepos(state, repos) {
249
- state.repos = repos;
250
- setCache(repos);
251
108
  },
252
109
  };
@@ -0,0 +1,159 @@
1
+ import { isArray } from '@shell/utils/array';
2
+
3
+ const API_VERSION = 'v4';
4
+ const GITLAB_BASE_API = 'https://gitlab.com/api';
5
+ const TOKEN = '';
6
+ const MAX_RESULTS = 100; // max number of results is 100
7
+
8
+ const getResponse = (endpoint) => fetch(`${ GITLAB_BASE_API }/${ API_VERSION }/${ endpoint }${ TOKEN }`);
9
+
10
+ function fetchUserOrOrganization(endpoint) {
11
+ return Promise.all([
12
+ getResponse(`users/${ endpoint }`),
13
+ getResponse(`groups/${ endpoint }`),
14
+ ]).then((responses) => {
15
+ const found = responses.find((r) => r.ok);
16
+
17
+ if (!found) {
18
+ throw responses[0];
19
+ }
20
+
21
+ return found.json();
22
+ });
23
+ }
24
+
25
+ const fetchGitLabAPI = async(endpoint) => {
26
+ const response = await getResponse(endpoint);
27
+
28
+ // If rate-limit is exceeded, we should wait until the rate limit is reset
29
+ if (response.status === 403) {
30
+ const resetTime = new Date(response.headers.get('X-RateLimit-Reset') * 1000);
31
+
32
+ throw new Error(`Rate limit exceeded. Try again at ${ resetTime }`);
33
+ }
34
+
35
+ if (!response.ok) {
36
+ throw response;
37
+ }
38
+
39
+ return await response.json();
40
+ };
41
+
42
+ export const getters = {};
43
+
44
+ export const actions = {
45
+ async apiList(ctx, {
46
+ username, email, endpoint, repo, branch
47
+ }) {
48
+ try {
49
+ switch (endpoint) {
50
+ case 'branches': {
51
+ return await fetchGitLabAPI(`projects/${ username }%2F${ repo }/repository/branches?per_page=${ MAX_RESULTS }`);
52
+ }
53
+ case 'repo': {
54
+ return await fetchGitLabAPI(`projects/${ username }%2F${ repo }`);
55
+ }
56
+ case 'commits': {
57
+ return await fetchGitLabAPI(`projects/${ username }%2F${ repo }/repository/commits?ref_name=${ branch }&order_by=updated_at&per_page=${ MAX_RESULTS }`);
58
+ }
59
+ case 'recentRepos': {
60
+ return await fetchUserOrOrganization(`${ username }/projects?order_by=name&sort=asc&per_page=${ MAX_RESULTS }`);
61
+ }
62
+ case 'avatar': {
63
+ return await fetchGitLabAPI(`avatar?email=${ email }`);
64
+ }
65
+ case 'search': {
66
+ // Fetch for a specific branches
67
+ if (username && repo && branch) {
68
+ const response = await fetchGitLabAPI(`projects/${ repo }/repository/branches/${ branch }`);
69
+
70
+ return [response];
71
+ }
72
+
73
+ // Fetch for repos
74
+ const response = await fetchGitLabAPI(`search/repositories?q=repo:${ username }/${ repo }`);
75
+
76
+ if (response) {
77
+ return response.items;
78
+ }
79
+ }
80
+ }
81
+ } catch (error) {
82
+ throw await error.json() ?? Error(`Error fetching ${ endpoint }`);
83
+ }
84
+ },
85
+
86
+ async fetchRecentRepos({ commit, dispatch }, { username } = {}) {
87
+ const res = await dispatch('apiList', { username, endpoint: 'recentRepos' });
88
+
89
+ return res;
90
+ },
91
+
92
+ async fetchRepoDetails({ commit, dispatch }, { username, repo } = {}) {
93
+ const res = await dispatch('apiList', {
94
+ username, endpoint: 'repo', repo: repo.name
95
+ });
96
+
97
+ return res;
98
+ },
99
+
100
+ async fetchBranches({ commit, dispatch }, { repo, username }) {
101
+ const res = await dispatch('apiList', {
102
+ username, endpoint: 'branches', repo: repo.name
103
+ });
104
+
105
+ return res;
106
+ },
107
+
108
+ async fetchCommits(ctx, { repo, username, branch }) {
109
+ const { dispatch } = ctx;
110
+
111
+ const res = await dispatch('apiList', {
112
+ username, endpoint: 'commits', repo: repo.name, branch: branch.name
113
+ });
114
+
115
+ let commits = [];
116
+
117
+ // Get and cache Avatar URLs
118
+ if (res) {
119
+ commits = isArray(res) ? res : [res];
120
+
121
+ const avatars = {};
122
+
123
+ for (const c of commits) {
124
+ const found = avatars[c.author_email];
125
+
126
+ if (found) {
127
+ c.avatar_url = found;
128
+ } else {
129
+ const newAvatar = await dispatch('apiList', {
130
+ username, endpoint: 'avatar', email: c.author_email
131
+ });
132
+
133
+ c.avatar_url = newAvatar?.avatar_url;
134
+ avatars[c.author_email] = c.avatar_url;
135
+ }
136
+ }
137
+ }
138
+
139
+ return commits;
140
+ },
141
+
142
+ async search({ dispatch }, { repo, username, branch }) {
143
+ try {
144
+ const res = await dispatch('apiList', {
145
+ username, endpoint: 'search', repo: repo?.id, branch: branch?.name
146
+ });
147
+
148
+ return {
149
+ ...res,
150
+ hasError: false,
151
+ };
152
+ } catch (error) {
153
+ return {
154
+ message: error.message,
155
+ hasError: true
156
+ };
157
+ }
158
+ }
159
+ };
package/store/growl.js CHANGED
@@ -11,7 +11,7 @@ export const state = function() {
11
11
  };
12
12
 
13
13
  export const getters = {
14
- find: state => ({ key, val }) => {
14
+ find: (state) => ({ key, val }) => {
15
15
  return findBy(state.stack, key, val);
16
16
  }
17
17
  };
package/store/i18n.js CHANGED
@@ -58,7 +58,7 @@ export const getters = {
58
58
  return out;
59
59
  },
60
60
 
61
- t: state => (key, args, language) => {
61
+ t: (state) => (key, args, language) => {
62
62
  if (state.selected === NONE && !language) {
63
63
  return `%${ key }%`;
64
64
  }
@@ -110,7 +110,7 @@ export const getters = {
110
110
  }
111
111
  },
112
112
 
113
- exists: state => (key, language) => {
113
+ exists: (state) => (key, language) => {
114
114
  const locale = language || state.selected;
115
115
  const cacheKey = `${ locale }/${ key }`;
116
116
 
@@ -131,11 +131,11 @@ export const getters = {
131
131
  return false;
132
132
  },
133
133
 
134
- current: state => () => {
134
+ current: (state) => () => {
135
135
  return state.selected;
136
136
  },
137
137
 
138
- default: state => () => {
138
+ default: (state) => () => {
139
139
  return state.default;
140
140
  },
141
141
 
@@ -191,7 +191,7 @@ export const mutations = {
191
191
 
192
192
  // Add a locale to the list of available locales
193
193
  addLocale(state, { locale, label }) {
194
- const hasLocale = state.available.find(l => l === locale);
194
+ const hasLocale = state.available.find((l) => l === locale);
195
195
 
196
196
  if (!hasLocale) {
197
197
  state.available.push(locale);
@@ -203,7 +203,7 @@ export const mutations = {
203
203
 
204
204
  // Remove locale
205
205
  removeLocale(state, locale) {
206
- const index = state.available.findIndex(l => l === locale);
206
+ const index = state.available.findIndex((l) => l === locale);
207
207
 
208
208
  if (index !== -1) {
209
209
  state.available.splice(index, 1);
@@ -222,7 +222,7 @@ export const actions = {
222
222
  let selected = rootGetters['prefs/get']('locale');
223
223
 
224
224
  // We might be using a locale that is loaded by a plugin that is no longer loaded
225
- const exists = !!state.available.find(loc => loc === selected);
225
+ const exists = !!state.available.find((loc) => loc === selected);
226
226
 
227
227
  if ( !selected || !exists) {
228
228
  selected = state.default;