mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 02:06:42 +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;
|
: undefined;
|
||||||
const area = this._computeArea(this.areas, device);
|
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`
|
return html`
|
||||||
<hass-tabs-subpage
|
<hass-tabs-subpage
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -316,13 +323,15 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
: html``
|
: html``
|
||||||
}
|
}
|
||||||
${
|
${
|
||||||
device.configuration_url
|
configurationUrl
|
||||||
? html`
|
? html`
|
||||||
<div class="card-actions" slot="actions">
|
<div class="card-actions" slot="actions">
|
||||||
<a
|
<a
|
||||||
href=${device.configuration_url}
|
href=${configurationUrl}
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
|
.target=${configurationUrlIsHomeAssistant
|
||||||
|
? "_self"
|
||||||
|
: "_blank"}
|
||||||
>
|
>
|
||||||
<mwc-button>
|
<mwc-button>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user