mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 06:16:33 +00:00
Add refresh button to state dev tools (#9231)
This commit is contained in:
parent
583cc4bc8a
commit
0af14eb77e
@ -2,6 +2,7 @@ import "@material/mwc-button";
|
|||||||
import {
|
import {
|
||||||
mdiClipboardTextMultipleOutline,
|
mdiClipboardTextMultipleOutline,
|
||||||
mdiInformationOutline,
|
mdiInformationOutline,
|
||||||
|
mdiRefresh,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import "@polymer/paper-checkbox/paper-checkbox";
|
import "@polymer/paper-checkbox/paper-checkbox";
|
||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
@ -46,8 +47,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
mwc-button {
|
.button-row {
|
||||||
|
display: flex;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-wrapper {
|
.table-wrapper {
|
||||||
@ -139,9 +142,19 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
error="[[!validJSON]]"
|
error="[[!validJSON]]"
|
||||||
on-value-changed="_yamlChanged"
|
on-value-changed="_yamlChanged"
|
||||||
></ha-code-editor>
|
></ha-code-editor>
|
||||||
<mwc-button on-click="handleSetState" disabled="[[!validJSON]]" raised
|
<div class="button-row">
|
||||||
|
<mwc-button
|
||||||
|
on-click="handleSetState"
|
||||||
|
disabled="[[!validJSON]]"
|
||||||
|
raised
|
||||||
>[[localize('ui.panel.developer-tools.tabs.states.set_state')]]</mwc-button
|
>[[localize('ui.panel.developer-tools.tabs.states.set_state')]]</mwc-button
|
||||||
>
|
>
|
||||||
|
<mwc-icon-button
|
||||||
|
on-click="entityIdChanged"
|
||||||
|
label="[[localize('ui.common.refresh')]]"
|
||||||
|
><ha-svg-icon path="[[refreshIcon()]]"></ha-svg-icon
|
||||||
|
></mwc-icon-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<template is="dom-if" if="[[_entity]]">
|
<template is="dom-if" if="[[_entity]]">
|
||||||
@ -367,6 +380,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
return mdiClipboardTextMultipleOutline;
|
return mdiClipboardTextMultipleOutline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshIcon() {
|
||||||
|
return mdiRefresh;
|
||||||
|
}
|
||||||
|
|
||||||
computeEntities(hass, _entityFilter, _stateFilter, _attributeFilter) {
|
computeEntities(hass, _entityFilter, _stateFilter, _attributeFilter) {
|
||||||
return Object.keys(hass.states)
|
return Object.keys(hass.states)
|
||||||
.map(function (key) {
|
.map(function (key) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user