mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 17:38:31 +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 placeholder: string;
|
||||||
export let altText: string;
|
export let altText: string;
|
||||||
export let type: "url" | "uuid" = "url";
|
export let type: "url" | "uuid" = "url";
|
||||||
|
|
||||||
|
export let isPassword = false;
|
||||||
export let showInstanceWarning = false;
|
export let showInstanceWarning = false;
|
||||||
|
|
||||||
|
let inputType = isPassword ? "password" : "text";
|
||||||
|
|
||||||
const regex = {
|
const regex = {
|
||||||
url: "https?:\\/\\/[a-z0-9.\\-]+(:\\d+)?/?",
|
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}$",
|
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]}
|
pattern={regex[type]}
|
||||||
aria-label={altText}
|
aria-label={altText}
|
||||||
aria-hidden="false"
|
aria-hidden="false"
|
||||||
|
|
||||||
|
{ ...{ type: inputType } }
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{#if inputValue.length === 0}
|
{#if inputValue.length === 0}
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
placeholder="00000000-0000-0000-0000-000000000000"
|
placeholder="00000000-0000-0000-0000-000000000000"
|
||||||
altText={$t("settings.processing.access_key.input.alt_text")}
|
altText={$t("settings.processing.access_key.input.alt_text")}
|
||||||
type="uuid"
|
type="uuid"
|
||||||
|
isPassword
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user