mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +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 """
|
""" 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-icons": "polymer/core-icons#~0.5.5",
|
||||||
"core-image": "polymer/core-image#~0.5.5",
|
"core-image": "polymer/core-image#~0.5.5",
|
||||||
"core-style": "polymer/core-style#~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-toast": "Polymer/paper-toast#~0.5.5",
|
||||||
"paper-dialog": "Polymer/paper-dialog#~0.5.5",
|
"paper-dialog": "Polymer/paper-dialog#~0.5.5",
|
||||||
"paper-spinner": "Polymer/paper-spinner#~0.5.5",
|
"paper-spinner": "Polymer/paper-spinner#~0.5.5",
|
||||||
@ -33,6 +34,7 @@
|
|||||||
"paper-dropdown": "polymer/paper-dropdown#~0.5.5",
|
"paper-dropdown": "polymer/paper-dropdown#~0.5.5",
|
||||||
"paper-item": "polymer/paper-item#~0.5.5",
|
"paper-item": "polymer/paper-item#~0.5.5",
|
||||||
"paper-slider": "polymer/paper-slider#~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",
|
"color-picker-element": "~0.0.2",
|
||||||
"google-apis": "GoogleWebComponents/google-apis#~0.4.2",
|
"google-apis": "GoogleWebComponents/google-apis#~0.4.2",
|
||||||
"core-drawer-panel": "polymer/core-drawer-panel#~0.5.5",
|
"core-drawer-panel": "polymer/core-drawer-panel#~0.5.5",
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 2f96b21d42c6b1c01a235b39fbbd2e0cf1b8d651
|
Subproject commit 8ea3a9e858a8c39d4c3aa46b719362b33f4a358f
|
@ -30,8 +30,9 @@
|
|||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
var storeListenerMixIn = window.hass.storeListenerMixIn,
|
||||||
var uiActions = window.hass.uiActions;
|
uiActions = window.hass.uiActions,
|
||||||
|
preferenceStore = window.hass.preferenceStore;
|
||||||
|
|
||||||
Polymer(Polymer.mixin({
|
Polymer(Polymer.mixin({
|
||||||
loaded: false,
|
loaded: false,
|
||||||
@ -42,7 +43,9 @@
|
|||||||
|
|
||||||
// if auth was given, tell the backend
|
// if auth was given, tell the backend
|
||||||
if(this.auth) {
|
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/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-button/paper-button.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
||||||
<link rel="import" href="../bower_components/core-input/core-input.html">
|
<link rel="import" href="../bower_components/core-input/core-input.html">
|
||||||
@ -8,15 +10,29 @@
|
|||||||
<polymer-element name="login-form">
|
<polymer-element name="login-form">
|
||||||
<template>
|
<template>
|
||||||
<style>
|
<style>
|
||||||
paper-input {
|
#passwordDecorator {
|
||||||
display: block;
|
display: block;
|
||||||
|
height: 57px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login paper-button {
|
paper-checkbox {
|
||||||
margin-left: 242px;
|
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;
|
height: 125px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,8 +60,15 @@
|
|||||||
<input is="core-input" type="password" id="passwordInput"
|
<input is="core-input" type="password" id="passwordInput"
|
||||||
value="{{authToken}}" on-keyup="{{passwordKeyup}}">
|
value="{{authToken}}" on-keyup="{{passwordKeyup}}">
|
||||||
</paper-input-decorator>
|
</paper-input-decorator>
|
||||||
|
|
||||||
|
<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>
|
<paper-button on-click={{validatePassword}}>Log In</paper-button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="validatebox" hidden?="{{!(isValidating || isLoggedIn)}}">
|
<div id="validatebox" hidden?="{{!(isValidating || isLoggedIn)}}">
|
||||||
<paper-spinner active="true"></paper-spinner><br />
|
<paper-spinner active="true"></paper-spinner><br />
|
||||||
@ -66,6 +89,7 @@
|
|||||||
MSG_LOADING_DATA: "Loading data…",
|
MSG_LOADING_DATA: "Loading data…",
|
||||||
|
|
||||||
authToken: "",
|
authToken: "",
|
||||||
|
rememberLogin: false,
|
||||||
|
|
||||||
isValidating: false,
|
isValidating: false,
|
||||||
isLoggedIn: false,
|
isLoggedIn: false,
|
||||||
@ -114,7 +138,7 @@
|
|||||||
validatePassword: function() {
|
validatePassword: function() {
|
||||||
this.$.hideKeyboardOnFocus.focus();
|
this.$.hideKeyboardOnFocus.focus();
|
||||||
|
|
||||||
uiActions.validateAuth(this.authToken);
|
uiActions.validateAuth(this.authToken, this.rememberLogin);
|
||||||
},
|
},
|
||||||
}, storeListenerMixIn));
|
}, storeListenerMixIn));
|
||||||
</script>
|
</script>
|
||||||
|
@ -61,8 +61,11 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
validateAuth: function(authToken) {
|
validateAuth: function(authToken, rememberLogin) {
|
||||||
authActions.validate(authToken, preferenceStore.useStreaming());
|
authActions.validate(authToken, {
|
||||||
|
useStreaming: preferenceStore.useStreaming(),
|
||||||
|
rememberLogin: rememberLogin,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user