mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 12:46:35 +00:00
Present confirmation for server restarts/stops (#3564)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3233
This commit is contained in:
parent
c3e29e359a
commit
ba0d7cb156
@ -42,10 +42,17 @@ class HaCallServiceButton extends EventsMixin(PolymerElement) {
|
||||
type: Object,
|
||||
value: {},
|
||||
},
|
||||
|
||||
confirmation: {
|
||||
type: String,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
buttonTapped() {
|
||||
if (this.confirmation && !window.confirm(this.confirmation)) {
|
||||
return;
|
||||
}
|
||||
this.progress = true;
|
||||
var el = this;
|
||||
var eventData = {
|
||||
|
@ -150,6 +150,7 @@ class HaConfigSectionServerControl extends LocalizeMixin(PolymerElement) {
|
||||
hass="[[hass]]"
|
||||
domain="homeassistant"
|
||||
service="restart"
|
||||
confirmation="[[localize('ui.panel.config.server_control.section.server_management.confirm_restart')]]"
|
||||
>[[localize('ui.panel.config.server_control.section.server_management.restart')]]
|
||||
</ha-call-service-button>
|
||||
<ha-call-service-button
|
||||
@ -157,6 +158,7 @@ class HaConfigSectionServerControl extends LocalizeMixin(PolymerElement) {
|
||||
hass="[[hass]]"
|
||||
domain="homeassistant"
|
||||
service="stop"
|
||||
confirmation="[[localize('ui.panel.config.server_control.section.server_management.confirm_stop')]]"
|
||||
>[[localize('ui.panel.config.server_control.section.server_management.stop')]]
|
||||
</ha-call-service-button>
|
||||
</div>
|
||||
|
@ -649,7 +649,9 @@
|
||||
"heading": "Server management",
|
||||
"introduction": "Control your Home Assistant server… from Home Assistant.",
|
||||
"restart": "Restart",
|
||||
"stop": "Stop"
|
||||
"confirm_restart": "Are you sure you want to restart Home Assistant?",
|
||||
"stop": "Stop",
|
||||
"confirm_stop": "Are you sure you want to stop Home Assistant?"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user