-
Notifications
You must be signed in to change notification settings - Fork 11
/
web.html
183 lines (170 loc) · 6.04 KB
/
web.html
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
<!DOCTYPE html>
<html lang='zh-cn'>
<head>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, initial-scale=1, user-scalable=no' />
<title>小爱拦截、MQTT程序</title>
<style type='text/css'>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
font-size: 16px;
color: #333;
line-height: 1.75;
}
table.gridtable {
color: #333333;
border-width: 1px;
border-color: #ddd;
border-collapse: collapse;
margin: auto;
margin-top: 15px;
width: 80%;
}
table.gridtable th {
border-width: 1.5px;
padding: 8px;
border-style: solid;
border-color: #ddd;
background-color: #f5f5f5;
}
table.gridtable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #ddd;
background-color: #ffffff;
}
input {
border: 1px solid #ccc;
padding: 7px 0px;
border-radius: 3px;
padding-left: 5px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s
}
input:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}
button {
color: #fff;
border-width: 0px;
border-radius: 3px;
cursor: pointer;
outline: none;
font-size: 17px;
line-height: 2.4rem;
;
width: 100%;
}
.btn-info {
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:hover {
background-color: #31b0d5;
border-color: #269abc;
}
.alert {
width: 80%;
padding: 15px;
border: 1px solid transparent;
border-radius: 4px;
position: fixed;
top: 10px;
left: 10%;
z-index: 999999;
display: none;
}
</style>
<script type='text/javascript'>
function toast(msg, duration, isok) {
var m = document.getElementById('alert');
m.innerHTML = msg;
m.style.cssText = isok ? 'color: #3c763d;background-color: #dff0d8;border-color: #d6e9c6;' : 'color: #a94442; background-color: #f2dede; border-color: #ebccd1;';
m.style.display = 'block';
setTimeout(function () {
var d = 0.5;
m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
m.style.opacity = '0';
setTimeout(function () {
m.style.display = 'none'
}, d * 1000);
}, duration);
}
</script>
</head>
<body>
<div id='alert' class='alert'></div>
<h1 style='text-align: center'>小爱拦截、MQTT程序</h1>
<form method='post' action='/'>
<table class='gridtable'>
<thead>
<tr>
<th colspan='2'>小爱设置</th>
</tr>
</thead>
<tbody>
<tr>
<td>小爱位置</td>
<td><input type='text' name='zone' placeholder='小爱位置' value='%s'></td>
</tr>
<tr>
<td>接口地址</td>
<td><input type='text' name='apiUrl' placeholder='接口地址' value='%s' style='width:98%'></td>
</tr>
<tr>
<td>asr截词接口</td>
<td><input type='text' name='asrUrl' placeholder='asr截词接口' value='%.*s' style='width:98%'></td>
</tr>
<tr>
<td>res截词接口</td>
<td><input type='text' name='resUrl' placeholder='res截词接口' value='%.*s' style='width:98%'></td>
</tr>
<tr>
<td>更新时间</td>
<td><input type='number' min='0' max='1440' name='intervals' value='%d'> 分钟</td>
</tr>
</tbody>
<thead>
<tr>
<th colspan='2'>MQTT设置</th>
</tr>
</thead>
<tbody>
<tr>
<td>地址</td>
<td><input type='text' name='mqttServer' placeholder='服务器地址' value='%s'></td>
</tr>
<tr>
<td>端口</td>
<td><input type='number' min='0' max='65535' name='mqttPort' value='%d'></td>
</tr>
<tr>
<td>用户名</td>
<td><input type='text' name='mqttUserName' placeholder='用户名' value='%s'></td>
</tr>
<tr>
<td>密码</td>
<td><input type='password' name='mqttPassword' placeholder='密码' value='%s'></td>
</tr>
<tr>
<td>状态</td>
<td>%s</td>
</tr>
<tr>
<td colspan='2'>
<button type='submit' class='btn-info'>保存</button>
</td>
</tr>
</tbody>
</table>
</form>
</body>
%s
</html>