dashboard-shell-shell 3.0.5-test.1 → 3.0.5-test.11

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 (50) hide show
  1. package/assets/styles/base/_variables.scss +3 -3
  2. package/assets/styles/global/_button.scss +7 -7
  3. package/assets/styles/global/_tooltip.scss +4 -4
  4. package/assets/styles/themes/_light.scss +3 -1
  5. package/assets/translations/zh-hans.yaml +76 -0
  6. package/components/ActionDropdown.vue +1 -1
  7. package/components/CopyToClipboard.vue +15 -0
  8. package/components/Drawer/Chrome.vue +2 -2
  9. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -22
  10. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
  11. package/components/Drawer/ResourceDetailDrawer/index.vue +2 -1
  12. package/components/ExplorerMembers.vue +18 -3
  13. package/components/PodSecurityAdmission.vue +1 -1
  14. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  15. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  16. package/components/Resource/Detail/Metadata/index.vue +3 -1
  17. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  18. package/components/Resource/Detail/TitleBar/Top.vue +2 -0
  19. package/components/Resource/Detail/TitleBar/index.vue +109 -24
  20. package/components/ResourceDetail/Masthead/legacy.vue +235 -164
  21. package/components/ResourceDetail/legacy.vue +29 -13
  22. package/components/ResourceList/Masthead.vue +22 -14
  23. package/components/SortableTable/index.vue +2 -2
  24. package/components/Tabbed/Tab.vue +1 -1
  25. package/components/Tabbed/index.vue +51 -32
  26. package/components/auth/Principal.vue +35 -11
  27. package/components/breadcrumb/index.vue +316 -0
  28. package/components/form/LabeledSelect.vue +3 -2
  29. package/components/form/NameNsDescription.vue +5 -5
  30. package/components/form/Taints.vue +2 -1
  31. package/components/form/WorkloadPorts.vue +143 -123
  32. package/components/nav/Header.vue +3 -4
  33. package/components/nav/NamespaceFilter.vue +1 -2
  34. package/edit/workload/index.vue +3 -3
  35. package/package.json +1 -1
  36. package/pages/account/index.vue +25 -79
  37. package/pages/c/_cluster/auth/roles/index.vue +38 -5
  38. package/pkg/tsconfig.json +9 -9
  39. package/pkg/vue.config.js +2 -2
  40. package/plugins/dashboard-store/resource-class.js +28 -27
  41. package/rancher-components/BadgeState/BadgeState.vue +33 -52
  42. package/rancher-components/Banner/Banner.vue +2 -2
  43. package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
  44. package/scripts/publish-shell.sh +1 -1
  45. package/store/i18n.js +3 -0
  46. package/store/type-map.js +1 -1
  47. package/types/shell/index.d.ts +4 -30
  48. package/utils/error.js +3 -1
  49. package/utils/errorTranslate.json +15 -0
  50. package/vue.config.js +2 -2
@@ -0,0 +1,316 @@
1
+ <script>
2
+ import { Banner } from '@components/Banner';
3
+ 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
+ import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
9
+ import { useStore } from 'vuex';
10
+
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
+ export default {
19
+
20
+ name: 'MastheadResourceDetail',
21
+
22
+ components: {
23
+ // BadgeState,
24
+ Banner,
25
+ },
26
+ 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: {
45
+ type: String,
46
+ default: _YAML,
47
+ },
48
+
49
+ storeOverride: {
50
+ type: String,
51
+ default: null,
52
+ },
53
+
54
+ resource: {
55
+ type: String,
56
+ default: null,
57
+ },
58
+
59
+ resourceSubtype: {
60
+ type: String,
61
+ default: null,
62
+ },
63
+
64
+ parentRouteOverride: {
65
+ type: String,
66
+ default: null,
67
+ },
68
+
69
+ },
70
+
71
+ setup() {
72
+ const store = useStore();
73
+ const { featureDropdownMenu } = useRuntimeFlag(store);
74
+
75
+ return { featureDropdownMenu };
76
+ },
77
+
78
+ data() {
79
+ return {
80
+ DETAIL_VIEW: _DETAIL,
81
+ extensionType: ExtensionPoint.PANEL,
82
+ extensionLocation: PanelLocation.DETAILS_MASTHEAD,
83
+ Svg: require('~shell/assets/images/API.svg')
84
+ };
85
+ },
86
+
87
+ 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
+
157
+ demoDisplay() {
158
+
159
+ const resources = this.$route.params?.resource || ''
160
+
161
+ const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], resources);
162
+
163
+ if (productId === undefined) {
164
+ return '';
165
+ }
166
+ const parts = productId.split('::');
167
+ const newString = 'root';
168
+
169
+ if (!parts?.includes(newString)) {
170
+ parts.unshift(newString); // 将字符串添加到数组第一位
171
+ }
172
+
173
+ const partsEn = parts.map((item) => {
174
+ return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
175
+ });
176
+
177
+ return partsEn;
178
+ },
179
+
180
+ location() {
181
+ const { parent } = this;
182
+
183
+ return parent?.location;
184
+ },
185
+
186
+ },
187
+
188
+ methods: {
189
+ get,
190
+ }
191
+ };
192
+ </script>
193
+
194
+ <template>
195
+ <div class="masthead">
196
+ <div class="title">
197
+ <!-- 标题区域 -->
198
+ <div
199
+ class="excram-list"
200
+ >
201
+ <span
202
+ v-for="(item,index) in demoDisplay"
203
+ :key="index"
204
+ >
205
+ <span>{{ item }}</span>
206
+ <span>/</span>
207
+ </span>
208
+ <span class="excram-last-name">
209
+ {{ (realMode === 'view'? '查看': realMode === 'edit' ? '编辑':'创建') + parent.displayName }}
210
+ </span>
211
+ </div>
212
+ </div>
213
+ </div>
214
+ </template>
215
+
216
+ <style lang='scss' scoped>
217
+
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
+ .excram-list{
284
+ font-size: 14px;
285
+ margin-bottom: 20px;
286
+ }
287
+ .excram-last-name{
288
+ color: var(--link);
289
+ }
290
+ .valid{
291
+ color: #d7d7d7;
292
+ margin: 0px 10px;
293
+ }
294
+ .detailIcon-span{
295
+ width: 24px;
296
+ height: 24px;
297
+ display: inline-block;
298
+ position: relative;
299
+ background: var(--primary);
300
+ margin-right: 10px;
301
+ }
302
+ .detailIcon{
303
+ position: absolute;
304
+ color: #fff;
305
+ font-size: 38px;
306
+ left: 4px;
307
+ top: -2px;
308
+ }
309
+ .primary-title{
310
+ display: flex;
311
+ align-items: center;
312
+ }
313
+ .detailIcon-span-title{
314
+ font-weight: bold;
315
+ }
316
+ </style>
@@ -326,6 +326,7 @@ export default {
326
326
  <template>
327
327
  <div style="display: flex;">
328
328
  <div
329
+ v-if="hasLabel"
329
330
  :class="{ 'labeled-container': true, raised, empty, [mode]: true, 'is-lable': isLabel }"
330
331
  :style="{ border: 'none', width: selectWidth===''?'160px':selectWidth,lineHeight: '32px' }"
331
332
  >
@@ -348,7 +349,7 @@ export default {
348
349
  ref="select"
349
350
  class="labeled-select"
350
351
  :class="[
351
- $attrs.class,
352
+ $attrs.class && $attrs.class.replace('mb-20', ''),
352
353
  {
353
354
  disabled: isView || disabled,
354
355
  focused,
@@ -529,7 +530,7 @@ export default {
529
530
  // Prevent namespace field from wiggling or changing
530
531
  // height when it is toggled from a LabeledInput to a
531
532
  // LabeledSelect.
532
- padding-bottom: 1px;
533
+ // padding-bottom: 1px;
533
534
  &:deep() .vs__actions:after {
534
535
  padding-top: 10px;
535
536
  }
@@ -360,7 +360,7 @@ export default {
360
360
 
361
361
  colSpan() {
362
362
  if (!this.horizontal) {
363
- return `span-5`;
363
+ return `span-6`;
364
364
  }
365
365
  // Name and namespace take up two columns.
366
366
  // let cols = (this.nameNsHidden ? 0 : 2) + (this.descriptionHidden ? 0 : 1) + this.extraColumns.length;
@@ -439,8 +439,8 @@ export default {
439
439
  <div
440
440
  v-if="namespaced && !nameNsHidden && createNamespace"
441
441
  :data-testid="componentTestid + '-namespace-create'"
442
- class="col span-5"
443
- :class=" isDialog? 'namespace-item-row mb-20': 'col span-5'"
442
+ class="col span-6"
443
+ :class=" isDialog? 'namespace-item-row mb-20': 'col span-6'"
444
444
  style="display: flex;"
445
445
  >
446
446
 
@@ -473,7 +473,7 @@ export default {
473
473
  <div
474
474
  v-if="namespaced && !nameNsHidden && !createNamespace"
475
475
  :data-testid="componentTestid + '-namespace'"
476
- :class=" isDialog? 'namespace-item-row mb-20': 'col span-5'"
476
+ :class=" isDialog? 'namespace-item-row mb-20': 'col span-6'"
477
477
  >
478
478
  <LabeledSelect
479
479
  v-show="!createNamespace"
@@ -518,7 +518,7 @@ export default {
518
518
  <!-- <div
519
519
  v-show="!descriptionHidden"
520
520
  :data-testid="componentTestid + '-description'"
521
- :class="['col', extraColumns.length > 0 ? 'span-3' : 'span-5']"
521
+ :class="['col', extraColumns.length > 0 ? 'span-3' : 'span-6']"
522
522
  > -->
523
523
 
524
524
  <!-- 额外的动态列 -->
@@ -112,6 +112,7 @@ export default {
112
112
 
113
113
  <style lang="scss" scoped>
114
114
  .compact-select {
115
- height: 40px;
115
+ height: 32px;
116
+ overflow: hidden;
116
117
  }
117
118
  </style>