Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
) => {
const isControlled = value !== undefined;
const { defaultValue, ...restProps } = props;
const { t } = useTranslation();
const inputValue = isControlled ? value : defaultValue;
const [showPassword, setShowPassword] = useState(false);
const [prefixWidth, setPrefixWidth] = useState(0);
Expand Down Expand Up @@ -136,6 +137,11 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
dark:peer-autofill/input:focus-visible:text-text-primary-inverse
"
onClick={() => setShowPassword(!showPassword)}
aria-label={
showPassword
? t('common.hidePassword')
: t('common.showPassword')
}
>
{showPassword ? (
<EyeOff className="size-[1em]" />
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export default {
noDataFound: 'No data found.',
noData: 'No data available',
promptPlaceholder: `Please input or use / to quickly insert variables.`,
showPassword: 'Show password',
hidePassword: 'Hide password',
mcp: {
namePlaceholder: 'My MCP server',
nameRequired:
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export default {
'提示:Access Key / Secret Key 可留空,以启用 AWS IAM 自动验证。',
zendeskDescription: '连接 Zendesk,同步工单、文章及其他内容。',
promptPlaceholder: '请输入或使用 / 快速插入变量。',
showPassword: '显示密码',
hidePassword: '隐藏密码',
selected: '已选择',
},
login: {
Expand Down