+
View logs
diff --git a/panels/hassio/ha-panel-hassio.html b/panels/hassio/ha-panel-hassio.html
index ee03a303ee..c402b8e650 100644
--- a/panels/hassio/ha-panel-hassio.html
+++ b/panels/hassio/ha-panel-hassio.html
@@ -3,6 +3,7 @@
+
@@ -52,11 +53,17 @@
+
+
+
+
@@ -121,13 +128,22 @@ Polymer({
listeners: {
'hassio-select-addon': 'addonSelected',
- 'hassio-show-store': 'showStore',
+ 'hassio-show-page': 'showPage',
'hass-api-called': 'apiCalled',
},
apiCalled: function (ev) {
if (ev.detail.success) {
- this.$.data.refresh();
+ var tries = 1;
+
+ var tryUpdate = function () {
+ this.$.data.refresh().catch(function () {
+ tries += 1;
+ setTimeout(tryUpdate, Math.min(tries, 5) * 1000);
+ });
+ }.bind(this);
+
+ tryUpdate();
}
},
@@ -158,8 +174,8 @@ Polymer({
}
},
- showStore: function () {
- this.currentPage = 'addon-store';
+ showPage: function (ev) {
+ this.currentPage = ev.detail.page;
},
dashboardSelected: function (currentPage) {
@@ -174,5 +190,9 @@ Polymer({
return currentPage === 'addon-view';
},
+ supervisorSelected: function (currentPage) {
+ return currentPage === 'supervisor';
+ },
+
});
diff --git a/panels/hassio/hassio-data.html b/panels/hassio/hassio-data.html
index 4e07d35f45..e30b61c2de 100644
--- a/panels/hassio/hassio-data.html
+++ b/panels/hassio/hassio-data.html
@@ -29,27 +29,29 @@ Polymer({
},
refresh: function () {
- this.fetchSupervisorInfo();
- this.fetchHostInfo();
- this.fetchHassInfo();
+ return Promise.all([
+ this.fetchSupervisorInfo(),
+ this.fetchHostInfo(),
+ this.fetchHassInfo(),
+ ]);
},
fetchSupervisorInfo: function () {
- this.hass.callApi('get', 'hassio/supervisor/info')
+ return this.hass.callApi('get', 'hassio/supervisor/info')
.then(function (info) {
this.supervisor = info.data;
}.bind(this));
},
fetchHostInfo: function () {
- this.hass.callApi('get', 'hassio/host/info')
+ return this.hass.callApi('get', 'hassio/host/info')
.then(function (info) {
this.host = info.data;
}.bind(this));
},
fetchHassInfo: function () {
- this.hass.callApi('get', 'hassio/homeassistant/info')
+ return this.hass.callApi('get', 'hassio/homeassistant/info')
.then(function (info) {
this.homeassistant = info.data;
}.bind(this));
diff --git a/panels/hassio/supervisor/hassio-supervisor.html b/panels/hassio/supervisor/hassio-supervisor.html
new file mode 100644
index 0000000000..7ec21626df
--- /dev/null
+++ b/panels/hassio/supervisor/hassio-supervisor.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Supervisor Logs
+
+
+
+
+ [[logs]]
+
+
+
+
+
diff --git a/src/components/buttons/ha-call-api-button.html b/src/components/buttons/ha-call-api-button.html
index 0fc31c07b8..1db75f824e 100644
--- a/src/components/buttons/ha-call-api-button.html
+++ b/src/components/buttons/ha-call-api-button.html
@@ -56,14 +56,16 @@ Polymer({
};
this.hass.callApi(this.method, this.path, this.data)
- .then(function () {
+ .then(function (resp) {
el.progress = false;
el.$.progress.actionSuccess();
eventData.success = true;
- }, function () {
+ eventData.response = resp;
+ }, function (resp) {
el.progress = false;
el.$.progress.actionError();
eventData.success = false;
+ eventData.response = resp;
}).then(function () {
el.fire('hass-api-called', eventData);
});