web/SettingsInput: hide sensitive info (such as api key)
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user