Skip to content

Commit b83ff7f

Browse files
author
ssongliu
committed
perf: Optimize installed application password parameter display
1 parent db2b38e commit b83ff7f

4 files changed

Lines changed: 47 additions & 4 deletions

File tree

frontend/src/api/interface/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export namespace App {
290290
required?: boolean;
291291
multiple?: boolean;
292292
label: Locale;
293+
showPassword: boolean;
293294
}
294295

295296
export interface AppConfig {

frontend/src/views/app-store/installed/detail/index.vue

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,33 @@
2828
</el-button>
2929
</span>
3030
</el-descriptions-item>
31-
<el-descriptions-item v-for="(param, key) in params" :label="getLabel(param)" :key="key">
32-
<span class="break-all whitespace-normal">
31+
<el-descriptions-item
32+
label-class-name="system-label"
33+
v-for="(param, key) in params"
34+
:label="getLabel(param)"
35+
:key="key"
36+
>
37+
<span v-if="param.type === 'password' && !param.showPassword">********</span>
38+
<span v-else class="break-all whitespace-normal">
3339
{{ param.showValue && param.showValue != '' ? param.showValue : param.value }}
3440
</span>
35-
<CopyButton v-if="showCopyButton(param.key)" :content="param.value" />
41+
<template v-if="param.type === 'password'">
42+
<el-button
43+
v-if="!param.showPassword"
44+
link
45+
@click="param.showPassword = true"
46+
icon="View"
47+
class="-mt-1 ml-3"
48+
></el-button>
49+
<el-button
50+
v-if="param.showPassword"
51+
link
52+
@click="param.showPassword = false"
53+
icon="Hide"
54+
class="-mt-1 ml-3"
55+
></el-button>
56+
</template>
57+
<CopyButton class="-mt-1" v-if="showCopyButton(param.key)" :content="param.value" />
3658
</el-descriptions-item>
3759
</el-descriptions>
3860
</div>
@@ -47,6 +69,19 @@
4769
v-model.number="paramModel.params[p.key]"
4870
:disabled="!p.edit"
4971
></el-input>
72+
<el-input
73+
v-else-if="p.type == 'password'"
74+
:type="p.showPassword ? 'text' : 'password'"
75+
v-model="paramModel.params[p.key]"
76+
:disabled="!p.edit"
77+
>
78+
<template #append>
79+
<el-button
80+
:icon="p.showPassword ? 'Hide' : 'View'"
81+
@click="p.showPassword = !p.showPassword"
82+
/>
83+
</template>
84+
</el-input>
5085
<el-select
5186
v-model="paramModel.params[p.key]"
5287
v-else-if="p.type == 'select'"
@@ -258,6 +293,7 @@ const acceptParams = async (props: ParamProps) => {
258293
await get();
259294
open.value = true;
260295
openConfig.value = false;
296+
console.log('params', params.value);
261297
};
262298
263299
const handleClose = () => {
@@ -304,6 +340,7 @@ const get = async () => {
304340
multiple: d.multiple,
305341
label: d.label,
306342
required: d.required,
343+
showPassword: false,
307344
});
308345
if (d.required) {
309346
rules.params[d.key] = [Rules.requiredInput];
@@ -437,4 +474,8 @@ defineExpose({ acceptParams });
437474
.change-button {
438475
margin-top: 5px;
439476
}
477+
.system-label {
478+
width: 40% !important;
479+
white-space: nowrap !important;
480+
}
440481
</style>

frontend/src/views/cronjob/cronjob/operate/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@
651651
<el-row :gutter="20">
652652
<LayoutCol v-if="isBackup() && !isDatabase()">
653653
<el-form-item :label="$t('setting.compressPassword')" prop="secret">
654-
<el-input v-model="form.secret" />
654+
<el-input type="password" show-password v-model="form.secret" />
655655
</el-form-item>
656656
</LayoutCol>
657657
<LayoutCol>

frontend/src/xpack-ee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 329f2b121b9cbe556ac8abe323d8cac273263f61

0 commit comments

Comments
 (0)