mirror of
https://github.com/home-assistant/frontend.git
synced 2026-11-25 22:28:46 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25307e427d | ||
|
|
207cbcc585 |
No files matched your search
@@ -620,14 +620,15 @@ class MoreInfoWeather extends LitElement {
|
||||
}
|
||||
|
||||
.temp-attribute .temp {
|
||||
position: relative;
|
||||
margin-right: var(--ha-space-6);
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.temp-attribute .temp span {
|
||||
position: relative;
|
||||
position: absolute;
|
||||
font-size: var(--ha-font-size-2xl);
|
||||
top: 1px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.state,
|
||||
|
||||
@@ -95,23 +95,6 @@ class DialogStartupProgress extends DialogMixin(LitElement) {
|
||||
.slice(0, MAX_SLOWEST);
|
||||
});
|
||||
}
|
||||
if (changedProps.has("_progress") || changedProps.has("_setups")) {
|
||||
this._loadTitles();
|
||||
}
|
||||
}
|
||||
|
||||
private _loadTitles() {
|
||||
const progress = this._progress
|
||||
? this._computeProgress(this._progress, this._config.config.state)
|
||||
: undefined;
|
||||
const domains = [
|
||||
...(progress?.active.map(([domain]) => domain) ?? []),
|
||||
...(progress?.failed ?? []),
|
||||
...(this._setups?.map((setup) => setup.domain) ?? []),
|
||||
];
|
||||
if (domains.length) {
|
||||
this._i18n.loadBackendTranslation("title", domains);
|
||||
}
|
||||
}
|
||||
|
||||
protected render() {
|
||||
|
||||
+29
-1
@@ -75,11 +75,39 @@ const clearUrlParams = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const SERVER_CHECK_TIMEOUT = 10_000;
|
||||
|
||||
const checkServer = async () => {
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), SERVER_CHECK_TIMEOUT);
|
||||
try {
|
||||
const response = await fetch(`${hassUrl}/manifest.json`, {
|
||||
mode: "no-cors",
|
||||
cache: "no-store",
|
||||
signal: controller.signal,
|
||||
});
|
||||
if (response.status >= 500) {
|
||||
throw new Error(`Home Assistant responded with ${response.status}`);
|
||||
}
|
||||
} finally {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
};
|
||||
|
||||
// The login page is never cached, so check the server is up before getAuth redirects to it.
|
||||
const loadTokensOrCheckServer = async () => {
|
||||
const tokens = loadTokens();
|
||||
if (!tokens || tokens.hassUrl !== hassUrl) {
|
||||
await checkServer();
|
||||
}
|
||||
return tokens;
|
||||
};
|
||||
|
||||
const authOptions = {
|
||||
hassUrl,
|
||||
limitHassInstance: true,
|
||||
saveTokens,
|
||||
loadTokens: () => Promise.resolve(loadTokens()),
|
||||
loadTokens: loadTokensOrCheckServer,
|
||||
};
|
||||
|
||||
const getAuthDroppingStaleCallback = async () => {
|
||||
|
||||
@@ -89,7 +89,11 @@ class HaBackupConfigAgents extends LitElement {
|
||||
|
||||
const retention = this.agentsConfig?.[agentId]?.retention;
|
||||
|
||||
if (retention) {
|
||||
if (retention && !this._value.includes(agentId)) {
|
||||
texts.push(
|
||||
this.hass.localize("ui.panel.config.backup.agents.retention_inactive")
|
||||
);
|
||||
} else if (retention) {
|
||||
if (retention.copies === null && retention.days === null) {
|
||||
texts.push(
|
||||
this.hass.localize("ui.panel.config.backup.agents.retention_all")
|
||||
|
||||
@@ -120,21 +120,34 @@ class HaConfigBackupDetails extends LitElement {
|
||||
</p>
|
||||
</div>
|
||||
`
|
||||
: html`<ha-backup-config-retention
|
||||
location-specific
|
||||
.headline=${this.hass.localize(
|
||||
`ui.panel.config.backup.location.retention_for_${isLocalAgent(this.agentId) ? "this_system" : "location"}`,
|
||||
{ location: agentName }
|
||||
)}
|
||||
.hass=${this.hass}
|
||||
.retention=${
|
||||
!this.config
|
||||
? undefined
|
||||
: this.config.agents[this.agentId]
|
||||
?.retention || null
|
||||
}
|
||||
@value-changed=${this._retentionChanged}
|
||||
></ha-backup-config-retention>`
|
||||
: html`${
|
||||
this.config &&
|
||||
!this.config.create_backup.agent_ids.includes(
|
||||
this.agentId
|
||||
)
|
||||
? html`<div class="card-content">
|
||||
<ha-alert alert-type="info">
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.backup.location.retention_inactive"
|
||||
)}
|
||||
</ha-alert>
|
||||
</div>`
|
||||
: nothing
|
||||
}<ha-backup-config-retention
|
||||
location-specific
|
||||
.headline=${this.hass.localize(
|
||||
`ui.panel.config.backup.location.retention_for_${isLocalAgent(this.agentId) ? "this_system" : "location"}`,
|
||||
{ location: agentName }
|
||||
)}
|
||||
.hass=${this.hass}
|
||||
.retention=${
|
||||
!this.config
|
||||
? undefined
|
||||
: this.config.agents[this.agentId]
|
||||
?.retention || null
|
||||
}
|
||||
@value-changed=${this._retentionChanged}
|
||||
></ha-backup-config-retention>`
|
||||
}
|
||||
</ha-card>
|
||||
<ha-card>
|
||||
|
||||
@@ -820,14 +820,15 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
|
||||
}
|
||||
|
||||
.temp-attribute .temp {
|
||||
position: relative;
|
||||
margin-right: 24px;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.temp-attribute .temp span {
|
||||
position: relative;
|
||||
position: absolute;
|
||||
font-size: var(--ha-font-size-2xl);
|
||||
top: 1px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.state,
|
||||
@@ -1024,6 +1025,12 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
|
||||
font-size: var(--ha-font-size-xl);
|
||||
}
|
||||
|
||||
[class*="narrow"] .temp-attribute .temp {
|
||||
margin-right: 16px;
|
||||
margin-inline-end: 16px;
|
||||
margin-inline-start: initial;
|
||||
}
|
||||
|
||||
[class*="narrow"] .temp span {
|
||||
top: 1px;
|
||||
font-size: var(--ha-font-size-l);
|
||||
|
||||
@@ -28,20 +28,12 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
||||
|
||||
private _startupToastKey?: string;
|
||||
|
||||
private _startupDetailsOpen = false;
|
||||
|
||||
private _disconnectedTimeout?: number;
|
||||
|
||||
protected firstUpdated(changedProps: PropertyValues<this>) {
|
||||
super.firstUpdated(changedProps);
|
||||
// Need to load in advance because when disconnected, can't dynamically load code.
|
||||
setTimeout(() => import("../managers/notification-manager"), 5000);
|
||||
this.addEventListener("dialog-closed", (ev) => {
|
||||
if (ev.detail.dialog === "dialog-startup-progress") {
|
||||
this._startupDetailsOpen = false;
|
||||
this._updateStartupProgress();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updated(changedProperties: PropertyValues<this>) {
|
||||
@@ -143,7 +135,6 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
||||
// Wait until the translations are available.
|
||||
if (
|
||||
!this._startupProgressVisible ||
|
||||
this._startupDetailsOpen ||
|
||||
!this.hass!.localize("ui.startup_progress.starting")
|
||||
) {
|
||||
return;
|
||||
@@ -172,19 +163,13 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
||||
? {
|
||||
text: { translationKey: "ui.startup_progress.details" },
|
||||
icon: mdiInformationOutline,
|
||||
action: () => this._showStartupDetails(),
|
||||
keepOpen: true,
|
||||
action: () => showStartupProgressDialog(this),
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
// Toasts always show above dialogs, so the toast is hidden while the details are open.
|
||||
private _showStartupDetails() {
|
||||
this._startupDetailsOpen = true;
|
||||
this._startupToastKey = undefined;
|
||||
showStartupProgressDialog(this);
|
||||
}
|
||||
|
||||
// Keeps the subscription, so the completion toast still reflects late failures.
|
||||
private _hideStartupProgress() {
|
||||
this._startupProgressVisible = false;
|
||||
@@ -208,9 +193,6 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
||||
);
|
||||
this._hideStartupProgress();
|
||||
this._unsubscribeBootstrapProgress();
|
||||
if (this._startupDetailsOpen) {
|
||||
return;
|
||||
}
|
||||
const issues = failed.length;
|
||||
showToast(this, {
|
||||
id: SERVER_STARTUP_TOAST_ID,
|
||||
|
||||
@@ -3993,7 +3993,8 @@
|
||||
"location_settings": "Location settings",
|
||||
"retention_all": "Keep all backups",
|
||||
"retention_backups": "Keep {count} {count, plural,\n one {backup}\n other {backups}\n}",
|
||||
"retention_days": "Keep {count} {count, plural,\n one {day}\n other {days}\n}"
|
||||
"retention_days": "Keep {count} {count, plural,\n one {day}\n other {days}\n}",
|
||||
"retention_inactive": "Retention paused"
|
||||
},
|
||||
"data": {
|
||||
"ha_settings": "Home Assistant settings",
|
||||
@@ -4049,7 +4050,7 @@
|
||||
"retention": "Retention",
|
||||
"custom_retention": "Custom retention",
|
||||
"custom_retention_label": "Keep only",
|
||||
"retention_description": "Based on the maximum number of backups or how many days they should be kept.",
|
||||
"retention_description": "Based on the maximum number of backups or how many days they should be kept. Only applies to automatic backups, in the locations they are stored in.",
|
||||
"retention_presets": {
|
||||
"global": "Use global settings",
|
||||
"copies_3": "3 backups",
|
||||
@@ -4324,6 +4325,7 @@
|
||||
"save_error": "Error saving configuration: {error}",
|
||||
"retention_for_this_system": "Retention for this system",
|
||||
"retention_for_location": "Retention for {location}",
|
||||
"retention_inactive": "Automatic backups aren't stored in this location, so its retention settings are paused. Backups already in this location are kept until you delete them. Retention applies again when you turn the location back on for automatic backups.",
|
||||
"not_found": "Not found",
|
||||
"not_found_description": "Location matching ''{backupId}'' not found",
|
||||
"error": "Could not fetch location details",
|
||||
|
||||
Reference in new issue
Block a user