web/SettingsInput: hide sensitive info (such as api key)

This commit is contained in:
wukko 2025-02-05 17:07:29 +06:00
parent 88d4b4dc7c
commit 62dccf7b51
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2
2 changed files with 7 additions and 0 deletions

View File

@ -20,8 +20,12 @@
export let placeholder: string;
export let altText: string;
export let type: "url" | "uuid" = "url";
export let isPassword = false;
export let showInstanceWarning = false;
let inputType = isPassword ? "password" : "text";
const regex = {
url: "https?:\\/\\/[a-z0-9.\\-]+(:\\d+)?/?",
uuid: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
@ -74,6 +78,8 @@
pattern={regex[type]}
aria-label={altText}
aria-hidden="false"
{ ...{ type: inputType } }
/>
{#if inputValue.length === 0}

View File

@ -50,6 +50,7 @@
placeholder="00000000-0000-0000-0000-000000000000"
altText={$t("settings.processing.access_key.input.alt_text")}
type="uuid"
isPassword
/>
{/if}
</div>