mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Only show update/reboot for host card if available
https://www.pivotaltracker.com/story/show/145135469
This commit is contained in:
parent
1946f6c1f0
commit
031e2af311
@ -43,15 +43,19 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<ha-call-api-button
|
<template is='dom-if' if='[[computeUpdateAvailable(data)]]'>
|
||||||
hass='[[hass]]'
|
<ha-call-api-button
|
||||||
path="hassio/host/update"
|
hass='[[hass]]'
|
||||||
>Update</ha-call-api-button>
|
path="hassio/host/update"
|
||||||
<ha-call-api-button
|
>Update</ha-call-api-button>
|
||||||
class='warning'
|
</template>
|
||||||
hass='[[hass]]'
|
<template is='dom-if' if='[[computeRebootAvailable(data)]]'>
|
||||||
path="hassio/host/reboot"
|
<ha-call-api-button
|
||||||
>Reboot</ha-call-api-button>
|
class='warning'
|
||||||
|
hass='[[hass]]'
|
||||||
|
path="hassio/host/reboot"
|
||||||
|
>Reboot</ha-call-api-button>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</paper-card>
|
</paper-card>
|
||||||
</template>
|
</template>
|
||||||
@ -71,5 +75,13 @@ Polymer({
|
|||||||
value: {},
|
value: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computeUpdateAvailable: function (data) {
|
||||||
|
return data.version !== data.last_version;
|
||||||
|
},
|
||||||
|
|
||||||
|
computeRebootAvailable: function (data) {
|
||||||
|
return data.features && data.features.indexOf("reboot") !== -1;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user