mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-12 18:42:10 +01:00
Fix login for username/password #108
This commit is contained in:
parent
120f6be664
commit
7f4cc19914
6 changed files with 22 additions and 14 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#ifndef configsettings_h
|
||||
#define configsettings_h
|
||||
|
||||
#define FW_VERSION "v2.0.2"
|
||||
#define FW_VERSION "v2.0.3"
|
||||
enum DeviceStatus {
|
||||
DS_OK = 0,
|
||||
DS_ERROR = 1,
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
2.0.2
|
||||
2.0.3
|
||||
|
|
@ -3,11 +3,11 @@
|
|||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="main.css?v=2.0.2" type="text/css" />
|
||||
<link rel="stylesheet" href="widgets.css?v=2.0.2" type="text/css" />
|
||||
<link rel="stylesheet" href="icons.css?v=2.0.2" type="text/css" />
|
||||
<link rel="stylesheet" href="main.css?v=2.0.3" type="text/css" />
|
||||
<link rel="stylesheet" href="widgets.css?v=2.0.3" type="text/css" />
|
||||
<link rel="stylesheet" href="icons.css?v=2.0.3" type="text/css" />
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<script type="text/javascript" src="index.js?v=2.0.2"></script>
|
||||
<script type="text/javascript" src="index.js?v=2.0.3"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="divContainer" class="container main" data-auth="false">
|
||||
|
|
@ -584,7 +584,7 @@
|
|||
<div id="divUnauthenticated">
|
||||
<h1 style="text-align: center;"><img src="icon.png" style="width:127px;margin-left:1px;margin-top:-10px;" /></h1>
|
||||
<input id="fldLoginPin" type="hidden" name="pin" />
|
||||
<input id="fldLoginType" type="hidden" data-bind="type" data-datatype="int" />
|
||||
<input id="fldLoginType" type="hidden" data-bind="login.type" data-datatype="int" />
|
||||
<div id="divLoginPin" style="display:none;">
|
||||
<div class="field-group" style="text-align:center;">
|
||||
<div id="fldPinEntry" style="display:inline-block;" onkeydown="ui.pinKeyPressed(event);">
|
||||
|
|
|
|||
|
|
@ -1116,6 +1116,8 @@ class Security {
|
|||
resolve();
|
||||
if (err) ui.serviceError(err);
|
||||
else {
|
||||
console.log(ctx);
|
||||
document.getElementById('divContainer').setAttribute('data-securitytype', ctx.type);
|
||||
this.type = ctx.type;
|
||||
this.permissions = ctx.permissions;
|
||||
switch (ctx.type) {
|
||||
|
|
@ -1153,13 +1155,19 @@ class Security {
|
|||
let msg = pnl.querySelector('#spanLoginMessage');
|
||||
msg.innerHTML = '';
|
||||
let sec = ui.fromElement(pnl).login;
|
||||
let pin = '';
|
||||
for (let i = 0; i < 4; i++) {
|
||||
pin += sec.pin[`d${i}`];
|
||||
}
|
||||
if (pin.length !== 4) return;
|
||||
sec.pin = pin;
|
||||
console.log(sec);
|
||||
let pin = '';
|
||||
switch (sec.type) {
|
||||
case 1:
|
||||
for (let i = 0; i < 4; i++) {
|
||||
pin += sec.pin[`d${i}`];
|
||||
}
|
||||
if (pin.length !== 4) return;
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
sec.pin = pin;
|
||||
putJSONSync('/login', sec, (err, log) => {
|
||||
if (err) ui.serviceError(err);
|
||||
else {
|
||||
|
|
@ -1186,7 +1194,7 @@ var security = new Security();
|
|||
|
||||
class General {
|
||||
initialized = false;
|
||||
appVersion = 'v2.0.2';
|
||||
appVersion = 'v2.0.3';
|
||||
reloadApp = false;
|
||||
init() {
|
||||
if (this.initialized) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue