mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Fixes (#2643)
* Sort areas alphabetically in device card * Fix background color of registry editors when using themes * Fix area/entity reg dialog being disabled after deletion * Better fix card background * Warn user when system health component not loaded
This commit is contained in:
parent
ecd33fd93c
commit
25a579f7ed
@ -1,7 +1,6 @@
|
|||||||
import { HomeAssistant } from "../types";
|
import { HomeAssistant } from "../types";
|
||||||
|
|
||||||
export interface SystemHealthInfo {
|
export interface HomeAssistantSystemHealthInfo {
|
||||||
homeassistant: {
|
|
||||||
version: string;
|
version: string;
|
||||||
dev: boolean;
|
dev: boolean;
|
||||||
hassio: boolean;
|
hassio: boolean;
|
||||||
@ -11,7 +10,9 @@ export interface SystemHealthInfo {
|
|||||||
arch: string;
|
arch: string;
|
||||||
timezone: string;
|
timezone: string;
|
||||||
os_name: string;
|
os_name: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export interface SystemHealthInfo {
|
||||||
[domain: string]: { [key: string]: string | number | boolean };
|
[domain: string]: { [key: string]: string | number | boolean };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ class DialogAreaDetail extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _updateEntry() {
|
private async _updateEntry() {
|
||||||
|
this._submitting = true;
|
||||||
try {
|
try {
|
||||||
const values: AreaRegistryEntryMutableParams = {
|
const values: AreaRegistryEntryMutableParams = {
|
||||||
name: this._name.trim(),
|
name: this._name.trim(),
|
||||||
@ -109,13 +110,20 @@ class DialogAreaDetail extends LitElement {
|
|||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this._error = err;
|
this._error = err;
|
||||||
|
} finally {
|
||||||
|
this._submitting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _deleteEntry() {
|
private async _deleteEntry() {
|
||||||
|
this._submitting = true;
|
||||||
|
try {
|
||||||
if (await this._params!.removeEntry()) {
|
if (await this._params!.removeEntry()) {
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
this._submitting = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _openedChanged(ev: PolymerChangedEvent<boolean>): void {
|
private _openedChanged(ev: PolymerChangedEvent<boolean>): void {
|
||||||
|
@ -162,7 +162,6 @@ All devices in this area will become unassigned.`)
|
|||||||
display: block;
|
display: block;
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
margin: 16px auto;
|
margin: 16px auto;
|
||||||
background-color: white;
|
|
||||||
}
|
}
|
||||||
.empty {
|
.empty {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -145,7 +145,7 @@ class HaConfigEntries extends NavigateMixin(PolymerElement) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
fetchAreaRegistry(this.hass).then((areas) => {
|
fetchAreaRegistry(this.hass).then((areas) => {
|
||||||
this._areas = areas;
|
this._areas = areas.sort((a, b) => compare(a.name, b.name));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,25 +123,27 @@ class DialogEntityRegistryDetail extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _updateEntry(): Promise<void> {
|
private async _updateEntry(): Promise<void> {
|
||||||
try {
|
|
||||||
this._submitting = true;
|
this._submitting = true;
|
||||||
|
try {
|
||||||
await this._params!.updateEntry({
|
await this._params!.updateEntry({
|
||||||
name: this._name.trim() || null,
|
name: this._name.trim() || null,
|
||||||
new_entity_id: this._entityId.trim(),
|
new_entity_id: this._entityId.trim(),
|
||||||
});
|
});
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this._submitting = false;
|
|
||||||
this._error = err;
|
this._error = err;
|
||||||
|
} finally {
|
||||||
|
this._submitting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _deleteEntry(): Promise<void> {
|
private async _deleteEntry(): Promise<void> {
|
||||||
this._submitting = true;
|
this._submitting = true;
|
||||||
|
try {
|
||||||
if (await this._params!.removeEntry()) {
|
if (await this._params!.removeEntry()) {
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
} else {
|
}
|
||||||
|
} finally {
|
||||||
this._submitting = false;
|
this._submitting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,6 @@ Deleting an entry will not remove the entity from Home Assistant. To do this, yo
|
|||||||
}
|
}
|
||||||
paper-card {
|
paper-card {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: white;
|
|
||||||
}
|
}
|
||||||
paper-icon-item {
|
paper-icon-item {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -95,7 +95,16 @@ class SystemHealthCard extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _fetchInfo() {
|
private async _fetchInfo() {
|
||||||
|
try {
|
||||||
this._info = await fetchSystemHealthInfo(this.hass!);
|
this._info = await fetchSystemHealthInfo(this.hass!);
|
||||||
|
} catch (err) {
|
||||||
|
this._info = {
|
||||||
|
system_health: {
|
||||||
|
error:
|
||||||
|
"System Health component is not loaded. Add 'system_health:' to configuration.yaml",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResult {
|
static get styles(): CSSResult {
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
"sensor": "Sensor",
|
"sensor": "Sensor",
|
||||||
"sun": "Sun",
|
"sun": "Sun",
|
||||||
"switch": "Switch",
|
"switch": "Switch",
|
||||||
|
"system_health": "System Health",
|
||||||
"updater": "Updater",
|
"updater": "Updater",
|
||||||
"vacuum": "Vacuum",
|
"vacuum": "Vacuum",
|
||||||
"weblink": "Weblink",
|
"weblink": "Weblink",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user