mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-04 15:07:48 +00:00
Comments
This commit is contained in:
parent
ec2e3bcada
commit
5b031f46f2
@ -11,12 +11,18 @@ import "./ha-progress-button";
|
|||||||
class HaCallServiceButton extends EventsMixin(PolymerElement) {
|
class HaCallServiceButton extends EventsMixin(PolymerElement) {
|
||||||
static get template() {
|
static get template() {
|
||||||
return html`
|
return html`
|
||||||
|
<style>
|
||||||
|
ha-progress-button {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
id="progress"
|
id="progress"
|
||||||
progress="[[progress]]"
|
progress="[[progress]]"
|
||||||
on-click="buttonTapped"
|
on-click="buttonTapped"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
raised="[[raised]]"
|
raised="[[raised]]"
|
||||||
|
outlined="[[outlined]]"
|
||||||
><slot></slot
|
><slot></slot
|
||||||
></ha-progress-button>
|
></ha-progress-button>
|
||||||
`;
|
`;
|
||||||
@ -54,6 +60,11 @@ class HaCallServiceButton extends EventsMixin(PolymerElement) {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: false,
|
value: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
outlined: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,12 +21,15 @@ class HaProgressButton extends LitElement {
|
|||||||
|
|
||||||
@property({ type: Boolean }) public raised = false;
|
@property({ type: Boolean }) public raised = false;
|
||||||
|
|
||||||
|
@property({ type: Boolean }) public outlined = false;
|
||||||
|
|
||||||
@query("mwc-button") private _button?: Button;
|
@query("mwc-button") private _button?: Button;
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<mwc-button
|
<mwc-button
|
||||||
?raised=${this.raised}
|
?raised=${this.raised}
|
||||||
|
?outlined=${this.outlined}
|
||||||
.disabled=${this.disabled || this.progress}
|
.disabled=${this.disabled || this.progress}
|
||||||
@click=${this._buttonTapped}
|
@click=${this._buttonTapped}
|
||||||
>
|
>
|
||||||
@ -71,6 +74,7 @@ class HaProgressButton extends LitElement {
|
|||||||
|
|
||||||
mwc-button {
|
mwc-button {
|
||||||
transition: all 1s;
|
transition: all 1s;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
mwc-button.success {
|
mwc-button.success {
|
||||||
|
@ -32,17 +32,17 @@ export class CloudAlexaPref extends LitElement {
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-card
|
<ha-card
|
||||||
header=${this.hass!.localize(
|
.header=${this.hass!.localize(
|
||||||
"ui.panel.config.cloud.account.alexa.title"
|
"ui.panel.config.cloud.account.alexa.title"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div class="switch">
|
|
||||||
<ha-switch
|
|
||||||
.checked=${alexa_enabled}
|
|
||||||
@change=${this._enabledToggleChanged}
|
|
||||||
></ha-switch>
|
|
||||||
</div>
|
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
|
<div class="switch">
|
||||||
|
<ha-switch
|
||||||
|
.checked=${alexa_enabled}
|
||||||
|
@change=${this._enabledToggleChanged}
|
||||||
|
></ha-switch>
|
||||||
|
</div>
|
||||||
${this.hass!.localize("ui.panel.config.cloud.account.alexa.info")}
|
${this.hass!.localize("ui.panel.config.cloud.account.alexa.info")}
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@ -197,6 +197,15 @@ export class CloudAlexaPref extends LitElement {
|
|||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
margin-left: 0.5em;
|
margin-left: 0.5em;
|
||||||
}
|
}
|
||||||
|
ha-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.card-content {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,46 +51,31 @@ class ConfigUrlForm extends LitElement {
|
|||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this._error ? html`<div class="error">${this._error}</div>` : ""}
|
${this._error ? html`<div class="error">${this._error}</div>` : ""}
|
||||||
<div class="row">
|
|
||||||
<div class="flex">
|
|
||||||
${this.hass.localize(
|
|
||||||
"ui.panel.config.core.section.core.core_config.external_url"
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<paper-input
|
<paper-input
|
||||||
class="flex"
|
class="flex"
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.core.section.core.core_config.external_url"
|
"ui.panel.config.core.section.core.core_config.external_url"
|
||||||
)}
|
)}
|
||||||
name="external_url"
|
name="external_url"
|
||||||
type="url"
|
type="url"
|
||||||
.disabled=${disabled}
|
.disabled=${disabled}
|
||||||
.value=${this._externalUrlValue}
|
.value=${this._externalUrlValue}
|
||||||
@value-changed=${this._handleChange}
|
@value-changed=${this._handleChange}
|
||||||
>
|
>
|
||||||
</paper-input>
|
</paper-input>
|
||||||
</div>
|
<paper-input
|
||||||
|
class="flex"
|
||||||
<div class="row">
|
.label=${this.hass.localize(
|
||||||
<div class="flex">
|
"ui.panel.config.core.section.core.core_config.internal_url"
|
||||||
${this.hass.localize(
|
)}
|
||||||
"ui.panel.config.core.section.core.core_config.internal_url"
|
name="internal_url"
|
||||||
)}
|
type="url"
|
||||||
</div>
|
.disabled=${disabled}
|
||||||
<paper-input
|
.value=${this._internalUrlValue}
|
||||||
class="flex"
|
@value-changed=${this._handleChange}
|
||||||
.label=${this.hass.localize(
|
>
|
||||||
"ui.panel.config.core.section.core.core_config.internal_url"
|
</paper-input>
|
||||||
)}
|
|
||||||
name="internal_url"
|
|
||||||
type="url"
|
|
||||||
.disabled=${disabled}
|
|
||||||
.value=${this._internalUrlValue}
|
|
||||||
@value-changed=${this._handleChange}
|
|
||||||
>
|
|
||||||
</paper-input>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<mwc-button @click=${this._save} .disabled=${disabled}>
|
<mwc-button @click=${this._save} .disabled=${disabled}>
|
||||||
|
@ -216,6 +216,7 @@ export class HaConfigServerControl extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<ha-call-service-button
|
<ha-call-service-button
|
||||||
|
outlined
|
||||||
domain="homeassistant"
|
domain="homeassistant"
|
||||||
service="reload_core_config"
|
service="reload_core_config"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -228,6 +229,7 @@ export class HaConfigServerControl extends LitElement {
|
|||||||
isServiceLoaded(this.hass, domain, "reload")
|
isServiceLoaded(this.hass, domain, "reload")
|
||||||
? html`
|
? html`
|
||||||
<ha-call-service-button
|
<ha-call-service-button
|
||||||
|
outlined
|
||||||
service="reload"
|
service="reload"
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.domain=${domain}
|
.domain=${domain}
|
||||||
@ -346,12 +348,12 @@ export class HaConfigServerControl extends LitElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
padding-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.reload ha-call-service-button {
|
.reload ha-call-service-button {
|
||||||
padding: 8px;
|
padding: 0 8px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border: 1px solid var(--divider-color, #e8e8e8);
|
|
||||||
width: calc(33% - 24px);
|
width: calc(33% - 24px);
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user