@rancher/shell 3.0.0-rc.2 → 3.0.0-rc.4

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 (323) hide show
  1. package/assets/styles/base/_variables.scss +12 -4
  2. package/assets/styles/global/_layout.scss +10 -1
  3. package/assets/styles/global/_tooltip.scss +13 -1
  4. package/assets/translations/en-us.yaml +62 -26
  5. package/assets/translations/zh-hans.yaml +6 -5
  6. package/chart/istio.vue +2 -0
  7. package/chart/monitoring/ClusterSelector.vue +2 -0
  8. package/chart/monitoring/StorageClassSelector.vue +4 -1
  9. package/chart/monitoring/index.vue +2 -0
  10. package/chart/rancher-backup/S3.vue +2 -0
  11. package/chart/rancher-backup/index.vue +2 -0
  12. package/cloud-credential/aws.vue +2 -0
  13. package/cloud-credential/azure.vue +2 -0
  14. package/cloud-credential/digitalocean.vue +2 -0
  15. package/cloud-credential/gcp.vue +2 -0
  16. package/cloud-credential/generic.vue +2 -0
  17. package/cloud-credential/harvester.vue +2 -0
  18. package/cloud-credential/linode.vue +2 -0
  19. package/cloud-credential/pnap.vue +2 -0
  20. package/cloud-credential/s3.vue +2 -0
  21. package/cloud-credential/vmwarevsphere.vue +2 -0
  22. package/components/ActionDropdown.vue +1 -1
  23. package/components/ActionMenu.vue +4 -1
  24. package/components/AppModal.vue +4 -1
  25. package/components/ButtonDropdown.vue +3 -0
  26. package/components/ButtonGroup.vue +2 -0
  27. package/components/ButtonMultiAction.vue +41 -0
  28. package/components/Carousel.vue +3 -0
  29. package/components/CodeMirror.vue +88 -71
  30. package/components/Collapse.vue +4 -1
  31. package/components/CollapsibleCard.vue +4 -1
  32. package/components/ContainerResourceLimit.vue +2 -0
  33. package/components/CopyCode.vue +8 -4
  34. package/components/CopyToClipboardText.vue +2 -0
  35. package/components/CruResource.vue +61 -61
  36. package/components/CruResourceFooter.vue +2 -0
  37. package/components/Dialog.vue +2 -0
  38. package/components/DisableAuthProviderModal.vue +4 -1
  39. package/components/EmberPage.vue +2 -0
  40. package/components/ExplorerProjectsNamespaces.vue +11 -8
  41. package/components/GlobalRoleBindings.vue +2 -0
  42. package/components/Import.vue +2 -1
  43. package/components/InputOrDisplay.vue +23 -18
  44. package/components/Loading.vue +4 -1
  45. package/components/LocaleSelector.vue +4 -2
  46. package/components/Markdown.vue +2 -0
  47. package/components/ModalWithCard.vue +2 -0
  48. package/components/MoveModal.vue +2 -0
  49. package/components/PodSecurityAdmission.vue +2 -0
  50. package/components/Questions/Array.vue +2 -0
  51. package/components/Questions/Boolean.vue +2 -0
  52. package/components/Questions/CloudCredential.vue +2 -0
  53. package/components/Questions/Enum.vue +2 -0
  54. package/components/Questions/Float.vue +2 -0
  55. package/components/Questions/Int.vue +2 -0
  56. package/components/Questions/QuestionMap.vue +4 -1
  57. package/components/Questions/Radio.vue +2 -0
  58. package/components/Questions/Reference.vue +2 -0
  59. package/components/Questions/String.vue +2 -0
  60. package/components/Questions/Yaml.vue +2 -0
  61. package/components/Questions/index.vue +2 -0
  62. package/components/ResourceCancelModal.vue +2 -0
  63. package/components/ResourceDetail/Masthead.vue +4 -3
  64. package/components/ResourceDetail/index.vue +17 -15
  65. package/components/ResourceTable.vue +2 -0
  66. package/components/ResourceYaml.vue +2 -0
  67. package/components/SelectIconGrid.vue +2 -0
  68. package/components/SimpleBox.vue +2 -0
  69. package/components/SortableTable/THead.vue +2 -0
  70. package/components/SortableTable/index.vue +17 -20
  71. package/components/StatusTable.vue +2 -0
  72. package/components/Tabbed/Tab.vue +2 -0
  73. package/components/Tabbed/index.vue +2 -0
  74. package/components/Wizard.vue +4 -0
  75. package/components/YamlEditor.vue +3 -1
  76. package/components/__tests__/ButtonMultiAction.test.ts +31 -0
  77. package/components/__tests__/ContainerResourceLimit.test.ts +35 -0
  78. package/components/auth/RoleDetailEdit.vue +2 -0
  79. package/components/auth/SelectPrincipal.vue +3 -1
  80. package/components/auth/login/ldap.vue +2 -0
  81. package/components/fleet/FleetStatus.vue +2 -2
  82. package/components/form/ArrayList.vue +16 -1
  83. package/components/form/ArrayListSelect.vue +2 -0
  84. package/components/form/ChangePassword.vue +2 -0
  85. package/components/form/ColorInput.vue +2 -0
  86. package/components/form/Command.vue +2 -0
  87. package/components/form/FileImageSelector.vue +2 -0
  88. package/components/form/FileSelector.vue +2 -0
  89. package/components/form/Footer.vue +2 -0
  90. package/components/form/GitPicker.vue +1 -0
  91. package/components/form/HealthCheck.vue +5 -3
  92. package/components/form/HookOption.vue +22 -18
  93. package/components/form/InputWithSelect.vue +3 -1
  94. package/components/form/KeyValue.vue +2 -0
  95. package/components/form/LabeledSelect.vue +13 -3
  96. package/components/form/Labels.vue +11 -13
  97. package/components/form/LifecycleHooks.vue +2 -0
  98. package/components/form/MatchExpressions.vue +2 -0
  99. package/components/form/Members/ClusterPermissionsEditor.vue +2 -0
  100. package/components/form/Members/MembershipEditor.vue +2 -0
  101. package/components/form/NameNsDescription.vue +4 -1
  102. package/components/form/Networking.vue +2 -0
  103. package/components/form/NodeAffinity.vue +4 -1
  104. package/components/form/Password.vue +2 -0
  105. package/components/form/PlusMinus.vue +2 -0
  106. package/components/form/PodAffinity.vue +4 -1
  107. package/components/form/Ports.vue +2 -0
  108. package/components/form/Probe.vue +8 -4
  109. package/components/form/ResourceQuota/NamespaceRow.vue +2 -0
  110. package/components/form/ResourceQuota/Project.vue +2 -0
  111. package/components/form/ResourceQuota/ProjectRow.vue +2 -0
  112. package/components/form/RuleSelector.vue +2 -0
  113. package/components/form/SecretSelector.vue +1 -0
  114. package/components/form/Security.vue +5 -2
  115. package/components/form/Select.vue +2 -1
  116. package/components/form/SelectOrCreateAuthSecret.vue +2 -0
  117. package/components/form/ServiceNameSelect.vue +2 -0
  118. package/components/form/ServicePorts.vue +2 -0
  119. package/components/form/ShellInput.vue +2 -0
  120. package/components/form/SimpleSecretSelector.vue +2 -0
  121. package/components/form/Taints.vue +2 -0
  122. package/components/form/Tolerations.vue +2 -0
  123. package/components/form/UnitInput.vue +2 -0
  124. package/components/form/ValueFromResource.vue +2 -0
  125. package/components/form/WorkloadPorts.vue +5 -3
  126. package/components/form/__tests__/HookOption.test.ts +28 -0
  127. package/components/form/__tests__/LabeledSelect.test.ts +42 -0
  128. package/components/form/__tests__/Probe.test.ts +12 -0
  129. package/components/form/__tests__/UnitInput.test.ts +68 -0
  130. package/components/formatter/AppSummaryGraph.vue +2 -2
  131. package/components/formatter/FleetSummaryGraph.vue +2 -2
  132. package/components/formatter/InternalExternalIP.vue +13 -15
  133. package/components/formatter/MachineSummaryGraph.vue +2 -2
  134. package/components/formatter/Scale.vue +2 -2
  135. package/components/nav/Header.vue +17 -141
  136. package/components/nav/HeaderPageActionMenu.vue +173 -0
  137. package/components/nav/Jump.vue +2 -0
  138. package/components/nav/NamespaceFilter.vue +7 -2
  139. package/components/nav/TopLevelMenu.vue +4 -4
  140. package/components/nav/Type.vue +28 -2
  141. package/components/nav/WindowManager/ContainerLogs.vue +2 -1
  142. package/components/nav/WindowManager/ContainerShell.vue +6 -12
  143. package/components/nav/WindowManager/index.vue +2 -0
  144. package/components/nav/__tests__/Type.test.ts +68 -24
  145. package/composables/useClickOutside.ts +81 -0
  146. package/composables/useUserRetentionValidation.test.ts +1 -1
  147. package/composables/useUserRetentionValidation.ts +1 -1
  148. package/config/product/cis.js +4 -3
  149. package/config/product/manager.js +1 -0
  150. package/config/router/routes.js +1 -1
  151. package/config/table-headers.js +0 -10
  152. package/config/uiplugins.js +186 -143
  153. package/config/version.js +10 -0
  154. package/core/{plugin-helpers.js → plugin-helpers.ts} +25 -7
  155. package/core/plugin-routes.ts +5 -6
  156. package/core/plugin.ts +30 -3
  157. package/detail/autoscaling.horizontalpodautoscaler/index.vue +2 -0
  158. package/detail/configmap.vue +2 -0
  159. package/detail/fleet.cattle.io.cluster.vue +2 -0
  160. package/detail/fleet.cattle.io.clustergroup.vue +2 -0
  161. package/detail/fleet.cattle.io.gitrepo.vue +2 -0
  162. package/detail/harvesterhci.io.management.cluster.vue +2 -0
  163. package/detail/helm.cattle.io.projecthelmchart.vue +6 -8
  164. package/detail/management.cattle.io.roletemplate.vue +4 -4
  165. package/detail/management.cattle.io.user.vue +2 -0
  166. package/detail/namespace.vue +2 -0
  167. package/detail/networking.k8s.io.ingress.vue +1 -0
  168. package/detail/node.vue +2 -0
  169. package/detail/provisioning.cattle.io.cluster.vue +2 -0
  170. package/detail/secret.vue +2 -0
  171. package/detail/service.vue +2 -0
  172. package/detail/workload/index.vue +1 -1
  173. package/dialog/AddClusterMemberDialog.vue +2 -0
  174. package/dialog/AddCustomBadgeDialog.vue +3 -1
  175. package/dialog/AddProjectMemberDialog.vue +2 -0
  176. package/dialog/AddonConfigConfirmationDialog.vue +2 -0
  177. package/dialog/DeactivateDriverDialog.vue +2 -0
  178. package/dialog/DiagnosticTimingsDialog.vue +2 -0
  179. package/dialog/DrainNode.vue +2 -0
  180. package/dialog/ForceMachineRemoveDialog.vue +2 -0
  181. package/dialog/GenericPrompt.vue +2 -0
  182. package/dialog/RollbackWorkloadDialog.vue +2 -0
  183. package/dialog/RotateCertificatesDialog.vue +2 -0
  184. package/dialog/RotateEncryptionKeyDialog.vue +2 -0
  185. package/dialog/SaveAsRKETemplateDialog.vue +2 -0
  186. package/dialog/ScaleMachineDownDialog.vue +2 -0
  187. package/dialog/ScalePoolDownDialog.vue +2 -0
  188. package/dialog/SloDialog.vue +2 -0
  189. package/edit/auth/ldap/config.vue +282 -280
  190. package/edit/auth/saml.vue +1 -4
  191. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +3 -3
  192. package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -2
  193. package/edit/catalog.cattle.io.clusterrepo.vue +2 -0
  194. package/edit/cis.cattle.io.clusterscan.vue +115 -97
  195. package/edit/cis.cattle.io.clusterscanprofile.vue +29 -31
  196. package/edit/cloudcredential.vue +2 -0
  197. package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +2 -0
  198. package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +2 -0
  199. package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +2 -0
  200. package/edit/constraints.gatekeeper.sh.constraint/index.vue +2 -0
  201. package/edit/fleet.cattle.io.cluster.vue +2 -0
  202. package/edit/fleet.cattle.io.clustergroup.vue +4 -1
  203. package/edit/fleet.cattle.io.gitrepo.vue +2 -0
  204. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +2 -0
  205. package/edit/logging-flow/Match.vue +2 -0
  206. package/edit/logging-flow/index.vue +10 -8
  207. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +1 -1
  208. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +1 -1
  209. package/edit/logging.banzaicloud.io.output/providers/redis.vue +3 -3
  210. package/edit/management.cattle.io.clusterroletemplatebinding.vue +1 -0
  211. package/edit/management.cattle.io.fleetworkspace.vue +4 -1
  212. package/edit/management.cattle.io.project.vue +2 -0
  213. package/edit/management.cattle.io.roletemplate.vue +1 -1
  214. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -0
  215. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +2 -0
  216. package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -0
  217. package/edit/namespace.vue +1 -0
  218. package/edit/networking.k8s.io.ingress/Certificate.vue +2 -0
  219. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -1
  220. package/edit/networking.k8s.io.ingress/Rule.vue +1 -0
  221. package/edit/networking.k8s.io.ingress/RulePath.vue +20 -23
  222. package/edit/networking.k8s.io.ingress/index.vue +1 -0
  223. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +1 -1
  224. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -0
  225. package/edit/node.vue +2 -0
  226. package/edit/persistentvolumeclaim.vue +1 -0
  227. package/edit/policy.poddisruptionbudget.vue +3 -1
  228. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +2 -0
  229. package/edit/provisioning.cattle.io.cluster/Labels.vue +2 -0
  230. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +2 -0
  231. package/edit/provisioning.cattle.io.cluster/import.vue +2 -0
  232. package/edit/provisioning.cattle.io.cluster/index.vue +2 -2
  233. package/edit/provisioning.cattle.io.cluster/rke2.vue +38 -13
  234. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +49 -0
  235. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +32 -65
  236. package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +2 -0
  237. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +2 -0
  238. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +2 -0
  239. package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +2 -0
  240. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +2 -0
  241. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +2 -0
  242. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +2 -0
  243. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +31 -32
  244. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +2 -0
  245. package/edit/resources.cattle.io.backup.vue +97 -99
  246. package/edit/resources.cattle.io.restore.vue +96 -98
  247. package/edit/secret/index.vue +2 -0
  248. package/edit/service.vue +12 -3
  249. package/edit/ui.cattle.io.navlink.vue +1 -0
  250. package/edit/workload/Job.vue +3 -2
  251. package/edit/workload/Upgrading.vue +1 -0
  252. package/edit/workload/__tests__/index.test.ts +9 -7
  253. package/edit/workload/index.vue +33 -16
  254. package/edit/workload/storage/ContainerMountPaths.vue +37 -97
  255. package/edit/workload/storage/awsElasticBlockStore.vue +1 -1
  256. package/edit/workload/storage/azureDisk.vue +1 -1
  257. package/edit/workload/storage/csi/driver.longhorn.io.vue +2 -0
  258. package/edit/workload/storage/ephemeralVolume/index.vue +2 -0
  259. package/edit/workload/storage/gcePersistentDisk.vue +1 -1
  260. package/edit/workload/storage/index.vue +38 -22
  261. package/edit/workload/storage/persistentVolumeClaim/index.vue +2 -0
  262. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +1 -0
  263. package/edit/workload/storage/vsphereVolume.vue +1 -1
  264. package/initialize/install-components.js +0 -12
  265. package/initialize/install-plugins.js +6 -7
  266. package/machine-config/azure.vue +2 -0
  267. package/machine-config/generic.vue +2 -0
  268. package/machine-config/vmwarevsphere.vue +2 -0
  269. package/mixins/fetch.client.js +2 -1
  270. package/mixins/resource-manager.js +1 -1
  271. package/models/cis.cattle.io.clusterscan.js +17 -16
  272. package/models/cis.cattle.io.clusterscanprofile.js +17 -0
  273. package/models/management.cattle.io.user.js +3 -3
  274. package/models/provisioning.cattle.io.cluster.js +2 -1
  275. package/models/steve-schema.ts +1 -1
  276. package/models/workload.js +2 -1
  277. package/package.json +6 -8
  278. package/pages/auth/login.vue +2 -1
  279. package/pages/c/_cluster/apps/charts/chart.vue +3 -1
  280. package/pages/c/_cluster/apps/charts/install.vue +5 -56
  281. package/pages/c/_cluster/auth/user.retention/index.vue +1 -1
  282. package/pages/c/_cluster/fleet/index.vue +0 -1
  283. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +1 -0
  284. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +2 -0
  285. package/pages/c/_cluster/settings/performance.vue +2 -2
  286. package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +45 -52
  287. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +2 -0
  288. package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +2 -0
  289. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +2 -0
  290. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +6 -3
  291. package/pages/c/_cluster/uiplugins/InstallDialog.vue +2 -0
  292. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +7 -17
  293. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +2 -0
  294. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +3 -6
  295. package/pages/c/_cluster/uiplugins/index.vue +93 -92
  296. package/pages/index.vue +10 -2
  297. package/pkg/vue.config.js +2 -0
  298. package/plugins/i18n.js +1 -1
  299. package/plugins/plugin.js +27 -19
  300. package/plugins/version.js +3 -13
  301. package/promptRemove/management.cattle.io.roletemplate.vue +3 -5
  302. package/promptRemove/pod.vue +2 -0
  303. package/rancher-components/Form/LabeledInput/LabeledInput.vue +14 -8
  304. package/rancher-components/Form/Radio/RadioButton.vue +0 -1
  305. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +17 -9
  306. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +4 -33
  307. package/rancher-components/StringList/StringList.vue +6 -15
  308. package/scripts/extension/bundle +1 -1
  309. package/scripts/extension/publish +174 -99
  310. package/store/catalog.js +0 -26
  311. package/store/growl.js +8 -5
  312. package/store/type-map.js +3 -2
  313. package/utils/cluster.js +9 -0
  314. package/utils/versions.ts +39 -0
  315. package/vue.config.js +5 -0
  316. package/components/form/PodSecurity.vue +0 -168
  317. package/components/formatter/Weight.vue +0 -147
  318. package/components/nuxt/nuxt-build-indicator.vue +0 -170
  319. package/components/nuxt/nuxt-child.js +0 -52
  320. package/components/nuxt/nuxt-error.vue +0 -128
  321. package/components/nuxt/nuxt-link.client.js +0 -17
  322. package/components/nuxt/nuxt-loading.vue +0 -165
  323. package/composables/useStore.ts +0 -16
package/vue.config.js CHANGED
@@ -74,6 +74,7 @@ const getProxyConfig = (proxyConfig) => ({
74
74
  '/meta': proxyMetaOpts(api), // Browser API UI
75
75
  '/v1-*': proxyOpts(api), // SAML, KDM, etc
76
76
  '/rancherversion': proxyPrimeOpts(api), // Rancher version endpoint
77
+ '/version': proxyPrimeOpts(api), // Rancher Kube version endpoint
77
78
  // These are for Ember embedding
78
79
  '/c/*/edit': proxyOpts('https://127.0.0.1:8000'), // Can't proxy all of /c because that's used by Vue too
79
80
  '/k/': proxyOpts('https://127.0.0.1:8000'),
@@ -362,6 +363,9 @@ const getVirtualModulesAutoImport = (dir) => {
362
363
  return new VirtualModulesPlugin(autoImportTypes);
363
364
  };
364
365
 
366
+ // Get current shell version
367
+ const shellPkgData = require(path.join(__dirname, 'package.json'));
368
+
365
369
  /**
366
370
  * DefinePlugin does string replacement within our code. We may want to consider replacing it with something else. In code we'll see something like
367
371
  * process.env.commit even though process and env aren't even defined objects. This could cause people to be mislead.
@@ -377,6 +381,7 @@ const createEnvVariablesPlugin = (routerBasePath, rancherEnv) => new webpack.Def
377
381
  'process.env.rancherEnv': JSON.stringify(rancherEnv),
378
382
  'process.env.harvesterPkgUrl': JSON.stringify(process.env.HARVESTER_PKG_URL),
379
383
  'process.env.api': JSON.stringify(api),
384
+ 'process.env.UI_EXTENSIONS_API_VERSION': JSON.stringify(shellPkgData.version),
380
385
  // Store the Router Base as env variable that we can use in `shell/config/router.js`
381
386
  'process.env.routerBase': JSON.stringify(routerBasePath),
382
387
  __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false',
@@ -1,168 +0,0 @@
1
- <script>
2
- import { RadioGroup } from '@components/Form/Radio';
3
- import ArrayList from '@shell/components/form/ArrayList';
4
- import KeyValue from '@shell/components/form/KeyValue';
5
- import { mapGetters } from 'vuex';
6
- import { LabeledInput } from '@components/Form/LabeledInput';
7
-
8
- export default {
9
- components: {
10
- RadioGroup,
11
- ArrayList,
12
- KeyValue,
13
- LabeledInput
14
- },
15
- props: {
16
- value: {
17
- type: Object,
18
- default: () => {
19
- return {};
20
- }
21
- },
22
- mode: {
23
- type: String,
24
- default: 'view'
25
- }
26
- },
27
-
28
- data() {
29
- const {
30
- shareProcessNamespace, securityContext = {}, hostPID, hostIPC
31
- } = this.value;
32
- const {
33
- runasNonRoot, runAsUser, runAsGroup, supplementalGroups, fsGroup, sysctls
34
- } = securityContext;
35
-
36
- return {
37
- shareProcessNamespace,
38
- hostPID,
39
- hostIPC,
40
- runasNonRoot,
41
- runAsUser,
42
- runAsGroup,
43
- supplementalGroups,
44
- fsGroup,
45
- sysctls
46
- };
47
- },
48
-
49
- computed: { ...mapGetters({ t: 'i18n/t' }) }
50
- };
51
- </script>
52
-
53
- <template>
54
- <div>
55
- <div class="row">
56
- <div class="col span-6">
57
- <RadioGroup
58
- v-model:value="shareProcessNamespace"
59
- name="shareProcessNamespace"
60
- :label="t('workload.container.security.shareProcessNamespace')"
61
- :labels="['No', 'Yes']"
62
- :options="[false, true]"
63
- :mode="mode"
64
- />
65
- </div>
66
- <div class="col span-6">
67
- <RadioGroup
68
- v-model:value="runasNonRoot"
69
- name="runasNonRoot"
70
- :label="t('workload.container.security.runAsNonRoot')"
71
- :options="[false, true]"
72
- :labels="[t('workload.container.security.runAsNonRootOptions.noOption'), t('workload.container.security.runAsNonRootOptions.yesOption')]"
73
- :mode="mode"
74
- />
75
- </div>
76
- </div>
77
-
78
- <div class="spacer" />
79
-
80
- <div class="row">
81
- <div class="col span-6">
82
- <LabeledInput
83
- v-model.number="runAsUser"
84
- :label="t('workload.container.security.runAsUser')"
85
- :mode="mode"
86
- />
87
- </div>
88
- <div class="col span-6">
89
- <LabeledInput
90
- v-model.number="runAsGroup"
91
- :label="t('workload.container.security.runAsGroup')"
92
- :mode="mode"
93
- />
94
- </div>
95
- </div>
96
-
97
- <div class="spacer" />
98
-
99
- <div class="row">
100
- <div class="col span-6">
101
- <h5 class="text-label">
102
- <t k="workload.container.security.supplementalGroups" />
103
- </h5>
104
- <ArrayList
105
- v-model:value="supplementalGroups"
106
- :add-label="t('workload.container.security.addGroupIDs')"
107
- :mode="mode"
108
- />
109
- </div>
110
- </div>
111
-
112
- <div class="spacer" />
113
-
114
- <div class="row">
115
- <div class="col span-6">
116
- <LabeledInput
117
- v-model.number="fsGroup"
118
- :label="t('workload.container.security.fsGroup')"
119
- :mode="mode"
120
- />
121
- </div>
122
- </div>
123
-
124
- <div class="spacer" />
125
-
126
- <div class="row">
127
- <div class="col span-6">
128
- <RadioGroup
129
- v-model:value="hostIPC"
130
- name="hostIPC"
131
- :label="t('workload.container.security.hostIPC')"
132
- :labels="['No', 'Yes']"
133
- :options="[false, true]"
134
- :mode="mode"
135
- />
136
- </div>
137
- <div class="col span-6">
138
- <RadioGroup
139
- v-model:value="hostPID"
140
- name="hostPID"
141
- :label="t('workload.container.security.hostPID')"
142
- :labels="['No', 'Yes']"
143
- :options="[false, true]"
144
- :mode="mode"
145
- />
146
- </div>
147
- </div>
148
-
149
- <div class="spacer" />
150
-
151
- <div class="row">
152
- <div class="col span-12">
153
- <KeyValue
154
- v-model:value="sysctls"
155
- :title="t('workload.container.security.sysctls')"
156
- :key-label="t('workload.container.security.sysctlsKey')"
157
- :mode="mode"
158
- >
159
- <template #title>
160
- <h3>
161
- {{ t('workload.container.security.sysctls') }}
162
- </h3>
163
- </template>
164
- </KeyValue>
165
- </div>
166
- </div>
167
- </div>
168
- </template>
@@ -1,147 +0,0 @@
1
- <script>
2
- import { LabeledInput } from '@components/Form/LabeledInput';
3
-
4
- export default {
5
- components: { LabeledInput },
6
-
7
- props: {
8
- value: {
9
- type: Number,
10
- default: 0,
11
- },
12
- row: {
13
- type: Object,
14
- required: true
15
- },
16
- col: {
17
- type: Object,
18
- default: () => {}
19
- },
20
- },
21
-
22
- data() {
23
- return { newPercent: null };
24
- },
25
-
26
- computed: {
27
- totalForApp() {
28
- return this.row.weightsOfApp;
29
- },
30
-
31
- desired() {
32
- const desired = this.row.weights.desired;
33
- const total = this.totalForApp.desired;
34
-
35
- if ( total === 0 ) {
36
- return 0;
37
- }
38
-
39
- return Math.round(desired / total * 1000) / 10;
40
- },
41
-
42
- current() {
43
- const current = this.row.weights.current;
44
- const total = this.totalForApp.current;
45
-
46
- if ( total === 0 ) {
47
- return 0;
48
- }
49
-
50
- return Math.round(current / total * 1000) / 10;
51
- },
52
-
53
- showDesired() {
54
- return this.current !== this.desired;
55
- },
56
-
57
- canAdjust() {
58
- return this.totalForApp.count > 1 && this.current !== 100;
59
- },
60
-
61
- newWeightValid() {
62
- const percent = this.newPercent;
63
-
64
- return percent >= 0 && percent <= 100;
65
- }
66
- },
67
-
68
- methods: {
69
- onShown() {
70
- setTimeout(() => {
71
- this.$refs.newPercent.focus();
72
- }, 250);
73
- },
74
-
75
- setWeight() {
76
- const newPercent = this.newPercent || 0;
77
-
78
- this.row.saveWeightPercent(newPercent);
79
- },
80
- }
81
- };
82
- </script>
83
-
84
- <template>
85
- <v-dropdown
86
- :class="{'hand': canAdjust}"
87
- placement="top"
88
- :open-group="row.id"
89
- :trigger="canAdjust ? 'click' : 'manual'"
90
- offset="1"
91
- @apply-show="onShown"
92
- >
93
- <div>
94
- <span
95
- v-if="totalForApp.count === 1"
96
- class="text-muted"
97
- >
98
- &mdash;
99
- </span>
100
- <span
101
- v-else
102
- v-trim-whitespace
103
- :class="{'text-muted': current === 0 && desired === 0}"
104
- >
105
- {{ current }}%
106
- </span>
107
- <div v-if="showDesired">
108
- <i class="icon icon-chevron-right" />
109
- {{ desired }}%
110
- </div>
111
- </div>
112
-
113
- <template #popper>
114
- <div
115
- v-if="canAdjust"
116
- class="text-center pb-5"
117
- >
118
- <form>
119
- <LabeledInput
120
- ref="newPercent"
121
- v-model.number="newPercent"
122
- label="Target"
123
- size="4"
124
- min="0"
125
- max="100"
126
- class="text-left"
127
- style="width: 100px;"
128
- >
129
- <template #suffix>
130
- <div class="addon">
131
- %
132
- </div>
133
- </template>
134
- </LabeledInput>
135
- <button
136
- type="submit"
137
- class="btn bg-primary btn-sm mt-20"
138
- :disabled="!newWeightValid"
139
- @click.stop.prevent="setWeight"
140
- >
141
- Set
142
- </button>
143
- </form>
144
- </div>
145
- </template>
146
- </v-dropdown>
147
- </template>
@@ -1,170 +0,0 @@
1
- <template>
2
- <transition appear>
3
- <div
4
- v-if="building"
5
- class="nuxt__build_indicator"
6
- :style="indicatorStyle"
7
- >
8
- <svg
9
- viewBox="0 0 96 72"
10
- version="1"
11
- xmlns="http://www.w3.org/2000/svg"
12
- >
13
- <g
14
- fill="none"
15
- fill-rule="evenodd"
16
- >
17
- <path d="M6 66h23l1-3 21-37L40 6 6 66zM79 66h11L62 17l-5 9 22 37v3zM54 31L35 66h38z" />
18
- <path
19
- d="M29 69v-1-2H6L40 6l11 20 3-6L44 3s-2-3-4-3-3 1-5 3L1 63c0 1-2 3 0 6 0 1 2 2 5 2h28c-3 0-4-1-5-2z"
20
- fill="#00C58E"
21
- />
22
- <path
23
- d="M95 63L67 14c0-1-2-3-5-3-1 0-3 0-4 3l-4 6 3 6 5-9 28 49H79a5 5 0 0 1 0 3c-2 2-5 2-5 2h16c1 0 4 0 5-2 1-1 2-3 0-6z"
24
- fill="#00C58E"
25
- />
26
- <path
27
- d="M79 69v-1-2-3L57 26l-3-6-3 6-21 37-1 3a5 5 0 0 0 0 3c1 1 2 2 5 2h40s3 0 5-2zM54 31l19 35H35l19-35z"
28
- fill="#FFF"
29
- fill-rule="nonzero"
30
- />
31
- </g>
32
- </svg>
33
- {{ animatedProgress }}%
34
- </div>
35
- </transition>
36
- </template>
37
-
38
- <script>
39
- export default {
40
- name: 'NuxtBuildIndicator',
41
- data() {
42
- return {
43
- building: false,
44
- progress: 0,
45
- animatedProgress: 0,
46
- reconnectAttempts: 0
47
- };
48
- },
49
- computed: {
50
- options: () => ({
51
- position: 'bottom-right', backgroundColor: '#2E495E', color: '#00C48D'
52
- }),
53
- indicatorStyle() {
54
- const [d1, d2] = this.options.position.split('-');
55
-
56
- return {
57
- [d1]: '20px',
58
- [d2]: '20px',
59
- 'background-color': this.options.backgroundColor,
60
- color: this.options.color
61
- };
62
- }
63
- },
64
- watch: {
65
- progress(val, oldVal) {
66
- // Average progress may decrease but ignore it!
67
- if (val < oldVal) {
68
- return;
69
- }
70
- // Cancel old animation
71
- clearInterval(this._progressAnimation);
72
- // Jump to edge immediately
73
- if (val < 10 || val > 90) {
74
- this.animatedProgress = val;
75
-
76
- return;
77
- }
78
- // Animate to value
79
- this._progressAnimation = setInterval(() => {
80
- const diff = this.progress - this.animatedProgress;
81
-
82
- if (diff > 0) {
83
- this.animatedProgress++;
84
- } else {
85
- clearInterval(this._progressAnimation);
86
- }
87
- }, 50);
88
- }
89
- },
90
- mounted() {
91
- if (EventSource === undefined) {
92
- return; // Unsupported
93
- }
94
- this.sseConnect();
95
- },
96
- beforeUnmount() {
97
- this.sseClose();
98
- clearInterval(this._progressAnimation);
99
- },
100
- methods: {
101
- sseConnect() {
102
- if (this._connecting) {
103
- return;
104
- }
105
- this._connecting = true;
106
- this.sse = new EventSource('/_loading/sse');
107
- this.sse.addEventListener('message', (event) => this.onSseMessage(event));
108
- },
109
- onSseMessage(message) {
110
- const data = JSON.parse(message.data);
111
-
112
- if (!data.states) {
113
- return;
114
- }
115
-
116
- this.progress = Math.round(data.states.reduce((p, s) => p + s.progress, 0) / data.states.length);
117
-
118
- if (!data.allDone) {
119
- this.building = true;
120
- } else {
121
- this.$nextTick(() => {
122
- this.building = false;
123
- this.animatedProgress = 0;
124
- this.progress = 0;
125
- clearInterval(this._progressAnimation);
126
- });
127
- }
128
- },
129
-
130
- sseClose() {
131
- if (this.sse) {
132
- this.sse.close();
133
- delete this.sse;
134
- }
135
- }
136
- }
137
- };
138
- </script>
139
-
140
- <style scoped>
141
- .nuxt__build_indicator {
142
- box-sizing: border-box;
143
- position: fixed;
144
- font-family: monospace;
145
- padding: 5px 10px;
146
- border-radius: 5px;
147
- box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.2);
148
- width: 88px;
149
- z-index: 2147483647;
150
- font-size: 16px;
151
- line-height: 1.2rem;
152
- }
153
- .v-enter-active, .v-leave-active {
154
- transition-delay: 0.2s;
155
- transition-property: all;
156
- transition-duration: 0.3s;
157
- }
158
- .v-leave-to {
159
- opacity: 0;
160
- transform: translateY(20px);
161
- }
162
- svg {
163
- display: inline-block;
164
- vertical-align: baseline;
165
- width: 1.1em;
166
- height: 0.825em;
167
- position: relative;
168
- top: 1px;
169
- }
170
- </style>
@@ -1,52 +0,0 @@
1
-
2
- export default {
3
- name: 'NuxtChild',
4
- functional: true,
5
- props: {
6
- nuxtChildKey: {
7
- type: String,
8
- default: ''
9
- },
10
- keepAlive: Boolean,
11
- keepAliveProps: {
12
- type: Object,
13
- default: undefined
14
- }
15
- },
16
- render(_, { parent, data, props }) {
17
- const h = parent.$createElement;
18
-
19
- data.nuxtChild = true;
20
- const _parent = parent;
21
- let depth = 0;
22
-
23
- while (parent) {
24
- if (parent.$vnode && parent.$vnode.data.nuxtChild) {
25
- depth++;
26
- }
27
- parent = parent.$parent;
28
- }
29
- data.nuxtChildDepth = depth;
30
-
31
- const listeners = {};
32
-
33
- const beforeEnter = listeners.beforeEnter;
34
-
35
- listeners.beforeEnter = (el) => {
36
- if (beforeEnter) {
37
- return beforeEnter.call(_parent, el);
38
- }
39
- };
40
-
41
- let routerView = h('routerView', data);
42
-
43
- if (props.keepAlive) {
44
- routerView = h('keep-alive', { props: props.keepAliveProps }, [routerView]);
45
- }
46
-
47
- // this needs to be a "transition" or another non-rendering component,
48
- // otherwise we will break pages like the charts wizard or the extensions main screen (DOM would render an additional element and break CSS)
49
- // we can deal with this later once we remove this component and <nuxt /> component
50
- return h('transition', { on: listeners }, [routerView]);
51
- }
52
- };
@@ -1,128 +0,0 @@
1
- <template>
2
- <div class="__nuxt-error-page">
3
- <div class="error">
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- width="90"
7
- height="90"
8
- fill="#DBE1EC"
9
- viewBox="0 0 48 48"
10
- >
11
- <path d="M22 30h4v4h-4zm0-16h4v12h-4zm1.99-10C12.94 4 4 12.95 4 24s8.94 20 19.99 20S44 35.05 44 24 35.04 4 23.99 4zM24 40c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z" />
12
- </svg>
13
-
14
- <div class="title">
15
- {{ message }}
16
- </div>
17
- <p
18
- v-if="statusCode === 404"
19
- class="description"
20
- >
21
- <a
22
- v-if="typeof $route === 'undefined'"
23
- class="error-link"
24
- href="/"
25
- />
26
- <router-link
27
- v-else
28
- class="error-link"
29
- to="/"
30
- >
31
- Back to the home page
32
- </router-link>
33
- </p>
34
-
35
- <p
36
- v-else
37
- class="description"
38
- >
39
- An error occurred while rendering the page. Check developer tools console for details.
40
- </p>
41
-
42
- <div class="logo">
43
- <a
44
- href="https://nuxtjs.org"
45
- target="_blank"
46
- rel="noopener"
47
- >Nuxt</a>
48
- </div>
49
- </div>
50
- </div>
51
- </template>
52
-
53
- <script>
54
- export default {
55
- name: 'NuxtError',
56
- props: {
57
- error: {
58
- type: Object,
59
- default: null
60
- }
61
- },
62
- computed: {
63
- statusCode() {
64
- return (this.error && this.error.statusCode) || 500;
65
- },
66
- message() {
67
- return this.error.message || 'Error';
68
- }
69
- },
70
- head() {
71
- return {
72
- title: this.message,
73
- meta: [
74
- {
75
- name: 'viewport',
76
- content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0'
77
- }
78
- ]
79
- };
80
- }
81
- };
82
- </script>
83
-
84
- <style>
85
- .__nuxt-error-page {
86
- padding: 1rem;
87
- background: #F7F8FB;
88
- color: #47494E;
89
- text-align: center;
90
- display: flex;
91
- justify-content: center;
92
- align-items: center;
93
- flex-direction: column;
94
- font-family: sans-serif;
95
- font-weight: 100 !important;
96
- -ms-text-size-adjust: 100%;
97
- -webkit-text-size-adjust: 100%;
98
- -webkit-font-smoothing: antialiased;
99
- position: absolute;
100
- top: 0;
101
- left: 0;
102
- right: 0;
103
- bottom: 0;
104
- }
105
- .__nuxt-error-page .error {
106
- max-width: 450px;
107
- }
108
- .__nuxt-error-page .title {
109
- font-size: 1.5rem;
110
- margin-top: 15px;
111
- color: #47494E;
112
- margin-bottom: 8px;
113
- }
114
- .__nuxt-error-page .description {
115
- color: #7F828B;
116
- line-height: 21px;
117
- margin-bottom: 10px;
118
- }
119
- .__nuxt-error-page a {
120
- color: #7F828B !important;
121
- text-decoration: none;
122
- }
123
- .__nuxt-error-page .logo {
124
- position: fixed;
125
- left: 12px;
126
- bottom: 12px;
127
- }
128
- </style>
@@ -1,17 +0,0 @@
1
- // TODO: #9541 Remove for Vue 3 migration
2
- /**
3
- * Prints a deprecation warning for any extensions that might be using NuxtLink
4
- * @param {string} aliasName The alias that will print the deprecation warning
5
- * @returns Functional component that prints a deprecation warning and renders a
6
- * `router-link` instead
7
- */
8
- export const nuxtLinkAlias = (aliasName) => {
9
- return {
10
- functional: true,
11
- render(createElement, context) {
12
- console.warn(`${ aliasName } is deprecated in Rancher Dashboard. Use 'router-link' instead.`); // eslint-disable-line no-console
13
-
14
- return createElement('router-link', context.data, context.children);
15
- }
16
- };
17
- };