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

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 (163) hide show
  1. package/assets/brand/csp/favicon.png +0 -0
  2. package/assets/icons/iconfont.css +4 -1
  3. package/assets/images/pl/dark/logo.png +0 -0
  4. package/assets/styles/all.scss +23 -3
  5. package/assets/styles/base/_variables.scss +5 -5
  6. package/assets/styles/fonts/_icons.scss +3 -2
  7. package/assets/styles/global/_button.scss +8 -8
  8. package/assets/styles/global/_form.scss +1 -0
  9. package/assets/styles/global/_select.scss +1 -1
  10. package/assets/styles/global/_tooltip.scss +9 -5
  11. package/assets/styles/themes/_light.scss +6 -4
  12. package/assets/styles/vendor/vue-select.scss +2 -1
  13. package/assets/translations/en-us.yaml +59 -0
  14. package/assets/translations/zh-hans.yaml +168 -15
  15. package/components/ActionDropdown.vue +1 -1
  16. package/components/ButtonDropdown.vue +3 -1
  17. package/components/CodeMirror.vue +6 -4
  18. package/components/ContainerResourceLimit.vue +2 -2
  19. package/components/CopyToClipboard.vue +15 -0
  20. package/components/Drawer/Chrome.vue +2 -2
  21. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +30 -27
  22. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
  23. package/components/Drawer/ResourceDetailDrawer/index.vue +5 -4
  24. package/components/ExplorerMembers.vue +28 -4
  25. package/components/GlobalRoleBindings.vue +51 -112
  26. package/components/PodSecurityAdmission.vue +2 -2
  27. package/components/RelatedResources.vue +3 -0
  28. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  29. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  30. package/components/Resource/Detail/Metadata/index.vue +3 -1
  31. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  32. package/components/Resource/Detail/TitleBar/Top.vue +2 -0
  33. package/components/Resource/Detail/TitleBar/composables.ts +16 -1
  34. package/components/Resource/Detail/TitleBar/index.vue +123 -25
  35. package/components/ResourceDetail/Masthead/index.vue +1 -1
  36. package/components/ResourceDetail/Masthead/latest.vue +1 -1
  37. package/components/ResourceDetail/Masthead/legacy.vue +8 -7
  38. package/components/ResourceDetail/legacy.vue +18 -16
  39. package/components/ResourceList/Masthead.vue +13 -17
  40. package/components/ResourceTable.vue +10 -0
  41. package/components/SideNav.vue +21 -21
  42. package/components/SortableTable/THead.vue +46 -1
  43. package/components/SortableTable/index.vue +40 -20
  44. package/components/Tabbed/index.vue +6 -1
  45. package/components/auth/Principal.vue +10 -5
  46. package/components/auth/RoleDetailEdit.vue +11 -7
  47. package/components/breadcrumb/index.vue +119 -0
  48. package/components/form/ArrayList.vue +164 -147
  49. package/components/form/ArrayListGrouped.vue +5 -3
  50. package/components/form/ChangePassword.vue +1 -1
  51. package/components/form/Command.vue +4 -5
  52. package/components/form/Conditions.vue +15 -1
  53. package/components/form/Footer.vue +1 -0
  54. package/components/form/HealthCheck.vue +0 -2
  55. package/components/form/HookOption.vue +87 -58
  56. package/components/form/InputWithSelect.vue +8 -7
  57. package/components/form/KeyValue.vue +20 -2
  58. package/components/form/LabeledSelect.vue +6 -3
  59. package/components/form/Labels.vue +2 -2
  60. package/components/form/MatchExpressions.vue +4 -4
  61. package/components/form/Members/ClusterMembershipEditor.vue +1 -1
  62. package/components/form/Members/ClusterPermissionsEditor.vue +31 -28
  63. package/components/form/Members/MembershipEditor.vue +2 -2
  64. package/components/form/NameNsDescription.vue +1 -1
  65. package/components/form/Networking.vue +6 -9
  66. package/components/form/NodeAffinity.vue +29 -28
  67. package/components/form/PodAffinity.vue +23 -23
  68. package/components/form/Probe.vue +15 -11
  69. package/components/form/ProjectMemberEditor.vue +28 -25
  70. package/components/form/ResourceQuota/Namespace.vue +4 -4
  71. package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
  72. package/components/form/ResourceQuota/Project.vue +4 -4
  73. package/components/form/ResourceQuota/ProjectRow.vue +36 -30
  74. package/components/form/ResourceSelector.vue +1 -1
  75. package/components/form/Security.vue +1 -3
  76. package/components/form/Select.vue +7 -1
  77. package/components/form/ServiceNameSelect.vue +2 -5
  78. package/components/form/ServicePorts.vue +149 -75
  79. package/components/form/Taints.vue +2 -1
  80. package/components/form/Tolerations.vue +13 -9
  81. package/components/form/ValueFromResource.vue +110 -96
  82. package/components/form/WorkloadPorts.vue +143 -123
  83. package/components/formatter/WorkloadHealthScale.vue +4 -3
  84. package/components/nav/Group.vue +6 -0
  85. package/components/nav/Header.vue +7 -4
  86. package/components/nav/NamespaceFilter.vue +15 -21
  87. package/components/nav/TopLevelMenu.vue +99 -125
  88. package/components/nav/Type.vue +11 -3
  89. package/config/menuRouteMap.js +10 -0
  90. package/config/product/explorer.js +31 -9
  91. package/config/router/navigation-guards/index.js +61 -3
  92. package/detail/node.vue +28 -23
  93. package/dialog/AddCustomBadgeDialog.vue +17 -9
  94. package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
  95. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
  96. package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
  97. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
  98. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
  99. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
  100. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
  101. package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
  102. package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
  103. package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
  104. package/edit/configmap.vue +4 -0
  105. package/edit/networking.k8s.io.ingress/Certificate.vue +14 -5
  106. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
  107. package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
  108. package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
  109. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
  110. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
  111. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
  112. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  113. package/edit/persistentvolume/index.vue +3 -1
  114. package/edit/persistentvolumeclaim.vue +2 -0
  115. package/edit/secret/index.vue +2 -2
  116. package/edit/service.vue +4 -1
  117. package/edit/storage.k8s.io.storageclass/index.vue +10 -8
  118. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
  119. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
  120. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
  121. package/edit/workload/Job.vue +31 -34
  122. package/edit/workload/Upgrading.vue +5 -5
  123. package/edit/workload/index.vue +22 -18
  124. package/edit/workload/storage/Mount.vue +1 -0
  125. package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
  126. package/edit/workload/storage/azureDisk.vue +14 -10
  127. package/edit/workload/storage/azureFile.vue +9 -7
  128. package/edit/workload/storage/csi/index.vue +6 -9
  129. package/edit/workload/storage/emptyDir.vue +7 -5
  130. package/edit/workload/storage/gcePersistentDisk.vue +9 -7
  131. package/edit/workload/storage/hostPath.vue +7 -5
  132. package/edit/workload/storage/nfs.vue +8 -6
  133. package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
  134. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
  135. package/edit/workload/storage/secret.vue +9 -6
  136. package/edit/workload/storage/vsphereVolume.vue +11 -7
  137. package/initialize/app-extended.js +7 -1
  138. package/models/provisioning.cattle.io.cluster.js +19 -18
  139. package/package.json +1 -1
  140. package/pages/account/index.vue +90 -118
  141. package/pages/account/pri.vue +229 -0
  142. package/pages/auth/login.vue +6 -1
  143. package/pages/auth/setup.vue +36 -17
  144. package/pages/c/_cluster/_product/namespaces.vue +1 -1
  145. package/pages/c/_cluster/auth/roles/index.vue +38 -5
  146. package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
  147. package/pages/c/_cluster/explorer/tools/index.vue +6 -6
  148. package/pages/home.vue +3 -4
  149. package/pkg/tsconfig.json +9 -9
  150. package/pkg/vue.config.js +1 -1
  151. package/plugins/dashboard-store/resource-class.js +28 -27
  152. package/rancher-components/BadgeState/BadgeState.vue +33 -52
  153. package/rancher-components/Banner/Banner.vue +4 -1
  154. package/rancher-components/Form/Radio/RadioGroup.vue +9 -1
  155. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
  156. package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
  157. package/scripts/publish-shell.sh +1 -1
  158. package/store/i18n.js +4 -0
  159. package/store/type-map.js +1 -3
  160. package/types/shell/index.d.ts +4 -30
  161. package/utils/error.js +3 -1
  162. package/utils/errorTranslate.json +366 -2
  163. package/vue.config.js +1 -1
@@ -151,71 +151,39 @@ export default {
151
151
  <template>
152
152
  <Loading v-if="$fetchState.pending" />
153
153
  <div v-else>
154
- <!-- <BackLink :link="backLink" />
155
- <h1>
156
- <TabTitle breadcrumb="vendor-only">
157
- {{ t('accountAndKeys.title') }}
158
- </TabTitle>
159
- </h1> -->
160
- <div class="api-key-title mb-20">
161
- {{ t('accountAndKeys.title') }}
162
- </div>
163
-
164
- <!-- <h2 v-t="'accountAndKeys.account.title'" /> -->
165
- <div class="account">
166
- <div class="account-title">
167
- {{ t('accountAndKeys.account.title') }}
154
+ <div style="display: flex;align-items: center;margin-bottom: 20px;">
155
+ <!-- <BackLink class="backLinkCls" :link="backLink" /> -->
156
+ <div style="font-size: 26px;">
157
+ <TabTitle breadcrumb="vendor-only">
158
+ {{ t('accountAndKeys.title') }}
159
+ </TabTitle>
168
160
  </div>
169
- <Principal
170
- :value="principal.id"
171
- :use-muted="false"
172
- :show-labels="true"
173
- :isShowPass="true"
174
- >
175
- <template #edit>
176
- <span
177
- v-if="canChangePassword"
178
- class="edit-pass-txt"
179
- @click="$refs.promptChangePassword.show(true)"
180
- >修改
181
- </span>
182
- </template>
183
- </Principal>
184
- <!-- <div>
185
- <button
186
- v-if="canChangePassword"
187
- role="button"
188
- :aria-label="t('accountAndKeys.account.change')"
189
- type="button"
190
- class="btn role-primary"
191
- data-testid="account_change_password"
192
- @click="showChangePasswordDialog"
193
- >
194
- {{ t("accountAndKeys.account.change") }}
195
- </button>
196
- </div> -->
197
161
  </div>
198
162
 
199
- <!-- <hr role="none"> -->
200
- <div
201
- style=" border: 1px solid #d7d7d7;padding: 20px 20px 0px 20px;"
202
- class="mt-20">
203
- <div class="keys-header">
204
- <div>
205
- <!-- <h2 v-t="'accountAndKeys.apiKeys.title'" /> -->
206
- <div
207
- v-t="'accountAndKeys.apiKeys.title'"
208
- class="account-title mb-20"
209
- />
210
- <div class="api-url">
211
- <span>{{ t("accountAndKeys.apiKeys.apiEndpoint") }}</span>
212
- <CopyToClipboardText
213
- :aria-label="t('accountAndKeys.apiKeys.copyApiEnpoint')"
214
- :text="apiUrl"
215
- />
163
+ <div class="account_card mb-20">
164
+ <h5 v-t="'accountAndKeys.account.title'" />
165
+ <div class="account">
166
+ <Principal
167
+ :userLogoSize="79"
168
+ :value="principal.id"
169
+ :use-muted="false"
170
+ :show-labels="true"
171
+ />
172
+ <div>
173
+ <button
174
+ v-if="canChangePassword"
175
+ role="button"
176
+ :aria-label="t('accountAndKeys.account.change')"
177
+ type="button"
178
+ class="btn role-primary"
179
+ data-testid="account_change_password"
180
+ @click="showChangePasswordDialog"
181
+ >
182
+ {{ t("accountAndKeys.account.change") }}
183
+ </button>
216
184
  </div>
217
185
  </div>
218
- <button
186
+ <!-- <button
219
187
  v-if="apiKeySchema"
220
188
  role="button"
221
189
  :aria-label="t('accountAndKeys.apiKeys.add.label')"
@@ -224,58 +192,82 @@ export default {
224
192
  @click="addKey"
225
193
  >
226
194
  {{ t('accountAndKeys.apiKeys.add.label') }}
227
- </button>
195
+ </button> -->
228
196
  </div>
229
- <div
230
- v-if="apiKeySchema"
231
- class="keys mb-20"
232
- >
233
- <ResourceTable
234
- :schema="apiKeySchema"
235
- :rows="apiKeys"
236
- :headers="apiKeyheaders"
237
- key-field="id"
238
- data-testid="api_keys_list"
239
- :search="true"
240
- :row-actions="true"
241
- :table-actions="true"
242
- >
243
- <template #header-right>
244
- <button
197
+
198
+ <div class="account_card mb-20">
199
+ <div class="keys-header">
200
+ <div>
201
+ <h5 v-t="'accountAndKeys.apiKeys.title'" />
202
+ <div class="api-url">
203
+ <span>{{ t("accountAndKeys.apiKeys.apiEndpoint") }}</span>
204
+ <CopyToClipboardText
205
+ :aria-label="t('accountAndKeys.apiKeys.copyApiEnpoint')"
206
+ :text="apiUrl"
207
+ />
208
+ </div>
209
+ </div>
210
+ </div>
211
+ <div
245
212
  v-if="apiKeySchema"
246
- role="button"
247
- :aria-label="t('accountAndKeys.apiKeys.add.label')"
248
- class="btn role-primary add mb-20"
249
- data-testid="account_create_api_keys"
250
- @click="addKey"
213
+ class="keys"
251
214
  >
252
- {{ t('accountAndKeys.apiKeys.add.label') }}
253
- </button>
215
+ <ResourceTable
216
+ :schema="apiKeySchema"
217
+ :rows="apiKeys"
218
+ :headers="apiKeyheaders"
219
+ key-field="id"
220
+ data-testid="api_keys_list"
221
+ :search="true"
222
+ :row-actions="true"
223
+ :table-actions="true"
224
+ >
225
+ <template #header-right>
226
+ <button
227
+ style="margin-right: 10px;"
228
+ v-if="apiKeySchema"
229
+ role="button"
230
+ :aria-label="t('accountAndKeys.apiKeys.add.label')"
231
+ class="btn role-primary add"
232
+ data-testid="account_create_api_keys"
233
+ @click="addKey"
234
+ >
235
+ {{ t('accountAndKeys.apiKeys.add.label') }}
236
+ </button>
254
237
  </template>
255
- </ResourceTable>
256
- </div>
257
- <div v-else>
258
- <Banner
259
- color="warning"
260
- :label="t('accountAndKeys.apiKeys.notAllowed')"
261
- />
238
+ </ResourceTable>
239
+ </div>
240
+ <div v-else>
241
+ <Banner
242
+ color="warning"
243
+ :label="t('accountAndKeys.apiKeys.notAllowed')"
244
+ />
245
+ </div>
262
246
  </div>
263
247
  </div>
264
- </div>
265
248
  </template>
266
249
 
267
250
  <style lang='scss' scoped>
251
+ .account_card {
252
+ border: 1px solid #d7d7d7;
253
+ padding: 20px;
254
+ box-sizing: border-box;
255
+ }
256
+ :deep() .back-link {
257
+ font-size: 26px;
258
+ margin: 0 20px 0 0 !important;
259
+ }
268
260
  hr {
269
261
  margin: 20px 0;
270
262
  }
271
263
 
272
264
  .account {
273
- /* display: flex;
274
- justify-content: space-between */
275
- border: 1px solid #D7D7D7;
276
- padding: 20px;
277
- box-sizing: border-box;
265
+ display: flex;
266
+ justify-content: space-between
267
+ }
278
268
 
269
+ .principal .avatar {
270
+ width: 287px !important;
279
271
  }
280
272
 
281
273
  .keys-header {
@@ -288,37 +280,17 @@ export default {
288
280
  .keys {
289
281
  display: flex;
290
282
  flex-direction: column;
291
- margin-top: 20px;
292
283
  .add {
293
284
  align-self: flex-end;
294
- margin-left: 10px
295
285
  }
296
286
  }
297
287
 
298
288
  .api-url {
299
289
  display: flex;
290
+ margin: 20px 0;
300
291
 
301
292
  > span {
302
293
  margin-right: 6px;
303
294
  }
304
295
  }
305
- .api-key-title{
306
- font-size: 26px;
307
- /* line-height: 20px; */
308
- font-weight: 400;
309
- }
310
-
311
- .edit-pass-txt{
312
- cursor: pointer;
313
- color: var(--primary);
314
- }
315
-
316
- .table-account{
317
- border: 1px solid #d7d7d7;
318
- }
319
- .account-title{
320
- font-size: 14px;
321
- line-height: 19px;
322
- margin-bottom: 16px;
323
- }
324
296
  </style>
@@ -0,0 +1,229 @@
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>
@@ -32,6 +32,7 @@ import loadPlugins from '@shell/plugins/plugin';
32
32
  import Loading from '@shell/components/Loading';
33
33
  import { HARVESTER_NAME as HARVESTER } from '@shell/config/features';
34
34
  import TabTitle from '@shell/components/TabTitle.vue';
35
+ import { AFTER_LOGIN_ROUTE } from '@shell/store/prefs';
35
36
 
36
37
  export default {
37
38
  name: 'Login',
@@ -63,6 +64,10 @@ export default {
63
64
  };
64
65
  },
65
66
 
67
+ created () {
68
+ // this.$store.dispatch('i18n/switchTo', 'zh-hans');
69
+ },
70
+
66
71
  computed: {
67
72
  ...mapGetters(['isSingleProduct']),
68
73
  ...mapGetters({ t: 'i18n/t', hasMultipleLocales: 'i18n/hasMultipleLocales' }),
@@ -168,7 +173,7 @@ export default {
168
173
  this.focusSomething();
169
174
  });
170
175
  },
171
-
176
+
172
177
  methods: {
173
178
  async loadInitialSettings() {
174
179
  let firstLoginSetting, plSetting, brand;
@@ -21,6 +21,7 @@ import FormValidation from '@shell/mixins/form-validation';
21
21
  import isUrl from 'is-url';
22
22
  import { isLocalhost } from '@shell/utils/validators/setting';
23
23
  import Loading from '@shell/components/Loading';
24
+ import { copyTextToClipboard } from '@shell/utils/clipboard';
24
25
 
25
26
  const calcIsFirstLogin = (store) => {
26
27
  const firstLoginSetting = store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.FIRST_LOGIN);
@@ -149,7 +150,7 @@ export default {
149
150
  this['isFirstLogin'] = isFirstLogin;
150
151
  this['mustChangePassword'] = mustChangePassword;
151
152
  // this['current'] = current;
152
- this['current'] = 'admin';
153
+ this['current'] = current || 'admin';
153
154
  this['v3User'] = v3User;
154
155
  this['serverUrl'] = serverUrl;
155
156
  this['mcmEnabled'] = mcmEnabled;
@@ -259,6 +260,14 @@ export default {
259
260
  this.$router.replace('/');
260
261
  },
261
262
 
263
+ copyPassword(val) {
264
+ copyTextToClipboard(val).then(() => {
265
+ console.log('复制成功')
266
+ }).catch(() => {
267
+ console.log('复制失败')
268
+ });
269
+ },
270
+
262
271
  onServerUrlChange(value) {
263
272
  this.serverUrl = value.trim();
264
273
  },
@@ -324,13 +333,14 @@ export default {
324
333
  >
325
334
  <div class="mb-20">
326
335
  <RadioGroup
336
+ class="setupRadioGroupCls"
327
337
  v-model:value="useRandom"
328
338
  data-testid="setup-password-mode"
329
339
  name="password-mode"
330
340
  :options="passwordOptions"
331
341
  />
332
342
  </div>
333
- <div class="mb-20">
343
+ <div class="setup_radom-password mb-20">
334
344
  <LabeledInput
335
345
  v-if="useRandom"
336
346
  ref="password"
@@ -347,13 +357,9 @@ export default {
347
357
  >
348
358
  <div
349
359
  class="addon"
350
- style="padding: 0 0 0 0px;"
360
+ style="padding: 4px 0px 0px;"
351
361
  >
352
- <CopyToClipboard
353
- :aria-label="t('setup.copyRandom')"
354
- :text="password"
355
- class="btn-sm"
356
- />
362
+ <a @click="copyPassword(password)" href="javascript:;">复制</a>
357
363
  </div>
358
364
  </template>
359
365
  </LabeledInput>
@@ -367,15 +373,17 @@ export default {
367
373
  :required="true"
368
374
  />
369
375
  </div>
370
- <Password
371
- v-show="!useRandom"
372
- v-model:value.trim="confirm"
373
- autocomplete="new-password"
374
- data-testid="setup-password-confirm"
375
- class="setup-password"
376
- :label="t('setup.confirmPassword')"
377
- :required="true"
378
- />
376
+ <div class="setup_radom-password">
377
+ <Password
378
+ v-show="!useRandom"
379
+ v-model:value.trim="confirm"
380
+ autocomplete="new-password"
381
+ data-testid="setup-password-confirm"
382
+ class="setup-password"
383
+ :label="t('setup.confirmPassword')"
384
+ :required="true"
385
+ />
386
+ </div>
379
387
  </template>
380
388
 
381
389
  <template v-if="isFirstLogin">
@@ -467,6 +475,16 @@ export default {
467
475
  </template>
468
476
 
469
477
  <style lang="scss" scoped>
478
+ .setup_radom-password {
479
+ :deep(.label-input-all) LABEL {
480
+ color: #fff;
481
+ }
482
+ }
483
+ .setupRadioGroupCls {
484
+ :deep(.radio-label) {
485
+ color: #fff;
486
+ }
487
+ }
470
488
  .principal {
471
489
  display: block;
472
490
  background: var(--box-bg);
@@ -538,6 +556,7 @@ export default {
538
556
  }
539
557
 
540
558
  .setup-title {
559
+ color: #fff;
541
560
  :deep() code {
542
561
  font-size: 12px;
543
562
  padding: 0;
@@ -29,8 +29,8 @@ export default {
29
29
  computed: {
30
30
  headers() {
31
31
  return [
32
- STATE,
33
32
  NAME,
33
+ STATE,
34
34
  AGE
35
35
  ];
36
36
  },