mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add shortcuts item to command quick bar (#24952)
* Add shortcuts item to command quick bar * Remove
This commit is contained in:
parent
74acd7ec38
commit
228acf1fae
@ -5,6 +5,7 @@ import {
|
|||||||
mdiConsoleLine,
|
mdiConsoleLine,
|
||||||
mdiDevices,
|
mdiDevices,
|
||||||
mdiEarth,
|
mdiEarth,
|
||||||
|
mdiKeyboard,
|
||||||
mdiMagnify,
|
mdiMagnify,
|
||||||
mdiReload,
|
mdiReload,
|
||||||
mdiServerNetwork,
|
mdiServerNetwork,
|
||||||
@ -42,6 +43,7 @@ import { loadVirtualizer } from "../../resources/virtualizer";
|
|||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import { showConfirmationDialog } from "../generic/show-dialog-box";
|
import { showConfirmationDialog } from "../generic/show-dialog-box";
|
||||||
import { QuickBarMode, type QuickBarParams } from "./show-dialog-quick-bar";
|
import { QuickBarMode, type QuickBarParams } from "./show-dialog-quick-bar";
|
||||||
|
import { showShortcutsDialog } from "../shortcuts/show-shortcuts-dialog";
|
||||||
|
|
||||||
interface QuickBarItem extends ScorableTextItem {
|
interface QuickBarItem extends ScorableTextItem {
|
||||||
primaryText: string;
|
primaryText: string;
|
||||||
@ -736,10 +738,20 @@ export class QuickBar extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const additionalItems = [
|
||||||
|
{
|
||||||
|
path: "",
|
||||||
|
primaryText: this.hass.localize("ui.panel.config.info.shortcuts"),
|
||||||
|
action: () => showShortcutsDialog(this),
|
||||||
|
iconPath: mdiKeyboard,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return this._finalizeNavigationCommands([
|
return this._finalizeNavigationCommands([
|
||||||
...panelItems,
|
...panelItems,
|
||||||
...sectionItems,
|
...sectionItems,
|
||||||
...supervisorItems,
|
...supervisorItems,
|
||||||
|
...additionalItems,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -816,12 +828,12 @@ export class QuickBar extends LitElement {
|
|||||||
const categoryKey: CommandItem["categoryKey"] = "navigation";
|
const categoryKey: CommandItem["categoryKey"] = "navigation";
|
||||||
|
|
||||||
const navItem = {
|
const navItem = {
|
||||||
...item,
|
|
||||||
iconPath: mdiEarth,
|
iconPath: mdiEarth,
|
||||||
categoryText: this.hass.localize(
|
categoryText: this.hass.localize(
|
||||||
`ui.dialogs.quick-bar.commands.types.${categoryKey}`
|
`ui.dialogs.quick-bar.commands.types.${categoryKey}`
|
||||||
),
|
),
|
||||||
action: () => navigate(item.path),
|
action: () => navigate(item.path),
|
||||||
|
...item,
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user