mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Add more secret string fields (#10149)
This commit is contained in:
parent
13fe62975d
commit
784e5e6e39
@ -12,6 +12,8 @@ import type {
|
|||||||
HaFormStringSchema,
|
HaFormStringSchema,
|
||||||
} from "./ha-form";
|
} from "./ha-form";
|
||||||
|
|
||||||
|
const MASKED_FIELDS = ["password", "secret", "token"];
|
||||||
|
|
||||||
@customElement("ha-form-string")
|
@customElement("ha-form-string")
|
||||||
export class HaFormString extends LitElement implements HaFormElement {
|
export class HaFormString extends LitElement implements HaFormElement {
|
||||||
@property() public schema!: HaFormStringSchema;
|
@property() public schema!: HaFormStringSchema;
|
||||||
@ -33,7 +35,7 @@ export class HaFormString extends LitElement implements HaFormElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return this.schema.name.includes("password")
|
return MASKED_FIELDS.some((field) => this.schema.name.includes(field))
|
||||||
? html`
|
? html`
|
||||||
<paper-input
|
<paper-input
|
||||||
.type=${this._unmaskedPassword ? "text" : "password"}
|
.type=${this._unmaskedPassword ? "text" : "password"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user