mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Allow configuration_url to point to an internal panel (#10395)
This commit is contained in:
parent
32ac04ea78
commit
63cd576d56
@ -195,6 +195,13 @@ export class HaConfigDevicePage extends LitElement {
|
||||
: undefined;
|
||||
const area = this._computeArea(this.areas, device);
|
||||
|
||||
const configurationUrlIsHomeAssistant =
|
||||
device.configuration_url?.startsWith("homeassistant://") || false;
|
||||
|
||||
const configurationUrl = configurationUrlIsHomeAssistant
|
||||
? device.configuration_url!.replace("homeassistant://", "/")
|
||||
: device.configuration_url;
|
||||
|
||||
return html`
|
||||
<hass-tabs-subpage
|
||||
.hass=${this.hass}
|
||||
@ -316,13 +323,15 @@ export class HaConfigDevicePage extends LitElement {
|
||||
: html``
|
||||
}
|
||||
${
|
||||
device.configuration_url
|
||||
configurationUrl
|
||||
? html`
|
||||
<div class="card-actions" slot="actions">
|
||||
<a
|
||||
href=${device.configuration_url}
|
||||
target="_blank"
|
||||
href=${configurationUrl}
|
||||
rel="noopener noreferrer"
|
||||
.target=${configurationUrlIsHomeAssistant
|
||||
? "_self"
|
||||
: "_blank"}
|
||||
>
|
||||
<mwc-button>
|
||||
${this.hass.localize(
|
||||
|
Loading…
x
Reference in New Issue
Block a user