-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
242 lines (231 loc) · 11.1 KB
/
Copy pathindex.html
File metadata and controls
242 lines (231 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!--
作者:Eason-swc
版本:v1.0
日期:2025/11/19
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<!-- 文档元数据 -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Freenove - Web Flasher</title>
<!-- 引入样式文件 -->
<link rel="stylesheet" href="style.css">
<!-- 引入 Font Awesome 图标库,用于显示各种图标 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="icon" href="freenove.ico" type="image/x-icon">
<!-- 引入 Xterm.js 终端库的样式文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@4.19.0/css/xterm.css">
</head>
<body>
<!-- 页面头部区域 -->
<header>
<!-- 品牌Logo和名称 -->
<div class="logo">
<img src="freenove.ico" alt="Freenove Logo" class="logo-icon">
<span>Freenove</span>
</div>
<!-- 头部右侧内容,包含导航和主题切换 -->
<div class="header-right">
<!-- 导航菜单 -->
<nav>
<a href="https://freenove.com/" class="nav-button" target="_blank">Home</a>
<a href="https://freenove.com/store" class="nav-button" target="_blank">Store</a>
<a href="https://freenove.com/support" class="nav-button" target="_blank">Support</a>
</nav>
<!-- 主题切换器,用于切换深色/浅色模式 -->
<div id="theme-switcher" class="theme-switcher">
<i class="fas fa-moon"></i>
</div>
</div>
</header>
<!-- 页面主要内容区域 -->
<main>
<!-- 英雄区域:主标题和副标题 -->
<section class="hero">
<h1 class="main-title">Flash directly from the web</h1>
<p class="subtitle">Connect your device, select your model and board version, and start flashing immediately. No setup required.</p>
</section>
<!-- 步骤指示器区域:引导用户完成设备、固件、版本选择 -->
<section class="stepper">
<!-- 步骤1: 选择设备 -->
<div id="step-1" class="step active">
<div class="step-icon"><i class="fas fa-desktop"></i></div>
<div id="select-device-btn" class="step-content step-button">
<span>Select device</span>
</div>
</div>
<!-- 步骤2: 选择固件 -->
<div id="step-2" class="step">
<div class="step-icon"><i class="fas fa-microchip"></i></div>
<div class="step-content">
<div class="dropdown-container">
<select id="firmware-select" disabled>
<option value="">Select firmware</option>
</select>
</div>
</div>
</div>
<!-- 步骤3: 选择版本 -->
<div id="step-3" class="step">
<div class="step-icon"><i class="fas fa-code-branch"></i></div>
<div class="step-content">
<div class="dropdown-container">
<select id="version-select" disabled>
<option value="">Select version</option>
</select>
</div>
</div>
</div>
</section>
<!-- 操作区域:包含烧录控制按钮和选项 -->
<section class="actions">
<div class="controls-grid">
<!-- 波特率选择器 -->
<div class="baud-rate-selector">
<label for="baud-rate-select">Flash Baud Rate:</label>
<select id="baud-rate-select">
<option value="9600">9600</option>
<option value="115200">115200</option>
<option value="230400">230400</option>
<option value="460800">460800</option>
<option value="921600" selected>921600</option>
<option value="1500000">1500000</option>
<option value="2000000">2000000</option>
</select>
</div>
<!-- 擦除闪存复选框 -->
<div class="erase-checkbox-container">
<input type="checkbox" id="erase-flash-checkbox" name="erase-flash" checked>
<label for="erase-flash-checkbox">Erase Flash</label>
</div>
<!-- 连接设备按钮 -->
<button id="connect-btn" class="action-btn"><i class="fas fa-link"></i> Connect</button>
<!-- 烧录固件按钮 -->
<button id="flash-btn" class="action-btn" disabled><i class="fas fa-bolt"></i> Flash</button>
<!-- 切换控制台显示按钮 -->
<button id="toggle-console-btn" class="action-btn"><i class="fas fa-terminal"></i> Open Console</button>
<!-- 串口监视器按钮 -->
<button id="serial-port-info-btn" class="action-btn" disabled><i class="fas fa-info-circle"></i> Serial Monitor</button>
</div>
</section>
<!-- 终端控制台区域,默认隐藏 -->
<section class="terminal-section hidden">
<div id="terminal-log"></div>
</section>
</main>
<!-- 页面底部区域 -->
<footer>
<!-- 版权信息 -->
<div class="footer-copyright">
© 2026 Freenove
<span style="margin: 0 0.5rem; opacity: 0.5;">|</span>
Powered by <a href="https://github.com/espressif/esptool-js" target="_blank" class="footer-link">esptool-js</a>
</div>
<!-- 社交媒体链接 -->
<div class="footer-socials">
<a href="https://github.com/Freenove" target="_blank" aria-label="GitHub">
<i class="fab fa-github"></i>
</a>
<a href="https://www.youtube.com/@Freenove" target="_blank" aria-label="YouTube">
<i class="fab fa-youtube"></i>
</a>
</div>
<!-- 功能说明悬浮组件 -->
<!-- <div id="info-widget" class="info-widget"> -->
<!-- 状态1:圆形触发按钮 -->
<!-- <button id="info-trigger-btn" class="info-trigger-btn" aria-label="Help & Instructions">
<i class="fas fa-question"></i>
</button> -->
<!-- 状态2:展开的文本框 -->
<!-- <div class="info-card">
<div class="info-header">
<h3>How to use</h3>
<button id="info-close-btn" class="info-close-btn">×</button>
</div>
<div class="info-body">
<p><strong>1. 使用说明:</strong> 选择合适的设备</p>
<p><strong>2. Connect:</strong> Click "Connect" and select the USB port.</p>
<p><strong>3. Flash:</strong> Pick the firmware version and click "Flash".</p>
<p class="note">Note: 烧录完后需要手动复位.</p>
</div>
</div>
</div> -->
</footer>
<!-- 设备选择模态框 -->
<div id="device-modal" class="modal-overlay">
<div class="modal-content">
<!-- 模态框头部 -->
<div class="modal-header">
<h2>Select device</h2>
<button id="close-modal-btn" class="close-btn">×</button>
</div>
<!-- 模态框主体内容 -->
<div class="modal-main">
<!-- 搜索和过滤栏 -->
<div class="modal-filter-bar">
<div class="chip-filters">
<button class="filter-btn active" data-chip="all">All</button>
<button class="filter-btn" data-chip="ESP32-S3">ESP32-S3</button>
<button class="filter-btn" data-chip="ESP32">ESP32</button>
</div>
<div class="search-box">
<i class="fas fa-search"></i>
<input type="text" id="device-search-input" placeholder="Search devices...">
</div>
</div>
<!-- 设备列表区域 -->
<div class="device-container">
<!-- 设备列表,由JavaScript动态注入 -->
<div id="device-list" class="device-list">
<!-- Device items will be injected by JS -->
</div>
</div>
</div>
</div>
</div>
<!-- 串口监视器模态框 -->
<div id="serial-info-modal" class="modal-overlay">
<div class="modal-content serial-monitor-modal-content">
<!-- 模态框头部 -->
<div class="modal-header">
<h2>Serial Monitor</h2>
<button id="close-serial-info-modal-btn" class="close-btn">×</button>
</div>
<!-- 模态框主体内容 -->
<div class="modal-main">
<div id="serial-info-content" class="serial-info-content">
<!-- 串口监视器波特率选择器 -->
<div class="baud-rate-selector">
<label for="modal-baud-rate-select">Monitor Baud Rate:</label>
<select id="modal-baud-rate-select">
<option value="9600">9600</option>
<option value="115200" selected>115200</option>
<option value="230400">230400</option>
<option value="460800">460800</option>
<option value="921600">921600</option>
<option value="1500000">1500000</option>
<option value="2000000">2000000</option>
</select>
<button id="clear-terminal-btn" class="action-btn small-btn" style="margin-left: auto;"><i class="fas fa-trash-alt"></i> Clear</button>
</div>
<!-- 串口监视器终端显示区域 -->
<div id="serial-monitor-terminal" class="serial-monitor-terminal"></div>
<!-- 串口发送区域 -->
<div class="serial-send-area">
<input type="text" id="serial-send-input" placeholder="Type command..." />
<button id="serial-send-btn" class="action-btn small-btn">Send</button>
</div>
</div>
</div>
</div>
</div>
<!-- 引入第三方JavaScript库 -->
<script src="https://cdn.jsdelivr.net/npm/crypto-js@4.1.1/crypto-js.js"></script>
<!-- 引入esptool-js集成脚本,处理与ESP设备的通信逻辑 -->
<script type="module" src="esptool-integration.js"></script>
<!-- 引入主应用脚本,处理用户界面交互 -->
<script type="module" src="script.js"></script>
</body>
</html>