dashboard-shell-shell 3.0.5-test.5 → 3.0.5-test.51
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.
- package/assets/brand/csp/favicon.png +0 -0
- package/assets/icons/iconfont.css +4 -1
- package/assets/images/pl/dark/logo.png +0 -0
- package/assets/styles/all.scss +23 -3
- package/assets/styles/base/_variables.scss +5 -5
- package/assets/styles/fonts/_icons.scss +3 -2
- package/assets/styles/global/_button.scss +2 -2
- package/assets/styles/global/_form.scss +1 -0
- package/assets/styles/global/_select.scss +1 -1
- package/assets/styles/global/_tooltip.scss +5 -1
- package/assets/styles/themes/_light.scss +3 -3
- package/assets/styles/vendor/vue-select.scss +2 -1
- package/assets/translations/en-us.yaml +64 -0
- package/assets/translations/zh-hans.yaml +206 -21
- package/components/ButtonDropdown.vue +3 -1
- package/components/ClusterIconMenu.vue +1 -1
- package/components/CodeMirror.vue +6 -4
- package/components/ConsumptionGauge.vue +1 -1
- package/components/ContainerResourceLimit.vue +2 -2
- package/components/CruResource.vue +3 -2
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +10 -7
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
- package/components/Drawer/ResourceDetailDrawer/index.vue +3 -2
- package/components/ExplorerMembers.vue +10 -1
- package/components/GlobalRoleBindings.vue +69 -114
- package/components/PodSecurityAdmission.vue +1 -1
- package/components/PromptRemove.vue +23 -1
- package/components/RelatedResources.vue +3 -0
- package/components/Resource/Detail/Metadata/index.vue +1 -0
- package/components/Resource/Detail/TitleBar/Top.vue +2 -0
- package/components/Resource/Detail/TitleBar/composables.ts +16 -1
- package/components/Resource/Detail/TitleBar/index.vue +42 -23
- package/components/ResourceDetail/Masthead/index.vue +1 -1
- package/components/ResourceDetail/Masthead/latest.vue +1 -1
- package/components/ResourceDetail/Masthead/legacy.vue +8 -7
- package/components/ResourceDetail/legacy.vue +15 -15
- package/components/ResourceList/Masthead.vue +13 -17
- package/components/ResourceTable.vue +16 -0
- package/components/SideNav.vue +21 -21
- package/components/SingleClusterInfo.vue +2 -1
- package/components/SortableTable/THead.vue +46 -1
- package/components/SortableTable/index.vue +55 -19
- package/components/Tabbed/index.vue +7 -2
- package/components/auth/Principal.vue +16 -8
- package/components/auth/RoleDetailEdit.vue +11 -7
- package/components/breadcrumb/index.vue +15 -236
- package/components/form/ArrayList.vue +164 -147
- package/components/form/ArrayListGrouped.vue +5 -3
- package/components/form/ChangePassword.vue +1 -1
- package/components/form/ClusterAppearance.vue +4 -3
- package/components/form/Command.vue +4 -5
- package/components/form/Conditions.vue +15 -1
- package/components/form/Footer.vue +1 -0
- package/components/form/HealthCheck.vue +0 -2
- package/components/form/HookOption.vue +87 -58
- package/components/form/InputWithSelect.vue +8 -7
- package/components/form/KeyValue.vue +20 -2
- package/components/form/LabeledSelect.vue +3 -1
- package/components/form/Labels.vue +2 -2
- package/components/form/MatchExpressions.vue +4 -4
- package/components/form/Members/ClusterMembershipEditor.vue +1 -1
- package/components/form/Members/ClusterPermissionsEditor.vue +60 -41
- package/components/form/Members/MembershipEditor.vue +4 -4
- package/components/form/Members/ProjectMembershipEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +2 -1
- package/components/form/Networking.vue +6 -9
- package/components/form/NodeAffinity.vue +29 -28
- package/components/form/PodAffinity.vue +23 -23
- package/components/form/Probe.vue +15 -11
- package/components/form/ProjectMemberEditor.vue +66 -48
- package/components/form/ResourceQuota/Namespace.vue +4 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
- package/components/form/ResourceQuota/Project.vue +4 -4
- package/components/form/ResourceQuota/ProjectRow.vue +36 -30
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/Security.vue +1 -3
- package/components/form/Select.vue +7 -1
- package/components/form/ServiceNameSelect.vue +2 -5
- package/components/form/ServicePorts.vue +149 -75
- package/components/form/Tolerations.vue +13 -9
- package/components/form/ValueFromResource.vue +110 -96
- package/components/formatter/WorkloadHealthScale.vue +4 -3
- package/components/nav/Group.vue +6 -0
- package/components/nav/Header.vue +17 -137
- package/components/nav/NamespaceFilter.vue +15 -21
- package/components/nav/TopLevelMenu.vue +99 -125
- package/components/nav/Type.vue +11 -3
- package/config/menuRouteMap.js +10 -0
- package/config/product/explorer.js +32 -10
- package/config/product/manager.js +28 -17
- package/config/router/navigation-guards/index.js +61 -3
- package/detail/node.vue +28 -23
- package/dialog/AddCustomBadgeDialog.vue +17 -9
- package/dialog/RollbackWorkloadDialog.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
- package/edit/configmap.vue +4 -0
- package/edit/networking.k8s.io.ingress/Certificate.vue +14 -5
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
- package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
- package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/persistentvolume/index.vue +3 -1
- package/edit/persistentvolumeclaim.vue +2 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -1
- package/edit/secret/index.vue +2 -2
- package/edit/service.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +10 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
- package/edit/workload/Job.vue +31 -34
- package/edit/workload/Upgrading.vue +5 -5
- package/edit/workload/index.vue +19 -15
- package/edit/workload/storage/Mount.vue +1 -0
- package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
- package/edit/workload/storage/azureDisk.vue +14 -10
- package/edit/workload/storage/azureFile.vue +9 -7
- package/edit/workload/storage/csi/index.vue +6 -9
- package/edit/workload/storage/emptyDir.vue +7 -5
- package/edit/workload/storage/gcePersistentDisk.vue +9 -7
- package/edit/workload/storage/hostPath.vue +7 -5
- package/edit/workload/storage/nfs.vue +8 -6
- package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
- package/edit/workload/storage/secret.vue +9 -6
- package/edit/workload/storage/vsphereVolume.vue +11 -7
- package/initialize/app-extended.js +7 -1
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +8 -6
- package/mixins/create-edit-view/impl.js +10 -0
- package/models/provisioning.cattle.io.cluster.js +19 -18
- package/models/workload.js +2 -2
- package/package.json +1 -1
- package/pages/account/index.vue +96 -115
- package/pages/auth/setup.vue +36 -17
- package/pages/c/_cluster/auth/roles/index.vue +65 -8
- package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +2 -1
- package/pages/c/_cluster/explorer/tools/index.vue +6 -6
- package/pages/home.vue +55 -13
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/plugins/dashboard-store/actions.js +1 -1
- package/plugins/dashboard-store/resource-class.js +28 -27
- package/rancher-components/Banner/Banner.vue +14 -2
- package/rancher-components/Form/Radio/RadioGroup.vue +9 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
- package/scripts/build-pkg.sh +18 -23
- package/scripts/publish-shell.sh +1 -1
- package/store/i18n.js +1 -0
- package/store/type-map.js +1 -3
- package/types/shell/index.d.ts +12 -30
- package/utils/error.js +26 -4
- package/utils/errorTranslate.json +390 -6
- package/utils/errorTranslateNew.json +39 -0
- package/utils/roleFiltering.js +33 -0
- package/vue.config.js +1 -1
|
@@ -25,8 +25,8 @@ export default {
|
|
|
25
25
|
|
|
26
26
|
<template>
|
|
27
27
|
<div>
|
|
28
|
-
<div class="row
|
|
29
|
-
<div class="col
|
|
28
|
+
<div class="row">
|
|
29
|
+
<div class="col">
|
|
30
30
|
<LabeledInput
|
|
31
31
|
v-model:value="value.name"
|
|
32
32
|
:required="true"
|
|
@@ -35,8 +35,8 @@ export default {
|
|
|
35
35
|
/>
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
|
-
<div class="row
|
|
39
|
-
<div class="col
|
|
38
|
+
<div class="row">
|
|
39
|
+
<div class="col">
|
|
40
40
|
<LabeledInput
|
|
41
41
|
v-model:value="value.vsphereVolume.storagePolicyID"
|
|
42
42
|
:mode="mode"
|
|
@@ -44,7 +44,9 @@ export default {
|
|
|
44
44
|
:required="true"
|
|
45
45
|
/>
|
|
46
46
|
</div>
|
|
47
|
-
|
|
47
|
+
</div>
|
|
48
|
+
<div class="row">
|
|
49
|
+
<div class="col">
|
|
48
50
|
<LabeledInput
|
|
49
51
|
v-model:value.number="value.vsphereVolume.storagePolicyName"
|
|
50
52
|
:mode="mode"
|
|
@@ -53,7 +55,7 @@ export default {
|
|
|
53
55
|
</div>
|
|
54
56
|
</div>
|
|
55
57
|
<div class="row">
|
|
56
|
-
<div class="col
|
|
58
|
+
<div class="col">
|
|
57
59
|
<LabeledInput
|
|
58
60
|
v-model:value="value.vsphereVolume.volumePath"
|
|
59
61
|
:mode="mode"
|
|
@@ -61,7 +63,9 @@ export default {
|
|
|
61
63
|
:required="true"
|
|
62
64
|
/>
|
|
63
65
|
</div>
|
|
64
|
-
|
|
66
|
+
</div>
|
|
67
|
+
<div class="row">
|
|
68
|
+
<div class="col">
|
|
65
69
|
<LabeledInput
|
|
66
70
|
v-model:value="value.vsphereVolume.fsType"
|
|
67
71
|
:mode="mode"
|
|
@@ -55,7 +55,13 @@ async function extendApp(vueApp) {
|
|
|
55
55
|
const next = (location) => appPartials.router.push(location);
|
|
56
56
|
// Resolve route
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
let path = getLocation(router.options.base, router.options.mode);
|
|
59
|
+
|
|
60
|
+
// 🔹 增加 rewrite,不改变原逻辑
|
|
61
|
+
if (path.includes('/cloud/')) {
|
|
62
|
+
path = path.replace(/cloud/g, 'harvester');
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
const route = router.resolve(path);
|
|
60
66
|
|
|
61
67
|
// Set context to app.context
|
|
@@ -37,15 +37,17 @@ export default {
|
|
|
37
37
|
|
|
38
38
|
<template>
|
|
39
39
|
<div>
|
|
40
|
-
<Banner
|
|
41
|
-
color="info"
|
|
42
|
-
:label="t('podSecurityAdmission.banner.modifications')"
|
|
43
|
-
/>
|
|
44
|
-
|
|
45
40
|
<ResourceTable
|
|
46
41
|
:loading="loading"
|
|
47
42
|
:schema="schema"
|
|
48
43
|
:rows="rows"
|
|
49
|
-
|
|
44
|
+
>
|
|
45
|
+
<template #banner>
|
|
46
|
+
<Banner
|
|
47
|
+
color="info"
|
|
48
|
+
:label="t('podSecurityAdmission.banner.modifications')"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
</ResourceTable>
|
|
50
52
|
</div>
|
|
51
53
|
</template>
|
|
@@ -170,6 +170,16 @@ export default {
|
|
|
170
170
|
} catch (err) {
|
|
171
171
|
// This exception handles errors from the `request` action when it receives a failed http request. The `err` object could be from the action's error handler (raw http response object containing `status`) or thrown later on given the response of the action (a massaged object containing `_status`). TBD why one 409 triggers the error handler and another does not.
|
|
172
172
|
const IS_ERR_409 = err.status === 409 || err._status === 409;
|
|
173
|
+
|
|
174
|
+
const IS_ERR_403 = err.status === 403 || err._status === 403;
|
|
175
|
+
|
|
176
|
+
if (err.message === '' && err.fieldName && err.code) {
|
|
177
|
+
err.message = err.code + ' ' + err.fieldName
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (IS_ERR_403) {
|
|
181
|
+
err.message = '权限不足'
|
|
182
|
+
}
|
|
173
183
|
|
|
174
184
|
// Conflict, the resource being edited has changed since starting editing
|
|
175
185
|
if (IS_ERR_409 && depth === 0 && this.isEdit) {
|
|
@@ -115,25 +115,26 @@ export default class ProvCluster extends SteveModel {
|
|
|
115
115
|
const actions = [
|
|
116
116
|
// Note: Actions are not supported in the Steve API, so we check
|
|
117
117
|
// available actions for RKE1 clusters, but not RKE2 clusters.
|
|
118
|
+
// {
|
|
119
|
+
// action: 'openShell',
|
|
120
|
+
// label: this.$rootGetters['i18n/t']('nav.shell'),
|
|
121
|
+
// icon: 'icon icon-terminal',
|
|
122
|
+
// enabled: !!this.mgmt?.links.shell && ready,
|
|
123
|
+
// }, {
|
|
124
|
+
// action: 'downloadKubeConfig',
|
|
125
|
+
// bulkAction: 'downloadKubeConfigBulk',
|
|
126
|
+
// label: this.$rootGetters['i18n/t']('nav.kubeconfig.download'),
|
|
127
|
+
// icon: 'icon icon-download',
|
|
128
|
+
// bulkable: true,
|
|
129
|
+
// enabled: this.mgmt?.hasAction('generateKubeconfig'),
|
|
130
|
+
// }, {
|
|
131
|
+
// action: 'copyKubeConfig',
|
|
132
|
+
// label: this.t('cluster.copyConfig'),
|
|
133
|
+
// bulkable: false,
|
|
134
|
+
// enabled: this.mgmt?.hasAction('generateKubeconfig'),
|
|
135
|
+
// icon: 'icon icon-copy',
|
|
136
|
+
// },
|
|
118
137
|
{
|
|
119
|
-
action: 'openShell',
|
|
120
|
-
label: this.$rootGetters['i18n/t']('nav.shell'),
|
|
121
|
-
icon: 'icon icon-terminal',
|
|
122
|
-
enabled: !!this.mgmt?.links.shell && ready,
|
|
123
|
-
}, {
|
|
124
|
-
action: 'downloadKubeConfig',
|
|
125
|
-
bulkAction: 'downloadKubeConfigBulk',
|
|
126
|
-
label: this.$rootGetters['i18n/t']('nav.kubeconfig.download'),
|
|
127
|
-
icon: 'icon icon-download',
|
|
128
|
-
bulkable: true,
|
|
129
|
-
enabled: this.mgmt?.hasAction('generateKubeconfig'),
|
|
130
|
-
}, {
|
|
131
|
-
action: 'copyKubeConfig',
|
|
132
|
-
label: this.t('cluster.copyConfig'),
|
|
133
|
-
bulkable: false,
|
|
134
|
-
enabled: this.mgmt?.hasAction('generateKubeconfig'),
|
|
135
|
-
icon: 'icon icon-copy',
|
|
136
|
-
}, {
|
|
137
138
|
action: 'snapshotAction',
|
|
138
139
|
label: this.$rootGetters['i18n/t']('nav.takeSnapshot'),
|
|
139
140
|
icon: 'icon icon-snapshot',
|
package/models/workload.js
CHANGED
|
@@ -199,8 +199,8 @@ export default class Workload extends WorkloadService {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
this.$dispatch('growl/error', {
|
|
202
|
-
title: '
|
|
203
|
-
message: '
|
|
202
|
+
title: '不可用',
|
|
203
|
+
message: '没有正在运行的 Pod 可用来执行 Shell。'
|
|
204
204
|
}, { root: true });
|
|
205
205
|
}
|
|
206
206
|
|
package/package.json
CHANGED
package/pages/account/index.vue
CHANGED
|
@@ -3,8 +3,7 @@ import BackLink from '@shell/components/BackLink';
|
|
|
3
3
|
import { MANAGEMENT, NORMAN } from '@shell/config/types';
|
|
4
4
|
import { SETTING } from '@shell/config/settings';
|
|
5
5
|
import Loading from '@shell/components/Loading';
|
|
6
|
-
|
|
7
|
-
import Principal from './pri.vue';
|
|
6
|
+
import Principal from '@shell/components/auth/Principal';
|
|
8
7
|
import BackRoute from '@shell/mixins/back-link';
|
|
9
8
|
import { mapGetters } from 'vuex';
|
|
10
9
|
|
|
@@ -17,7 +16,7 @@ const API_ENDPOINT = '/v3';
|
|
|
17
16
|
|
|
18
17
|
export default {
|
|
19
18
|
components: {
|
|
20
|
-
CopyToClipboardText, BackLink, Banner,
|
|
19
|
+
CopyToClipboardText, BackLink, Banner, Loading, ResourceTable, Principal, TabTitle
|
|
21
20
|
},
|
|
22
21
|
mixins: [BackRoute],
|
|
23
22
|
async fetch() {
|
|
@@ -152,88 +151,40 @@ export default {
|
|
|
152
151
|
<template>
|
|
153
152
|
<Loading v-if="$fetchState.pending" />
|
|
154
153
|
<div v-else>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
{{ t('accountAndKeys.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>
|
|
160
|
+
</div>
|
|
163
161
|
</div>
|
|
164
162
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
<div class="account
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
<span
|
|
163
|
+
<div class="account_card mb-20">
|
|
164
|
+
<h5 v-t="'accountAndKeys.account.title'" />
|
|
165
|
+
<div class="account">
|
|
166
|
+
<Principal
|
|
167
|
+
:userLogo="true"
|
|
168
|
+
:userLogoSize="79"
|
|
169
|
+
:value="principal.id"
|
|
170
|
+
:use-muted="false"
|
|
171
|
+
:show-labels="true"
|
|
172
|
+
/>
|
|
173
|
+
<div>
|
|
174
|
+
<button
|
|
178
175
|
v-if="canChangePassword"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
role="button"
|
|
189
|
-
:aria-label="t('accountAndKeys.account.change')"
|
|
190
|
-
type="button"
|
|
191
|
-
class="btn role-primary"
|
|
192
|
-
data-testid="account_change_password"
|
|
193
|
-
@click="$refs.promptChangePassword.show(true)"
|
|
194
|
-
>
|
|
195
|
-
{{ t("accountAndKeys.account.change") }}
|
|
196
|
-
</button>
|
|
197
|
-
</div> -->
|
|
198
|
-
</div>
|
|
199
|
-
<PromptChangePassword ref="promptChangePassword" />
|
|
200
|
-
|
|
201
|
-
<!-- <hr role="none"> -->
|
|
202
|
-
<div
|
|
203
|
-
style=" border: 1px solid #d7d7d7;padding: 20px 20px 0px 20px;"
|
|
204
|
-
class="mt-20">
|
|
205
|
-
<div class="keys-header">
|
|
206
|
-
<div>
|
|
207
|
-
<!-- <h2 v-t="'accountAndKeys.apiKeys.title'" /> -->
|
|
208
|
-
<div
|
|
209
|
-
v-t="'accountAndKeys.apiKeys.title'"
|
|
210
|
-
class="account-title mb-20"
|
|
211
|
-
/>
|
|
212
|
-
<div class="api-url">
|
|
213
|
-
<span>{{ t("accountAndKeys.apiKeys.apiEndpoint") }}</span>
|
|
214
|
-
<CopyToClipboardText
|
|
215
|
-
:aria-label="t('accountAndKeys.apiKeys.copyApiEnpoint')"
|
|
216
|
-
:text="apiUrl"
|
|
217
|
-
/>
|
|
176
|
+
role="button"
|
|
177
|
+
:aria-label="t('accountAndKeys.account.change')"
|
|
178
|
+
type="button"
|
|
179
|
+
class="btn role-primary"
|
|
180
|
+
data-testid="account_change_password"
|
|
181
|
+
@click="showChangePasswordDialog"
|
|
182
|
+
>
|
|
183
|
+
{{ t("accountAndKeys.account.change") }}
|
|
184
|
+
</button>
|
|
218
185
|
</div>
|
|
219
186
|
</div>
|
|
220
|
-
|
|
221
|
-
<div
|
|
222
|
-
v-if="apiKeySchema"
|
|
223
|
-
class="keys mb-20"
|
|
224
|
-
>
|
|
225
|
-
<ResourceTable
|
|
226
|
-
:schema="apiKeySchema"
|
|
227
|
-
:rows="apiKeys"
|
|
228
|
-
:headers="apiKeyheaders"
|
|
229
|
-
key-field="id"
|
|
230
|
-
data-testid="api_keys_list"
|
|
231
|
-
:search="true"
|
|
232
|
-
:row-actions="true"
|
|
233
|
-
:table-actions="true"
|
|
234
|
-
>
|
|
235
|
-
<template #header-right>
|
|
236
|
-
<button
|
|
187
|
+
<!-- <button
|
|
237
188
|
v-if="apiKeySchema"
|
|
238
189
|
role="button"
|
|
239
190
|
:aria-label="t('accountAndKeys.apiKeys.add.label')"
|
|
@@ -242,32 +193,82 @@ export default {
|
|
|
242
193
|
@click="addKey"
|
|
243
194
|
>
|
|
244
195
|
{{ t('accountAndKeys.apiKeys.add.label') }}
|
|
245
|
-
</button>
|
|
246
|
-
</template>
|
|
247
|
-
</ResourceTable>
|
|
196
|
+
</button> -->
|
|
248
197
|
</div>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
198
|
+
|
|
199
|
+
<div class="account_card mb-20">
|
|
200
|
+
<div class="keys-header">
|
|
201
|
+
<div>
|
|
202
|
+
<h5 v-t="'accountAndKeys.apiKeys.title'" />
|
|
203
|
+
<div class="api-url">
|
|
204
|
+
<span>{{ t("accountAndKeys.apiKeys.apiEndpoint") }}</span>
|
|
205
|
+
<CopyToClipboardText
|
|
206
|
+
:aria-label="t('accountAndKeys.apiKeys.copyApiEnpoint')"
|
|
207
|
+
:text="apiUrl"
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
<div
|
|
213
|
+
v-if="apiKeySchema"
|
|
214
|
+
class="keys"
|
|
215
|
+
>
|
|
216
|
+
<ResourceTable
|
|
217
|
+
:schema="apiKeySchema"
|
|
218
|
+
:rows="apiKeys"
|
|
219
|
+
:headers="apiKeyheaders"
|
|
220
|
+
key-field="id"
|
|
221
|
+
data-testid="api_keys_list"
|
|
222
|
+
:search="true"
|
|
223
|
+
:row-actions="true"
|
|
224
|
+
:table-actions="true"
|
|
225
|
+
>
|
|
226
|
+
<template #header-right>
|
|
227
|
+
<button
|
|
228
|
+
style="margin-right: 10px;"
|
|
229
|
+
v-if="apiKeySchema"
|
|
230
|
+
role="button"
|
|
231
|
+
:aria-label="t('accountAndKeys.apiKeys.add.label')"
|
|
232
|
+
class="btn role-primary add"
|
|
233
|
+
data-testid="account_create_api_keys"
|
|
234
|
+
@click="addKey"
|
|
235
|
+
>
|
|
236
|
+
{{ t('accountAndKeys.apiKeys.add.label') }}
|
|
237
|
+
</button>
|
|
238
|
+
</template>
|
|
239
|
+
</ResourceTable>
|
|
240
|
+
</div>
|
|
241
|
+
<div v-else>
|
|
242
|
+
<Banner
|
|
243
|
+
color="warning"
|
|
244
|
+
:label="t('accountAndKeys.apiKeys.notAllowed')"
|
|
245
|
+
/>
|
|
246
|
+
</div>
|
|
254
247
|
</div>
|
|
255
248
|
</div>
|
|
256
|
-
</div>
|
|
257
249
|
</template>
|
|
258
250
|
|
|
259
251
|
<style lang='scss' scoped>
|
|
252
|
+
.account_card {
|
|
253
|
+
border: 1px solid #d7d7d7;
|
|
254
|
+
padding: 20px;
|
|
255
|
+
box-sizing: border-box;
|
|
256
|
+
}
|
|
257
|
+
:deep() .back-link {
|
|
258
|
+
font-size: 26px;
|
|
259
|
+
margin: 0 20px 0 0 !important;
|
|
260
|
+
}
|
|
260
261
|
hr {
|
|
261
262
|
margin: 20px 0;
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
.account {
|
|
265
|
-
|
|
266
|
-
justify-content: space-between
|
|
267
|
-
|
|
268
|
-
padding: 20px;
|
|
269
|
-
box-sizing: border-box;
|
|
266
|
+
display: flex;
|
|
267
|
+
justify-content: space-between
|
|
268
|
+
}
|
|
270
269
|
|
|
270
|
+
.principal .avatar {
|
|
271
|
+
width: 287px !important;
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
.keys-header {
|
|
@@ -280,37 +281,17 @@ export default {
|
|
|
280
281
|
.keys {
|
|
281
282
|
display: flex;
|
|
282
283
|
flex-direction: column;
|
|
283
|
-
margin-top: 20px;
|
|
284
284
|
.add {
|
|
285
285
|
align-self: flex-end;
|
|
286
|
-
margin-left: 10px
|
|
287
286
|
}
|
|
288
287
|
}
|
|
289
288
|
|
|
290
289
|
.api-url {
|
|
291
290
|
display: flex;
|
|
291
|
+
margin: 20px 0;
|
|
292
292
|
|
|
293
293
|
> span {
|
|
294
294
|
margin-right: 6px;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
.api-key-title{
|
|
298
|
-
font-size: 26px;
|
|
299
|
-
/* line-height: 20px; */
|
|
300
|
-
font-weight: 400;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.edit-pass-txt{
|
|
304
|
-
cursor: pointer;
|
|
305
|
-
color: var(--primary);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.table-account{
|
|
309
|
-
border: 1px solid #d7d7d7;
|
|
310
|
-
}
|
|
311
|
-
.account-title{
|
|
312
|
-
font-size: 14px;
|
|
313
|
-
line-height: 19px;
|
|
314
|
-
margin-bottom: 16px;
|
|
315
|
-
}
|
|
316
297
|
</style>
|
package/pages/auth/setup.vue
CHANGED
|
@@ -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:
|
|
360
|
+
style="padding: 4px 0px 0px;"
|
|
351
361
|
>
|
|
352
|
-
<
|
|
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
|
-
<
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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;
|