182 files

This commit is contained in:
Home Assistant Version Control
2026-08-17 12:11:35 +00:00
parent 7dddf6bb13
commit ece15a1c1b
183 changed files with 11457 additions and 3092 deletions
@@ -8,8 +8,9 @@
import { LitElement, html, css, nothing } from "lit";
import { property, state } from "lit/decorators.js";
import { t, ensureLocale } from "../styles";
import { t, ensureLocale, langOf } from "../styles";
import { describeWsError } from "../ws-errors";
import { openSignedDocument } from "../helpers/document-url";
import { formatBytes } from "../helpers/format-bytes";
import type { HomeAssistant } from "../types";
@@ -55,7 +56,7 @@ export class MaintenanceStorageSectionCard extends LitElement {
private _searchTimer = 0;
private get _lang(): string {
return this.hass?.language || "en";
return langOf(this.hass);
}
updated(changed: Map<string, unknown>): void {
@@ -137,17 +138,9 @@ export class MaintenanceStorageSectionCard extends LitElement {
window.open(doc.url, "_blank", "noopener");
return;
}
const win = window.open("about:blank", "_blank");
try {
const s = await this.hass.connection.sendMessagePromise<{ path: string }>({
type: "auth/sign_path",
path: `/api/maintenance_supporter/document/${doc.id}`,
expires: 300,
});
// Absolute URL so it navigates the blank popup reliably (about:blank base).
if (win) win.location.href = new URL(s.path, window.location.origin).href;
await openSignedDocument(this.hass, doc.id);
} catch (e) {
if (win) win.close();
this._error = describeWsError(e, this._lang);
}
}