mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Make Lovelace default (#2414)
* Set Lovelace as default * Remove template * Make link follow OPT_IN_PANEL
This commit is contained in:
parent
7173b16ef3
commit
937a939907
@ -8,7 +8,7 @@
|
||||
export const DEFAULT_DOMAIN_ICON = "hass:bookmark";
|
||||
|
||||
/** Panel to show when no panel is picked. */
|
||||
export const DEFAULT_PANEL = "states";
|
||||
export const DEFAULT_PANEL = "lovelace";
|
||||
|
||||
/** Domains that have a state card. */
|
||||
export const DOMAINS_WITH_CARD = [
|
||||
|
@ -20,7 +20,7 @@ import formatTime from "../../common/datetime/format_time";
|
||||
import EventsMixin from "../../mixins/events-mixin";
|
||||
import LocalizeMixin from "../../mixins/localize-mixin";
|
||||
|
||||
const OPT_IN_PANEL = "lovelace";
|
||||
const OPT_IN_PANEL = "states";
|
||||
let registeredDialog = false;
|
||||
|
||||
class HaPanelDevInfo extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||
@ -167,7 +167,7 @@ class HaPanelDevInfo extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||
</template>
|
||||
</p>
|
||||
<p>
|
||||
<a href='/lovelace'>Try out the new Lovelace UI</a>
|
||||
<a href="[[_nonDefaultLink()]]">[[_nonDefaultLinkText()]]</a>
|
||||
<div id="love" style="cursor:pointer;" on-click="_toggleDefaultPage">[[_defaultPageText()]]</div
|
||||
</p>
|
||||
</div>
|
||||
@ -366,6 +366,26 @@ class HaPanelDevInfo extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||
});
|
||||
}
|
||||
|
||||
_nonDefaultLink() {
|
||||
if (
|
||||
localStorage.defaultPage === OPT_IN_PANEL &&
|
||||
OPT_IN_PANEL === "states"
|
||||
) {
|
||||
return "/lovelace";
|
||||
}
|
||||
return "/states";
|
||||
}
|
||||
|
||||
_nonDefaultLinkText() {
|
||||
if (
|
||||
localStorage.defaultPage === OPT_IN_PANEL &&
|
||||
OPT_IN_PANEL === "states"
|
||||
) {
|
||||
return "Go to the Lovelace UI";
|
||||
}
|
||||
return "Go to the states UI";
|
||||
}
|
||||
|
||||
_defaultPageText() {
|
||||
return `>> ${
|
||||
localStorage.defaultPage === OPT_IN_PANEL ? "Remove" : "Set"
|
||||
|
Loading…
x
Reference in New Issue
Block a user