Hide stop if "hassio" is loaded

This commit is contained in:
Ludeeus 2020-08-28 19:06:03 +00:00
parent b39b54e0ac
commit aaeb9cde7b

View File

@ -17,6 +17,7 @@ import { HomeAssistant, Route } from "../../../types";
import "@material/mwc-button";
import "@polymer/paper-input/paper-input";
import { isServiceLoaded } from "../../../common/config/is_service_loaded";
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-card";
import "../ha-config-section";
@ -178,18 +179,20 @@ export class HaConfigServerControl extends LitElement {
"ui.panel.config.server_control.section.server_management.restart"
)}
</ha-call-service-button>
<ha-call-service-button
class="warning"
.hass=${this.hass}
domain="homeassistant"
service="stop"
confirmation=${this.hass.localize(
"ui.panel.config.server_control.section.server_management.confirm_stop"
)}
>${this.hass.localize(
"ui.panel.config.server_control.section.server_management.stop"
)}
</ha-call-service-button>
${!isComponentLoaded(this.hass, "hassio")
? html` <ha-call-service-button
class="warning"
.hass=${this.hass}
domain="homeassistant"
service="stop"
confirmation=${this.hass.localize(
"ui.panel.config.server_control.section.server_management.confirm_stop"
)}
>${this.hass.localize(
"ui.panel.config.server_control.section.server_management.stop"
)}
</ha-call-service-button>`
: ""}
</div>
</ha-card>