fix
parent
c0210dba7a
commit
d76dd8be03
|
@ -44,6 +44,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -45,6 +45,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
6
eq.html
6
eq.html
|
@ -43,6 +43,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -45,6 +45,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
6
fs.html
6
fs.html
|
@ -45,6 +45,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -48,6 +48,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
19
js/main.js
19
js/main.js
|
@ -1,6 +1,6 @@
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#blink").on('click', function () {
|
$("#blink").on('click', function () {
|
||||||
console.log('click','#blink')
|
console.log('click', '#blink')
|
||||||
let url = 'http://192.168.0.116/cgi-bin/test.cgi';
|
let url = 'http://192.168.0.116/cgi-bin/test.cgi';
|
||||||
let postData = {
|
let postData = {
|
||||||
action: 'blink'
|
action: 'blink'
|
||||||
|
@ -20,11 +20,26 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (res) {
|
error: function (res) {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("#logout").on('click', function () {
|
||||||
|
sessionStorage.clear();
|
||||||
|
window.location.href='login.html'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
var data = sessionStorage.getItem('state');
|
||||||
|
if (data != 'logined') {
|
||||||
|
if (window.location.href.indexOf('login') != -1) {
|
||||||
|
//login page
|
||||||
|
console.log('bbbb')
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.location.href = 'login.html'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
28
login.html
28
login.html
|
@ -37,7 +37,7 @@
|
||||||
<button type="button" id="submit" class="btn btn-lg btn-dark border border-black">LOGIN</button>
|
<button type="button" id="submit" class="btn btn-lg btn-dark border border-black">LOGIN</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-5 mb-3" style="color: #888888;">
|
<div class="mt-5 mb-3" style="color: #888888;">
|
||||||
<div >GUI <span id="guiv">V1.0.0</span>
|
<div>GUI <span id="guiv">V1.0.0</span>
|
||||||
</div>
|
</div>
|
||||||
<div>FIRMWARE <span id="firmwarev">V1.0.0</span></div>
|
<div>FIRMWARE <span id="firmwarev">V1.0.0</span></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -62,23 +62,36 @@
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
//初始化配置
|
//初始化配置
|
||||||
|
|
||||||
loadData()
|
loadData()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
console.log('ready', $("#name").val())
|
||||||
|
window.focus()
|
||||||
|
$("#name").focus()
|
||||||
|
var alertState = sessionStorage.getItem('alert')
|
||||||
|
if (alertState == 'alert') {
|
||||||
|
sessionStorage.removeItem('alert');
|
||||||
|
console.log('重新跳转')
|
||||||
|
window.location.href = 'login.html?t=' + new Date().getTime()
|
||||||
|
}
|
||||||
$("#submit").on("click", function () {
|
$("#submit").on("click", function () {
|
||||||
let name = $("#name").val()
|
let name = $("#name").val()
|
||||||
let password = $("#password").val()
|
let password = $("#password").val()
|
||||||
if (name.length == 0) {
|
if (name.length == 0) {
|
||||||
|
sessionStorage.setItem('alert', 'alert');
|
||||||
alert('Please enter your username')
|
alert('Please enter your username')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (password.length == 0) {
|
if (password.length == 0) {
|
||||||
|
sessionStorage.setItem('alert', 'alert');
|
||||||
alert('Please enter the account login password')
|
alert('Please enter the account login password')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = 'http://192.168.0.116/cgi-bin/test.cgi';
|
let url = '/cgi-bin/test.cgi';
|
||||||
let postData = {
|
let postData = {
|
||||||
action: 'login_set',
|
action: 'login_set',
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -92,14 +105,19 @@
|
||||||
//contentType: "application/json; charset=utf-8",
|
//contentType: "application/json; charset=utf-8",
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
alert('Login successful')
|
// alert('Login successful')
|
||||||
window.location.href="/home.html"
|
window.location.href = "/home.html"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
alert(res.message)
|
alert(res.message)
|
||||||
|
sessionStorage.setItem('alert', 'alert');
|
||||||
|
return
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (res) {
|
error: function (res) {
|
||||||
|
alert('error')
|
||||||
|
// sessionStorage.setItem('state', 'logined');
|
||||||
|
// window.location.href = "home.html"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -134,7 +152,7 @@
|
||||||
$("#hostName").text(`${data.hostname}`)
|
$("#hostName").text(`${data.hostname}`)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="js/main.js"></script>
|
<script src="js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -42,6 +42,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -42,6 +42,12 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
|
||||||
|
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -44,6 +44,15 @@
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-dark border-black ms-2" id="logout">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||||
|
class="bi bi-box-arrow-right" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z" />
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
Loading…
Reference in New Issue