mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +00:00
web/SettingsInput: hide sensitive info (such as api key)
This commit is contained in:
parent
88d4b4dc7c
commit
62dccf7b51
@ -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}
|
||||
|
@ -50,6 +50,7 @@
|
||||
placeholder="00000000-0000-0000-0000-000000000000"
|
||||
altText={$t("settings.processing.access_key.input.alt_text")}
|
||||
type="uuid"
|
||||
isPassword
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user