@rancher/shell 0.3.0 → 0.3.2
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.
- package/assets/styles/global/_button.scss +5 -1
- package/assets/styles/global/_columns.scss +4 -0
- package/assets/styles/global/_gauges.scss +1 -1
- package/assets/styles/global/_layout.scss +5 -2
- package/assets/styles/global/_select.scss +1 -4
- package/assets/styles/themes/_dark.scss +5 -4
- package/assets/styles/themes/_light.scss +4 -3
- package/assets/styles/themes/_suse.scss +1 -1
- package/assets/styles/vendor/vue-select.scss +4 -3
- package/assets/translations/en-us.yaml +673 -73
- package/assets/translations/zh-hans.yaml +720 -207
- package/chart/monitoring/steps/uninstall-v1.vue +2 -2
- package/cloud-credential/azure.vue +23 -0
- package/cloud-credential/harvester.vue +25 -62
- package/cloud-credential/pnap.vue +80 -0
- package/components/.DS_Store +0 -0
- package/components/ActionMenu.vue +28 -7
- package/components/AdvancedSection.vue +9 -2
- package/components/Alert.vue +2 -2
- package/components/ButtonDropdown.vue +0 -2
- package/components/ButtonGroup.vue +1 -0
- package/components/CollapsibleCard.vue +0 -1
- package/components/CruResource.vue +41 -4
- package/components/DetailTop.vue +72 -4
- package/components/DisableAuthProviderModal.vue +106 -0
- package/{rancher-components/components/Utils/DraggableZone → components}/DraggableZone.vue +0 -0
- package/components/ExplorerMembers.vue +253 -30
- package/components/ExplorerProjectsNamespaces.vue +77 -33
- package/components/ExtensionPanel.vue +42 -0
- package/components/GrowlManager.vue +3 -3
- package/components/IconOrSvg.vue +178 -0
- package/components/LogItem.vue +69 -0
- package/components/PodSecurityAdmission.vue +302 -0
- package/components/PromptModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +69 -4
- package/components/ResourceDetail/index.vue +12 -5
- package/components/ResourceList/Masthead.vue +11 -1
- package/components/ResourceList/ResourceLoadingIndicator.vue +12 -2
- package/components/ResourceList/index.vue +66 -12
- package/components/ResourceList/resource-list.config.js +7 -0
- package/components/ResourceTable.vue +33 -6
- package/components/SimpleBox.vue +1 -1
- package/components/SortableTable/THead.vue +21 -14
- package/components/SortableTable/filtering.js +1 -1
- package/components/SortableTable/index.vue +21 -10
- package/components/SortableTable/selection.js +15 -3
- package/components/Tabbed/Tab.vue +1 -1
- package/components/Tabbed/index.vue +20 -15
- package/components/__tests__/.DS_Store +0 -0
- package/components/__tests__/AsyncButton.test.ts +140 -0
- package/components/__tests__/BackLink.test.ts +33 -0
- package/components/__tests__/ButtonGroup.test.ts +124 -0
- package/components/__tests__/ClusterBadge.test.ts +32 -0
- package/components/__tests__/CollapsibleCard.test.ts +64 -0
- package/components/__tests__/ConsumptionGauge.test.ts +88 -0
- package/components/__tests__/CruResource.test.ts +3 -2
- package/components/__tests__/FixedBanner.test.ts +129 -0
- package/components/__tests__/GrowlManager.test.ts +147 -0
- package/components/__tests__/NamespaceFilter.test.ts +33 -25
- package/components/__tests__/PercentageBar.test.ts +32 -0
- package/components/__tests__/PodSecurityAdmission.test.ts +398 -0
- package/components/auth/AuthBanner.vue +20 -10
- package/components/auth/RoleDetailEdit.vue +26 -17
- package/components/auth/SelectPrincipal.vue +36 -5
- package/components/form/ArrayList.vue +3 -35
- package/components/form/ArrayListGrouped.vue +13 -4
- package/components/form/ArrayListSelect.vue +5 -5
- package/components/form/Error.vue +8 -0
- package/components/form/KeyValue.vue +39 -7
- package/components/form/LabeledSelect.vue +5 -2
- package/components/form/Labels.vue +46 -16
- package/components/form/Members/ClusterPermissionsEditor.vue +17 -17
- package/components/form/Members/MembershipEditor.vue +12 -12
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/NodeScheduling.vue +1 -1
- package/components/form/Probe.vue +3 -3
- package/components/form/ResourceQuota/Project.vue +6 -6
- package/components/form/ResourceTabs/index.vue +24 -6
- package/components/form/Security.vue +7 -6
- package/components/form/Select.vue +3 -2
- package/components/form/SelectOrCreateAuthSecret.vue +22 -29
- package/components/form/ServicePorts.vue +8 -0
- package/components/form/WorkloadPorts.vue +7 -1
- package/components/form/__tests__/ArrayList.test.ts +74 -0
- package/components/form/__tests__/ArrayListGrouped.test.ts +6 -4
- package/components/formatter/Checked.vue +1 -1
- package/components/formatter/ClusterLink.vue +5 -0
- package/components/formatter/IconIsDefault.vue +2 -2
- package/components/formatter/InternalExternalIP.vue +11 -8
- package/components/formatter/LiveDuration.vue +78 -0
- package/components/formatter/WorkloadHealthScale.vue +5 -3
- package/components/nav/Header.vue +74 -7
- package/components/nav/NamespaceFilter.vue +146 -63
- package/components/nav/TopLevelMenu.vue +22 -19
- package/components/nav/WindowManager/ContainerLogs.vue +83 -126
- package/components/nav/WindowManager/ContainerShell.vue +9 -7
- package/components/nav/WindowManager/Window.vue +2 -0
- package/components/nav/WindowManager/index.vue +10 -0
- package/config/elemental-types.js +9 -0
- package/config/features.js +2 -0
- package/config/home-links.js +4 -1
- package/config/pod-security-admission.ts +82 -0
- package/config/product/apps.js +1 -1
- package/config/product/auth.js +6 -5
- package/config/product/backup.js +1 -1
- package/config/product/explorer.js +6 -6
- package/config/product/fleet.js +1 -1
- package/config/product/manager.js +6 -2
- package/config/query-params.js +1 -0
- package/config/secret.js +0 -1
- package/config/settings.ts +26 -9
- package/config/table-headers.js +22 -11
- package/config/types.js +4 -1
- package/config/uiplugins.js +3 -3
- package/content/docs/zh-hans/getting-started.md +113 -137
- package/content/docs/zh-hans/whats-new.md +8 -46
- package/core/plugin-helpers.js +171 -0
- package/core/plugin.ts +61 -1
- package/core/plugins.js +33 -0
- package/core/types.ts +128 -2
- package/creators/pkg/package-lock.json +37 -0
- package/creators/pkg/package.json +1 -1
- package/detail/catalog.cattle.io.app.vue +1 -1
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +35 -9
- package/detail/service.vue +2 -9
- package/detail/workload/index.vue +0 -1
- package/dialog/AddClusterMemberDialog.vue +22 -28
- package/dialog/AddProjectMemberDialog.vue +53 -9
- package/dialog/DiagnosticTimingsDialog.vue +8 -7
- package/dialog/DrainNode.vue +44 -48
- package/dialog/ForceMachineRemoveDialog.vue +5 -7
- package/dialog/GenericPrompt.vue +15 -20
- package/dialog/RollbackWorkloadDialog.vue +15 -46
- package/dialog/RotateCertificatesDialog.vue +5 -7
- package/dialog/RotateEncryptionKeyDialog.vue +5 -9
- package/dialog/SaveAsRKETemplateDialog.vue +5 -13
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/dialog/ScalePoolDownDialog.vue +121 -0
- package/edit/__tests__/management.cattle.io.setting.test.ts +3 -3
- package/edit/auth/azuread.vue +16 -16
- package/edit/auth/github.vue +8 -0
- package/edit/auth/googleoauth.vue +10 -1
- package/edit/auth/ldap/index.vue +10 -0
- package/edit/auth/oidc.vue +10 -0
- package/edit/auth/saml.vue +10 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +1 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +3 -0
- package/edit/cloudcredential.vue +3 -7
- package/edit/logging-flow/Match.vue +39 -8
- package/edit/logging-flow/index.vue +27 -4
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +107 -0
- package/edit/management.cattle.io.project.vue +8 -1
- package/edit/management.cattle.io.setting.vue +5 -2
- package/edit/management.cattle.io.user.vue +7 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +36 -8
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +2 -2
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +14 -6
- package/edit/namespace.vue +18 -4
- package/edit/networking.k8s.io.ingress/Certificate.vue +1 -0
- package/edit/networking.k8s.io.ingress/IngressClass.vue +8 -6
- package/edit/networking.k8s.io.ingress/RulePath.vue +12 -6
- package/edit/networking.k8s.io.ingress/index.vue +8 -6
- package/edit/persistentvolume/index.vue +30 -27
- package/edit/persistentvolume/plugins/cephfs.vue +29 -29
- package/edit/persistentvolume/plugins/csi.vue +102 -62
- package/edit/persistentvolume/plugins/fc.vue +19 -19
- package/edit/persistentvolume/plugins/iscsi.vue +45 -45
- package/edit/persistentvolume/plugins/rbd.vue +39 -39
- package/edit/persistentvolumeclaim.vue +78 -75
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -7
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +10 -1
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +87 -27
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +3 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +96 -0
- package/edit/provisioning.cattle.io.cluster/import.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +29 -6
- package/edit/provisioning.cattle.io.cluster/rke2.vue +445 -154
- package/edit/secret/index.vue +3 -7
- package/edit/service.vue +3 -1
- package/edit/storage.k8s.io.storageclass/index.vue +100 -16
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +114 -0
- package/edit/workload/__tests__/index.test.ts +98 -0
- package/edit/workload/index.vue +58 -8
- package/edit/workload/mixins/workload.js +107 -70
- package/edit/workload/storage/ContainerMountPaths.vue +0 -10
- package/edit/workload/storage/emptyDir.vue +88 -0
- package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
- package/edit/workload/storage/index.vue +8 -0
- package/edit/workload/storage/persistentVolumeClaim/index.vue +1 -1
- package/layouts/default.vue +57 -44
- package/list/__tests__/workload.test.ts +5 -2
- package/list/catalog.cattle.io.app.vue +1 -0
- package/list/cis.cattle.io.clusterscan.vue +1 -0
- package/list/fleet.cattle.io.bundle.vue +5 -6
- package/list/fleet.cattle.io.cluster.vue +6 -3
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +5 -6
- package/list/fleet.cattle.io.gitrepo.vue +4 -9
- package/list/helm.cattle.io.projecthelmchart.vue +1 -5
- package/list/logging.banzaicloud.io.clusterflow.vue +4 -1
- package/list/logging.banzaicloud.io.flow.vue +6 -5
- package/list/management.cattle.io.cluster.vue +1 -0
- package/list/management.cattle.io.feature.vue +3 -4
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +47 -0
- package/list/management.cattle.io.setting.vue +2 -2
- package/list/management.cattle.io.user.vue +4 -10
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +2 -7
- package/list/node.vue +8 -5
- package/list/persistentvolume.vue +3 -3
- package/list/persistentvolumeclaim.vue +3 -4
- package/list/provisioning.cattle.io.cluster.vue +18 -19
- package/list/service.vue +6 -14
- package/list/workload.vue +43 -38
- package/machine-config/azure.vue +429 -60
- package/machine-config/pnap.vue +288 -0
- package/mixins/auth-config.js +1 -3
- package/mixins/browser-tab-visibility.js +8 -14
- package/mixins/chart.js +1 -1
- package/mixins/create-edit-view/impl.js +4 -0
- package/mixins/create-edit-view/index.js +4 -2
- package/mixins/resource-fetch-namespaced.js +98 -0
- package/mixins/resource-fetch.js +79 -45
- package/mixins/resource-manager.js +1 -23
- package/models/apps.controllerrevision.js +7 -0
- package/models/apps.daemonset.js +18 -0
- package/models/apps.deployment.js +44 -0
- package/models/apps.replicaset.js +7 -0
- package/models/apps.statefulset.js +18 -0
- package/models/batch.job.js +7 -14
- package/models/cluster/node.js +10 -2
- package/models/cluster.x-k8s.io.machine.js +26 -4
- package/models/cluster.x-k8s.io.machinedeployment.js +12 -2
- package/models/event.js +7 -0
- package/models/logging.banzaicloud.io.flow.js +4 -0
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.clusterroletemplatebinding.js +1 -1
- package/models/management.cattle.io.globalrole.js +2 -2
- package/models/management.cattle.io.node.js +37 -2
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +4 -0
- package/models/management.cattle.io.project.js +30 -11
- package/models/management.cattle.io.setting.js +1 -1
- package/models/management.cattle.io.user.js +37 -1
- package/models/namespace.js +42 -5
- package/models/persistentvolume.js +14 -2
- package/models/pod.js +15 -0
- package/models/projectroletemplatebinding.js +7 -0
- package/models/provisioning.cattle.io.cluster.js +61 -10
- package/models/rke-machine.cattle.io.pnapmachinetemplate.js +15 -0
- package/models/service.js +14 -13
- package/models/storage.k8s.io.storageclass.js +33 -18
- package/models/workload.js +38 -7
- package/nuxt.config.js +27 -17
- package/package.json +7 -7
- package/pages/about.vue +14 -2
- package/pages/c/_cluster/apps/charts/index.vue +21 -3
- package/pages/c/_cluster/apps/charts/install.vue +59 -22
- package/pages/c/_cluster/auth/config/_id.vue +6 -0
- package/pages/c/_cluster/auth/config/index.vue +8 -6
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +1 -1
- package/pages/c/_cluster/auth/roles/index.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +51 -6
- package/pages/c/_cluster/longhorn/index.vue +1 -1
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +15 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/neuvector/index.vue +1 -1
- package/pages/c/_cluster/settings/performance.vue +48 -2
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +2 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +3 -0
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +42 -2
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -0
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +1 -0
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +2 -0
- package/pages/c/_cluster/uiplugins/index.vue +42 -3
- package/pages/diagnostic.vue +5 -4
- package/pages/home.vue +105 -30
- package/pages/prefs.vue +23 -12
- package/pages/rio/mesh.vue +1 -1
- package/pkg/dynamic-importer.lib.js +8 -0
- package/pkg/vue.config.js +4 -0
- package/plugins/dashboard-store/__tests__/mutations.spec.js +406 -0
- package/plugins/dashboard-store/actions.js +32 -25
- package/plugins/dashboard-store/getters.js +50 -33
- package/plugins/dashboard-store/mutations.js +134 -28
- package/plugins/dashboard-store/resource-class.js +37 -42
- package/plugins/steve/actions.js +30 -0
- package/plugins/steve/caches/resourceCache.js +60 -0
- package/plugins/steve/getters.js +44 -1
- package/plugins/steve/mutations.js +97 -36
- package/plugins/steve/resourceWatcher.js +277 -0
- package/plugins/steve/schema.utils.js +25 -0
- package/plugins/steve/subscribe.js +288 -115
- package/plugins/steve/worker/index.js +17 -0
- package/plugins/steve/worker/web-worker.advanced.js +302 -0
- package/plugins/steve/{web-worker.steve-sub-worker.js → worker/web-worker.basic.js} +3 -44
- package/rancher-components/Card/Card.vue +3 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
- package/rancher-components/StringList/StringList.test.ts +45 -420
- package/rancher-components/StringList/StringList.vue +1 -10
- package/rancher-components/components/Banner/Banner.test.ts +44 -0
- package/rancher-components/components/Banner/Banner.vue +130 -61
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +13 -22
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +8 -6
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +9 -9
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +0 -1
- package/rancher-components/components/StringList/StringList.test.ts +7 -7
- package/rancher-components/components/StringList/StringList.vue +21 -15
- package/scripts/test-plugins-build.sh +8 -0
- package/static/loading-indicator.html +1 -1
- package/store/action-menu.js +4 -3
- package/store/index.js +54 -3
- package/store/plugins.js +0 -17
- package/store/pnap.js +128 -0
- package/store/prefs.js +4 -2
- package/store/type-map.js +81 -13
- package/types/pod-security-admission.ts +36 -0
- package/types/shell/index.d.ts +497 -396
- package/utils/__tests__/object.test.ts +17 -1
- package/utils/__tests__/pod-security-admission.test.ts +61 -0
- package/utils/async.ts +36 -0
- package/utils/color.js +45 -0
- package/utils/crypto/browserHashUtils.js +18 -0
- package/utils/dynamic-importer.js +8 -0
- package/utils/install-redirect.js +1 -1
- package/utils/object.js +24 -0
- package/utils/pod-security-admission.ts +39 -0
- package/utils/socket.js +61 -24
- package/utils/string.js +2 -0
- package/utils/svg-filter.js +301 -0
- package/utils/time.js +49 -0
- package/utils/validators/cidr.js +4 -0
- package/utils/validators/formRules/__tests__/index.test.ts +23 -3
- package/utils/validators/formRules/index.ts +14 -0
- package/config/product/harvester-manager.js +0 -162
- package/edit/harvesterhci.io.management.cluster.vue +0 -153
- package/list/harvesterhci.io.management.cluster.vue +0 -241
- package/machine-config/harvester.vue +0 -693
- package/models/harvesterhci.io.management.cluster.js +0 -228
- package/pages/c/_cluster/harvesterManager/index.vue +0 -24
- package/rancher-components/Card/Card.test.ts +0 -39
- package/rancher-components/Utils/DraggableZone/DraggableZone.vue +0 -181
- package/rancher-components/Utils/DraggableZone/index.ts +0 -1
- package/rancher-components/components/Utils/DraggableZone/index.ts +0 -1
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: 开始使用
|
|
3
3
|
sideToc: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# 开始使用
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
本指南提供了 UI 的基本介绍。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
如果你以前使用的是 Cluster Manager UI,请查看下面的指南,了解在新的 UI 中你可以在哪里访问相应的功能。
|
|
11
11
|
|
|
12
12
|
## 首页
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
你可以从主页和首选项页面来改变你登录时的位置。要访问用户偏好,请点击右上方的用户头像图标,并从菜单中选择'偏好'。
|
|
14
|
+
首次登录 Rancher 时,你会访问新的主页。这里包括了许多信息卡片。你可以使用 <i class="icon icon-close doc-icon"></i> 图标来关闭这些卡片。如果要恢复隐藏的卡片,请单击右上方的 <i class="icon icon-actions doc-icon"></i> 图标,然后选择 "恢复隐藏的卡片"。
|
|
17
15
|
|
|
16
|
+
你可以从主页和偏好设置页面改变登录时显示的页面。要访问用户偏好设置页面,请单击右上角的用户头像图标,然后从菜单中选择“偏好设置”。
|
|
18
17
|
### 顶层菜单
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
新的滑入式菜单让你能快速访问集群和应用程序。点击 <svg class="doc-icon" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /></svg> 图标(左上角)即可进行访问。
|
|
20
|
+
|
|
21
21
|
|
|
22
|
-
## 从集群管理器迁移
|
|
23
22
|
|
|
24
|
-
从
|
|
23
|
+
## 从 Cluster Manager 迁移
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
从 Rancher 2.6 开始,Cluster Manager 不再作为一个单独的 UI。我们已增强 Dashboard UI 以提供 Cluster Manager 的功能。因此,Cluster Manager 的功能在新的 UI 中的位置可能不同,本指南会帮助你找到所需的功能。
|
|
26
|
+
|
|
27
|
+
> 请注意,你需要启用旧版功能标志才能使用旧版功能。你可以从滑入式菜单 → 全局设置 → 功能开关中启用该功能。
|
|
27
28
|
|
|
28
29
|
<table>
|
|
29
30
|
<thead>
|
|
30
31
|
<tr>
|
|
31
|
-
<th
|
|
32
|
-
<th
|
|
32
|
+
<th>功能</th>
|
|
33
|
+
<th>Cluster Manager 位置</th>
|
|
33
34
|
<th>新位置</th>
|
|
34
35
|
</tr>
|
|
35
36
|
</thead>
|
|
@@ -39,210 +40,185 @@ sideToc: false
|
|
|
39
40
|
</tr>
|
|
40
41
|
<tr>
|
|
41
42
|
<td>集群列表</td>
|
|
42
|
-
<td>全局 →
|
|
43
|
-
<td>菜单 →
|
|
43
|
+
<td>全局 → 集群</td>
|
|
44
|
+
<td>菜单 → 集群管理 → 集群</td>
|
|
44
45
|
</tr>
|
|
45
46
|
<tr>
|
|
46
|
-
<td
|
|
47
|
-
<td
|
|
48
|
-
<td
|
|
47
|
+
<td>驱动</td>
|
|
48
|
+
<td>全局 → 工具 → 驱动</td>
|
|
49
|
+
<td>菜单 → 集群管理 → 驱动</td>
|
|
49
50
|
</tr>
|
|
50
51
|
<tr>
|
|
51
|
-
<td>RKE1
|
|
52
|
-
<td
|
|
53
|
-
<td
|
|
52
|
+
<td>RKE1 模板</td>
|
|
53
|
+
<td>全局 → 工具 → RKE 模板</td>
|
|
54
|
+
<td>菜单 → 集群管理 → RKE1 配置 → RKE 模板</td>
|
|
54
55
|
</tr>
|
|
55
56
|
<tr>
|
|
56
|
-
<td>RKE1
|
|
57
|
-
<td
|
|
58
|
-
<td
|
|
57
|
+
<td>RKE1 云凭证</td>
|
|
58
|
+
<td>用户图标 → 云凭证</td>
|
|
59
|
+
<td>菜单 → 集群管理 → RKE1 配置 → 云凭证</td>
|
|
59
60
|
</tr>
|
|
60
61
|
<tr>
|
|
61
|
-
<td>RKE1
|
|
62
|
-
<td
|
|
63
|
-
<td
|
|
62
|
+
<td>RKE1 节点模板</td>
|
|
63
|
+
<td>用户图标 → 节点模板</td>
|
|
64
|
+
<td>菜单 → 集群管理 → RKE1 配置 → 节点模板</td>
|
|
64
65
|
</tr>
|
|
65
66
|
<tr>
|
|
66
|
-
<td>RKE1
|
|
67
|
-
<td
|
|
68
|
-
<td
|
|
67
|
+
<td>RKE1 快照</td>
|
|
68
|
+
<td>全局 → 集群 → 快照</td>
|
|
69
|
+
<td>菜单 → 集群管理 →(集群)→ 快照</td></td>
|
|
69
70
|
</tr>
|
|
70
71
|
<!-- -->
|
|
71
72
|
<tr class="table-group">
|
|
72
|
-
<td colspan="3"
|
|
73
|
+
<td colspan="3">全局</td>
|
|
73
74
|
</tr>
|
|
74
75
|
<tr>
|
|
75
|
-
<td
|
|
76
|
-
<td
|
|
77
|
-
<td
|
|
76
|
+
<td>设置</td>
|
|
77
|
+
<td>全局 → 设置</td>
|
|
78
|
+
<td>菜单 → 全局设置</td>
|
|
78
79
|
</tr>
|
|
79
80
|
<tr>
|
|
80
|
-
<td
|
|
81
|
-
<td
|
|
82
|
-
<td
|
|
81
|
+
<td>应用商店</td>
|
|
82
|
+
<td>全局 → 工具 → 应用商店</td>
|
|
83
|
+
<td>菜单 → 全局设置 → 应用商店</td>
|
|
83
84
|
</tr>
|
|
84
85
|
<tr>
|
|
85
|
-
<td
|
|
86
|
-
<td
|
|
87
|
-
<td
|
|
86
|
+
<td>全局 DNS 条目</td>
|
|
87
|
+
<td>全局 → 工具 → 全局 DNS 条目</td>
|
|
88
|
+
<td>菜单 → 全局设置 → 全局 DNS 条目</td>
|
|
88
89
|
</tr>
|
|
89
90
|
<tr>
|
|
90
|
-
<td
|
|
91
|
-
<td
|
|
92
|
-
<td
|
|
91
|
+
<td>全局 DNS 提供商</td>
|
|
92
|
+
<td>全局→ 工具 → 全局 DNS 提供商</td>
|
|
93
|
+
<td>菜单 → 全局设置 → 全局 DNS 提供商</td>
|
|
93
94
|
</tr>
|
|
94
95
|
<tr>
|
|
95
|
-
<td>
|
|
96
|
-
<td
|
|
97
|
-
<td
|
|
98
|
-
</tr>
|
|
99
|
-
<tr>
|
|
100
|
-
<td>Pod Security Policies</td>
|
|
101
|
-
<td>Global → Security → Pod Security Policies</td>
|
|
102
|
-
<td>Menu → Cluster Management → Advanced → Pod Security Policies</td>
|
|
96
|
+
<td>Pod 安全策略</td>
|
|
97
|
+
<td>全局 → 安全 → Pod 安全策略</td>
|
|
98
|
+
<td>菜单 → 集群管理 → Pod 安全策略</td>
|
|
103
99
|
</tr>
|
|
104
100
|
<!-- -->
|
|
105
101
|
<tr class="table-group">
|
|
106
|
-
<td colspan="3"
|
|
102
|
+
<td colspan="3">集群功能(针对特定集群)</td>
|
|
107
103
|
</tr>
|
|
108
104
|
<tr>
|
|
109
|
-
<td
|
|
110
|
-
<td
|
|
111
|
-
<td
|
|
105
|
+
<td>集群</td>
|
|
106
|
+
<td>(集群)→ 集群</td>
|
|
107
|
+
<td>菜单 →(集群)→ 集群</td>
|
|
112
108
|
</tr>
|
|
113
109
|
<tr>
|
|
114
|
-
<td
|
|
115
|
-
<td
|
|
116
|
-
<td
|
|
110
|
+
<td>节点</td>
|
|
111
|
+
<td>(集群)→ 节点</td>
|
|
112
|
+
<td>菜单 →(集群)→ 集群 → Kube 节点</td>
|
|
117
113
|
</tr>
|
|
118
114
|
<tr>
|
|
119
|
-
<td
|
|
120
|
-
<td
|
|
121
|
-
<td
|
|
115
|
+
<td>项目/命名空间</td>
|
|
116
|
+
<td>(集群)→ 项目/命名空间</td>
|
|
117
|
+
<td>菜单 →(集群)→ 集群 → 项目/命名空间</td>
|
|
122
118
|
</tr>
|
|
123
119
|
<tr>
|
|
124
120
|
<td>Alerts (V1)</td>
|
|
125
|
-
<td
|
|
126
|
-
<td
|
|
121
|
+
<td>(集群)→ 工具 → Alerts</td>
|
|
122
|
+
<td>菜单 →(集群)→ 旧版 → Alerts</td>
|
|
127
123
|
</tr>
|
|
128
124
|
<tr>
|
|
129
|
-
<td
|
|
130
|
-
<td
|
|
131
|
-
<td
|
|
125
|
+
<td>应用商店</td>
|
|
126
|
+
<td>(集群)→ 工具 → 应用商店</td>
|
|
127
|
+
<td>菜单 →(集群)→ 旧版 -> 应用商店</td>
|
|
132
128
|
</tr>
|
|
133
129
|
<tr>
|
|
134
130
|
<td>Notifiers (V1)</td>
|
|
135
|
-
<td
|
|
136
|
-
<td
|
|
137
|
-
</tr>
|
|
138
|
-
<tr>
|
|
139
|
-
<td>Logging (V1)</td>
|
|
140
|
-
<td>(Cluster) → Tools → Logging</td>
|
|
141
|
-
<td>Menu → (Cluster) → Cluster Tools -> Logging (Legacy)</td>
|
|
131
|
+
<td>(集群)→ 工具 → Notifiers</td>
|
|
132
|
+
<td>菜单 →(集群)→ 旧版 -> Notifiers</td>
|
|
142
133
|
</tr>
|
|
143
134
|
<tr>
|
|
144
135
|
<td>Monitoring (V1)</td>
|
|
145
|
-
<td
|
|
146
|
-
<td
|
|
147
|
-
</tr>
|
|
148
|
-
<tr>
|
|
149
|
-
<td>Istio (V1)</td>
|
|
150
|
-
<td>(Cluster) → Tools → Istio</td>
|
|
151
|
-
<td>Menu → (Cluster) → Cluster Tools -> Istio (Legacy)</td>
|
|
152
|
-
</tr>
|
|
153
|
-
<tr>
|
|
154
|
-
<td>CIS Scans (V1)</td>
|
|
155
|
-
<td>(Cluster) → Tools → CIS Scans</td>
|
|
156
|
-
<td>Menu → (Cluster) → Legacy -> CIS Scans</td>
|
|
136
|
+
<td>(集群)→ 工具 → Monitoring</td>
|
|
137
|
+
<td>菜单 → (集群)→ 集群工具 → Monitoring(旧版)</td>
|
|
157
138
|
</tr>
|
|
158
139
|
<tr class="table-group">
|
|
159
140
|
<td colspan="3">V1 Monitoring</td>
|
|
160
141
|
<tr>
|
|
161
|
-
<td
|
|
162
|
-
<td
|
|
163
|
-
<td
|
|
142
|
+
<td>集群指标</td>
|
|
143
|
+
<td>(集群)→ 集群</td>
|
|
144
|
+
<td>菜单 →(集群)→ 集群</td>
|
|
164
145
|
</tr>
|
|
165
146
|
<tr>
|
|
166
|
-
<td
|
|
167
|
-
<td
|
|
168
|
-
<td
|
|
147
|
+
<td>节点指标</td>
|
|
148
|
+
<td>(集群)→ 节点 →(节点)</td>
|
|
149
|
+
<td>菜单 →(集群)→ 集群 → 节点 →(节点)</td>
|
|
169
150
|
</tr>
|
|
170
151
|
<tr>
|
|
171
|
-
<td
|
|
172
|
-
<td
|
|
173
|
-
<td
|
|
152
|
+
<td>工作负载指标</td>
|
|
153
|
+
<td>(集群)→(项目)→ 资源 → 工作负载 →(工作负载)→ 工作负载指标</td>
|
|
154
|
+
<td>菜单 →(集群)→ Deployments →(Deployment)→ 指标</td>
|
|
174
155
|
</tr>
|
|
175
156
|
<tr>
|
|
176
|
-
<td>Pod
|
|
177
|
-
<td
|
|
178
|
-
<td
|
|
157
|
+
<td>Pod 指标</td>
|
|
158
|
+
<td>(集群)→(项目)→ 资源 → 工作负载 →(工作负载)→ Pod → (Pod) → Pod 指标</td>
|
|
159
|
+
<td>菜单 →(集群)→ Deployments →(Deployment)→ Pod → (Pod) → 指标</td>
|
|
179
160
|
</tr>
|
|
180
161
|
</tr>
|
|
181
162
|
<tr class="table-group">
|
|
182
|
-
<td colspan="3"
|
|
163
|
+
<td colspan="3">项目</td>
|
|
183
164
|
</tr>
|
|
184
165
|
<tr>
|
|
185
|
-
<td
|
|
186
|
-
<td
|
|
187
|
-
<td
|
|
166
|
+
<td>命名空间</td>
|
|
167
|
+
<td>(集群)→(项目)→ 命名空间</td>
|
|
168
|
+
<td>菜单 →(集群)→ 集群 → 项目/命名空间</td>
|
|
188
169
|
</tr>
|
|
189
170
|
<tr>
|
|
190
|
-
<td
|
|
191
|
-
<td
|
|
192
|
-
<td
|
|
171
|
+
<td>应用</td>
|
|
172
|
+
<td>(集群)→(项目)→ 应用</td>
|
|
173
|
+
<td>菜单 →(集群)→ 旧版 → 项目 → 应用</td>
|
|
193
174
|
</tr>
|
|
194
175
|
<tr>
|
|
195
|
-
<td
|
|
196
|
-
<td
|
|
197
|
-
<td
|
|
176
|
+
<td>告警</td>
|
|
177
|
+
<td>(集群)→(项目)→ 工具 → Alerts</td>
|
|
178
|
+
<td>菜单 →(集群)→ 旧版 → 项目 →(项目)→ Alerts</td>
|
|
198
179
|
</tr>
|
|
199
180
|
<tr>
|
|
200
|
-
<td
|
|
201
|
-
<td
|
|
202
|
-
<td
|
|
181
|
+
<td>应用商店</td>
|
|
182
|
+
<td>(集群)→(项目)→ 工具 → 应用商店</td>
|
|
183
|
+
<td>菜单 →(集群)→ 旧版 → 项目 →(项目)→ 应用商店</td>
|
|
203
184
|
</tr>
|
|
204
185
|
<tr>
|
|
205
186
|
<td>Logging</td>
|
|
206
|
-
<td
|
|
207
|
-
<td
|
|
187
|
+
<td>(集群)→(项目)→ 工具 → Logging</td>
|
|
188
|
+
<td>菜单 →(集群)→ 旧版 → 项目 →(项目)→ Logging</td>
|
|
208
189
|
</tr>
|
|
209
190
|
<tr>
|
|
210
|
-
<td
|
|
211
|
-
<td
|
|
212
|
-
<td
|
|
213
|
-
</tr>
|
|
214
|
-
<tr>
|
|
215
|
-
<td>Pipeline</td>
|
|
216
|
-
<td>(Cluster) → (Project) → Tools → Pipeline</td>
|
|
217
|
-
<td>Menu → (Cluster) → Legacy → Project → (Project) → Pipelines → Configuration</td>
|
|
191
|
+
<td>监控</td>
|
|
192
|
+
<td>(集群)→(项目)→ 工具 → Monitoring</td>
|
|
193
|
+
<td>菜单 →(集群)→ 旧版 → 项目 →(项目)→ Monitoring</td>
|
|
218
194
|
</tr>
|
|
219
195
|
<tr class="table-group">
|
|
220
|
-
<td colspan="3"
|
|
196
|
+
<td colspan="3">其他</td>
|
|
221
197
|
</tr>
|
|
222
198
|
<tr>
|
|
223
|
-
<td>Kubeconfig
|
|
224
|
-
<td
|
|
225
|
-
<td
|
|
199
|
+
<td>Kubeconfig 下载</td>
|
|
200
|
+
<td>(集群)→ 集群 → Kubeconfig 文件</td>
|
|
201
|
+
<td>菜单 →(集群)→ 集群 → 文件图标(右上角)</td>
|
|
226
202
|
</tr>
|
|
227
203
|
<tr>
|
|
228
|
-
<td>CLI
|
|
229
|
-
<td
|
|
230
|
-
<td
|
|
204
|
+
<td>CLI 下载</td>
|
|
205
|
+
<td>底栏</td>
|
|
206
|
+
<td>菜单 → 版本</td>
|
|
231
207
|
</tr>
|
|
232
208
|
<tr>
|
|
233
|
-
<td
|
|
234
|
-
<td
|
|
235
|
-
<td
|
|
209
|
+
<td>镜像列表下载</td>
|
|
210
|
+
<td>底栏 → 版本</td>
|
|
211
|
+
<td>菜单 → 版本</td>
|
|
236
212
|
</tr>
|
|
237
213
|
<tr>
|
|
238
|
-
<td>API &
|
|
239
|
-
<td
|
|
240
|
-
<td
|
|
214
|
+
<td>API & 密钥</td>
|
|
215
|
+
<td>用户头像 → API 和密钥</td>
|
|
216
|
+
<td>用户头像 → 账号 & API 密钥</td>
|
|
241
217
|
</tr>
|
|
242
218
|
<tr>
|
|
243
|
-
<td
|
|
244
|
-
<td
|
|
245
|
-
<td
|
|
246
|
-
</tr>
|
|
219
|
+
<td>偏好设置</td>
|
|
220
|
+
<td>用户头像 → 偏好设置</td>
|
|
221
|
+
<td>用户头像 → 偏好设置</td>
|
|
222
|
+
</tr>
|
|
247
223
|
</tbody>
|
|
248
224
|
</table>
|
|
@@ -1,56 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: 2.
|
|
2
|
+
title: 2.7 的新功能
|
|
3
3
|
---
|
|
4
|
-
## 重新设计的Rancher用户体验
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## 2.7.0 的新功能
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
- 全局导航经过重新设计,使用户和管理员更容易在集群和顶级应用之间快速切换。
|
|
10
|
-
- 集群管理列出了用户的所有集群,并增强了它自己的左侧导航菜单,将所有集群生命周期工具集中到一个地方。
|
|
7
|
+
### K3s 配置已 GA(仅限 x86)
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
- 在 x86 集群上配置 K3s 集群已正式 GA!该 Kubernetes 发行版完全兼容、已经过简化、使用安全而且小于 60 MB,非常适合 Edge。
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
- 用户可以在集群资源管理器导航中添加自己的应用程序的链接。
|
|
11
|
+
### Rancher 扩展
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
- Rancher Extensions 可用于扩展 Rancher Manager UI 的功能。Rancher 将使用它来提供新的功能。扩展以 Helm Chart 的形式提供。新的顶层“扩展”UI 允许管理员启用扩展支持并自行安装和管理扩展。
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
- 现有的AKS集群可以被注册,从而能够管理Kubernetes版本和配置设置。
|
|
15
|
+
### OCI 对 Helm Fleet 的支持
|
|
21
16
|
|
|
22
|
-
|
|
17
|
+
- 现在支持对基于 OCI 的镜像仓库进行身份验证。请注意,fleet.yaml 的结构是相同的,并且凭证作为 Kubernetes Secret 提供(Repo Structure 文档的 Private Helm Repo 框中已进行了描述)。
|
|
23
18
|
|
|
24
|
-
- 对GKE集群的配置进行了更新,以支持共享VPC、多节点池、自动缩放和网络标签。
|
|
25
|
-
- 现有的GKE集群可以被注册,从而能够管理Kubernetes版本和配置设置。
|
|
26
|
-
- Rancher的项目网络隔离可以为通过Rancher配置或注册的GKE集群启用。
|
|
27
|
-
|
|
28
|
-
## 技术预览 - RKE2集群配置
|
|
29
|
-
|
|
30
|
-
- 为了支持RKE2集群的配置,我们引入了一个建立在集群API之上的新的配置框架。
|
|
31
|
-
- RKE2集群可以通过Rancher在不同的云基础设施供应商(如AWS、Azure、vSphere、Linode和DigitalOcean)配置虚拟机。
|
|
32
|
-
- RKE2集群也可以在现有的虚拟或裸机服务器上进行配置。
|
|
33
|
-
|
|
34
|
-
## 技术预览 - RKE2支持Windows工作节点
|
|
35
|
-
|
|
36
|
-
- Windows工作节点可以被添加到任何使用默认Calico CNI的RKE2自定义集群中。
|
|
37
|
-
|
|
38
|
-
## 技术预览 - 集群模板
|
|
39
|
-
|
|
40
|
-
- 集群模板提供了控制哪些参数可以被定制的能力,以配置集群。
|
|
41
|
-
|
|
42
|
-
集群可以定义的例子有。
|
|
43
|
-
|
|
44
|
-
- etcd、control和worker的节点池。
|
|
45
|
-
- 用于配置节点的云凭证。
|
|
46
|
-
|
|
47
|
-
## 使用OIDC的Keycloak
|
|
48
|
-
|
|
49
|
-
- Keycloak现在可以使用OIDC进行认证。
|
|
50
|
-
|
|
51
|
-
## 安全性增强
|
|
52
|
-
|
|
53
|
-
- 管理员现在可以通过Rancher和Kubernetes审计日志中的用户名和身份提供者(IdP)来追踪用户。
|
|
54
|
-
- 管理员可以启用Rancher API令牌的单向哈希。
|
|
55
|
-
|
|
56
|
-
阅读完整的[发布说明](https://github.com/rancher/rancher/releases/tag/v2.6.0)以了解更多细节。
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { ActionLocation, CardLocation, ExtensionPoint } from '@shell/core/types';
|
|
2
|
+
import { isMac } from '@shell/utils/platform';
|
|
3
|
+
import { ucFirst, randomStr } from '@shell/utils/string';
|
|
4
|
+
import { _EDIT, _CONFIG, _DETAIL, _LIST } from '@shell/config/query-params';
|
|
5
|
+
import { getProductFromRoute } from '@shell/middleware/authenticated';
|
|
6
|
+
|
|
7
|
+
function checkRouteProduct({ name, params, query }, locationConfigParam) {
|
|
8
|
+
const product = getProductFromRoute({
|
|
9
|
+
name, params, query
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// alias for the homepage
|
|
13
|
+
if (locationConfigParam === 'home' && name === 'home') {
|
|
14
|
+
return true;
|
|
15
|
+
} else if (locationConfigParam === product) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function checkRouteMode({ name, query }, locationConfigParam) {
|
|
23
|
+
if (locationConfigParam === _EDIT && query.mode && query.mode === _EDIT) {
|
|
24
|
+
return true;
|
|
25
|
+
} else if (locationConfigParam === _CONFIG && query.as && query.as === _CONFIG) {
|
|
26
|
+
return true;
|
|
27
|
+
} else if (locationConfigParam === _DETAIL && name.includes('-id')) {
|
|
28
|
+
return true;
|
|
29
|
+
// alias to target all list views
|
|
30
|
+
} else if (locationConfigParam === _LIST && !name.includes('-id') && name.includes('-resource')) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function checkExtensionRouteBinding($route, locationConfig) {
|
|
38
|
+
// if no configuration is passed, consider it as global
|
|
39
|
+
if (!Object.keys(locationConfig).length) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const { params } = $route;
|
|
44
|
+
|
|
45
|
+
// "params" to be checked based on the locationConfig
|
|
46
|
+
const paramsToCheck = [
|
|
47
|
+
'product',
|
|
48
|
+
'resource',
|
|
49
|
+
'namespace',
|
|
50
|
+
'cluster',
|
|
51
|
+
'id',
|
|
52
|
+
'mode'
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
let res = false;
|
|
56
|
+
|
|
57
|
+
for (let i = 0; i < paramsToCheck.length; i++) {
|
|
58
|
+
const param = paramsToCheck[i];
|
|
59
|
+
|
|
60
|
+
if (locationConfig[param]) {
|
|
61
|
+
for (let x = 0; x < locationConfig[param].length; x++) {
|
|
62
|
+
const locationConfigParam = locationConfig[param][x];
|
|
63
|
+
|
|
64
|
+
if (locationConfigParam) {
|
|
65
|
+
// handle "product" in a separate way...
|
|
66
|
+
if (param === 'product') {
|
|
67
|
+
res = checkRouteProduct($route, locationConfigParam);
|
|
68
|
+
// also handle "mode" in a separate way because it mainly depends on query params
|
|
69
|
+
} else if (param === 'mode') {
|
|
70
|
+
res = checkRouteMode($route, locationConfigParam);
|
|
71
|
+
} else if (locationConfigParam === params[param]) {
|
|
72
|
+
res = true;
|
|
73
|
+
} else {
|
|
74
|
+
res = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// If a single location config param is good then this is an param (aka ['pods', 'configmap'] = pods or configmaps)
|
|
79
|
+
if (res) {
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// If a single param (set of location config params) is bad then this is not an acceptable location
|
|
85
|
+
if (!res) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return res;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function getApplicableExtensionEnhancements(pluginCtx, actionType, uiArea, currRoute, translationCtx = pluginCtx) {
|
|
95
|
+
const extensionEnhancements = [];
|
|
96
|
+
|
|
97
|
+
const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);
|
|
98
|
+
|
|
99
|
+
actions.forEach((action, i) => {
|
|
100
|
+
if (checkExtensionRouteBinding(currRoute, action.locationConfig)) {
|
|
101
|
+
// ADD CARD PLUGIN UI ENHANCEMENT
|
|
102
|
+
if (actionType === ExtensionPoint.CARD) {
|
|
103
|
+
// intercept to apply translation
|
|
104
|
+
if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {
|
|
105
|
+
actions[i].label = translationCtx.t(action.labelKey);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ADD ACTION PLUGIN UI ENHANCEMENT
|
|
109
|
+
} else if (actionType === ExtensionPoint.ACTION) {
|
|
110
|
+
// TABLE ACTION
|
|
111
|
+
if (uiArea === ActionLocation.TABLE) {
|
|
112
|
+
// intercept to apply translation
|
|
113
|
+
if (action.labelKey) {
|
|
114
|
+
actions[i].label = translationCtx.t(action.labelKey);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// sets the enabled flag to true if omitted on the config
|
|
118
|
+
if (!Object.keys(action).includes('enabled')) {
|
|
119
|
+
actions[i].enabled = true;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// bulkable flag
|
|
123
|
+
actions[i].bulkable = actions[i].multiple || actions[i].bulkable;
|
|
124
|
+
|
|
125
|
+
// populate action identifier to prevent errors
|
|
126
|
+
if (!actions[i].action) {
|
|
127
|
+
actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// extract simplified shortcut definition on plugin - HEADER ACTION
|
|
132
|
+
if (uiArea === ActionLocation.HEADER && action.shortcut) {
|
|
133
|
+
// if it's a string, then assume CTRL for windows and META for mac
|
|
134
|
+
if (typeof action.shortcut === 'string') {
|
|
135
|
+
actions[i].shortcutLabel = () => {
|
|
136
|
+
return isMac ? `(\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;
|
|
137
|
+
};
|
|
138
|
+
actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };
|
|
139
|
+
// correct check for an Object type in JS... handle the object passed
|
|
140
|
+
} else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {
|
|
141
|
+
actions[i].shortcutKey = action.shortcut;
|
|
142
|
+
const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];
|
|
143
|
+
let scLabel = '';
|
|
144
|
+
|
|
145
|
+
keyboardCombo.forEach((key, i) => {
|
|
146
|
+
if (i < keyboardCombo.length - 1) {
|
|
147
|
+
if (key === 'meta') {
|
|
148
|
+
key = '\u2318';
|
|
149
|
+
} else {
|
|
150
|
+
key = ucFirst(key);
|
|
151
|
+
}
|
|
152
|
+
scLabel += `${ key }`;
|
|
153
|
+
scLabel += '-';
|
|
154
|
+
} else {
|
|
155
|
+
scLabel += `${ key.toUpperCase() }`;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
actions[i].shortcutLabel = () => {
|
|
160
|
+
return `(${ scLabel })`;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
extensionEnhancements.push(actions[i]);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
return extensionEnhancements;
|
|
171
|
+
}
|