fix: only mask secret values, show non-secret values in plaintext
This commit is contained in:
parent
58494b8fca
commit
eadaa97caa
@ -55,7 +55,8 @@ export default function ConfigTable({ entries, onEdit, onDelete, addToast }: Pro
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{entries.map(([key, entry]) => {
|
{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));
|
const displayVal = show ? entry.value : "•".repeat(Math.min(entry.value.length || 8, 24));
|
||||||
return (
|
return (
|
||||||
<tr key={key} className="border-b border-[#1e2030]/50 hover:bg-[#1e2030]/30 transition-colors">
|
<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}
|
{displayVal}
|
||||||
</span>
|
</span>
|
||||||
|
{isSecret && (
|
||||||
<button onClick={() => toggle(key)} className="text-[#64748b] hover:text-white shrink-0 transition-colors" title={show ? "Hide" : "Reveal"}>
|
<button onClick={() => toggle(key)} className="text-[#64748b] hover:text-white shrink-0 transition-colors" title={show ? "Hide" : "Reveal"}>
|
||||||
{show ? "👁" : "👁🗨"}
|
{show ? "👁" : "👁🗨"}
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
<button onClick={() => copy(entry.value)} className="text-[#64748b] hover:text-[#3b82f6] shrink-0 transition-colors" title="Copy">
|
<button onClick={() => copy(entry.value)} className="text-[#64748b] hover:text-[#3b82f6] shrink-0 transition-colors" title="Copy">
|
||||||
📋
|
📋
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user