fix: only mask secret values, show non-secret values in plaintext

This commit is contained in:
团子 2026-04-21 04:06:38 +00:00
parent 58494b8fca
commit eadaa97caa
2 changed files with 8 additions and 5 deletions

View File

@ -55,7 +55,8 @@ export default function ConfigTable({ entries, onEdit, onDelete, addToast }: Pro
</thead>
<tbody>
{entries.map(([key, entry]) => {
const show = revealed.has(key);
const isSecret = entry.secret === true;
const show = !isSecret || revealed.has(key);
const displayVal = show ? entry.value : "•".repeat(Math.min(entry.value.length || 8, 24));
return (
<tr key={key} className="border-b border-[#1e2030]/50 hover:bg-[#1e2030]/30 transition-colors">
@ -70,9 +71,11 @@ export default function ConfigTable({ entries, onEdit, onDelete, addToast }: Pro
>
{displayVal}
</span>
{isSecret && (
<button onClick={() => toggle(key)} className="text-[#64748b] hover:text-white shrink-0 transition-colors" title={show ? "Hide" : "Reveal"}>
{show ? "👁" : "👁‍🗨"}
</button>
)}
<button onClick={() => copy(entry.value)} className="text-[#64748b] hover:text-[#3b82f6] shrink-0 transition-colors" title="Copy">
📋
</button>

File diff suppressed because one or more lines are too long