mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Polymer 1.0: Clean up
This commit is contained in:
parent
63114b988f
commit
d503ee94f5
@ -1,50 +0,0 @@
|
|||||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
|
||||||
<link rel="import" href="../bower_components/core-style/core-style.html">
|
|
||||||
|
|
||||||
<link rel="import" href="./loading-box.html">
|
|
||||||
<link rel="import" href="relative-ha-datetime.html">
|
|
||||||
|
|
||||||
<polymer-element name="recent-states" attributes="stateObj">
|
|
||||||
<template>
|
|
||||||
<core-style ref='ha-data-table'></core-style>
|
|
||||||
|
|
||||||
<template if="{{recentStates === null}}">
|
|
||||||
<loading-box text="Loading recent states"></loading-box>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template if="{{recentStates !== null}}">
|
|
||||||
<div layout vertical>
|
|
||||||
<template repeat="{{recentStates as state}}">
|
|
||||||
<div layout justified horizontal class='data-entry'>
|
|
||||||
<div>
|
|
||||||
{{state.state}}
|
|
||||||
</div>
|
|
||||||
<div class='data'>
|
|
||||||
<relative-ha-datetime datetime="{{stateObj.last_changed}}">
|
|
||||||
</relative-ha-datetime>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template if="{{recentStates.length == 0}}">
|
|
||||||
There are no recent states.
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
Polymer({
|
|
||||||
recentStates: null,
|
|
||||||
|
|
||||||
stateObjChanged: function() {
|
|
||||||
this.recentStates = null;
|
|
||||||
|
|
||||||
window.hass.callApi(
|
|
||||||
'GET', 'history/entity/' + this.stateObj.entityId + '/recent_states').then(
|
|
||||||
function(states) {
|
|
||||||
this.recentStates = states.slice(1);
|
|
||||||
}.bind(this));
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</polymer-element>
|
|
@ -1,18 +0,0 @@
|
|||||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
|
||||||
<link rel="import" href="../bower_components/core-style/core-style.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
|
|
||||||
|
|
||||||
<polymer-element name="ha-dialog" extends="paper-dialog">
|
|
||||||
<template>
|
|
||||||
<core-style ref='ha-dialog'></core-style>
|
|
||||||
<shadow></shadow>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
Polymer({
|
|
||||||
layered: true,
|
|
||||||
backdrop: true,
|
|
||||||
transition: 'core-transition-bottom',
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</polymer-element>
|
|
@ -120,14 +120,12 @@
|
|||||||
</paper-menu>
|
</paper-menu>
|
||||||
</paper-header-panel>
|
</paper-header-panel>
|
||||||
|
|
||||||
<!--
|
<template is='dom-if' if='[[!hideStates]]'>
|
||||||
This is the main partial, never remove it from the DOM but hide it
|
<partial-states
|
||||||
to speed up when people click on states.
|
|
||||||
-->
|
|
||||||
<partial-states hidden$='[[hideStates]]'
|
|
||||||
main narrow='[[narrow]]'
|
main narrow='[[narrow]]'
|
||||||
filter='[[stateFilter]]'>
|
filter='[[stateFilter]]'>
|
||||||
</partial-states>
|
</partial-states>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template is='dom-if' if='[[isSelectedLogbook]]'>
|
<template is='dom-if' if='[[isSelectedLogbook]]'>
|
||||||
<partial-logbook main narrow='[[narrow]]'></partial-logbook>
|
<partial-logbook main narrow='[[narrow]]'></partial-logbook>
|
||||||
|
@ -44,77 +44,3 @@
|
|||||||
animation: ha-spin 2s infinite linear;
|
animation: ha-spin 2s infinite linear;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<core-style id="ha-dialog">
|
|
||||||
:host {
|
|
||||||
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
|
|
||||||
|
|
||||||
min-width: 350px;
|
|
||||||
max-width: 700px;
|
|
||||||
|
|
||||||
/* First two are from core-transition-bottom */
|
|
||||||
transition:
|
|
||||||
transform 0.2s ease-in-out,
|
|
||||||
opacity 0.2s ease-in,
|
|
||||||
top .3s,
|
|
||||||
left .3s !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host .sidebar {
|
|
||||||
margin-left: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media all and (max-width: 620px) {
|
|
||||||
:host.two-column {
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
max-height: calc(100% - 64px);
|
|
||||||
bottom: 0px;
|
|
||||||
left: 0px;
|
|
||||||
right: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host .sidebar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media all and (max-width: 464px) {
|
|
||||||
:host {
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
max-height: calc(100% - 64px);
|
|
||||||
bottom: 0px;
|
|
||||||
left: 0px;
|
|
||||||
right: 0px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
html /deep/ .ha-form paper-input {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
html /deep/ .ha-form paper-input:first-child {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
</core-style>
|
|
||||||
|
|
||||||
<core-style id='ha-key-value-table'>
|
|
||||||
.data-entry {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.data-entry:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.data-entry .key {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.data-entry .value {
|
|
||||||
text-align: right;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
</core-style>
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user