dashboard-shell-shell 3.0.5-test.43 → 3.0.5-test.44

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.
@@ -1206,6 +1206,9 @@ compliance:
1206
1206
  testsToSkip: 要跳过的测试
1207
1207
 
1208
1208
  cluster:
1209
+ jwtAuthentication:
1210
+ banner: "使用 JWT 认证的服务账户访问可在集群创建后通过以下路径配置:<br>
1211
+ <code>集群管理 > 高级 > JWT 认证</code>"
1209
1212
  addonChart:
1210
1213
  rancher-vsphere-cpi: vSphere CPI 配置
1211
1214
  rancher-vsphere-csi: vSphere CSI 配置
@@ -1457,6 +1460,25 @@ cluster:
1457
1460
  name:
1458
1461
  label: 集群名称
1459
1462
  placeholder: 请输入集群名称
1463
+ directoryConfig:
1464
+ title: 数据目录配置
1465
+ banner: 集群创建后,数据目录配置将无法更改
1466
+ radioInput:
1467
+ defaultLabel: 使用默认数据目录配置
1468
+ commonLabel: 为数据目录配置使用公共基础目录(子系统路径将使用子目录:system-agent、provisioning 和 distro)
1469
+ customLabel: 使用自定义数据目录
1470
+ common:
1471
+ label: 数据目录基础路径
1472
+ tooltip: 数据目录基础路径。我们将为每个目录附加相应的子目录(/agent、/provisioning 以及 /rke2 或 /k3s)
1473
+ systemAgent:
1474
+ label: 系统代理目录路径
1475
+ tooltip: 用于存储系统代理连接信息和计划的数据目录
1476
+ provisioning:
1477
+ label: 供应目录路径
1478
+ tooltip: 用于存储供应相关文件的数据目录
1479
+ k8sDistro:
1480
+ label: K8s 发行版目录路径
1481
+ tooltip: 用于存储 K8s 发行版的数据目录
1460
1482
  machineConfig:
1461
1483
  banner:
1462
1484
  updateInfo: 创建一个池用来更新主机配置
@@ -1774,6 +1796,9 @@ cluster:
1774
1796
  rke2-k3-reprovisioning: '更改集群配置可能导致节点重新配置。详情请参见 <a target="blank" href="{docsBase}/how-to-guides/new-user-guides/launch-kubernetes-with-rancher/rke1-vs-rke2-differences#cluster-api" target="_blank" rel="noopener nofollow">文档</a>。'
1775
1797
  desiredNodeGroupWarning: 没有可用于运行 Cluster Agent 的节点。要让集群变为 Active 状态,至少需要有 1 个可用的节点。
1776
1798
  haveArgInfo: 所选 Kubernetes 版本的配置信息不可用。此屏幕中可用的选项将受到限制,你可能需要使用 YAML 编辑器。
1799
+ cloudProviderAddConfig: '在 Kubernetes 1.27 或更高版本中,<b>Amazon</b> 云提供商需要额外配置。请参阅<a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/amazon" target="_blank" rel="noopener noreferrer nofollow">文档</a>以了解更多信息。'
1800
+ cloudProviderUnsupportedAzure: '在 Kubernetes 1.30 或更高版本中,<b>Azure</b> 云提供商已被移除。请参阅<a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/azure" target="_blank" rel="noopener noreferrer nofollow">文档</a>以了解更多信息。'
1801
+ cloudProviderMigrateAzure: '在 Kubernetes 1.30 或更高版本中,<b>Azure</b> 云提供商已被移除。要升级 Kubernetes,应先将集群迁移到外部提供商。请参阅<a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/azure" target="_blank" rel="noopener noreferrer nofollow">文档</a>以了解更多信息。'
1777
1802
  rkeTemplateUpgrade: 模板修订版 {name} 可用于升级
1778
1803
 
1779
1804
  availabilityWarnings:
@@ -1978,7 +2003,19 @@ cluster:
1978
2003
  drain:
1979
2004
  label: 清空节点
1980
2005
  toolTip: 清空操作预先移除每个节点上的 Pod,使得升级中的节点上没有运行的工作负载。不清空的升级速度更快,造成的混乱更少,但是 Pod 仍可能根据进行中的升级进行重启。
1981
- deleteEmptyDir: "默认情况下,使用 emptyDir 卷的 pod 会在升级时被删除。在 pod 生命周期中依赖于 emptyDir 持久卷的操作可能会受到影响。"
2006
+ deleteEmptyDir:
2007
+ warning: "默认情况下,使用 emptyDir 卷的 Pod 将在升级时被删除。依赖 emptyDir 卷在 Pod 生命周期内持久化的操作可能会受到影响。"
2008
+ label: 删除使用 emptyDir 卷的 Pod
2009
+ tooltip: emptyDir 卷通常用于临时数据,但其中的数据将被永久删除。如果未设置此选项且存在使用 emptyDir 的 Pod,排水操作将失败。
2010
+ force:
2011
+ label: 删除独立 Pod
2012
+ tooltip: 删除不受工作负载控制器(Deployment、Job 等)管理的独立 Pod。如果未设置此选项且存在独立 Pod,排水操作将失败。
2013
+ gracePeriod:
2014
+ checkboxLabel: 覆盖 Pod 终止宽限期
2015
+ inputLabel: 宽限期
2016
+ timeout:
2017
+ checkboxLabel: 超时时间
2018
+ inputLabel: 排水超时
1982
2019
  truncateHostnames: 将主机名截断为 15 个字符来兼容 NetBIOS。
1983
2020
  address:
1984
2021
  tooltip: 创建集群后无法更改集群网络值。
@@ -2427,7 +2464,12 @@ glance:
2427
2464
  eventsTable: 完整事件列表
2428
2465
 
2429
2466
  clusterBadge:
2467
+ badgeAppearance: 集群徽章外观
2468
+ clusterComment: "集群注释 - {text}"
2469
+ customizeAppearance: 自定义外观
2430
2470
  addLabel: 添加集群徽章
2471
+ setClusterAppearance: 集群外观设置
2472
+ customize: 自定义
2431
2473
  editLabel: 编辑集群徽章
2432
2474
  modal:
2433
2475
  title: 自定义集群徽章
@@ -3,6 +3,10 @@ import { NORMAN } from '@shell/config/types';
3
3
 
4
4
  export default {
5
5
  props: {
6
+ userLogo: {
7
+ type: Boolean,
8
+ default: false,
9
+ },
6
10
  value: {
7
11
  type: String,
8
12
  required: true,
@@ -94,10 +98,10 @@ export default {
94
98
  </template>
95
99
 
96
100
  <template v-else-if="principal">
97
- <div :style="userLogoSize === 79 ? { width: '287px' } : {}" class="avatar">
101
+ <div v-if="userLogo" :style="userLogoSize === 79 ? { width: '287px' } : {}" class="avatar">
98
102
  <img
99
- :style="{ width: userLogoSize + 'px', height: userLogoSize + 'px' }"
100
- :src="require('@shell/assets/images/user.png')"
103
+ :style="{ width: userLogoSize + 'px', height: userLogoSize + 'px', marginRight: '10px' }"
104
+ src="@shell/assets/images/user.png"
101
105
  :class="{'round': principal.roundAvatar}"
102
106
  :alt="t('principal.alt.avatar')"
103
107
  >
@@ -171,16 +175,15 @@ export default {
171
175
  </template>
172
176
 
173
177
  <style lang="scss" scoped>
174
- $size: 20px;
178
+ $size: 24px;
175
179
 
176
180
  .principal {
177
181
  display: grid;
178
182
  grid-template-areas:
179
183
  "avatar name"
180
184
  "avatar description";
181
- grid-template-columns: $size auto;
185
+ grid-template-columns: min-content auto;
182
186
  // grid-template-rows: auto math.div($size, 2);
183
- column-gap: 10px;
184
187
 
185
188
  th {
186
189
  text-align: left;
@@ -236,13 +239,13 @@ export default {
236
239
 
237
240
  .name {
238
241
  grid-area: name;
239
- line-height: math.div($size, 2);
242
+ line-height: 16px;
240
243
  overflow-wrap: anywhere;
241
244
  }
242
245
 
243
246
  .description {
244
247
  grid-area: description;
245
- line-height: math.div($size, 2);
248
+ line-height: 16px;
246
249
  }
247
250
  }
248
251
  </style>
@@ -88,11 +88,12 @@ export default {
88
88
  <style lang="scss" scoped>
89
89
  .cluster-appearance {
90
90
  display: flex;
91
- flex-direction: column;
92
- margin: 3px 35px 0px 0px;
91
+ // flex-direction: column;
92
+ // align-items: center;
93
+ // margin: 3px 35px 0px 0px;
93
94
 
94
95
  label {
95
- margin: 6px 0 0;
96
+ margin: 10px 10px 0 0;
96
97
  }
97
98
 
98
99
  &-preview {
@@ -170,7 +170,7 @@ export default {
170
170
  >
171
171
  <template #column-headers>
172
172
  <div class="box mb-0">
173
- <div class="column-headers row" :style="{ width: (isCreate && i === 0) || isView ? '100%' : 'calc(100% - 100px)' }">
173
+ <div class="column-headers row" :style="{ width: isView ? '100%' : 'calc(100% - 100px)'}">
174
174
  <div class="col span-6">
175
175
  <label class="text-label">{{ t('membershipEditor.user') }}</label>
176
176
  </div>
@@ -206,7 +206,7 @@ export default {
206
206
  </button>
207
207
  </template>
208
208
  <template #remove-button="{remove, i}">
209
- <span v-if="(isCreate && i === 0) || isView" />
209
+ <div style="width: 100px;" v-if="(isCreate && i === 0) || isView" />
210
210
  <button
211
211
  v-else
212
212
  type="button"
@@ -704,6 +704,6 @@ export default {
704
704
 
705
705
  <style lang="scss" scoped>
706
706
  .patch-version {
707
- margin-top: 5px;
707
+ margin-top: 10px;
708
708
  }
709
709
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashboard-shell-shell",
3
- "version": "3.0.5-test.43",
3
+ "version": "3.0.5-test.44",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -164,6 +164,7 @@ export default {
164
164
  <h5 v-t="'accountAndKeys.account.title'" />
165
165
  <div class="account">
166
166
  <Principal
167
+ :userLogo="true"
167
168
  :userLogoSize="79"
168
169
  :value="principal.id"
169
170
  :use-muted="false"
@@ -41,26 +41,6 @@ export async function handleSpoofedRequest(rootGetters, schemaStore, opt, produc
41
41
  }
42
42
  }
43
43
 
44
- export function normalizeSchemaMethods(schema) {
45
- if (!schema) return schema;
46
-
47
- const HTTP_METHODS = ["get", "post", "put", "patch", "delete"];
48
-
49
- if (Array.isArray(schema.resourceMethods)) {
50
- schema.resourceMethods = schema.resourceMethods.map(m =>
51
- HTTP_METHODS.includes(m.toLowerCase()) ? m.toUpperCase() : m
52
- );
53
- }
54
-
55
- if (Array.isArray(schema.collectionMethods)) {
56
- schema.collectionMethods = schema.collectionMethods.map(m =>
57
- HTTP_METHODS.includes(m.toLowerCase()) ? m.toUpperCase() : m
58
- );
59
- }
60
-
61
- return schema;
62
- }
63
-
64
44
  export async function loadSchemas(ctx, watch = true) {
65
45
  const {
66
46
  getters, dispatch, commit, rootGetters
@@ -76,9 +56,6 @@ export async function loadSchemas(ctx, watch = true) {
76
56
 
77
57
  res.data.forEach(addSchemaIndexFields);
78
58
 
79
- // ✅ 统一处理 HTTP 方法
80
- res.data.forEach(normalizeSchemaMethods);
81
-
82
59
  commit('loadAll', {
83
60
  ctx,
84
61
  type: SCHEMA,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  # 执行命令示例:
4
- # TAG=shell-pkg-v3.0.5-test.43 ./shell/scripts/publish-shell.sh
4
+ # TAG=shell-pkg-v3.0.5-test.44 ./shell/scripts/publish-shell.sh
5
5
 
6
6
  set -euo pipefail
7
7
 
@@ -2687,7 +2687,6 @@ export default class Ingress {
2687
2687
 
2688
2688
  declare module '@shell/plugins/dashboard-store/actions' {
2689
2689
  export function handleSpoofedRequest(rootGetters: any, schemaStore: any, opt: any, product: any): Promise<any>;
2690
- export function normalizeSchemaMethods(schema: any): any;
2691
2690
  export function loadSchemas(ctx: any, watch?: boolean): Promise<any>;
2692
2691
  export const _ALL: "all";
2693
2692
  export const _MERGE: "merge";
package/utils/error.js CHANGED
@@ -51,8 +51,6 @@ export class ApiError extends Error {
51
51
 
52
52
  export function stringify(err) {
53
53
 
54
- console.log(err, ' err-------------------------------------------------1')
55
-
56
54
  let str;
57
55
  if ( typeof err === 'string' ) {
58
56
  str = err;
@@ -96,8 +94,6 @@ export function exceptionToErrorsArray(err) {
96
94
  if ( err?.response?.data ) {
97
95
  const body = err.response.data;
98
96
 
99
- console.log(err, ' err-------------------------------------------------1')
100
-
101
97
  if ( body && body.message ) {
102
98
  return [translateError(body.message)];
103
99
  } else {
@@ -152,6 +148,21 @@ export function translateError(error) {
152
148
  }).replace('internal error occurred: ', "");
153
149
  console.log('00044', error);
154
150
 
151
+ // 1. 资源配额错误(最高优先级)
152
+ if (originError.includes('exceeded quota')) {
153
+ return '资源配额超限:请求的资源超过了命名空间的配额限制';
154
+ }
155
+
156
+ // 2. 权限不足错误
157
+ const permissionDeniedPatterns = [
158
+ /"\S+" is forbidden:.*cannot.*(patch|update|create|delete|get|list|watch).*resource/i,
159
+ /is forbidden:.*user.*cannot.*(patch|update|create|delete|get|list|watch)/i
160
+ ];
161
+
162
+ if (permissionDeniedPatterns.some(pattern => pattern.test(originError))) {
163
+ return "权限不足";
164
+ }
165
+
155
166
 
156
167
  if (error.includes("a lowercase rfc 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character")) {
157
168
  error = "无效的名称不符合 RFC 1123 命名规则。名称只能包含小写字母、数字或 '-',并且必须以字母或数字开头和结尾(例如 'my-name' 或 '123-abc')。"
@@ -1,45 +1,5 @@
1
1
  {
2
2
  "translations": [
3
- {
4
- "pattern": "storageclasses.storage.k8sio \"(\\S+)\" is forbidden: User \"(\\S+)\" cannot patch resource \"(\\S+)\" in APl group \"(\\S+)\" at the cluster scope",
5
- "replacement": "权限不足",
6
- "flags": "gi"
7
- },
8
- {
9
- "pattern": "virtualmachineimages.harvesterhciio \"(\\S+)\" is forbidden: User \"(\\S+)\" cannot patch resource \"(\\S+)\" in Apl group \"(\\S+)\" in the namespace \"(\\S+)\"",
10
- "replacement": "权限不足",
11
- "flags": "gi"
12
- },
13
- {
14
- "pattern": "Method POST not supported",
15
- "replacement": "权限不足",
16
- "flags": "gi"
17
- },
18
- {
19
- "pattern": "Method GET not supported",
20
- "replacement": "权限不足",
21
- "flags": "gi"
22
- },
23
- {
24
- "pattern": "Method CREATE not supported",
25
- "replacement": "权限不足",
26
- "flags": "gi"
27
- },
28
- {
29
- "pattern": "Method GET not supported",
30
- "replacement": "权限不足",
31
- "flags": "gi"
32
- },
33
- {
34
- "pattern": "Method DELETE not supported",
35
- "replacement": "权限不足",
36
- "flags": "gi"
37
- },
38
- {
39
- "pattern": "Method PUT not supported",
40
- "replacement": "权限不足",
41
- "flags": "gi"
42
- },
43
3
  {
44
4
  "pattern": "failure while starting vmi: arm64 not support this disk bus type, please use virtio or scsi",
45
5
  "replacement": "启动虚拟机实例失败:ARM64 架构不支持此磁盘总线类型,请使用 virtio 或 scsi",
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "translations": [
3
- {
4
- "pattern": "virtualmachineimages\\.harvesterhci\\.io.*forbidden.*user.*cannot.*(patch|update|create|delete).*resource.*virtualmachineimages.*harvesterhci\\.io.*namespace",
5
- "replacement": "权限不足",
6
- "flags": "gi"
7
- },
8
- {
9
- "pattern": "storageclasses\\.storage\\.k8s\\.io.*forbidden.*user.*cannot.*(patch|update|create|delete).*resource.*storageclasses.*storage\\.k8s\\.io.*cluster scope",
3
+ {
4
+ "pattern": "Method (POST|GET|CREATE|DELETE|PUT|PATCH|OPTIONS|HEAD|TRACE|CONNECT) not supported",
10
5
  "replacement": "权限不足",
11
6
  "flags": "gi"
12
7
  },