dashboard-shell-shell 3.0.5-test.4 → 3.0.5-test.5

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 (33) hide show
  1. package/assets/styles/global/_button.scss +7 -7
  2. package/assets/styles/global/_tooltip.scss +4 -4
  3. package/assets/styles/themes/_light.scss +3 -1
  4. package/assets/translations/zh-hans.yaml +76 -0
  5. package/components/ActionDropdown.vue +1 -1
  6. package/components/CopyToClipboard.vue +15 -0
  7. package/components/Drawer/Chrome.vue +2 -2
  8. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +23 -23
  9. package/components/Drawer/ResourceDetailDrawer/index.vue +2 -2
  10. package/components/ExplorerMembers.vue +18 -3
  11. package/components/PodSecurityAdmission.vue +1 -1
  12. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  13. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  14. package/components/Resource/Detail/Metadata/index.vue +2 -1
  15. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  16. package/components/Resource/Detail/TitleBar/index.vue +103 -24
  17. package/components/ResourceDetail/legacy.vue +3 -1
  18. package/components/SortableTable/index.vue +1 -1
  19. package/components/Tabbed/index.vue +1 -1
  20. package/components/auth/Principal.vue +2 -2
  21. package/components/breadcrumb/index.vue +340 -0
  22. package/components/form/LabeledSelect.vue +3 -2
  23. package/components/form/Taints.vue +2 -1
  24. package/components/form/WorkloadPorts.vue +143 -123
  25. package/edit/workload/index.vue +3 -3
  26. package/package.json +1 -1
  27. package/pages/account/index.vue +5 -13
  28. package/pages/account/pri.vue +229 -0
  29. package/pages/auth/login.vue +6 -1
  30. package/pages/c/_cluster/_product/namespaces.vue +1 -1
  31. package/rancher-components/BadgeState/BadgeState.vue +33 -52
  32. package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
  33. package/store/i18n.js +3 -0
@@ -166,7 +166,7 @@ export default {
166
166
  </template>
167
167
 
168
168
  <style lang="scss" scoped>
169
- $size: 79px;
169
+ $size: 20px;
170
170
 
171
171
  .principal {
172
172
  display: grid;
@@ -174,7 +174,7 @@ export default {
174
174
  "avatar name"
175
175
  "avatar description";
176
176
  grid-template-columns: $size auto;
177
- grid-template-rows: auto math.div($size, 2);
177
+ // grid-template-rows: auto math.div($size, 2);
178
178
  column-gap: 10px;
179
179
 
180
180
  th {
@@ -0,0 +1,340 @@
1
+ <script>
2
+ import { KUBERNETES, PROJECT } from '@shell/config/labels-annotations';
3
+ import { FLEET, NAMESPACE, MANAGEMENT, HELM } from '@shell/config/types';
4
+ import ButtonGroup from '@shell/components/ButtonGroup';
5
+ // import { BadgeState } from '@components/BadgeState';
6
+ import DotState from '@shell/components/DotState.vue';
7
+ import { Banner } from '@components/Banner';
8
+ import { get } from '@shell/utils/object';
9
+ import { NAME as FLEET_NAME } from '@shell/config/product/fleet';
10
+ import { HIDE_SENSITIVE } from '@shell/store/prefs';
11
+ import {
12
+ AS, _DETAIL, _CONFIG, _YAML, MODE, _CREATE, _EDIT, _VIEW, _UNFLAG, _GRAPH
13
+ } from '@shell/config/query-params';
14
+ import { ExtensionPoint, PanelLocation } from '@shell/core/types';
15
+ import ExtensionPanel from '@shell/components/ExtensionPanel';
16
+ import TabTitle from '@shell/components/TabTitle';
17
+ import ActionMenu from '@shell/components/ActionMenuShell.vue';
18
+ import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
19
+ import { useStore } from 'vuex';
20
+
21
+ // i18n-uses resourceDetail.header.*
22
+
23
+ /**
24
+ * Resource Detail Masthead component.
25
+ *
26
+ * 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
27
+ */
28
+ export default {
29
+
30
+ name: 'MastheadResourceDetail',
31
+
32
+ components: {
33
+ // BadgeState,
34
+ DotState,
35
+ Banner,
36
+ ButtonGroup,
37
+ ExtensionPanel,
38
+ TabTitle,
39
+ ActionMenu,
40
+ },
41
+ props: {
42
+ value: {
43
+ type: Object,
44
+ default: () => {
45
+ return {};
46
+ }
47
+ },
48
+
49
+ mode: {
50
+ type: String,
51
+ default: 'view'
52
+ },
53
+
54
+ realMode: {
55
+ type: String,
56
+ default: 'view'
57
+ },
58
+
59
+ as: {
60
+ type: String,
61
+ default: _YAML,
62
+ },
63
+
64
+ storeOverride: {
65
+ type: String,
66
+ default: null,
67
+ },
68
+
69
+ resource: {
70
+ type: String,
71
+ default: null,
72
+ },
73
+
74
+ resourceSubtype: {
75
+ type: String,
76
+ default: null,
77
+ },
78
+
79
+ parentRouteOverride: {
80
+ type: String,
81
+ default: null,
82
+ },
83
+
84
+ },
85
+
86
+ setup() {
87
+ const store = useStore();
88
+ const { featureDropdownMenu } = useRuntimeFlag(store);
89
+
90
+ return { featureDropdownMenu };
91
+ },
92
+
93
+ data() {
94
+ return {
95
+ DETAIL_VIEW: _DETAIL,
96
+ extensionType: ExtensionPoint.PANEL,
97
+ extensionLocation: PanelLocation.DETAILS_MASTHEAD,
98
+ Svg: require('~shell/assets/images/API.svg')
99
+ };
100
+ },
101
+
102
+ computed: {
103
+ dev() {
104
+ return this.$store.getters['prefs/dev'];
105
+ },
106
+
107
+ schema() {
108
+ const inStore = this.storeOverride || this.$store.getters['currentStore'](this.resource);
109
+
110
+ return this.$store.getters[`${ inStore }/schemaFor`]( this.resource );
111
+ },
112
+
113
+ isProjectHelmChart() {
114
+ return this.schema?.id === HELM.PROJECTHELMCHART;
115
+ },
116
+
117
+ shouldHifenize() {
118
+ return (this.mode === 'view' || this.mode === 'edit') && this.resourceSubtype?.length && this.value?.nameDisplay?.length;
119
+ },
120
+
121
+ parent() {
122
+ const displayName = this.value?.parentNameOverride || this.$store.getters['type-map/labelFor'](this.schema);
123
+ const product = this.$store.getters['currentProduct'].name;
124
+
125
+ const defaultLocation = {
126
+ name: 'c-cluster-product-resource',
127
+ params: {
128
+ resource: this.resource,
129
+ product,
130
+ }
131
+ };
132
+
133
+ const location = this.value?.parentLocationOverride || defaultLocation;
134
+
135
+ if (this.parentRouteOverride) {
136
+ location.name = this.parentRouteOverride;
137
+ }
138
+
139
+ const typeOptions = this.$store.getters[`type-map/optionsFor`]( this.resource );
140
+
141
+ // 转换为中文
142
+ const displayName_zh_hans = {
143
+ 'GlobalRole': '全局角色',
144
+ 'RoleTemplate': '集群角色',
145
+ }
146
+ if (displayName_zh_hans[displayName]) {
147
+ displayName = displayName_zh_hans[displayName]
148
+ }
149
+
150
+ if (displayName == '集群角色' && (this.$route.query?.roleContext == 'NAMESPACE' || location.hash == '#NAMESPACE')) {
151
+ displayName = '项目或资源组角色'
152
+ }
153
+
154
+ const out = {
155
+ displayName, location, ...typeOptions
156
+ };
157
+
158
+ return out;
159
+ },
160
+
161
+
162
+ displayName() {
163
+ let displayName = this.value.nameDisplay;
164
+
165
+ if (this.isProjectHelmChart) {
166
+ displayName = this.value.projectDisplayName;
167
+ }
168
+
169
+ return this.shouldHifenize ? ` - ${ displayName }` : displayName;
170
+ },
171
+
172
+ demoDisplay() {
173
+ const product = this.$store.getters['productId'];
174
+
175
+ const resources = this.location?.params?.resource || ''
176
+
177
+ const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], resources);
178
+
179
+ if (productId === undefined) {
180
+ return '';
181
+ }
182
+ const parts = productId.split('::');
183
+ const newString = 'root';
184
+
185
+ if (!parts?.includes(newString)) {
186
+ parts.unshift(newString); // 将字符串添加到数组第一位
187
+ }
188
+
189
+ const partsEn = parts.map((item) => {
190
+ return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
191
+ });
192
+
193
+ return partsEn;
194
+ },
195
+ menuIcon() {
196
+ const product = this.$store.getters['productId'];
197
+
198
+ const resources = this.location?.params?.resource || ''
199
+
200
+ return this.$store.getters['type-map/groupsForVirTypes'](product, resources);
201
+ },
202
+
203
+ location() {
204
+ const { parent } = this;
205
+
206
+ return parent?.location;
207
+ },
208
+
209
+ },
210
+
211
+ methods: {
212
+ get,
213
+ }
214
+ };
215
+ </script>
216
+
217
+ <template>
218
+ <div class="masthead">
219
+ <div class="title">
220
+ <!-- 创建api密钥不需要面包屑 -->
221
+ <div
222
+ v-if="!(parentRouteOverride === 'account' && resource=== 'token')"
223
+ class="excram-list"
224
+ >
225
+ <span
226
+ v-for="(item,index) in demoDisplay"
227
+ :key="index"
228
+ >
229
+ <span>{{ item }}</span>
230
+ <span>/</span>
231
+ </span>
232
+ <span class="excram-last-name">
233
+ {{ (realMode === 'view'? '查看': realMode === 'edit' ? '编辑':'创建') + parent.displayName }}
234
+ </span>
235
+ </div>
236
+ </div>
237
+ </div>
238
+ </template>
239
+
240
+ <style lang='scss' scoped>
241
+
242
+ HEADER {
243
+ margin: 0;
244
+ }
245
+
246
+ .primaryheader {
247
+ display: flex;
248
+ flex-direction: row;
249
+ align-items: center;
250
+ font-size:14px;
251
+ height: 50px;
252
+
253
+ h1 {
254
+ margin: 0;
255
+ }
256
+ }
257
+
258
+ .subheader{
259
+ display: flex;
260
+ flex-direction: row;
261
+ color: var(--input-label);
262
+ & > * {
263
+ margin: 5px 20px 5px 0px;
264
+ }
265
+
266
+ .live-data {
267
+ color: var(--body-text)
268
+ }
269
+ }
270
+
271
+ .state-banner {
272
+ margin: 3px 0 0 0;
273
+ }
274
+
275
+ .masthead-state {
276
+ font-size: initial;
277
+ display: inline-block;
278
+ position: relative;
279
+ /* top: -2px; */
280
+ font-size: 12px;
281
+ margin-left: 5px;
282
+ }
283
+
284
+ .masthead-istio {
285
+ .icon {
286
+ vertical-align: middle;
287
+ color: var(--primary);
288
+ }
289
+ }
290
+
291
+ .left-right-split {
292
+ display: grid;
293
+ align-items: center;
294
+
295
+ .left-half {
296
+ grid-column: 1;
297
+ }
298
+
299
+ .right-half {
300
+ grid-column: 2;
301
+ }
302
+ }
303
+
304
+ .resource-external {
305
+ font-size: 18px;
306
+ }
307
+ .excram-list{
308
+ font-size: 14px;
309
+ margin-bottom: 20px;
310
+ }
311
+ .excram-last-name{
312
+ color: var(--link);
313
+ }
314
+ .valid{
315
+ color: #d7d7d7;
316
+ margin: 0px 10px;
317
+ }
318
+ .detailIcon-span{
319
+ width: 24px;
320
+ height: 24px;
321
+ display: inline-block;
322
+ position: relative;
323
+ background: var(--primary);
324
+ margin-right: 10px;
325
+ }
326
+ .detailIcon{
327
+ position: absolute;
328
+ color: #fff;
329
+ font-size: 38px;
330
+ left: 4px;
331
+ top: -2px;
332
+ }
333
+ .primary-title{
334
+ display: flex;
335
+ align-items: center;
336
+ }
337
+ .detailIcon-span-title{
338
+ font-weight: bold;
339
+ }
340
+ </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
  }
@@ -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>