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";
|
||||
|
||||
export interface SystemHealthInfo {
|
||||
homeassistant: {
|
||||
export interface HomeAssistantSystemHealthInfo {
|
||||
version: string;
|
||||
dev: boolean;
|
||||
hassio: boolean;
|
||||
@ -11,7 +10,9 @@ export interface SystemHealthInfo {
|
||||
arch: string;
|
||||
timezone: string;
|
||||
os_name: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SystemHealthInfo {
|
||||
[domain: string]: { [key: string]: string | number | boolean };
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,7 @@ class DialogAreaDetail extends LitElement {
|
||||
}
|
||||
|
||||
private async _updateEntry() {
|
||||
this._submitting = true;
|
||||
try {
|
||||
const values: AreaRegistryEntryMutableParams = {
|
||||
name: this._name.trim(),
|
||||
@ -109,13 +110,20 @@ class DialogAreaDetail extends LitElement {
|
||||
this._params = undefined;
|
||||
} catch (err) {
|
||||
this._error = err;
|
||||
} finally {
|
||||
this._submitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async _deleteEntry() {
|
||||
this._submitting = true;
|
||||
try {
|
||||
if (await this._params!.removeEntry()) {
|
||||
this._params = undefined;
|
||||
}
|
||||
} finally {
|
||||
this._submitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
private _openedChanged(ev: PolymerChangedEvent<boolean>): void {
|
||||
|
@ -162,7 +162,6 @@ All devices in this area will become unassigned.`)
|
||||
display: block;
|
||||
max-width: 600px;
|
||||
margin: 16px auto;
|
||||
background-color: white;
|
||||
}
|
||||
.empty {
|
||||
text-align: center;
|
||||
|
@ -145,7 +145,7 @@ class HaConfigEntries extends NavigateMixin(PolymerElement) {
|
||||
});
|
||||
|
||||
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> {
|
||||
try {
|
||||
this._submitting = true;
|
||||
try {
|
||||
await this._params!.updateEntry({
|
||||
name: this._name.trim() || null,
|
||||
new_entity_id: this._entityId.trim(),
|
||||
});
|
||||
this._params = undefined;
|
||||
} catch (err) {
|
||||
this._submitting = false;
|
||||
this._error = err;
|
||||
} finally {
|
||||
this._submitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async _deleteEntry(): Promise<void> {
|
||||
this._submitting = true;
|
||||
|
||||
try {
|
||||
if (await this._params!.removeEntry()) {
|
||||
this._params = undefined;
|
||||
} else {
|
||||
}
|
||||
} finally {
|
||||
this._submitting = false;
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,6 @@ Deleting an entry will not remove the entity from Home Assistant. To do this, yo
|
||||
}
|
||||
paper-card {
|
||||
display: block;
|
||||
background-color: white;
|
||||
}
|
||||
paper-icon-item {
|
||||
cursor: pointer;
|
||||
|
@ -95,7 +95,16 @@ class SystemHealthCard extends LitElement {
|
||||
}
|
||||
|
||||
private async _fetchInfo() {
|
||||
try {
|
||||
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 {
|
||||
|
@ -35,6 +35,7 @@
|
||||
"sensor": "Sensor",
|
||||
"sun": "Sun",
|
||||
"switch": "Switch",
|
||||
"system_health": "System Health",
|
||||
"updater": "Updater",
|
||||
"vacuum": "Vacuum",
|
||||
"weblink": "Weblink",
|
||||
|
Loading…
x
Reference in New Issue
Block a user