-
[[addonInfo.description]]
+
[[addonInfo.description]]
Installed |
diff --git a/panels/hassio/dashboard/hassio-addons.html b/panels/hassio/dashboard/hassio-addons.html
index 04c78f8adc..492ec1a936 100644
--- a/panels/hassio/dashboard/hassio-addons.html
+++ b/panels/hassio/dashboard/hassio-addons.html
@@ -17,17 +17,15 @@
}
-
-
-
-
- [[addon.name]]
- [[addon.description]]
-
- [[computeInstallStatus(addon)]]
-
-
-
+
+
+
+ [[addon.name]]
+ [[addon.description]]
+
+ [[addon.installed]]
+
+
@@ -56,10 +54,6 @@ Polymer({
},
},
- computeInstallStatus(addon) {
- return addon.installed || 'Not installed';
- },
-
addonTapped: function (ev) {
this.fire('hassio-select-addon', { addon: this.data[ev.model.index].slug });
ev.target.blur();
diff --git a/panels/hassio/dashboard/hassio-dashboard.html b/panels/hassio/dashboard/hassio-dashboard.html
index e0959dac00..3844c646d8 100644
--- a/panels/hassio/dashboard/hassio-dashboard.html
+++ b/panels/hassio/dashboard/hassio-dashboard.html
@@ -3,6 +3,7 @@
+
@@ -36,6 +37,10 @@
Hass.io
+
@@ -100,5 +105,9 @@ Polymer({
value: {},
},
},
+
+ storeTapped: function () {
+ this.fire('hassio-show-store');
+ },
});
diff --git a/panels/hassio/ha-panel-hassio.html b/panels/hassio/ha-panel-hassio.html
index ad124cec5e..bcb0efff10 100644
--- a/panels/hassio/ha-panel-hassio.html
+++ b/panels/hassio/ha-panel-hassio.html
@@ -2,6 +2,7 @@
+
@@ -20,34 +21,42 @@
host='{{hostInfo}}'
>
-
-
-
-
-
-
+
+
+ show-menu='[[showMenu]]'
+ >
-
-
+
+
+
+
+
+
+
+
+
@@ -97,16 +106,29 @@ Polymer({
loaded: {
type: Boolean,
computed: 'computeIsLoaded(supervisorInfo, hostInfo, hassInfo, forceLoading)',
- }
+ },
+
+ currentPage: {
+ type: String,
+ value: 'dashboard',
+ },
+
+ lastPage: {
+ type: String,
+ value: 'dashboard',
+ },
},
listeners: {
'hassio-select-addon': 'addonSelected',
+ 'hassio-show-store': 'showStore',
'hass-api-called': 'apiCalled',
},
- apiCalled: function () {
- this.$.data.refresh();
+ apiCalled: function (ev) {
+ if (ev.detail.success) {
+ this.$.data.refresh();
+ }
},
computeIsLoaded: function (supervisorInfo, hostInfo, hassInfo, forceLoading) {
@@ -117,11 +139,40 @@ Polymer({
},
addonSelected: function (ev) {
- this.forceLoading = true;
- setTimeout(function () {
- this.addon = ev.detail.addon;
- this.forceLoading = false;
- }.bind(this), 0);
+ var addon = ev.detail.addon;
+
+ if (this.currentPage === this.lastPage) {
+ this.lastPage = 'dashboard';
+ }
+
+ if (addon) {
+ this.lastPage = this.currentPage;
+ this.currentPage = 'addon-view';
+ this.addon = addon;
+ } else {
+ this.currentPage = this.lastPage;
+ // Give time to cleanup the addon-view panel or it crashes
+ setTimeout(function () {
+ this.addon = addon;
+ }.bind(this), 0);
+ }
},
+
+ showStore: function () {
+ this.currentPage = 'addon-store';
+ },
+
+ dashboardSelected: function (currentPage) {
+ return currentPage === 'dashboard';
+ },
+
+ addonStoreSelected: function (currentPage) {
+ return currentPage === 'addon-store';
+ },
+
+ addonViewSelected: function (currentPage) {
+ return currentPage === 'addon-view';
+ },
+
});