mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 13:07:49 +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,
|
type: Object,
|
||||||
value: {},
|
value: {},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
confirmation: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
buttonTapped() {
|
buttonTapped() {
|
||||||
|
if (this.confirmation && !window.confirm(this.confirmation)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.progress = true;
|
this.progress = true;
|
||||||
var el = this;
|
var el = this;
|
||||||
var eventData = {
|
var eventData = {
|
||||||
|
@ -150,6 +150,7 @@ class HaConfigSectionServerControl extends LocalizeMixin(PolymerElement) {
|
|||||||
hass="[[hass]]"
|
hass="[[hass]]"
|
||||||
domain="homeassistant"
|
domain="homeassistant"
|
||||||
service="restart"
|
service="restart"
|
||||||
|
confirmation="[[localize('ui.panel.config.server_control.section.server_management.confirm_restart')]]"
|
||||||
>[[localize('ui.panel.config.server_control.section.server_management.restart')]]
|
>[[localize('ui.panel.config.server_control.section.server_management.restart')]]
|
||||||
</ha-call-service-button>
|
</ha-call-service-button>
|
||||||
<ha-call-service-button
|
<ha-call-service-button
|
||||||
@ -157,6 +158,7 @@ class HaConfigSectionServerControl extends LocalizeMixin(PolymerElement) {
|
|||||||
hass="[[hass]]"
|
hass="[[hass]]"
|
||||||
domain="homeassistant"
|
domain="homeassistant"
|
||||||
service="stop"
|
service="stop"
|
||||||
|
confirmation="[[localize('ui.panel.config.server_control.section.server_management.confirm_stop')]]"
|
||||||
>[[localize('ui.panel.config.server_control.section.server_management.stop')]]
|
>[[localize('ui.panel.config.server_control.section.server_management.stop')]]
|
||||||
</ha-call-service-button>
|
</ha-call-service-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -649,7 +649,9 @@
|
|||||||
"heading": "Server management",
|
"heading": "Server management",
|
||||||
"introduction": "Control your Home Assistant server… from Home Assistant.",
|
"introduction": "Control your Home Assistant server… from Home Assistant.",
|
||||||
"restart": "Restart",
|
"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