mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 21:00:41 +00:00
feat: update custom field input to textarea for better usability; enhance styles for improved display
This commit is contained in:
@@ -357,7 +357,10 @@ export default function VaultDetailView(props: VaultDetailViewProps) {
|
|||||||
<div className="custom-field-label" title={fieldName}>{fieldName}</div>
|
<div className="custom-field-label" title={fieldName}>{fieldName}</div>
|
||||||
<div className="custom-field-body">
|
<div className="custom-field-body">
|
||||||
<div className="custom-field-value">
|
<div className="custom-field-value">
|
||||||
<strong className="value-ellipsis" title={fieldType === 1 && !isHiddenVisible ? '' : rawValue}>
|
<strong
|
||||||
|
className={fieldType === 1 && !isHiddenVisible ? 'value-ellipsis' : 'custom-field-display'}
|
||||||
|
title={fieldType === 1 && !isHiddenVisible ? '' : rawValue}
|
||||||
|
>
|
||||||
{fieldType === 1 && !isHiddenVisible ? maskSecret(rawValue) : rawValue}
|
{fieldType === 1 && !isHiddenVisible ? maskSecret(rawValue) : rawValue}
|
||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -99,7 +99,11 @@ export default function VaultDialogs(props: VaultDialogsProps) {
|
|||||||
) : (
|
) : (
|
||||||
<label className="field">
|
<label className="field">
|
||||||
<span>{t('txt_field_value')}</span>
|
<span>{t('txt_field_value')}</span>
|
||||||
<input className="input" value={props.fieldValue} onInput={(e) => props.onFieldValueChange((e.currentTarget as HTMLInputElement).value)} />
|
<textarea
|
||||||
|
className="input textarea custom-field-textarea"
|
||||||
|
value={props.fieldValue}
|
||||||
|
onInput={(e) => props.onFieldValueChange((e.currentTarget as HTMLTextAreaElement).value)}
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
</ConfirmDialog>
|
</ConfirmDialog>
|
||||||
|
|||||||
@@ -632,7 +632,11 @@ export default function VaultEditor(props: VaultEditorProps) {
|
|||||||
<span>{toBooleanFieldValue(field.value) ? t('txt_checked') : t('txt_unchecked')}</span>
|
<span>{toBooleanFieldValue(field.value) ? t('txt_checked') : t('txt_unchecked')}</span>
|
||||||
</label>
|
</label>
|
||||||
) : (
|
) : (
|
||||||
<input className="input" value={field.value} onInput={(e) => props.onPatchDraftCustomField(originalIndex, { value: (e.currentTarget as HTMLInputElement).value })} />
|
<textarea
|
||||||
|
className="input textarea custom-field-textarea"
|
||||||
|
value={field.value}
|
||||||
|
onInput={(e) => props.onPatchDraftCustomField(originalIndex, { value: (e.currentTarget as HTMLTextAreaElement).value })}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<button type="button" className="btn btn-secondary small custom-field-remove" onClick={() => props.onUpdateDraftCustomFields(props.draft.customFields.filter((_, i) => i !== originalIndex))}>
|
<button type="button" className="btn btn-secondary small custom-field-remove" onClick={() => props.onUpdateDraftCustomFields(props.draft.customFields.filter((_, i) => i !== originalIndex))}>
|
||||||
|
|||||||
@@ -921,6 +921,15 @@
|
|||||||
@apply w-full;
|
@apply w-full;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-field-textarea {
|
||||||
|
@apply min-h-20;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-field-display {
|
||||||
|
@apply block max-w-full whitespace-pre-wrap break-words text-sm font-semibold;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
.custom-field-check {
|
.custom-field-check {
|
||||||
@apply mb-0 inline-flex items-center gap-2;
|
@apply mb-0 inline-flex items-center gap-2;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user