mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Add last_updated tooltip to more info dialog (#6926)
This commit is contained in:
parent
2f21f6ef8a
commit
a214ab463e
@ -1,4 +1,5 @@
|
|||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
|
import "@polymer/paper-tooltip/paper-tooltip";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
import { computeStateName } from "../../common/entity/compute_state_name";
|
import { computeStateName } from "../../common/entity/compute_state_name";
|
||||||
@ -71,13 +72,20 @@ class StateInfo extends PolymerElement {
|
|||||||
<div class="name" in-dialog$="[[inDialog]]">
|
<div class="name" in-dialog$="[[inDialog]]">
|
||||||
[[computeStateName(stateObj)]]
|
[[computeStateName(stateObj)]]
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template is="dom-if" if="[[inDialog]]">
|
<template is="dom-if" if="[[inDialog]]">
|
||||||
<div class="time-ago">
|
<div class="time-ago">
|
||||||
<ha-relative-time
|
<ha-relative-time
|
||||||
|
id="last_changed"
|
||||||
hass="[[hass]]"
|
hass="[[hass]]"
|
||||||
datetime="[[stateObj.last_changed]]"
|
datetime="[[stateObj.last_changed]]"
|
||||||
></ha-relative-time>
|
></ha-relative-time>
|
||||||
|
<paper-tooltip animation-delay="0" for="last_changed">
|
||||||
|
[[localize('ui.dialogs.more_info_control.last_updated')]]:
|
||||||
|
<ha-relative-time
|
||||||
|
hass="[[hass]]"
|
||||||
|
datetime="[[stateObj.last_updated]]"
|
||||||
|
></ha-relative-time>
|
||||||
|
</paper-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template is="dom-if" if="[[!inDialog]]">
|
<template is="dom-if" if="[[!inDialog]]">
|
||||||
|
@ -430,6 +430,7 @@
|
|||||||
"edit": "Edit entity",
|
"edit": "Edit entity",
|
||||||
"details": "Details",
|
"details": "Details",
|
||||||
"history": "History",
|
"history": "History",
|
||||||
|
"last_updated": "Last updated",
|
||||||
"script": {
|
"script": {
|
||||||
"last_action": "Last Action",
|
"last_action": "Last Action",
|
||||||
"last_triggered": "Last Triggered"
|
"last_triggered": "Last Triggered"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user