mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Remove all exceptions from supervisor localize keys (#13402)
This commit is contained in:
parent
24509425ca
commit
52a1594969
@ -40,6 +40,7 @@ import "../../../../src/components/ha-settings-row";
|
|||||||
import "../../../../src/components/ha-svg-icon";
|
import "../../../../src/components/ha-svg-icon";
|
||||||
import "../../../../src/components/ha-switch";
|
import "../../../../src/components/ha-switch";
|
||||||
import {
|
import {
|
||||||
|
AddonCapability,
|
||||||
fetchHassioAddonChangelog,
|
fetchHassioAddonChangelog,
|
||||||
fetchHassioAddonInfo,
|
fetchHassioAddonInfo,
|
||||||
HassioAddonDetails,
|
HassioAddonDetails,
|
||||||
@ -701,7 +702,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _showMoreInfo(ev): void {
|
private _showMoreInfo(ev): void {
|
||||||
const id = ev.currentTarget.id;
|
const id = ev.currentTarget.id as AddonCapability;
|
||||||
showHassioMarkdownDialog(this, {
|
showHassioMarkdownDialog(this, {
|
||||||
title: this.supervisor.localize(`addon.dashboard.capability.${id}.title`),
|
title: this.supervisor.localize(`addon.dashboard.capability.${id}.title`),
|
||||||
content:
|
content:
|
||||||
|
@ -17,9 +17,12 @@ import {
|
|||||||
} from "../../../src/data/hassio/backup";
|
} from "../../../src/data/hassio/backup";
|
||||||
import { Supervisor } from "../../../src/data/supervisor/supervisor";
|
import { Supervisor } from "../../../src/data/supervisor/supervisor";
|
||||||
import { PolymerChangedEvent } from "../../../src/polymer-types";
|
import { PolymerChangedEvent } from "../../../src/polymer-types";
|
||||||
import { HomeAssistant } from "../../../src/types";
|
import { HomeAssistant, TranslationDict } from "../../../src/types";
|
||||||
import "./supervisor-formfield-label";
|
import "./supervisor-formfield-label";
|
||||||
|
|
||||||
|
type BackupOrRestoreKey = keyof TranslationDict["supervisor"]["backup"] &
|
||||||
|
keyof TranslationDict["ui"]["panel"]["page-onboarding"]["restore"];
|
||||||
|
|
||||||
interface CheckboxItem {
|
interface CheckboxItem {
|
||||||
slug: string;
|
slug: string;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
@ -108,9 +111,9 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
this._focusTarget?.focus();
|
this._focusTarget?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _localize = (string: string) =>
|
private _localize = (key: BackupOrRestoreKey) =>
|
||||||
this.supervisor?.localize(`backup.${string}`) ||
|
this.supervisor?.localize(`backup.${key}`) ||
|
||||||
this.localize!(`ui.panel.page-onboarding.restore.${string}`);
|
this.localize!(`ui.panel.page-onboarding.restore.${key}`);
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.onboarding && !this.supervisor) {
|
if (!this.onboarding && !this.supervisor) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { atLeastVersion } from "../../common/config/version";
|
import { atLeastVersion } from "../../common/config/version";
|
||||||
import type { HaFormSchema } from "../../components/ha-form/types";
|
import type { HaFormSchema } from "../../components/ha-form/types";
|
||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant, TranslationDict } from "../../types";
|
||||||
import { supervisorApiCall } from "../supervisor/common";
|
import { supervisorApiCall } from "../supervisor/common";
|
||||||
import { StoreAddonDetails } from "../supervisor/store";
|
import { StoreAddonDetails } from "../supervisor/store";
|
||||||
import { Supervisor, SupervisorArch } from "../supervisor/supervisor";
|
import { Supervisor, SupervisorArch } from "../supervisor/supervisor";
|
||||||
@ -10,6 +10,10 @@ import {
|
|||||||
HassioResponse,
|
HassioResponse,
|
||||||
} from "./common";
|
} from "./common";
|
||||||
|
|
||||||
|
export type AddonCapability = Exclude<
|
||||||
|
keyof TranslationDict["supervisor"]["addon"]["dashboard"]["capability"],
|
||||||
|
"label" | "role" | "stages"
|
||||||
|
>;
|
||||||
export type AddonStage = "stable" | "experimental" | "deprecated";
|
export type AddonStage = "stable" | "experimental" | "deprecated";
|
||||||
export type AddonAppArmour = "disable" | "default" | "profile";
|
export type AddonAppArmour = "disable" | "default" | "profile";
|
||||||
export type AddonRole = "default" | "homeassistant" | "manager" | "admin";
|
export type AddonRole = "default" | "homeassistant" | "manager" | "admin";
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { atLeastVersion } from "../../common/config/version";
|
import { atLeastVersion } from "../../common/config/version";
|
||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant, TranslationDict } from "../../types";
|
||||||
import { hassioApiResultExtractor, HassioResponse } from "./common";
|
import { hassioApiResultExtractor, HassioResponse } from "./common";
|
||||||
|
|
||||||
export interface HassioResolution {
|
export interface HassioResolution {
|
||||||
unsupported: string[];
|
unsupported: (keyof TranslationDict["supervisor"]["system"]["supervisor"]["unsupported_reason"])[];
|
||||||
unhealthy: string[];
|
unhealthy: (keyof TranslationDict["supervisor"]["system"]["supervisor"]["unhealthy_reason"])[];
|
||||||
issues: string[];
|
issues: string[];
|
||||||
suggestions: string[];
|
suggestions: string[];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant } from "../../types";
|
||||||
import { AddonStage } from "../hassio/addon";
|
import { AddonRole, AddonStage } from "../hassio/addon";
|
||||||
import { supervisorApiCall } from "./common";
|
import { supervisorApiCall } from "./common";
|
||||||
import { SupervisorArch } from "./supervisor";
|
import { SupervisorArch } from "./supervisor";
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ export interface StoreAddonDetails extends StoreAddon {
|
|||||||
documentation: boolean;
|
documentation: boolean;
|
||||||
full_access: boolean;
|
full_access: boolean;
|
||||||
hassio_api: boolean;
|
hassio_api: boolean;
|
||||||
hassio_role: string;
|
hassio_role: AddonRole;
|
||||||
homeassistant_api: boolean;
|
homeassistant_api: boolean;
|
||||||
host_network: boolean;
|
host_network: boolean;
|
||||||
host_pid: boolean;
|
host_pid: boolean;
|
||||||
|
@ -60,9 +60,7 @@ export interface SupervisorEvent {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupervisorKeys =
|
export type SupervisorKeys = FlattenObjectKeys<TranslationDict["supervisor"]>;
|
||||||
| FlattenObjectKeys<TranslationDict["supervisor"]>
|
|
||||||
| `${keyof TranslationDict["supervisor"]}.${string}`;
|
|
||||||
|
|
||||||
export interface Supervisor {
|
export interface Supervisor {
|
||||||
host: HassioHostInfo;
|
host: HassioHostInfo;
|
||||||
|
@ -4564,6 +4564,7 @@
|
|||||||
"hide_log": "Hide full log",
|
"hide_log": "Hide full log",
|
||||||
"full_backup": "[%key:supervisor::backup::full_backup%]",
|
"full_backup": "[%key:supervisor::backup::full_backup%]",
|
||||||
"partial_backup": "[%key:supervisor::backup::partial_backup%]",
|
"partial_backup": "[%key:supervisor::backup::partial_backup%]",
|
||||||
|
"name": "[%key:supervisor::backup::name%]",
|
||||||
"type": "[%key:supervisor::backup::type%]",
|
"type": "[%key:supervisor::backup::type%]",
|
||||||
"select_type": "[%key:supervisor::backup::select_type%]",
|
"select_type": "[%key:supervisor::backup::select_type%]",
|
||||||
"folders": "[%key:supervisor::backup::folders%]",
|
"folders": "[%key:supervisor::backup::folders%]",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user