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

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 (212) hide show
  1. package/assets/brand/harvester/favicon.png +0 -0
  2. package/assets/brand/suse/favicon.png +0 -0
  3. package/assets/images/pl/half-logo.svg +23 -2
  4. package/assets/images/pl/harvester.png +0 -0
  5. package/assets/styles/app.scss +0 -4
  6. package/assets/styles/base/_basic.scss +2 -2
  7. package/assets/styles/base/_mixins.scss +1 -1
  8. package/assets/styles/base/_typography.scss +1 -2
  9. package/assets/styles/base/_variables.scss +4 -11
  10. package/assets/styles/global/_button.scss +25 -43
  11. package/assets/styles/global/_columns.scss +1 -3
  12. package/assets/styles/global/_form.scss +13 -45
  13. package/assets/styles/global/_labeled-input.scss +26 -54
  14. package/assets/styles/global/_layout.scss +3 -8
  15. package/assets/styles/global/_select.scss +17 -25
  16. package/assets/styles/global/_table.scss +1 -7
  17. package/assets/styles/global/_tooltip.scss +8 -56
  18. package/assets/styles/themes/_dark.scss +0 -3
  19. package/assets/styles/themes/_light.scss +43 -66
  20. package/assets/styles/vendor/vue-select.scss +9 -22
  21. package/assets/translations/en-us.yaml +4 -28
  22. package/assets/translations/zh-hans.yaml +189 -452
  23. package/components/ActionDropdown.vue +1 -2
  24. package/components/ActionMenu.vue +2 -2
  25. package/components/ActionMenuShell.vue +0 -2
  26. package/components/AppModal.vue +5 -46
  27. package/components/BrandImage.vue +0 -1
  28. package/components/ButtonDropdown.vue +4 -26
  29. package/components/ButtonMultiAction.vue +0 -1
  30. package/components/ClusterIconMenu.vue +1 -1
  31. package/components/CodeMirror.vue +6 -20
  32. package/components/ConsumptionGauge.vue +5 -24
  33. package/components/CopyToClipboard.vue +0 -15
  34. package/components/CruResource.vue +8 -9
  35. package/components/CruResourceFooter.vue +2 -2
  36. package/components/DashboardOptions.vue +17 -29
  37. package/components/Drawer/Chrome.vue +2 -2
  38. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +23 -23
  39. package/components/Drawer/ResourceDetailDrawer/index.vue +2 -2
  40. package/components/ExplorerMembers.vue +3 -18
  41. package/components/ExplorerProjectsNamespaces.vue +5 -19
  42. package/components/GlobalRoleBindings.vue +48 -112
  43. package/components/GrafanaDashboard.vue +4 -4
  44. package/components/GrowlManager.vue +1 -3
  45. package/components/HardwareResourceGauge.vue +3 -39
  46. package/components/IndentedPanel.vue +10 -4
  47. package/components/InfoBox.vue +3 -3
  48. package/components/InputOrDisplay.vue +2 -28
  49. package/components/LabelValue.vue +1 -20
  50. package/components/ModalWithCard.vue +3 -12
  51. package/components/PodSecurityAdmission.vue +1 -1
  52. package/components/PromptModal.vue +1 -1
  53. package/components/PromptRemove.vue +11 -30
  54. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +3 -1
  55. package/components/Resource/Detail/Metadata/KeyValue.vue +4 -8
  56. package/components/Resource/Detail/Metadata/index.vue +1 -2
  57. package/components/Resource/Detail/TitleBar/Title.vue +3 -4
  58. package/components/Resource/Detail/TitleBar/index.vue +24 -103
  59. package/components/ResourceDetail/Masthead/legacy.vue +38 -181
  60. package/components/ResourceDetail/legacy.vue +14 -32
  61. package/components/ResourceList/Masthead.vue +54 -226
  62. package/components/ResourceList/ResourceLoadingIndicator.vue +2 -5
  63. package/components/ResourceTable.vue +2 -24
  64. package/components/SideNav.vue +20 -74
  65. package/components/SortableTable/THead.vue +3 -33
  66. package/components/SortableTable/index.vue +464 -1017
  67. package/components/SortableTable/paging.js +16 -26
  68. package/components/SortableTable/selection.js +2 -2
  69. package/components/Tabbed/Tab.vue +3 -3
  70. package/components/Tabbed/index.vue +30 -48
  71. package/components/YamlEditor.vue +1 -0
  72. package/components/auth/Principal.vue +13 -37
  73. package/components/auth/RoleDetailEdit.vue +7 -58
  74. package/components/auth/SelectPrincipal.vue +0 -1
  75. package/components/form/ArrayList.vue +33 -41
  76. package/components/form/ArrayListGrouped.vue +2 -10
  77. package/components/form/ArrayListSelect.vue +1 -1
  78. package/components/form/BannerSettings.vue +59 -64
  79. package/components/form/ChangePassword.vue +4 -4
  80. package/components/form/ColorInput.vue +8 -32
  81. package/components/form/Footer.vue +8 -11
  82. package/components/form/InputWithSelect.vue +5 -8
  83. package/components/form/KeyValue.vue +7 -47
  84. package/components/form/LabeledSelect.vue +242 -214
  85. package/components/form/Labels.vue +3 -3
  86. package/components/form/MatchExpressions.vue +7 -24
  87. package/components/form/Members/ClusterPermissionsEditor.vue +2 -1
  88. package/components/form/Members/MembershipEditor.vue +1 -1
  89. package/components/form/NameNsDescription.vue +20 -59
  90. package/components/form/Password.vue +7 -16
  91. package/components/form/PodAffinity.vue +5 -4
  92. package/components/form/ResourceQuota/Namespace.vue +4 -4
  93. package/components/form/ResourceQuota/NamespaceRow.vue +17 -18
  94. package/components/form/ResourceQuota/Project.vue +4 -4
  95. package/components/form/ResourceQuota/ProjectRow.vue +6 -3
  96. package/components/form/Select.vue +2 -5
  97. package/components/form/SimpleSecretSelector.vue +9 -29
  98. package/components/form/Taints.vue +1 -2
  99. package/components/form/UnitInput.vue +3 -8
  100. package/components/form/WorkloadPorts.vue +123 -143
  101. package/components/formatter/BadgeStateFormatter.vue +5 -8
  102. package/components/formatter/LiveDate.vue +3 -3
  103. package/components/nav/Favorite.vue +1 -5
  104. package/components/nav/Group.vue +99 -132
  105. package/components/nav/Header.vue +27 -124
  106. package/components/nav/HeaderPageActionMenu.vue +0 -1
  107. package/components/nav/NamespaceFilter.vue +15 -19
  108. package/components/nav/TopLevelMenu.vue +119 -182
  109. package/components/nav/Type.vue +41 -63
  110. package/composables/useClickOutside.ts +1 -1
  111. package/config/private-label.js +11 -15
  112. package/config/product/auth.js +7 -17
  113. package/config/product/settings.js +9 -19
  114. package/config/settings.ts +0 -28
  115. package/config/table-headers.js +2 -3
  116. package/dialog/ForceMachineRemoveDialog.vue +2 -2
  117. package/dialog/ScalePoolDownDialog.vue +2 -2
  118. package/edit/management.cattle.io.user.vue +4 -17
  119. package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +19 -19
  120. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +31 -31
  121. package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +12 -36
  122. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +6 -6
  123. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +10 -10
  124. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +4 -4
  125. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +4 -4
  126. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +1 -1
  127. package/edit/monitoring.coreos.com.receiver/types/email.vue +6 -6
  128. package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +10 -10
  129. package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +5 -5
  130. package/edit/monitoring.coreos.com.receiver/types/slack.vue +4 -4
  131. package/edit/namespace.vue +2 -1
  132. package/edit/token.vue +12 -31
  133. package/edit/workload/index.vue +4 -4
  134. package/list/management.cattle.io.setting.vue +13 -22
  135. package/list/management.cattle.io.user.vue +3 -7
  136. package/list/namespace.vue +0 -3
  137. package/list/provisioning.cattle.io.cluster.vue +7 -6
  138. package/mixins/brand.js +0 -17
  139. package/package.json +1 -1
  140. package/pages/account/index.vue +25 -79
  141. package/pages/auth/login.vue +52 -220
  142. package/pages/auth/setup.vue +19 -142
  143. package/pages/c/_cluster/_product/namespaces.vue +5 -5
  144. package/pages/c/_cluster/auth/roles/index.vue +1 -19
  145. package/pages/c/_cluster/monitoring/monitor/index.vue +2 -2
  146. package/pages/c/_cluster/settings/banners.vue +102 -174
  147. package/pages/c/_cluster/settings/brand.vue +302 -350
  148. package/pages/c/_cluster/settings/performance.vue +38 -61
  149. package/pages/home.vue +30 -70
  150. package/pages/prefs.vue +25 -27
  151. package/promptRemove/mixin/roleDeletionCheck.js +2 -2
  152. package/public/index.html +4 -4
  153. package/rancher-components/BadgeState/BadgeState.vue +55 -38
  154. package/rancher-components/Banner/Banner.vue +8 -12
  155. package/rancher-components/Card/Card.vue +8 -7
  156. package/rancher-components/Form/Checkbox/Checkbox.vue +0 -4
  157. package/rancher-components/Form/LabeledInput/LabeledInput.vue +3 -42
  158. package/rancher-components/Form/Radio/RadioButton.vue +11 -35
  159. package/rancher-components/Form/Radio/RadioGroup.vue +5 -13
  160. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +3 -3
  161. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +0 -1
  162. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +4 -12
  163. package/rancher-components/RcDropdown/RcDropdown.vue +7 -35
  164. package/rancher-components/RcDropdown/RcDropdownItem.vue +2 -2
  165. package/rancher-components/RcDropdown/RcDropdownMenu.vue +6 -12
  166. package/rancher-components/RcDropdown/types.ts +0 -1
  167. package/rancher-components/StringList/StringList.vue +1 -1
  168. package/static/favicon.ico +0 -0
  169. package/static/favicon.png +0 -0
  170. package/static/loading-indicator.html +3 -3
  171. package/store/i18n.js +2 -5
  172. package/store/modal.ts +3 -3
  173. package/store/prefs.js +4 -11
  174. package/store/type-map.js +2 -32
  175. package/types/shell/index.d.ts +67 -74
  176. package/utils/error.js +8 -87
  177. package/utils/router.js +0 -21
  178. package/utils/select.js +3 -26
  179. package/utils/string.js +5 -8
  180. package/utils/title.ts +1 -1
  181. package/assets/icons/demo.css +0 -539
  182. package/assets/icons/demo.css:Zone.Identifier +0 -0
  183. package/assets/icons/demo_index.html +0 -1131
  184. package/assets/icons/demo_index.html:Zone.Identifier +0 -0
  185. package/assets/icons/iconfont.css +0 -216
  186. package/assets/icons/iconfont.css:Zone.Identifier +0 -0
  187. package/assets/icons/iconfont.js +0 -1
  188. package/assets/icons/iconfont.js:Zone.Identifier +0 -0
  189. package/assets/icons/iconfont.json +0 -324
  190. package/assets/icons/iconfont.json:Zone.Identifier +0 -0
  191. package/assets/icons/iconfont.ttf +0 -0
  192. package/assets/icons/iconfont.ttf:Zone.Identifier +0 -0
  193. package/assets/icons/iconfont.woff +0 -0
  194. package/assets/icons/iconfont.woff2 +0 -0
  195. package/assets/icons/iconfont.woff2:Zone.Identifier +0 -0
  196. package/assets/icons/iconfont.woff:Zone.Identifier +0 -0
  197. package/assets/images/API.svg +0 -3
  198. package/assets/images/action.svg +0 -6
  199. package/assets/images/login/password.svg +0 -20
  200. package/assets/images/login/user.svg +0 -6
  201. package/assets/images/login-bg.png +0 -0
  202. package/assets/images/login-left.png +0 -0
  203. package/assets/images/login-logo.svg +0 -19
  204. package/assets/images/logo.png +0 -0
  205. package/assets/images/pl/logo.png +0 -0
  206. package/assets/images/promp-yellow.svg +0 -5
  207. package/assets/images/user.png +0 -0
  208. package/assets/styles/all.scss +0 -63
  209. package/components/DotState.vue +0 -84
  210. package/components/breadcrumb/index.vue +0 -340
  211. package/pages/account/pri.vue +0 -229
  212. package/utils/errorTranslate.json +0 -1336
@@ -1,340 +0,0 @@
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>
@@ -1,229 +0,0 @@
1
- <script>
2
- import { NORMAN } from '@shell/config/types';
3
-
4
- export default {
5
- props: {
6
- value: {
7
- type: String,
8
- required: true,
9
- },
10
-
11
- useMuted: {
12
- type: Boolean,
13
- default: true,
14
- },
15
-
16
- showLabels: {
17
- type: Boolean,
18
- default: false,
19
- },
20
- isShowPass: {
21
- type: Boolean,
22
- default: false,
23
- }
24
- },
25
-
26
- async fetch() {
27
- this.principal = this.$store.getters['rancher/byId'](NORMAN.PRINCIPAL, this.value);
28
-
29
- if ( this.principal ) {
30
- return;
31
- }
32
-
33
- const principalId = escape(this.value).replace(/\//g, '%2F');
34
-
35
- try {
36
- this.principal = await this.$store.dispatch('rancher/find', {
37
- type: NORMAN.PRINCIPAL,
38
- id: this.value,
39
- opt: { url: `/v3/principals/${ principalId }` }
40
- });
41
- } catch (e) {
42
- console.error('Failed to fetch principal', this.value, principalId); // eslint-disable-line no-console
43
- }
44
- },
45
-
46
- data() {
47
- // Load from cache immediately if possible
48
- return { principal: null };
49
- },
50
-
51
- computed: {
52
- showBoth() {
53
- const p = this.principal;
54
-
55
- return p.name && p.loginName && p.name.trim().toLowerCase() !== p.loginName.trim().toLowerCase();
56
- }
57
- },
58
- };
59
- </script>
60
-
61
- <template>
62
- <div
63
- class="principal"
64
- :class="{'showLabels': showLabels}"
65
- >
66
- <template v-if="!principal && $fetchState.pending">
67
- <div class="avatar">
68
- <div class="empty">
69
- <i class="icon icon-spinner icon-lg" />
70
- </div>
71
- </div>
72
- <div
73
- v-clean-html="t('principal.loading', null, true)"
74
- class="name"
75
- :class="{'text-muted': useMuted}"
76
- />
77
- <div class="description" />
78
- </template>
79
-
80
- <template v-else-if="principal">
81
- <div class="avatar">
82
- <img
83
- src="@shell/assets/images/user.png"
84
- >
85
- </div>
86
- <div
87
- v-if="showLabels"
88
- class="name"
89
- >
90
- <table>
91
- <tr class="mb-10">
92
- <td>{{ t('principal.name') }}: </td><td>{{ principal.name || principal.loginName }}</td>
93
- </tr>
94
- <tr class="mb-10">
95
- <td>{{ t('principal.loginName') }}: </td><td>{{ principal.loginName }}</td>
96
- </tr>
97
- <tr
98
- v-if="isShowPass"
99
- class="mb-10"
100
- >
101
- <td>修改密码: </td><td>****** <slot name="edit" /></td>
102
- </tr>
103
- <tr><td>{{ t('principal.type') }}: </td><td>{{ principal.displayType }}</td></tr>
104
- </table>
105
- </div>
106
- <template v-else>
107
- <div class="name">
108
- <template v-if="showBoth">
109
- {{ principal.name }}
110
- <span
111
- v-if="principal.loginName"
112
- :class="{'text-muted': useMuted}"
113
- >({{ principal.loginName }})</span>
114
- </template>
115
- <template v-else-if="principal.name">
116
- {{ principal.name }}
117
- </template>
118
- <template v-else>
119
- {{ principal.loginName }}
120
- </template>
121
- </div>
122
- <div
123
- class="description"
124
- :class="{'text-muted': useMuted}"
125
- >
126
- {{ principal.displayType }}
127
- </div>
128
- </template>
129
- </template>
130
-
131
- <template v-else>
132
- <div class="avatar">
133
- <div
134
- class="empty"
135
- :class="{'text-muted': useMuted}"
136
- >
137
- <i class="icon icon-warning icon-lg" />
138
- </div>
139
- </div>
140
- <div
141
- v-t="'principal.error'"
142
- class="name text-error"
143
- />
144
- <div
145
- class="description"
146
- :class="{'text-muted': useMuted}"
147
- >
148
- {{ value }}
149
- </div>
150
- </template>
151
- </div>
152
- </template>
153
-
154
- <style lang="scss" scoped>
155
- $size: 79px;
156
-
157
- .principal {
158
- display: grid;
159
- grid-template-areas:
160
- "avatar name"
161
- "avatar description";
162
- grid-template-columns: $size auto;
163
- grid-template-rows: auto math.div($size, 2);
164
- column-gap: 10px;
165
-
166
- th {
167
- text-align: left;
168
- font-weight: normal;
169
- padding-right: 10px;
170
- }
171
-
172
- &.showLabels {
173
- /* grid-template-areas:
174
- "avatar name";
175
- grid-template-columns: 60px auto;
176
- grid-template-rows: 60px;
177
- column-gap: 0; */
178
- display: flex;
179
- column-gap:0;
180
- .name {
181
- display: flex;
182
- line-height: unset;
183
- }
184
- table tr {
185
- display: block;
186
- }
187
- table tr td:not(:first-of-type) {
188
- padding-left: 10px;
189
- }
190
- table tr td:not(:last-of-type) {
191
- width: 100px;
192
- }
193
- }
194
-
195
- .avatar {
196
- /* grid-area: avatar;
197
- text-align: center; */
198
- width: 287px;
199
- display: flex;
200
- justify-content: center;
201
- align-items: center;
202
-
203
- DIV.empty {
204
- border: 1px solid var(--border);
205
- line-height: $size;
206
- }
207
-
208
- IMG {
209
- width: $size;
210
- height: $size;
211
- }
212
-
213
- DIV.round, IMG.round {
214
- border-radius: 50%;
215
- }
216
- }
217
-
218
- .name {
219
- grid-area: name;
220
- line-height: math.div($size, 2);
221
- overflow-wrap: anywhere;
222
- }
223
-
224
- .description {
225
- grid-area: description;
226
- line-height: math.div($size, 2);
227
- }
228
- }
229
- </style>