mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Add "last_changed" and "last_updated" to dev tools state view (#7375)
This commit is contained in:
parent
0037cd2e69
commit
1c9d0200ca
@ -42,6 +42,9 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
|
|
||||||
.entities th {
|
.entities th {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
font-size: var(
|
||||||
|
--paper-input-container-shared-input-style_-_font-size
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([rtl]) .entities th {
|
:host([rtl]) .entities th {
|
||||||
@ -62,7 +65,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
}
|
}
|
||||||
.entities td {
|
.entities td {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
min-width: 200px;
|
min-width: 220px;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
.entities ha-svg-icon {
|
.entities ha-svg-icon {
|
||||||
@ -168,7 +171,13 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
></ha-svg-icon>
|
></ha-svg-icon>
|
||||||
<a href="#" on-click="entitySelected">[[entity.entity_id]]</a>
|
<a href="#" on-click="entitySelected">[[entity.entity_id]]</a>
|
||||||
</td>
|
</td>
|
||||||
<td>[[entity.state]]</td>
|
<td>
|
||||||
|
[[entity.state]]<br /><br />
|
||||||
|
<span class="secondary">
|
||||||
|
last_changed: [[lastChangedString(entity)]]<br />
|
||||||
|
last_updated: [[lastUpdatedString(entity)]]
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
<template
|
<template
|
||||||
is="dom-if"
|
is="dom-if"
|
||||||
if="[[computeShowAttributes(narrow, _showAttributes)]]"
|
if="[[computeShowAttributes(narrow, _showAttributes)]]"
|
||||||
@ -381,6 +390,14 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastChangedString(entity) {
|
||||||
|
return new Date(entity.last_changed).toISOString();
|
||||||
|
}
|
||||||
|
|
||||||
|
lastUpdatedString(entity) {
|
||||||
|
return new Date(entity.last_updated).toISOString();
|
||||||
|
}
|
||||||
|
|
||||||
formatAttributeValue(value) {
|
formatAttributeValue(value) {
|
||||||
if (
|
if (
|
||||||
(Array.isArray(value) && value.some((val) => val instanceof Object)) ||
|
(Array.isArray(value) && value.some((val) => val instanceof Object)) ||
|
||||||
|
@ -518,6 +518,7 @@
|
|||||||
"edit": "Edit entity",
|
"edit": "Edit entity",
|
||||||
"details": "Details",
|
"details": "Details",
|
||||||
"history": "History",
|
"history": "History",
|
||||||
|
"last_changed": "Last changed",
|
||||||
"last_updated": "Last updated",
|
"last_updated": "Last updated",
|
||||||
"last_changed": "Last changed",
|
"last_changed": "Last changed",
|
||||||
"script": {
|
"script": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user