dashboard-shell-shell 3.0.5-test.17 → 3.0.5-test.18

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.
@@ -593,6 +593,7 @@ assignTo:
593
593
  workspace: 工作空间
594
594
 
595
595
  stateLabel:
596
+ Locked: 锁定
596
597
  Bound: 已绑定
597
598
  Running: 运行中
598
599
  Off: 关闭
@@ -14,7 +14,22 @@ export const useDefaultTitleBarProps = (resource: any, resourceSubtype?: Ref<str
14
14
  const resourceSubtypeValue = toValue(resourceSubtype);
15
15
  const currentStore = store.getters['currentStore'](resourceValue.type);
16
16
  const schema = store.getters[`${ currentStore }/schemaFor`](resourceValue.type);
17
- const resourceTypeLabel = resourceValue.parentNameOverride || store.getters['type-map/labelFor'](schema);
17
+ let resourceTypeLabel = resourceValue.parentNameOverride || store.getters['type-map/labelFor'](schema);
18
+
19
+ // 转换为中文
20
+ const displayName_zh_hans: Record<string, string> = {
21
+ 'GlobalRole': '全局角色',
22
+ 'RoleTemplate': '集群角色',
23
+ }
24
+
25
+ if (displayName_zh_hans[resourceTypeLabel]) {
26
+ resourceTypeLabel = displayName_zh_hans[resourceTypeLabel]
27
+ }
28
+
29
+ if (resourceTypeLabel == '集群角色' && (route.query?.roleContext == 'NAMESPACE' || resource?.parentLocationOverride?.hash == '#NAMESPACE')) {
30
+ resourceTypeLabel = '项目或资源组角色'
31
+ }
32
+
18
33
  const resourceName = resourceSubtypeValue ? `${ resourceSubtypeValue } - ${ resourceValue.nameDisplay }` : resourceValue.nameDisplay;
19
34
  const resourceTo = resourceValue.listLocation || {
20
35
  name: 'c-cluster-product-resource',
@@ -119,7 +119,7 @@ watch(
119
119
 
120
120
  <template>
121
121
  <div class="title-bar">
122
- <breadcrumb :resource="resource"/>
122
+ <breadcrumb :resourceTypeLabel="resourceTypeLabel" :resource="resource"/>
123
123
  <Top>
124
124
  <Title class="title">
125
125
  <span class="detailIcon-span">
@@ -1,54 +1,18 @@
1
1
  <script>
2
- import { Banner } from '@components/Banner';
3
2
  import { get } from '@shell/utils/object';;
4
- import {
5
- AS, _DETAIL, _CONFIG, _YAML, MODE, _CREATE, _EDIT, _VIEW, _UNFLAG, _GRAPH
6
- } from '@shell/config/query-params';
7
- import { ExtensionPoint, PanelLocation } from '@shell/core/types';
8
3
  import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
9
4
  import { useStore } from 'vuex';
10
5
 
11
- // i18n-uses resourceDetail.header.*
12
-
13
- /**
14
- * Resource Detail Masthead component.
15
- *
16
- * ToDo: this component seem to be picking up a lot of logic from special cases, could be simplified down to parameters and then customized per use-case via wrapper component
17
- */
18
6
  export default {
19
7
 
20
- name: 'MastheadResourceDetail',
8
+ name: 'MastheadBreadcrumb',
21
9
 
22
10
  components: {
23
- // BadgeState,
24
- Banner,
25
11
  },
26
12
  props: {
27
- value: {
28
- type: Object,
29
- default: () => {
30
- return {};
31
- }
32
- },
33
-
34
- mode: {
35
- type: String,
36
- default: 'view'
37
- },
38
-
39
- realMode: {
40
- type: String,
41
- default: 'view'
42
- },
43
-
44
- as: {
13
+ resourceTypeLabel: {
45
14
  type: String,
46
- default: _YAML,
47
- },
48
-
49
- storeOverride: {
50
- type: String,
51
- default: null,
15
+ default: ''
52
16
  },
53
17
 
54
18
  resource: {
@@ -56,15 +20,10 @@ export default {
56
20
  default: null,
57
21
  },
58
22
 
59
- resourceSubtype: {
60
- type: String,
61
- default: null,
62
- },
63
-
64
- parentRouteOverride: {
23
+ realMode: {
65
24
  type: String,
66
- default: null,
67
- },
25
+ default: 'view',
26
+ }
68
27
 
69
28
  },
70
29
 
@@ -77,82 +36,10 @@ export default {
77
36
 
78
37
  data() {
79
38
  return {
80
- DETAIL_VIEW: _DETAIL,
81
- extensionType: ExtensionPoint.PANEL,
82
- extensionLocation: PanelLocation.DETAILS_MASTHEAD,
83
- Svg: require('~shell/assets/images/API.svg')
84
39
  };
85
40
  },
86
41
 
87
42
  computed: {
88
- dev() {
89
- return this.$store.getters['prefs/dev'];
90
- },
91
-
92
- schema() {
93
- const inStore = this.storeOverride || this.$store.getters['currentStore'](this.resource);
94
-
95
- return this.$store.getters[`${ inStore }/schemaFor`]( this.resource );
96
- },
97
-
98
- isProjectHelmChart() {
99
- return this.schema?.id === HELM.PROJECTHELMCHART;
100
- },
101
-
102
- shouldHifenize() {
103
- return (this.mode === 'view' || this.mode === 'edit') && this.resourceSubtype?.length && this.value?.nameDisplay?.length;
104
- },
105
-
106
- parent() {
107
- const displayName = this.value?.parentNameOverride || this.$store.getters['type-map/labelFor'](this.schema);
108
- const product = this.$store.getters['currentProduct'].name;
109
-
110
- const defaultLocation = {
111
- name: 'c-cluster-product-resource',
112
- params: {
113
- resource: this.resource,
114
- product,
115
- }
116
- };
117
-
118
- const location = this.value?.parentLocationOverride || defaultLocation;
119
-
120
- if (this.parentRouteOverride) {
121
- location.name = this.parentRouteOverride;
122
- }
123
-
124
- const typeOptions = this.$store.getters[`type-map/optionsFor`]( this.resource );
125
-
126
- // 转换为中文
127
- const displayName_zh_hans = {
128
- 'GlobalRole': '全局角色',
129
- 'RoleTemplate': '集群角色',
130
- }
131
- if (displayName_zh_hans[displayName]) {
132
- displayName = displayName_zh_hans[displayName]
133
- }
134
-
135
- if (displayName == '集群角色' && (this.$route.query?.roleContext == 'NAMESPACE' || location.hash == '#NAMESPACE')) {
136
- displayName = '项目或资源组角色'
137
- }
138
-
139
- const out = {
140
- displayName, location, ...typeOptions
141
- };
142
-
143
- return out;
144
- },
145
-
146
-
147
- displayName() {
148
- let displayName = this.value.nameDisplay;
149
-
150
- if (this.isProjectHelmChart) {
151
- displayName = this.value.projectDisplayName;
152
- }
153
-
154
- return this.shouldHifenize ? ` - ${ displayName }` : displayName;
155
- },
156
43
 
157
44
  demoDisplay() {
158
45
 
@@ -177,12 +64,6 @@ export default {
177
64
  return partsEn;
178
65
  },
179
66
 
180
- location() {
181
- const { parent } = this;
182
-
183
- return parent?.location;
184
- },
185
-
186
67
  },
187
68
 
188
69
  methods: {
@@ -206,7 +87,7 @@ export default {
206
87
  <span>/</span>
207
88
  </span>
208
89
  <span class="excram-last-name">
209
- {{ (realMode === 'view'? '查看': realMode === 'edit' ? '编辑':'创建') + parent.displayName }}
90
+ {{ (realMode === 'view'? '查看': realMode === 'edit' ? '编辑':'创建') + resourceTypeLabel }}
210
91
  </span>
211
92
  </div>
212
93
  </div>
@@ -215,71 +96,6 @@ export default {
215
96
 
216
97
  <style lang='scss' scoped>
217
98
 
218
- HEADER {
219
- margin: 0;
220
- }
221
-
222
- .primaryheader {
223
- display: flex;
224
- flex-direction: row;
225
- align-items: center;
226
- font-size:14px;
227
- height: 50px;
228
-
229
- h1 {
230
- margin: 0;
231
- }
232
- }
233
-
234
- .subheader{
235
- display: flex;
236
- flex-direction: row;
237
- color: var(--input-label);
238
- & > * {
239
- margin: 5px 20px 5px 0px;
240
- }
241
-
242
- .live-data {
243
- color: var(--body-text)
244
- }
245
- }
246
-
247
- .state-banner {
248
- margin: 3px 0 0 0;
249
- }
250
-
251
- .masthead-state {
252
- font-size: initial;
253
- display: inline-block;
254
- position: relative;
255
- /* top: -2px; */
256
- font-size: 12px;
257
- margin-left: 5px;
258
- }
259
-
260
- .masthead-istio {
261
- .icon {
262
- vertical-align: middle;
263
- color: var(--primary);
264
- }
265
- }
266
-
267
- .left-right-split {
268
- display: grid;
269
- align-items: center;
270
-
271
- .left-half {
272
- grid-column: 1;
273
- }
274
-
275
- .right-half {
276
- grid-column: 2;
277
- }
278
- }
279
-
280
- .resource-external {
281
- font-size: 18px;
282
- }
283
99
  .excram-list{
284
100
  font-size: 14px;
285
101
  margin-bottom: 20px;
@@ -287,10 +103,7 @@ export default {
287
103
  .excram-last-name{
288
104
  color: var(--link);
289
105
  }
290
- .valid{
291
- color: #d7d7d7;
292
- margin: 0px 10px;
293
- }
106
+
294
107
  .detailIcon-span{
295
108
  width: 24px;
296
109
  height: 24px;
@@ -306,11 +119,5 @@ export default {
306
119
  left: 4px;
307
120
  top: -2px;
308
121
  }
309
- .primary-title{
310
- display: flex;
311
- align-items: center;
312
- }
313
- .detailIcon-span-title{
314
- font-weight: bold;
315
- }
122
+
316
123
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashboard-shell-shell",
3
- "version": "3.0.5-test.17",
3
+ "version": "3.0.5-test.18",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  # 执行命令示例:
4
- # TAG=shell-pkg-v3.0.5-test.17 ./shell/scripts/publish-shell.sh
4
+ # TAG=shell-pkg-v3.0.5-test.118 ./shell/scripts/publish-shell.sh
5
5
 
6
6
  set -euo pipefail
7
7
 
@@ -1,5 +1,98 @@
1
1
  {
2
2
  "translations": [
3
+ {
4
+ "pattern": "role is locked and cannot be assigned",
5
+ "replacement": "角色已被锁定,不能再分配"
6
+ },
7
+ {
8
+ "pattern": "invalid current password",
9
+ "replacement": "重复密码无效"
10
+ },
11
+ {
12
+ "pattern": "spec\\.template\\.spec\\.podaffinity\\.requiredduringschedulingignoredduringexecution\\[(\\d+)\\]\\.topologykey: required value: can not be empty[\\s\\S]*?regex used for validation is '([^']+)'",
13
+ "replacement": "拓扑键不能为空",
14
+ "flags": "gi"
15
+ },
16
+ {
17
+ "pattern": "pcidevice ([^\\s]+) has no iommugroup available",
18
+ "replacement": "PCI 设备 '$1' 没有可用的 IOMMU 组",
19
+ "flags": "gi"
20
+ },
21
+ {
22
+ "pattern": "invalidbodycontent 422: failed to parse totalsnapshotsizequota: quantities must match the regular expression '\\^\\(\\[\\+\\-\\]\\?\\[0-9\\.\\]\\+\\)\\(\\[eeinumkkmgtp\\]\\*\\[\\-\\+\\]\\?\\[0-9\\]\\*\\)\\$'",
23
+ "replacement": "快照配额不能为空",
24
+ "flags": "gi"
25
+ },
26
+ {
27
+ "pattern": "secrets \"([^\"]+)\" already exists",
28
+ "replacement": "密钥 \"$1\" 已存在",
29
+ "flags": "gi"
30
+ },
31
+ {
32
+ "pattern": "backup target is invalid",
33
+ "replacement": "备份目标无效",
34
+ "flags": "gi"
35
+ },
36
+ {
37
+ "pattern": "failed to list objects with param:[\\s\\S]*?server gave http response to https client",
38
+ "replacement": "列举对象失败:服务器返回 HTTP 响应,但客户端使用 HTTPS,请检查协议配置",
39
+ "flags": "gi"
40
+ },
41
+ {
42
+ "pattern": "clusternetwork\\.network\\.harvesterhci\\.io \"([^\"]+)\" is invalid: metadata\\.name: invalid value: \"([^\"]*)\": a lowercase rfc 1123 subdomain must consist of lower case alphanumeric characters, '-' or '\\.', and must start and end with an alphanumeric character",
43
+ "replacement": "集群网络名称 '$1' 无效:须符合 RFC 1123 子域名规则,只能使用小写字母、数字、'-' 或 '.',且以字母或数字开头和结尾",
44
+ "flags": "gi"
45
+ },
46
+ {
47
+ "pattern": "loadbalancer\\.loadbalancer\\.harvesterhci\\.io \"([^\"]+)\" is invalid: \\[spec\\.listeners\\[(\\d+)\\]\\.(backendport|port): required value[^\\]]*\\]",
48
+ "replacement": "负载均衡器 '$1' 配置无效:第 $2 个监听器的 $3 为必填项",
49
+ "flags": "gi"
50
+ },
51
+ {
52
+ "pattern": "can't delete cluster network (\\S+) because vlanconfig\\(s\\) \\[(.*?)\\] under this clusternetwork are still existing",
53
+ "replacement": "无法删除集群网络 '$1',因其下仍存在 VLAN 配置 [$2]",
54
+ "flags": "gi"
55
+ },
56
+ {
57
+ "pattern": "value: (\\d+) must be in range \\[1 \\.\\. (\\d+)\\]",
58
+ "replacement": "值 $1 超出范围,必须在 1–$2 之间",
59
+ "flags": "gi"
60
+ },
61
+ {
62
+ "pattern": "can't delete vlanconfig (\\S+) because it is blocked by vm\\(s\\) ([^/]+)/(\\S+) which must be stopped at first",
63
+ "replacement": "无法删除 VLAN 配置 '$1':需先停止虚拟机 '$2/$3'",
64
+ "flags": "gi"
65
+ },
66
+ {
67
+ "pattern": "cannot find nfs path",
68
+ "replacement": "无法找到 NFS 路径",
69
+ "flags": "gi"
70
+ },
71
+ {
72
+ "pattern": "get \"([^\"]+)\": unsupported protocol scheme \"\"",
73
+ "replacement": "url 无效",
74
+ "flags": "gi"
75
+ },
76
+ {
77
+ "pattern": "cannot mount nfs ([^\\s]+)[\\s\\S]*?no such file or directory[\\s\\S]*?cannot mount using nfsv4",
78
+ "replacement": "备份存储的端点无法访问",
79
+ "flags": "gi"
80
+ },
81
+ {
82
+ "pattern": "can't create nad ([^/]+)/([^\\s]+) because the gateway ([^\\s]+) is invalid",
83
+ "replacement": "无法创建虚拟网络 '$1/$2',因为网关 '$3' 无效",
84
+ "flags": "gi"
85
+ },
86
+ {
87
+ "pattern": "can't create nad ([^/]+)/([^\\s]+) because the cidr ([^\\s]+) is invalid",
88
+ "replacement": "无法创建虚拟网络 '$1/$2',因为 CIDR '$3' 无效",
89
+ "flags": "gi"
90
+ },
91
+ {
92
+ "pattern": "no matching backup found for url ([^\\s]+) and backing image ([^\\s]+)",
93
+ "replacement": "未找到与 URL $1 和镜像 $2 匹配的备份",
94
+ "flags": "gi"
95
+ },
3
96
  {
4
97
  "pattern": "take virtual machine snapshot ([^\\s]+) successfully\\.",
5
98
  "replacement": "虚拟机快照 '$1' 创建成功。",
@@ -87,7 +180,7 @@
87
180
  },
88
181
  {
89
182
  "pattern": "validation failed in api: vpc.kubeovn.io \"([^\"]*)\" is invalid: metadata\\.name: invalid value: \"([^\"]*)\": a lowercase rfc 1123 subdomain must consist of lower case alphanumeric characters, '-' or '\\.', and must start and end with an alphanumeric character \\(e\\.g\\..*?\\)",
90
- "replacement": "API 校验失败:VPC 名称 \"$1\" 不符合 RFC 1123 子域名规则,只能使用小写字母、数字、'-' 或 '.',且必须以字母/数字开头和结尾",
183
+ "replacement": "校验失败:VPC 名称 \"$1\" 不符合 RFC 1123 子域名规则,只能使用小写字母、数字、'-' 或 '.',且必须以字母/数字开头和结尾",
91
184
  "flags": "gi"
92
185
  },
93
186
  {