mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 13:56:35 +00:00
Add more-info dialog support to dev-states (#1071)
* Add state history card to dev-states * add hass-mixins.html import * Put icon for more-info next to entity_id
This commit is contained in:
parent
dc6ca7c774
commit
fdfa09ed2e
@ -13,6 +13,8 @@
|
|||||||
<link rel="import" href="../../src/components/entity/ha-entity-picker.html">
|
<link rel="import" href="../../src/components/entity/ha-entity-picker.html">
|
||||||
<link rel="import" href="../../src/resources/ha-style.html">
|
<link rel="import" href="../../src/resources/ha-style.html">
|
||||||
|
|
||||||
|
<link rel='import' href='../../src/util/hass-mixins.html'>
|
||||||
|
|
||||||
<dom-module id="ha-panel-dev-state">
|
<dom-module id="ha-panel-dev-state">
|
||||||
<template>
|
<template>
|
||||||
<style include="ha-style">
|
<style include="ha-style">
|
||||||
@ -46,7 +48,13 @@
|
|||||||
.entities tr:nth-child(even) {
|
.entities tr:nth-child(even) {
|
||||||
background-color: var(--table-row-alternative-background-color, #eee)
|
background-color: var(--table-row-alternative-background-color, #eee)
|
||||||
}
|
}
|
||||||
|
.entities td {
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
.entities paper-icon-button {
|
||||||
|
height: 24px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
.entities td:nth-child(3) {
|
.entities td:nth-child(3) {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
@ -108,7 +116,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<template is='dom-repeat' items='[[_entities]]' as='entity'>
|
<template is='dom-repeat' items='[[_entities]]' as='entity'>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href='#' on-click='entitySelected'>[[entity.entity_id]]</a></td>
|
<td>
|
||||||
|
<paper-icon-button
|
||||||
|
on-click='entityMoreInfo'
|
||||||
|
icon='mdi:open-in-new'
|
||||||
|
alt="More Info" title="More Info"
|
||||||
|
>
|
||||||
|
</paper-icon-button>
|
||||||
|
<a href='#' on-click='entitySelected'>[[entity.entity_id]]</a>
|
||||||
|
</td>
|
||||||
<td>[[entity.state]]</td>
|
<td>[[entity.state]]</td>
|
||||||
<template is='dom-if' if='[[computeShowAttributes(narrow, _showAttributes)]]'>
|
<template is='dom-if' if='[[computeShowAttributes(narrow, _showAttributes)]]'>
|
||||||
<td>[[attributeString(entity)]]</td>
|
<td>[[attributeString(entity)]]</td>
|
||||||
@ -122,7 +138,7 @@
|
|||||||
</dom-module>
|
</dom-module>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
class HaPanelDevState extends Polymer.Element {
|
class HaPanelDevState extends window.hassMixins.EventsMixin(Polymer.Element) {
|
||||||
static get is() { return 'ha-panel-dev-state'; }
|
static get is() { return 'ha-panel-dev-state'; }
|
||||||
|
|
||||||
static get properties() {
|
static get properties() {
|
||||||
@ -191,6 +207,11 @@ class HaPanelDevState extends Polymer.Element {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entityMoreInfo(ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
this.fire('hass-more-info', { entityId: ev.model.entity.entity_id });
|
||||||
|
}
|
||||||
|
|
||||||
handleSetState() {
|
handleSetState() {
|
||||||
var attr;
|
var attr;
|
||||||
var attrRaw = this._stateAttributes.replace(/^\s+|\s+$/g, '');
|
var attrRaw = this._stateAttributes.replace(/^\s+|\s+$/g, '');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user