@@ -6,38 +6,6 @@ m.apply_on_parse=true
6
6
s = m :section (TypedSection ," advanced" )
7
7
s .anonymous = true
8
8
9
- if nixio .fs .access (" /bin/nuc" )then
10
- s :tab (" mode" ,translate (" 模式设置" ),translate (" <br />可以在这里切换旁路由和正常模式,重置你的网络设置。<br /><font color=\" Red\" ><strong>点击后会立即重启设备,没有确认过程,请谨慎操作!</strong></font><br/>" ))
11
- o = s :taboption (" mode" ,Button ," nucmode" ,translate (" 切换为旁路由模式" ),translate (" <font color=\" green\" ><strong>本模式适合于单口和多网口主机,自动将网口全桥接好!<br />默认gateway是:192.168.1.1,ipaddr是192.168.1.2。用本机接口LAN接上级LAN当旁路由,主路由关闭DHCP服务。应用生效会重启软路由!</strong></font><br/>" ))
12
- o .inputtitle = translate (" Apply" )
13
- o .inputstyle = " reset"
14
- o .write = function ()
15
- luci .sys .exec (" /bin/nuc &> /dev/null &" )
16
- end
17
- o = s :taboption (" mode" ,Button ," normalmode" ,translate (" 切换成路由模式" ),translate (" <font color=\" green\" ><strong>本模式适合于有两个网口或以上的设备使用,如多网口软路由或者虚拟了两个以上网口的虚拟机使用!应用生效会重启软路由!。</strong></font><br/>" ))
18
- o .inputtitle = translate (" Apply" )
19
- o .inputstyle = " reset"
20
- o .write = function ()
21
- luci .sys .exec (" /bin/normalmode &> /dev/null &" )
22
- end
23
-
24
- o = s :taboption (" mode" ,Button ," ipmode6" ,translate (" 设置为IPV6网络" ),translate (" <font color=\" green\" ><strong>点击应用切换到IPV6模式!保存应用后即刻有效!</strong></font><br/>" ))
25
-
26
- o .inputtitle = translate (" Apply" )
27
- o .inputstyle = " add"
28
- o .write = function (self , section )
29
- luci .sys .exec (" ipmode6 &> /dev/null &" )
30
- end
31
-
32
- o = s :taboption (" mode" ,Button ," ipmode4" ,translate (" 设置为IPV4网络" ),translate (" <font color=\" green\" ><strong>点击应用切换到IPV4模式!保存应用后即刻有效!</strong></font><br/>" ))
33
-
34
- o .inputtitle = translate (" Apply" )
35
- o .inputstyle = " add"
36
- o .write = function (self , section )
37
- luci .sys .exec (" ipmode4 &> /dev/null &" )
38
- end
39
-
40
- end
41
9
if nixio .fs .access (" /etc/dnsmasq.conf" )then
42
10
43
11
s :tab (" dnsmasqconf" ,translate (" dnsmasq" ),translate (" 本页是配置/etc/dnsmasq.conf的文档内容。应用保存后自动重启生效" ))
@@ -127,6 +95,7 @@ e.remove("/tmp/hosts.tmp")
127
95
end
128
96
end
129
97
end
98
+
130
99
if nixio .fs .access (" /etc/config/arpbind" )then
131
100
s :tab (" arpbindconf" ,translate (" ARP绑定" ),translate (" 本页是配置/etc/config/arpbind包含APR绑定MAC地址文档内容。应用保存后自动重启生效" ))
132
101
conf = s :taboption (" arpbindconf" ,Value ," arpbindconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
@@ -148,6 +117,7 @@ e.remove("/tmp/arpbind")
148
117
end
149
118
end
150
119
end
120
+
151
121
if nixio .fs .access (" /etc/config/firewall" )then
152
122
s :tab (" firewallconf" ,translate (" 防火墙" ),translate (" 本页是配置/etc/config/firewall包含防火墙协议设置文档内容。应用保存后自动重启生效" ))
153
123
conf = s :taboption (" firewallconf" ,Value ," firewallconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
@@ -169,6 +139,7 @@ e.remove("/tmp/firewall")
169
139
end
170
140
end
171
141
end
142
+
172
143
if nixio .fs .access (" /etc/config/mwan3" )then
173
144
s :tab (" mwan3conf" ,translate (" 负载均衡" ),translate (" 本页是配置/etc/config/mwan3包含负载均衡设置文档内容。应用保存后自动重启生效" ))
174
145
conf = s :taboption (" mwan3conf" ,Value ," mwan3conf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
@@ -211,6 +182,7 @@ e.remove("/tmp/dhcp")
211
182
end
212
183
end
213
184
end
185
+
214
186
if nixio .fs .access (" /etc/config/ddns" )then
215
187
s :tab (" ddnsconf" ,translate (" DDNS" ),translate (" 本页是配置/etc/config/ddns包含动态域名设置文档内容。应用保存后自动重启生效" ))
216
188
conf = s :taboption (" ddnsconf" ,Value ," ddnsconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
@@ -233,48 +205,50 @@ end
233
205
end
234
206
end
235
207
236
- if nixio .fs .access (" /etc/config/timecontrol " )then
237
- s :tab (" timecontrolconf " ,translate (" 时间控制 " ),translate (" 本页是配置/etc/config/timecontrol包含上网时间控制配置文档内容 。应用保存后自动重启生效" ))
238
- conf = s :taboption (" timecontrolconf " ,Value ," timecontrolconf " ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
208
+ if nixio .fs .access (" /etc/config/parentcontrol " )then
209
+ s :tab (" parentcontrolconf " ,translate (" 家长控制 " ),translate (" 本页是配置/etc/config/parentcontrol包含家长控制配置文档内容 。应用保存后自动重启生效" ))
210
+ conf = s :taboption (" parentcontrolconf " ,Value ," parentcontrolconf " ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
239
211
conf .template = " cbi/tvalue"
240
212
conf .rows = 20
241
213
conf .wrap = " off"
242
214
conf .cfgvalue = function (t ,t )
243
- return e .readfile (" /etc/config/timecontrol " )or " "
215
+ return e .readfile (" /etc/config/parentcontrol " )or " "
244
216
end
245
217
conf .write = function (a ,a ,t )
246
218
if t then
247
219
t = t :gsub (" \r\n ?" ," \n " )
248
- e .writefile (" /tmp/timecontrol " ,t )
249
- if (luci .sys .call (" cmp -s /tmp/timecontrol /etc/config/timecontrol " )== 1 )then
250
- e .writefile (" /etc/config/timecontrol " ,t )
251
- luci .sys .call (" /etc/init.d/timecontrol restart >/dev/null" )
220
+ e .writefile (" /tmp/parentcontrol " ,t )
221
+ if (luci .sys .call (" cmp -s /tmp/parentcontrol /etc/config/parentcontrol " )== 1 )then
222
+ e .writefile (" /etc/config/parentcontrol " ,t )
223
+ luci .sys .call (" /etc/init.d/parentcontrol restart >/dev/null" )
252
224
end
253
- e .remove (" /tmp/timecontrol " )
225
+ e .remove (" /tmp/parentcontrol " )
254
226
end
255
227
end
256
228
end
257
- if nixio .fs .access (" /etc/config/rebootschedule" )then
258
- s :tab (" rebootscheduleconf" ,translate (" 定时设置" ),translate (" 本页是配置/etc/config/rebootschedule包含定时设置任务配置文档内容。应用保存后自动重启生效" ))
259
- conf = s :taboption (" rebootscheduleconf" ,Value ," rebootscheduleconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
229
+
230
+ if nixio .fs .access (" /etc/config/autotimeset" )then
231
+ s :tab (" autotimesetconf" ,translate (" 定时设置" ),translate (" 本页是配置/etc/config/autotimeset包含定时设置任务配置文档内容。应用保存后自动重启生效" ))
232
+ conf = s :taboption (" autotimesetconf" ,Value ," autotimesetconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
260
233
conf .template = " cbi/tvalue"
261
234
conf .rows = 20
262
235
conf .wrap = " off"
263
236
conf .cfgvalue = function (t ,t )
264
- return e .readfile (" /etc/config/rebootschedule " )or " "
237
+ return e .readfile (" /etc/config/autotimeset " )or " "
265
238
end
266
239
conf .write = function (a ,a ,t )
267
240
if t then
268
241
t = t :gsub (" \r\n ?" ," \n " )
269
- e .writefile (" /tmp/rebootschedule " ,t )
270
- if (luci .sys .call (" cmp -s /tmp/rebootschedule /etc/config/rebootschedule " )== 1 )then
271
- e .writefile (" /etc/config/rebootschedule " ,t )
272
- luci .sys .call (" /etc/init.d/rebootschedule restart >/dev/null" )
242
+ e .writefile (" /tmp/autotimeset " ,t )
243
+ if (luci .sys .call (" cmp -s /tmp/autotimeset /etc/config/autotimeset " )== 1 )then
244
+ e .writefile (" /etc/config/autotimeset " ,t )
245
+ luci .sys .call (" /etc/init.d/autotimeset restart >/dev/null" )
273
246
end
274
- e .remove (" /tmp/rebootschedule " )
247
+ e .remove (" /tmp/autotimeset " )
275
248
end
276
249
end
277
250
end
251
+
278
252
if nixio .fs .access (" /etc/config/wolplus" )then
279
253
s :tab (" wolplusconf" ,translate (" 网络唤醒" ),translate (" 本页是配置/etc/config/wolplus包含网络唤醒配置文档内容。应用保存后自动重启生效" ))
280
254
conf = s :taboption (" wolplusconf" ,Value ," wolplusconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
@@ -318,6 +292,29 @@ e.remove("/tmp/smartdns")
318
292
end
319
293
end
320
294
end
295
+
296
+ if nixio .fs .access (" /etc/config/bypass" )then
297
+ s :tab (" bypassconf" ,translate (" BYPASS" ),translate (" 本页是配置/etc/config/bypass包含bypass配置文档内容。应用保存后自动重启生效" ))
298
+ conf = s :taboption (" bypassconf" ,Value ," bypassconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
299
+ conf .template = " cbi/tvalue"
300
+ conf .rows = 20
301
+ conf .wrap = " off"
302
+ conf .cfgvalue = function (t ,t )
303
+ return e .readfile (" /etc/config/bypass" )or " "
304
+ end
305
+ conf .write = function (a ,a ,t )
306
+ if t then
307
+ t = t :gsub (" \r\n ?" ," \n " )
308
+ e .writefile (" /tmp/bypass" ,t )
309
+ if (luci .sys .call (" cmp -s /tmp/bypass /etc/config/bypass" )== 1 )then
310
+ e .writefile (" /etc/config/bypass" ,t )
311
+ luci .sys .call (" /etc/init.d/bypass restart >/dev/null" )
312
+ end
313
+ e .remove (" /tmp/bypass" )
314
+ end
315
+ end
316
+ end
317
+
321
318
if nixio .fs .access (" /etc/config/openclash" )then
322
319
s :tab (" openclashconf" ,translate (" openclash" ),translate (" 本页是配置/etc/config/openclash的文档内容。应用保存后自动重启生效" ))
323
320
conf = s :taboption (" openclashconf" ,Value ," openclashconf" ,nil ,translate (" 开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。" ))
340
337
end
341
338
end
342
339
343
-
344
340
return m
0 commit comments