first
This commit is contained in:
parent
2ba6ac703f
commit
fedd3a9dc9
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1 @@
|
||||
node_modules
|
||||
dist
|
||||
node_modules
|
21
dist/iteyes-win32-x64/LICENSE
vendored
Normal file
21
dist/iteyes-win32-x64/LICENSE
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Copyright (c) Electron contributors
|
||||
Copyright (c) 2013-2020 GitHub Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
163047
dist/iteyes-win32-x64/LICENSES.chromium.html
vendored
Normal file
163047
dist/iteyes-win32-x64/LICENSES.chromium.html
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
dist/iteyes-win32-x64/chrome_100_percent.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/chrome_100_percent.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/chrome_200_percent.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/chrome_200_percent.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/d3dcompiler_47.dll
vendored
Normal file
BIN
dist/iteyes-win32-x64/d3dcompiler_47.dll
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/ffmpeg.dll
vendored
Normal file
BIN
dist/iteyes-win32-x64/ffmpeg.dll
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/icudtl.dat
vendored
Normal file
BIN
dist/iteyes-win32-x64/icudtl.dat
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/iteyes.exe
vendored
Normal file
BIN
dist/iteyes-win32-x64/iteyes.exe
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/libEGL.dll
vendored
Normal file
BIN
dist/iteyes-win32-x64/libEGL.dll
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/libGLESv2.dll
vendored
Normal file
BIN
dist/iteyes-win32-x64/libGLESv2.dll
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/af.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/af.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/am.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/am.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ar.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ar.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/bg.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/bg.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/bn.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/bn.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ca.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ca.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/cs.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/cs.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/da.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/da.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/de.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/de.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/el.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/el.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/en-GB.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/en-GB.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/en-US.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/en-US.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/es-419.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/es-419.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/es.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/es.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/et.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/et.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/fa.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/fa.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/fi.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/fi.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/fil.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/fil.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/fr.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/fr.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/gu.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/gu.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/he.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/he.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/hi.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/hi.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/hr.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/hr.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/hu.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/hu.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/id.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/id.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/it.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/it.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ja.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ja.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/kn.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/kn.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ko.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ko.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/lt.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/lt.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/lv.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/lv.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ml.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ml.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/mr.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/mr.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ms.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ms.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/nb.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/nb.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/nl.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/nl.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/pl.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/pl.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/pt-BR.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/pt-BR.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/pt-PT.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/pt-PT.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ro.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ro.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ru.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ru.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/sk.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/sk.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/sl.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/sl.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/sr.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/sr.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/sv.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/sv.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/sw.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/sw.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ta.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ta.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/te.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/te.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/th.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/th.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/tr.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/tr.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/uk.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/uk.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/ur.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/ur.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/vi.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/vi.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/zh-CN.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/zh-CN.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/locales/zh-TW.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/locales/zh-TW.pak
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/resources.pak
vendored
Normal file
BIN
dist/iteyes-win32-x64/resources.pak
vendored
Normal file
Binary file not shown.
17
dist/iteyes-win32-x64/resources/app/app.py
vendored
Normal file
17
dist/iteyes-win32-x64/resources/app/app.py
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import os
|
||||
import http.server
|
||||
import socketserver
|
||||
|
||||
# 设置要使用的端口
|
||||
PORT = 5000
|
||||
|
||||
# 设置要服务的目录
|
||||
os.chdir('.') # 替换为你想要服务的目录路径
|
||||
|
||||
# 定义请求处理程序
|
||||
Handler = http.server.SimpleHTTPRequestHandler
|
||||
|
||||
# 创建服务器
|
||||
with socketserver.TCPServer(("", PORT), Handler) as httpd:
|
||||
print(f"Serving at port {PORT}")
|
||||
httpd.serve_forever()
|
BIN
dist/iteyes-win32-x64/resources/app/assets/icon.ico
vendored
Normal file
BIN
dist/iteyes-win32-x64/resources/app/assets/icon.ico
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 165 KiB |
159
dist/iteyes-win32-x64/resources/app/gncs.html
vendored
Normal file
159
dist/iteyes-win32-x64/resources/app/gncs.html
vendored
Normal file
@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>智眼-软件功能测试</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.container {
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 10px;
|
||||
width: 400px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.function-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
padding: 10px;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.function-item span {
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
}
|
||||
.toggle-btn {
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
background-color: #ccc;
|
||||
border-radius: 15px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
.toggle-btn::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background-color: white;
|
||||
border-radius: 50%;
|
||||
top: 1px;
|
||||
left: 1px;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
.toggle-btn.active {
|
||||
background-color: #4caf50;
|
||||
}
|
||||
.toggle-btn.active::before {
|
||||
transform: translateX(30px);
|
||||
}
|
||||
|
||||
/* 导航栏样式 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
background-color: #333;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.navbar a {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-size: 16px;
|
||||
}
|
||||
.navbar a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2>功能测试页面</h2>
|
||||
|
||||
<div class="function-item">
|
||||
<span>摄像头</span>
|
||||
<div class="toggle-btn" id="camera-btn"></div>
|
||||
</div>
|
||||
|
||||
<div class="function-item">
|
||||
<span>人脸距离过近</span>
|
||||
<div class="toggle-btn" id="face-btn"></div>
|
||||
</div>
|
||||
|
||||
<div class="function-item">
|
||||
<span>屏幕锁定密码解锁</span>
|
||||
<div class="toggle-btn" id="unlock-btn"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script>
|
||||
// 获取所有开关按钮
|
||||
const cameraBtn = document.getElementById('camera-btn');
|
||||
const faceBtn = document.getElementById('face-btn');
|
||||
const unlockBtn = document.getElementById('unlock-btn');
|
||||
|
||||
// 存储当前打开的测试按钮
|
||||
let activeButton = null;
|
||||
|
||||
// 切换开关按钮状态并控制逻辑
|
||||
function toggleButton(btn, testName) {
|
||||
if (btn === activeButton) {
|
||||
// 如果点击的是已经激活的按钮,则关闭它
|
||||
btn.classList.remove('active');
|
||||
activeButton = null;
|
||||
alert(`${testName} 停止`);
|
||||
} else {
|
||||
// 关闭当前已激活的按钮(如果有)
|
||||
if (activeButton) {
|
||||
activeButton.classList.remove('active');
|
||||
alert(`上一个测试已停止`);
|
||||
}
|
||||
// 激活新按钮
|
||||
btn.classList.add('active');
|
||||
activeButton = btn;
|
||||
alert(`${testName} 启动`);
|
||||
}
|
||||
}
|
||||
|
||||
// 绑定点击事件
|
||||
cameraBtn.addEventListener('click', () => toggleButton(cameraBtn, '摄像头'));
|
||||
faceBtn.addEventListener('click', () => toggleButton(faceBtn, '人脸距离过近'));
|
||||
unlockBtn.addEventListener('click', () => toggleButton(unlockBtn, '屏幕锁定密码解锁'));
|
||||
</script>
|
||||
|
||||
<!-- 导航栏 -->
|
||||
<div class="navbar">
|
||||
<a href="index.html"><button id="home">启动首页</button></a>
|
||||
<a href="psw.html"><button id="unlock">解锁密码设置</button></a>
|
||||
<a href="gncs.html"><button id="test">功能测试</button></a>
|
||||
<a href="setting.html"><button id="settings">软件设置</button></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
238
dist/iteyes-win32-x64/resources/app/index.html
vendored
Normal file
238
dist/iteyes-win32-x64/resources/app/index.html
vendored
Normal file
@ -0,0 +1,238 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>智眼-启动首页</title>
|
||||
<style>
|
||||
/* 样式定义 */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 10px;
|
||||
width: 300px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
background-color: #333;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
.function-buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.function-buttons button {
|
||||
width: 130px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
/* 开关容器的样式 */
|
||||
.switch-container {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
background-color: #ccc;
|
||||
border-radius: 25px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* 开关按钮的样式 */
|
||||
.switch {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-color: white;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* 开启状态的样式 */
|
||||
.switch.on {
|
||||
left: 55px;
|
||||
background-color: #4caf50; /* 绿色 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 开关按钮部分 -->
|
||||
<div class="switch-container" id="switch-container" style="margin-bottom: 20px;">
|
||||
<div class="switch" id="switch"></div>
|
||||
</div>
|
||||
|
||||
<!-- 功能按钮部分 -->
|
||||
<div class="container">
|
||||
<div class="function-buttons">
|
||||
<a href="index.html"><button id="home">启动首页</button></a>
|
||||
<a href="psw.html"><button id="unlock">解锁密码设置</button></a>
|
||||
<a href="gncs.html"><button id="test">功能测试</button></a>
|
||||
<a href="setting.html"><button id="settings">软件设置</button></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
socket = null
|
||||
// 开关按钮功能
|
||||
const switchButton = document.getElementById('switch');
|
||||
let isSwitchOn = false;
|
||||
|
||||
switchButton.addEventListener('click', function () {
|
||||
if (isSwitchOn) {
|
||||
const password = prompt("请输入密码以关闭开关:");
|
||||
if (password === currentPassword) {
|
||||
// socket.close(). then(() => {
|
||||
// switchButton.classList.remove('on')
|
||||
// alert('开关已关闭');
|
||||
// isSwitchOn = false;
|
||||
// socket = null
|
||||
// })
|
||||
switchButton.classList.remove('on')
|
||||
alert('开关已关闭');
|
||||
isSwitchOn = false;
|
||||
|
||||
} else {
|
||||
alert('密码错误!');
|
||||
}
|
||||
} else {
|
||||
//创建 WebSocket 连接
|
||||
socket = new WebSocket('ws://localhost:45601');
|
||||
|
||||
// 打开连接时触发
|
||||
socket.onopen = function(event) {
|
||||
console.log('WebSocketOn.');
|
||||
switchButton.classList.add('on');
|
||||
isSwitchOn = true;
|
||||
console.log(123)
|
||||
};
|
||||
|
||||
// 接收到消息时触发
|
||||
socket.onmessage = function(event) {
|
||||
console.log('收到消息:', event.data);
|
||||
|
||||
// 根据服务器的响应处理逻辑
|
||||
// 注意:服务器应该发送明确的消息格式以便客户端正确解析
|
||||
};
|
||||
|
||||
// 连接关闭时触发
|
||||
socket.onclose = function(event) {
|
||||
console.log('WebSocketClose.');
|
||||
};
|
||||
|
||||
// 连接出错时触发
|
||||
socket.onerror = function(error) {
|
||||
console.log('WebSocket Error:', error);
|
||||
};
|
||||
sendMessage({
|
||||
"ClientEvent":"open",
|
||||
"Content": null
|
||||
}).then(() => {
|
||||
switchButton.classList.add('on');
|
||||
isSwitchOn = true;
|
||||
console.log(123321)
|
||||
})
|
||||
switchButton.classList.add('on');
|
||||
isSwitchOn = true;
|
||||
console.log(123321)
|
||||
}
|
||||
});
|
||||
|
||||
function onMessage(data){
|
||||
switch (data.Event){
|
||||
case "near":
|
||||
if (nearTest){
|
||||
if (heavyAlert){
|
||||
//把强提醒函数写这
|
||||
}else{
|
||||
alert("用眼过近!")
|
||||
}
|
||||
}
|
||||
case "long":
|
||||
if (longTest){
|
||||
if (heavyAlert){
|
||||
//把强提醒函数写这
|
||||
fetch("http://localhost:45602/electronAlert", { method: 'POST' , body: "用眼过长!"})
|
||||
|
||||
}else{
|
||||
alert("用眼过长!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 向服务器发送消息
|
||||
function sendMessage(message) {
|
||||
if (socket.readyState === WebSocket.OPEN) {
|
||||
socket.send(message);
|
||||
} else {
|
||||
console.log('WebSocket 连接未打开.');
|
||||
}
|
||||
}
|
||||
// 导航按钮逻辑
|
||||
const navButtons = document.querySelectorAll('.function-buttons a');
|
||||
|
||||
navButtons.forEach(button => {
|
||||
button.addEventListener('click', function (e) {
|
||||
if (isSwitchOn) {
|
||||
e.preventDefault(); // 阻止默认行为
|
||||
const password = prompt("请输入密码以进行页面跳转:");
|
||||
if (password === currentPassword) {
|
||||
// 关闭开关
|
||||
switchButton.classList.remove('on');
|
||||
alert('开关已关闭');
|
||||
isSwitchOn = false;
|
||||
|
||||
// 跳转到目标页面
|
||||
window.location.href = button.href;
|
||||
} else {
|
||||
alert('密码错误!');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
46
dist/iteyes-win32-x64/resources/app/index.js
vendored
Normal file
46
dist/iteyes-win32-x64/resources/app/index.js
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
|
||||
const { spawn } = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
const flaskProcess = spawn('python', [path.join(__dirname, 'app.py')]);
|
||||
|
||||
flaskProcess.stdout.on('data', (data) => {
|
||||
console.log(`Flask: ${data}`);
|
||||
});
|
||||
|
||||
// 监听Node.js进程的关闭事件
|
||||
process.on('SIGINT', () => {
|
||||
console.log('Closing Node.js application and Python script...');
|
||||
|
||||
// 杀掉Python进程
|
||||
pythonProcess.kill('SIGINT');
|
||||
|
||||
// 完全退出Node.js应用
|
||||
process.exit();
|
||||
});
|
||||
|
||||
let mainWindow;
|
||||
|
||||
app.whenReady().then(() => {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
icon: path.join(__dirname, 'assets', 'icon.ico'),
|
||||
webPreferences: {
|
||||
nodeIntegration: false, // 禁用 Node 集成
|
||||
contextIsolation: true, // 启用上下文隔离
|
||||
},
|
||||
});
|
||||
|
||||
// 加载 HTTP 服务的 URL
|
||||
mainWindow.loadURL('http://127.0.0.1:5000/');
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null;
|
||||
});
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') app.quit();
|
||||
});
|
17
dist/iteyes-win32-x64/resources/app/package.json
vendored
Normal file
17
dist/iteyes-win32-x64/resources/app/package.json
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "iteyes",
|
||||
"version": "1.0.0",
|
||||
"description": "A program that intelligently controls eye health",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "electron .",
|
||||
"package": "electron-packager . needle-server --platform=win32 --arch=x64 --out=./out --asar --app-version=1.0.0 --overwrite --ignore=node_modules --electron-version=$(npm list electron --depth=0 | jq -r '.dependencies.electron.version')"
|
||||
},
|
||||
"author": "宫瑞骏,张晓星",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"electron": "^33.0.1",
|
||||
"electron-packager": "^17.1.2"
|
||||
}
|
||||
}
|
20
dist/iteyes-win32-x64/resources/app/package.sh
vendored
Normal file
20
dist/iteyes-win32-x64/resources/app/package.sh
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 要清理的临时目录路径
|
||||
TEMP_DIR="C:/Users/XINNIAN/AppData/Local/Temp/electron-packager"
|
||||
|
||||
# 检查临时目录是否存在,并清理其内容
|
||||
if [ -d "$TEMP_DIR" ]; then
|
||||
echo "正在清理临时目录: $TEMP_DIR"
|
||||
rm -rf "$TEMP_DIR"/*
|
||||
echo "临时目录清理完成!"
|
||||
else
|
||||
echo "临时目录不存在: $TEMP_DIR"
|
||||
fi
|
||||
|
||||
# 打包 Electron 应用
|
||||
echo "开始打包 Electron 应用..."
|
||||
npx electron-packager . iteyes --platform=win32 --arch=x64 --icon=assets/icon.ico --out=dist --overwrite
|
||||
|
||||
|
||||
echo "Electron 应用打包完成!"
|
151
dist/iteyes-win32-x64/resources/app/psw.html
vendored
Normal file
151
dist/iteyes-win32-x64/resources/app/psw.html
vendored
Normal file
@ -0,0 +1,151 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>智眼-密码设置</title>
|
||||
<style>
|
||||
/* 样式定义 */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.container {
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 10px;
|
||||
width: 300px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
h2 {
|
||||
text-align: center;
|
||||
}
|
||||
input[type="password"] {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
background-color: #333;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #555;
|
||||
}
|
||||
.function-buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.function-buttons button {
|
||||
width: 130px;
|
||||
margin: 10px;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2>智眼-密码设置</h2>
|
||||
<label for="password">输入密码</label>
|
||||
<input type="password" id="password" oncopy="return false" oncut="return false" onpaste="return false" ondragstart="return false" ondrop="return false">
|
||||
|
||||
<div class="button-container">
|
||||
<button id="confirm" style="display: block;">确认</button>
|
||||
<button id="reset" style="display: none;">重置</button>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div id="reset-section" class="hidden">
|
||||
<label for="old-password">输入旧密码进行重置</label>
|
||||
<input type="password" id="old-password" oncopy="return false" oncut="return false" onpaste="return false" ondragstart="return false" ondrop="return false">
|
||||
<button id="confirm-reset">确认重置</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 功能按钮部分 -->
|
||||
<div class="container">
|
||||
<div class="function-buttons">
|
||||
<a href="index.html"><button id="home">启动首页</button></a>
|
||||
<a href="psw.html"><button id="unlock">解锁密码设置</button></a>
|
||||
<a href="gncs.html"><button id="test">功能测试</button></a>
|
||||
<a href="setting.html"><button id="settings">软件设置</button></a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
currentPassword = '123';
|
||||
|
||||
// 当用户点击确认按钮时,保存密码并隐藏确认按钮
|
||||
document.getElementById('confirm').addEventListener('click', function() {
|
||||
const password = document.getElementById('password').value;
|
||||
if (password) {
|
||||
currentPassword = password;
|
||||
console.log(password)
|
||||
sendMessage({
|
||||
"ClientEvent": "SetPassword",
|
||||
"Content": {
|
||||
"Password": password
|
||||
}
|
||||
}).then(() => {
|
||||
alert('密码已设置');
|
||||
document.getElementById('password').setAttribute('disabled', true); // 禁用输入框
|
||||
document.getElementById('confirm').style.display = 'none'; // 隐藏确认按钮
|
||||
document.getElementById('reset').style.display = 'block'; // 显示重置按钮
|
||||
})
|
||||
|
||||
} else {
|
||||
alert('请输入密码');
|
||||
}
|
||||
});
|
||||
|
||||
// 当用户点击重置按钮时,显示输入旧密码的区域
|
||||
document.getElementById('reset').addEventListener('click', function() {
|
||||
document.getElementById('reset-section').classList.remove('hidden');
|
||||
});
|
||||
|
||||
// 确认重置密码
|
||||
document.getElementById('confirm-reset').addEventListener('click', function() {
|
||||
const oldPassword = document.getElementById('old-password').value;
|
||||
if (oldPassword === currentPassword) {
|
||||
currentPassword = ''; // 清空当前密码
|
||||
document.getElementById('password').value = ''; // 清空密码输入框
|
||||
document.getElementById('old-password').value = ''; // 清空旧密码输入框
|
||||
document.getElementById('password').removeAttribute('disabled'); // 重新启用密码输入框
|
||||
document.getElementById('confirm').style.display = 'block'; // 重新显示确认按钮
|
||||
document.getElementById('reset').style.display = 'none'; // 隐藏重置按钮
|
||||
document.getElementById('reset-section').classList.add('hidden'); // 隐藏重置部分
|
||||
alert('密码已重置');
|
||||
} else {
|
||||
alert('旧密码不正确');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
149
dist/iteyes-win32-x64/resources/app/setting.html
vendored
Normal file
149
dist/iteyes-win32-x64/resources/app/setting.html
vendored
Normal file
@ -0,0 +1,149 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>智眼-软件设置</title>
|
||||
<script type="text/javascript">
|
||||
function password() {
|
||||
var testV = 1;
|
||||
var pass1 = prompt('请输入密码','');
|
||||
while (testV < 3) {
|
||||
if (!pass1)
|
||||
history.go(-1);
|
||||
if (pass1 == "123") {//初始密码123
|
||||
alert('密码正确');
|
||||
break;
|
||||
}
|
||||
testV+=1;
|
||||
var pass1 =
|
||||
prompt('密码错误!请重新输入:');
|
||||
}
|
||||
if (pass1!="password" & testV ==3)
|
||||
history.go(-1);
|
||||
return " ";
|
||||
}
|
||||
document.write(password());
|
||||
</script>
|
||||
<style>
|
||||
/* 样式定义 */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.container {
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 10px;
|
||||
width: 300px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
input[type="text"], input[type="number"], input[type="checkbox"] {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
background-color: #333;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #555;
|
||||
}
|
||||
.function-buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.function-buttons button {
|
||||
width: 130px;
|
||||
margin: 10px;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2>时间限制设置</h2>
|
||||
<label for="time-limit">设置每天使用时间上限(分钟),填“0”则为不限制:</label>
|
||||
<input type="number" id="time-limit" min="0" max="7200">
|
||||
<div class="button-container">
|
||||
<button id="save-time-limit">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 导航栏部分 -->
|
||||
<div class="container">
|
||||
<div class="function-buttons">
|
||||
<a href="index.html"><button id="home">启动首页</button></a>
|
||||
<a href="psw.html"><button id="unlock">解锁密码设置</button></a>
|
||||
<a href="gncs.html"><button id="test">功能测试</button></a>
|
||||
<a href="setting.html"><button id="settings">软件设置</button></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 处理时间限制设置
|
||||
document.getElementById('save-time-limit').addEventListener('click', function() {
|
||||
const timeLimit = document.getElementById('time-limit').value;
|
||||
if (timeLimit > 0 && timeLimit <= 7200) {
|
||||
sendMessage({
|
||||
"ClientEvent": "SetLongTestTime",
|
||||
"Content": {
|
||||
"Time": timeLimit
|
||||
}
|
||||
}).then(() => {
|
||||
// 处理发送消息成功后的逻辑
|
||||
longTest = true
|
||||
alert(`已将每日使用时间上限设置为 ${timeLimit} 分钟`);
|
||||
})
|
||||
|
||||
}
|
||||
if (timeLimit > 7200) {
|
||||
alert('请输入有效的分钟数');
|
||||
}
|
||||
if (timeLimit < 0) {
|
||||
alert('请输入有效的分钟数');
|
||||
}
|
||||
if (timeLimit == 0) {
|
||||
longTest = false
|
||||
alert(`已取消时间限制`);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
BIN
dist/iteyes-win32-x64/snapshot_blob.bin
vendored
Normal file
BIN
dist/iteyes-win32-x64/snapshot_blob.bin
vendored
Normal file
Binary file not shown.
BIN
dist/iteyes-win32-x64/v8_context_snapshot.bin
vendored
Normal file
BIN
dist/iteyes-win32-x64/v8_context_snapshot.bin
vendored
Normal file
Binary file not shown.
1
dist/iteyes-win32-x64/version
vendored
Normal file
1
dist/iteyes-win32-x64/version
vendored
Normal file
@ -0,0 +1 @@
|
||||
33.0.1
|
BIN
dist/iteyes-win32-x64/vk_swiftshader.dll
vendored
Normal file
BIN
dist/iteyes-win32-x64/vk_swiftshader.dll
vendored
Normal file
Binary file not shown.
1
dist/iteyes-win32-x64/vk_swiftshader_icd.json
vendored
Normal file
1
dist/iteyes-win32-x64/vk_swiftshader_icd.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"file_format_version": "1.0.0", "ICD": {"library_path": ".\\vk_swiftshader.dll", "api_version": "1.0.5"}}
|
BIN
dist/iteyes-win32-x64/vulkan-1.dll
vendored
Normal file
BIN
dist/iteyes-win32-x64/vulkan-1.dll
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user