Tweak cloud config (#618)

This commit is contained in:
Paulus Schoutsen 2017-11-12 11:44:59 -08:00 committed by GitHub
parent 1314caba97
commit 926c46b701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 19 deletions

View File

@ -16,7 +16,7 @@
paper-card { paper-card {
display: block; display: block;
} }
.account { .account-row {
display: flex; display: flex;
padding: 0 16px; padding: 0 16px;
} }
@ -28,6 +28,19 @@
margin-top: 24px; margin-top: 24px;
text-align: center; text-align: center;
} }
.nowrap {
white-space: nowrap;;
}
.wrap {
white-space: normal;
}
.status {
padding: 16px;
}
paper-button {
color: var(--primary-color);
font-weight: 500;
}
</style> </style>
<hass-subpage title='Cloud Account'> <hass-subpage title='Cloud Account'>
<div class='content'> <div class='content'>
@ -36,23 +49,29 @@
> >
<span slot='header'>Home Assistant Cloud</span> <span slot='header'>Home Assistant Cloud</span>
<span slot='introduction'> <span slot='introduction'>
The Home Assistant Cloud allows you to opt-in to functions that will bring your Home Assistant experience to the next level. Thank you for supporting Home Assistant. It's because of people like you that we are able to run this project and make a great home automation experience for everyone. Thank you!
<p><i>
Home Assistant will never share information with our cloud without your prior permission.
</i></p>
</span> </span>
<paper-card> <paper-card>
<div class='account'> <div class='account-row'>
<paper-item-body> <paper-item-body two-line>
[[account.email]] [[account.email]]
<div secondary class='wrap'>
<span class='nowrap'>Subscription expires on </span>
<span class='nowrap'>[[_formatExpiration(account.sub_exp)]]</span>
</div>
</paper-item-body> </paper-item-body>
<paper-button <paper-button
class='warning'
on-tap='handleLogout' on-tap='handleLogout'
>Sign out</paper-button> >Sign out</paper-button>
</div> </div>
<div class='account-row'>
<paper-item-body>
Cloud connection status
</paper-item-body>
<div class='status'>[[account.cloud]]</div>
</div>
</paper-card> </paper-card>
<div class='soon'>More configuration options coming soon.</div> <div class='soon'>More configuration options coming soon.</div>
@ -76,6 +95,10 @@ class HaConfigCloudAccount extends window.hassMixins.EventsMixin(Polymer.Element
handleLogout() { handleLogout() {
this.hass.callApi('post', 'cloud/logout').then(() => this.fire('ha-account-refreshed', { account: null })); this.hass.callApi('post', 'cloud/logout').then(() => this.fire('ha-account-refreshed', { account: null }));
} }
_formatExpiration(date) {
return window.hassUtil.formatDateTime(new Date(date));
}
} }
customElements.define(HaConfigCloudAccount.is, HaConfigCloudAccount); customElements.define(HaConfigCloudAccount.is, HaConfigCloudAccount);

View File

@ -46,11 +46,7 @@
> >
<span slot='header'>Home Assistant Cloud</span> <span slot='header'>Home Assistant Cloud</span>
<span slot='introduction'> <span slot='introduction'>
The Home Assistant Cloud allows you to opt-in to functions that will bring your Home Assistant experience to the next level. The Home Assistant Cloud allows your local Home Assistant instance to connect with cloud-only services like Amazon Alexa.
<p><i>
Home Assistant will never share information with our cloud without your prior permission.
</i></p>
</span> </span>
<paper-card> <paper-card>

View File

@ -11,6 +11,9 @@
<dom-module id="ha-config-cloud-register"> <dom-module id="ha-config-cloud-register">
<template> <template>
<style include="iron-flex ha-style"> <style include="iron-flex ha-style">
a {
color: var(--primary-color);
}
paper-card { paper-card {
display: block; display: block;
} }
@ -43,7 +46,7 @@
> >
<span slot='header'>Register with the Home Assistant Cloud</span> <span slot='header'>Register with the Home Assistant Cloud</span>
<span slot='introduction'> <span slot='introduction'>
Register today to easily connect your Home Assistant to cloud-only services. Register today to easily connect with the Home Assistant Cloud. This will allow you to unlock great new services and functionality, like Amazon Alexa integration.
<p> <p>
By registering an account you agree to the following terms and conditions. By registering an account you agree to the following terms and conditions.
@ -52,10 +55,6 @@
<li><a href='https://home-assistant.io/privacy/' target='_blank'>Privacy Policy</a></li> <li><a href='https://home-assistant.io/privacy/' target='_blank'>Privacy Policy</a></li>
</ul> </ul>
</p> </p>
<p><i>
Home Assistant will never share information with our cloud without your prior permission.
</i></p>
</span> </span>
<template is='dom-if' if='[[!_hasConfirmationCode]]'> <template is='dom-if' if='[[!_hasConfirmationCode]]'>