V config/www vytvořte soubor panel-redirect.js takto /config/www/panel-redirect.js a do něho vložte
Kód: Vybrat vše
class PanelRedirect extends HTMLElement {
connectedCallback() {
if (this._info) {
this._navigate();
}
}
set panel(info) {
this._info = info;
if (this.isConnected) {
this._navigate();
}
}
_navigate() {
history.replaceState(null, "", this._info.config.target);
const event = new Event("location-changed", {
bubbles: true,
composed: true,
});
event.detail = { replace: true };
this.dispatchEvent(event);
}
}
customElements.define("panel-redirect", PanelRedirect);
Kód: Vybrat vše
panel_custom:
- name: panel-redirect
url_path: redirect-server-controls
sidebar_title: Server Controls
sidebar_icon: mdi:server
module_url: /local/panel-redirect.js
config:
target: /config/server_control
- name: panel-redirect
url_path: redirect-logs
sidebar_title: Logs
sidebar_icon: mdi:math-log
module_url: /local/panel-redirect.js
config:
target: /config/logs
- name: panel-redirect
url_path: redirect-supervisor
sidebar_title: Supervisor
sidebar_icon: mdi:home-assistant
module_url: /local/panel-redirect.js
config:
target: /hassio/dashboard