diff --git a/hassio/dashboard/hassio-addons.html b/hassio/dashboard/hassio-addons.html index fbe8353618..72ec36eec2 100644 --- a/hassio/dashboard/hassio-addons.html +++ b/hassio/dashboard/hassio-addons.html @@ -1,39 +1,40 @@ - - - - + + + + - + - - - - - Looks like you don't have any add-ons installed yet. Head over to the add-on store to get started! - + + Add-ons + + + + You don't have any add-ons installed yet. Head over to the add-on store to get started! + + - - - - [[addon.name]] - [[addon.description]] - - [[addon.installed]] - + + + + + + - + @@ -43,28 +44,27 @@ class HassioAddons extends window.hassMixins.EventsMixin(Polymer.Element) { static get properties() { return { - hass: { - type: Object, - }, - - narrow: { - type: Boolean, - }, - - showMenu: { - type: Boolean, - value: false, - }, - - data: { - type: Object, - value: [], - }, + hass: Object, + addons: Array, }; } + computeIcon(addon) { + return addon.installed !== addon.version ? 'mdi:arrow-up-bold-circle' : 'mdi:puzzle'; + } + + computeIconTitle(addon) { + if (addon.installed !== addon.version) return 'New version available'; + return addon.state === 'started' ? 'Add-on is running' : 'Add-on is stopped'; + } + + computeIconClass(addon) { + if (addon.installed !== addon.version) return 'update'; + return addon.state === 'started' ? 'running' : ''; + } + addonTapped(ev) { - history.pushState(null, null, '/hassio/addon/' + this.data[ev.model.index].slug); + history.pushState(null, null, '/hassio/addon/' + ev.model.addon.slug); this.fire('location-changed'); ev.target.blur(); } diff --git a/hassio/dashboard/hassio-dashboard.html b/hassio/dashboard/hassio-dashboard.html index 1a7e6bcaa9..e54901af67 100644 --- a/hassio/dashboard/hassio-dashboard.html +++ b/hassio/dashboard/hassio-dashboard.html @@ -20,8 +20,6 @@ + + + [[title]] + + + [[description]] + + + + + + + + + + diff --git a/src/resources/hassio-style.html b/src/resources/hassio-style.html new file mode 100644 index 0000000000..70d8258201 --- /dev/null +++ b/src/resources/hassio-style.html @@ -0,0 +1,52 @@ + + + + + \ No newline at end of file