mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Use new restart dialog in dev tools (#15530)
This commit is contained in:
parent
3e72b1cb5d
commit
3066a9d10d
@ -211,7 +211,14 @@ class DialogRestart extends LitElement {
|
||||
duration: 1000,
|
||||
});
|
||||
|
||||
await this.hass.callService("homeassistant", "reload_all");
|
||||
try {
|
||||
await this.hass.callService("homeassistant", "reload_all");
|
||||
} catch (err: any) {
|
||||
showAlertDialog(this, {
|
||||
title: this.hass.localize("ui.dialogs.restart.reload.failed"),
|
||||
text: err.message,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async _restart(ev) {
|
||||
|
@ -7,7 +7,7 @@ import "../../../components/ha-card";
|
||||
import "../../../components/ha-circular-progress";
|
||||
import { checkCoreConfig } from "../../../data/core";
|
||||
import { domainToName } from "../../../data/integration";
|
||||
import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box";
|
||||
import { showRestartDialog } from "../../../dialogs/restart/show-dialog-restart";
|
||||
import { haStyle } from "../../../resources/styles";
|
||||
import type { HomeAssistant, Route, TranslationDict } from "../../../types";
|
||||
|
||||
@ -181,23 +181,7 @@ export class DeveloperYamlConfig extends LitElement {
|
||||
}
|
||||
|
||||
private _restart() {
|
||||
showConfirmationDialog(this, {
|
||||
title: this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.yaml.section.server_management.confirm_restart_title"
|
||||
),
|
||||
text: this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.yaml.section.server_management.confirm_restart_text"
|
||||
),
|
||||
confirmText: this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.yaml.section.server_management.restart"
|
||||
),
|
||||
confirm: () => {
|
||||
this.hass.callService("homeassistant", "restart").catch((reason) => {
|
||||
this._isValid = false;
|
||||
this._validateLog = reason.message;
|
||||
});
|
||||
},
|
||||
});
|
||||
showRestartDialog(this);
|
||||
}
|
||||
|
||||
static get styles(): CSSResultGroup {
|
||||
|
@ -1016,7 +1016,8 @@
|
||||
"reload": {
|
||||
"title": "Quick reload",
|
||||
"description": "Load new YAML configurations without a restart.",
|
||||
"reloading": "Reloading configuration"
|
||||
"reloading": "Reloading configuration",
|
||||
"failed": "Failed to reload configuration"
|
||||
},
|
||||
"restart": {
|
||||
"title": "Restart Home Assistant",
|
||||
@ -4942,8 +4943,6 @@
|
||||
},
|
||||
"server_management": {
|
||||
"heading": "Home Assistant",
|
||||
"confirm_restart_text": "Restarting Home Assistant will stop all your active dashboards, automations and scripts.",
|
||||
"confirm_restart_title": "Restart Home Assistant?",
|
||||
"restart": "Restart",
|
||||
"stop": "Stop",
|
||||
"confirm_stop": "Are you sure you want to stop Home Assistant?",
|
||||
|
Loading…
x
Reference in New Issue
Block a user