mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Add remember login option
This commit is contained in:
parent
4e6773969a
commit
1b4ff986b0
@ -1,2 +1,2 @@
|
||||
""" DO NOT MODIFY. Auto-generated by build_frontend script """
|
||||
VERSION = "d55e35f81749356431666fe86ebe005c"
|
||||
VERSION = "1c265f0f07e6038c2cbb9b277e58b994"
|
||||
|
File diff suppressed because one or more lines are too long
@ -22,6 +22,7 @@
|
||||
"core-icons": "polymer/core-icons#~0.5.5",
|
||||
"core-image": "polymer/core-image#~0.5.5",
|
||||
"core-style": "polymer/core-style#~0.5.5",
|
||||
"core-label": "polymer/core-label#~0.5.5",
|
||||
"paper-toast": "Polymer/paper-toast#~0.5.5",
|
||||
"paper-dialog": "Polymer/paper-dialog#~0.5.5",
|
||||
"paper-spinner": "Polymer/paper-spinner#~0.5.5",
|
||||
@ -33,6 +34,7 @@
|
||||
"paper-dropdown": "polymer/paper-dropdown#~0.5.5",
|
||||
"paper-item": "polymer/paper-item#~0.5.5",
|
||||
"paper-slider": "polymer/paper-slider#~0.5.5",
|
||||
"paper-checkbox": "polymer/paper-checkbox#~0.5.5",
|
||||
"color-picker-element": "~0.0.2",
|
||||
"google-apis": "GoogleWebComponents/google-apis#~0.4.2",
|
||||
"core-drawer-panel": "polymer/core-drawer-panel#~0.5.5",
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 2f96b21d42c6b1c01a235b39fbbd2e0cf1b8d651
|
||||
Subproject commit 8ea3a9e858a8c39d4c3aa46b719362b33f4a358f
|
@ -30,8 +30,9 @@
|
||||
|
||||
</template>
|
||||
<script>
|
||||
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
||||
var uiActions = window.hass.uiActions;
|
||||
var storeListenerMixIn = window.hass.storeListenerMixIn,
|
||||
uiActions = window.hass.uiActions,
|
||||
preferenceStore = window.hass.preferenceStore;
|
||||
|
||||
Polymer(Polymer.mixin({
|
||||
loaded: false,
|
||||
@ -42,7 +43,9 @@
|
||||
|
||||
// if auth was given, tell the backend
|
||||
if(this.auth) {
|
||||
uiActions.validateAuth(this.auth);
|
||||
uiActions.validateAuth(this.auth, false);
|
||||
} else if (preferenceStore.hasAuthToken()) {
|
||||
uiActions.validateAuth(preferenceStore.getAuthToken(), false);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
||||
|
||||
<link rel="import" href="../bower_components/core-label/core-label.html">
|
||||
<link rel="import" href="../bower_components/paper-checkbox/paper-checkbox.html">
|
||||
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
||||
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
||||
<link rel="import" href="../bower_components/core-input/core-input.html">
|
||||
@ -8,15 +10,29 @@
|
||||
<polymer-element name="login-form">
|
||||
<template>
|
||||
<style>
|
||||
paper-input {
|
||||
#passwordDecorator {
|
||||
display: block;
|
||||
height: 57px;
|
||||
}
|
||||
|
||||
.login paper-button {
|
||||
margin-left: 242px;
|
||||
paper-checkbox {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.login .interact {
|
||||
paper-checkbox::shadow #checkbox.checked {
|
||||
background-color: #03a9f4;
|
||||
border-color: #03a9f4;
|
||||
}
|
||||
|
||||
paper-checkbox::shadow #ink[checked] {
|
||||
color: #03a9f4;
|
||||
}
|
||||
|
||||
paper-button {
|
||||
margin-left: 72px;
|
||||
}
|
||||
|
||||
.interact {
|
||||
height: 125px;
|
||||
}
|
||||
|
||||
@ -44,7 +60,14 @@
|
||||
<input is="core-input" type="password" id="passwordInput"
|
||||
value="{{authToken}}" on-keyup="{{passwordKeyup}}">
|
||||
</paper-input-decorator>
|
||||
<paper-button on-click={{validatePassword}}>Log In</paper-button>
|
||||
|
||||
<div horizontal center layout>
|
||||
<core-label horizontal layout>
|
||||
<paper-checkbox for checked={{rememberLogin}}></paper-checkbox><b>Remember</b>
|
||||
</core-label>
|
||||
|
||||
<paper-button on-click={{validatePassword}}>Log In</paper-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="validatebox" hidden?="{{!(isValidating || isLoggedIn)}}">
|
||||
@ -66,6 +89,7 @@
|
||||
MSG_LOADING_DATA: "Loading data…",
|
||||
|
||||
authToken: "",
|
||||
rememberLogin: false,
|
||||
|
||||
isValidating: false,
|
||||
isLoggedIn: false,
|
||||
@ -114,7 +138,7 @@
|
||||
validatePassword: function() {
|
||||
this.$.hideKeyboardOnFocus.focus();
|
||||
|
||||
uiActions.validateAuth(this.authToken);
|
||||
uiActions.validateAuth(this.authToken, this.rememberLogin);
|
||||
},
|
||||
}, storeListenerMixIn));
|
||||
</script>
|
||||
|
@ -61,8 +61,11 @@
|
||||
});
|
||||
},
|
||||
|
||||
validateAuth: function(authToken) {
|
||||
authActions.validate(authToken, preferenceStore.useStreaming());
|
||||
validateAuth: function(authToken, rememberLogin) {
|
||||
authActions.validate(authToken, {
|
||||
useStreaming: preferenceStore.useStreaming(),
|
||||
rememberLogin: rememberLogin,
|
||||
});
|
||||
},
|
||||
};
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user