|
173 | 173 | <el-carousel-item key="systemInfo"> |
174 | 174 | <CardWithHeader :header="$t('home.systemInfo')"> |
175 | 175 | <template #header-r> |
| 176 | + <el-button |
| 177 | + class="h-button-setting" |
| 178 | + @click="toggleSensitiveInfo" |
| 179 | + link |
| 180 | + :icon="showSensitiveInfo ? 'View' : 'Hide'" |
| 181 | + /> |
176 | 182 | <el-button class="h-button-setting" @click="handleCopy" link icon="CopyDocument" /> |
177 | 183 | </template> |
178 | 184 | <template #body> |
|
185 | 191 | <template #label> |
186 | 192 | <span class="system-label">{{ $t('home.hostname') }}</span> |
187 | 193 | </template> |
188 | | - {{ baseInfo.hostname }} |
| 194 | + {{ showSensitiveInfo ? baseInfo.hostname : '****' }} |
189 | 195 | </el-descriptions-item> |
190 | 196 | <el-descriptions-item |
191 | 197 | class-name="system-content" |
|
225 | 231 | <template #label> |
226 | 232 | <span class="system-label">{{ $t('home.ip') }}</span> |
227 | 233 | </template> |
228 | | - {{ baseInfo.ipV4Addr }} |
| 234 | + {{ showSensitiveInfo ? baseInfo.ipV4Addr : '****' }} |
229 | 235 | </el-descriptions-item> |
230 | 236 | <el-descriptions-item |
231 | 237 | v-if="baseInfo.httpProxy && baseInfo.httpProxy !== 'noProxy'" |
@@ -346,6 +352,8 @@ let isStatusInit = ref<boolean>(true); |
346 | 352 | let isActive = ref(true); |
347 | 353 | let isCurrentActive = ref(true); |
348 | 354 |
|
| 355 | +const showSensitiveInfo = ref(true); |
| 356 | +
|
349 | 357 | const ioReadBytes = ref<Array<number>>([]); |
350 | 358 | const ioWriteBytes = ref<Array<number>>([]); |
351 | 359 | const netBytesSents = ref<Array<number>>([]); |
@@ -510,6 +518,10 @@ const showSimpleNode = () => { |
510 | 518 | return globalStore.isMasterProductPro && simpleNodes.value?.length !== 0; |
511 | 519 | }; |
512 | 520 |
|
| 521 | +const toggleSensitiveInfo = () => { |
| 522 | + showSensitiveInfo.value = !showSensitiveInfo.value; |
| 523 | +}; |
| 524 | +
|
513 | 525 | const jumpPanel = (row: any) => { |
514 | 526 | let entrance = row.securityEntrance.startsWith('/') ? row.securityEntrance.slice(1) : row.securityEntrance; |
515 | 527 | entrance = entrance ? '/' + entrance : ''; |
|
0 commit comments