mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-10 02:46:38 +00:00
More re-org
This commit is contained in:
parent
bb61c33a4b
commit
35edf041ae
@ -1 +1 @@
|
|||||||
Subproject commit 0209bcdd0b7491d539f05887347d66a63e0da42c
|
Subproject commit b7ac88af0bf5a6065c021e47dc6af0f7006b187b
|
@ -1,21 +1,69 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
<link rel="import" href="./logbook-entry.html">
|
<link rel="import" href="../../src/components/domain-icon.html">
|
||||||
|
<link rel="import" href="../../src/components/display-time.html">
|
||||||
|
<link rel="import" href="../../src/components/relative-ha-datetime.html">
|
||||||
|
|
||||||
|
|
||||||
<dom-module id="ha-logbook">
|
<dom-module id="ha-logbook">
|
||||||
<template>
|
<template>
|
||||||
|
<style is="custom-style" include="iron-flex"></style>
|
||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.entry {
|
||||||
|
@apply(--paper-font-body1);
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
line-height: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
display-time {
|
||||||
|
width: 55px;
|
||||||
|
font-size: .8em;
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
domain-icon {
|
||||||
|
margin: 0 8px 0 16px;
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<template is='dom-if' if='[[!entries.length]]'>
|
<template is='dom-if' if='[[!entries.length]]'>
|
||||||
No logbook entries found.
|
No logbook entries found.
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template is='dom-repeat' items="[[entries]]">
|
<template is='dom-repeat' items="[[entries]]">
|
||||||
<logbook-entry entry-obj="[[item]]" hass='[[hass]]'></logbook-entry>
|
<div class='horizontal layout entry'>
|
||||||
|
<display-time date-obj="[[item.when]]"></display-time>
|
||||||
|
<domain-icon domain="[[item.domain]]" class='icon'></domain-icon>
|
||||||
|
<div class='message' flex>
|
||||||
|
<template is='dom-if' if="[[!item.entityId]]">
|
||||||
|
<span class='name'>[[item.name]]</span>
|
||||||
|
</template>
|
||||||
|
<template is='dom-if' if="[[item.entityId]]">
|
||||||
|
<a href='#' on-click="entityClicked" class='name'>[[item.name]]</a>
|
||||||
|
</template>
|
||||||
|
<span> </span>
|
||||||
|
<span>[[item.message]]</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</dom-module>
|
</dom-module>
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
paper-input {
|
paper-input {
|
||||||
max-width: 200px;
|
max-width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<partial-base narrow="[[narrow]]" show-menu='[[showMenu]]'>
|
<partial-base narrow="[[narrow]]" show-menu='[[showMenu]]'>
|
||||||
@ -30,8 +34,12 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class='selected-date-container'>
|
<div class='selected-date-container'>
|
||||||
<paper-input label='Showing entries for' id='datePicker'
|
<paper-input
|
||||||
value='[[selectedDate]]' on-focus='datepickerFocus'></paper-input>
|
label='Showing entries for'
|
||||||
|
id='datePicker'
|
||||||
|
value='[[selectedDate]]'
|
||||||
|
on-focus='datepickerFocus'
|
||||||
|
></paper-input>
|
||||||
|
|
||||||
<loading-box hidden$='[[!isLoading]]'>Loading logbook entries</loading-box>
|
<loading-box hidden$='[[!isLoading]]'>Loading logbook entries</loading-box>
|
||||||
</div>
|
</div>
|
||||||
@ -106,7 +114,7 @@ Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
datepickerFocus: function () {
|
datepickerFocus: function () {
|
||||||
this.datePicker.adjustPosition();
|
// this.datePicker.adjustPosition();
|
||||||
},
|
},
|
||||||
|
|
||||||
attached: function () {
|
attached: function () {
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
|
||||||
|
|
||||||
<link rel="import" href="../../src/components/domain-icon.html">
|
|
||||||
<link rel="import" href="../../src/components/display-time.html">
|
|
||||||
<link rel="import" href="../../src/components/relative-ha-datetime.html">
|
|
||||||
|
|
||||||
<dom-module id="logbook-entry">
|
|
||||||
<template>
|
|
||||||
<style is="custom-style" include="iron-flex"></style>
|
|
||||||
<style>
|
|
||||||
:host {
|
|
||||||
@apply(--paper-font-body1);
|
|
||||||
|
|
||||||
display: block;
|
|
||||||
line-height: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
display-time {
|
|
||||||
width: 55px;
|
|
||||||
font-size: .8em;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
domain-icon {
|
|
||||||
margin: 0 8px 0 16px;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message {
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<div class='horizontal layout'>
|
|
||||||
<display-time date-obj="[[entryObj.when]]"></display-time>
|
|
||||||
<domain-icon domain="[[entryObj.domain]]" class='icon'></domain-icon>
|
|
||||||
<div class='message' flex>
|
|
||||||
<template is='dom-if' if="[[!entryObj.entityId]]">
|
|
||||||
<span class='name'>[[entryObj.name]]</span>
|
|
||||||
</template>
|
|
||||||
<template is='dom-if' if="[[entryObj.entityId]]">
|
|
||||||
<a href='#' on-click="entityClicked" class='name'>[[entryObj.name]]</a>
|
|
||||||
</template>
|
|
||||||
<span> </span>
|
|
||||||
<span>[[entryObj.message]]</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
Polymer({
|
|
||||||
is: 'logbook-entry',
|
|
||||||
|
|
||||||
properties: {
|
|
||||||
hass: {
|
|
||||||
type: Object,
|
|
||||||
},
|
|
||||||
|
|
||||||
entryObj: {
|
|
||||||
type: Object,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
entityClicked: function (ev) {
|
|
||||||
ev.preventDefault();
|
|
||||||
this.hass.moreInfoActions.selectEntity(this.entryObj.entityId);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
@ -31,5 +31,11 @@ hass.reactor.batch(function () {
|
|||||||
|
|
||||||
setTimeout(hass.startLocalStoragePreferencesSync, 5000);
|
setTimeout(hass.startLocalStoragePreferencesSync, 5000);
|
||||||
|
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
window.addEventListener('load', function() {
|
||||||
|
navigator.serviceWorker.register('/service-worker.js');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// While we figure out how ha-entity-marker can keep it's references
|
// While we figure out how ha-entity-marker can keep it's references
|
||||||
window.hass = hass;
|
window.hass = hass;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
<link rel="import" href="./entity/state-badge.html">
|
<link rel="import" href="./state-badge.html">
|
||||||
<link rel="import" href="relative-ha-datetime.html">
|
<link rel="import" href="../relative-ha-datetime.html">
|
||||||
|
|
||||||
<dom-module id="state-info">
|
<dom-module id="state-info">
|
||||||
<template>
|
<template>
|
@ -70,6 +70,10 @@
|
|||||||
iron-image {
|
iron-image {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class='badge-container'>
|
<div class='badge-container'>
|
||||||
|
@ -8,18 +8,22 @@
|
|||||||
<dom-module id="stream-status">
|
<dom-module id="stream-status">
|
||||||
<template>
|
<template>
|
||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
paper-toggle-button {
|
paper-toggle-button {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
iron-icon {
|
iron-icon {
|
||||||
opacity: var(--dark-primary-opacity);
|
opacity: var(--dark-primary-opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<iron-icon icon="mdi:alert" hidden$="[[!hasError]]"></iron-icon>
|
<iron-icon icon="mdi:alert" hidden$="[[!hasError]]"></iron-icon>
|
||||||
|
@ -82,14 +82,6 @@ Polymer({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
created: function () {
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
navigator.serviceWorker.register('/service_worker.js');
|
|
||||||
},
|
|
||||||
|
|
||||||
ready: function () {
|
ready: function () {
|
||||||
this.loadIcons();
|
this.loadIcons();
|
||||||
},
|
},
|
||||||
|
@ -34,29 +34,17 @@ Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
panelChanged: function (panel) {
|
panelChanged: function (panel) {
|
||||||
if (!panel) {
|
if (!panel) return;
|
||||||
// while (rootEl.lastChild) {
|
|
||||||
// rootEl.removeChild(rootEl.lastChild);
|
|
||||||
// }
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const rootEl = Polymer.dom(this);
|
|
||||||
const tag = 'ha-panel-' + panel.get('component_name');
|
|
||||||
|
|
||||||
this.importHref(panel.get('url'));
|
this.importHref(panel.get('url'));
|
||||||
|
|
||||||
while (rootEl.lastChild) {
|
window.hassUtil.dynamicContentUpdater(
|
||||||
rootEl.removeChild(rootEl.lastChild);
|
this, 'ha-panel-' + panel.get('component_name'), {
|
||||||
}
|
hass: this.hass,
|
||||||
|
narrow: this.narrow,
|
||||||
const customEl = document.createElement(tag);
|
showMenu: this.showMenu,
|
||||||
|
panel: panel,
|
||||||
customEl.hass = this.hass;
|
})
|
||||||
customEl.narrow = this.narrow;
|
|
||||||
customEl.showMenu = this.showMenu;
|
|
||||||
customEl.panel = panel.toJS();
|
|
||||||
rootEl.appendChild(customEl);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
updateAttributes: function () {
|
updateAttributes: function () {
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export default window.Polymer;
|
|
@ -1,7 +1,7 @@
|
|||||||
<link rel='import' href='../../bower_components/polymer/polymer.html'>
|
<link rel='import' href='../../bower_components/polymer/polymer.html'>
|
||||||
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id='state-card-configurator'>
|
<dom-module id='state-card-configurator'>
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id="state-card-display">
|
<dom-module id="state-card-display">
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id="state-card-hvac">
|
<dom-module id="state-card-hvac">
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../../bower_components/paper-slider/paper-slider.html">
|
<link rel="import" href="../../bower_components/paper-slider/paper-slider.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id="state-card-input_slider">
|
<dom-module id="state-card-input_slider">
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id="state-card-media_player">
|
<dom-module id="state-card-media_player">
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
|
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id="state-card-rollershutter">
|
<dom-module id="state-card-rollershutter">
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id="state-card-scene">
|
<dom-module id="state-card-scene">
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
<link rel="import" href="../components/entity/ha-entity-toggle.html">
|
<link rel="import" href="../components/entity/ha-entity-toggle.html">
|
||||||
|
|
||||||
<dom-module id="state-card-script">
|
<dom-module id="state-card-script">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
|
|
||||||
<dom-module id="state-card-thermostat">
|
<dom-module id="state-card-thermostat">
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
<link rel="import" href="../components/entity/state-info.html">
|
||||||
<link rel="import" href="../components/entity/ha-entity-toggle.html">
|
<link rel="import" href="../components/entity/ha-entity-toggle.html">
|
||||||
|
|
||||||
<dom-module id="state-card-toggle">
|
<dom-module id="state-card-toggle">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user