Skip to content

Commit cfe9e94

Browse files
authored
feat: add sensitive info mask (#10865)
1 parent 902d329 commit cfe9e94

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

frontend/src/views/home/index.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@
173173
<el-carousel-item key="systemInfo">
174174
<CardWithHeader :header="$t('home.systemInfo')">
175175
<template #header-r>
176+
<el-button
177+
class="h-button-setting"
178+
@click="toggleSensitiveInfo"
179+
link
180+
:icon="showSensitiveInfo ? 'View' : 'Hide'"
181+
/>
176182
<el-button class="h-button-setting" @click="handleCopy" link icon="CopyDocument" />
177183
</template>
178184
<template #body>
@@ -185,7 +191,7 @@
185191
<template #label>
186192
<span class="system-label">{{ $t('home.hostname') }}</span>
187193
</template>
188-
{{ baseInfo.hostname }}
194+
{{ showSensitiveInfo ? baseInfo.hostname : '****' }}
189195
</el-descriptions-item>
190196
<el-descriptions-item
191197
class-name="system-content"
@@ -225,7 +231,7 @@
225231
<template #label>
226232
<span class="system-label">{{ $t('home.ip') }}</span>
227233
</template>
228-
{{ baseInfo.ipV4Addr }}
234+
{{ showSensitiveInfo ? baseInfo.ipV4Addr : '****' }}
229235
</el-descriptions-item>
230236
<el-descriptions-item
231237
v-if="baseInfo.httpProxy && baseInfo.httpProxy !== 'noProxy'"
@@ -346,6 +352,8 @@ let isStatusInit = ref<boolean>(true);
346352
let isActive = ref(true);
347353
let isCurrentActive = ref(true);
348354
355+
const showSensitiveInfo = ref(true);
356+
349357
const ioReadBytes = ref<Array<number>>([]);
350358
const ioWriteBytes = ref<Array<number>>([]);
351359
const netBytesSents = ref<Array<number>>([]);
@@ -510,6 +518,10 @@ const showSimpleNode = () => {
510518
return globalStore.isMasterProductPro && simpleNodes.value?.length !== 0;
511519
};
512520
521+
const toggleSensitiveInfo = () => {
522+
showSensitiveInfo.value = !showSensitiveInfo.value;
523+
};
524+
513525
const jumpPanel = (row: any) => {
514526
let entrance = row.securityEntrance.startsWith('/') ? row.securityEntrance.slice(1) : row.securityEntrance;
515527
entrance = entrance ? '/' + entrance : '';

0 commit comments

Comments
 (0)