forked from Jackysi/advancedtomato-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-debug.asp
119 lines (104 loc) · 5.24 KB
/
admin-debug.asp
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
<!--
Tomato GUI
Copyright (C) 2006-2010 Jonathan Zarate
http://www.polarcloud.com/tomato/
For use with Tomato Firmware only.
No part of this file may be used without permission.
--><title>Debugging</title>
<content>
<style>table.fields-table tr td:first-child { width: 40%; }</style>
<script type="text/javascript">
// <% nvram("at_update,tomatoanon_answer,debug_nocommit,debug_cprintf,debug_cprintf_file,console_loglevel,t_cafree,t_hidelr,debug_ddns,debug_norestart"); %>
function nvramCommit()
{
fields.disableAll('_fom', 1);
form.submitHidden('nvcommit.cgi', { '_nextpage': myName() });
}
function verifyFields(focused, quiet)
{
return 1;
}
function save()
{
var fom = E('_fom');
fom.debug_nocommit.value = fom.f_debug_nocommit.checked ? 1 : 0;
fom.debug_cprintf.value = fom.f_debug_cprintf.checked ? 1 : 0;
fom.debug_cprintf_file.value = fom.f_debug_cprintf_file.checked ? 1 : 0;
fom.t_cafree.value = fom.f_cafree.checked ? 1 : 0;
fom.t_hidelr.value = fom.f_hidelr.checked ? 1 : 0;
fom.debug_ddns.value = fom.f_debug_ddns.checked ? 1 : 0;
var a = [];
if (fom.f_nr_crond.checked) a.push('crond');
if (fom.f_nr_dnsmasq.checked) a.push('dnsmasq');
/* LINUX26-BEGIN */
if (fom.f_nr_hotplug2.checked) a.push('hotplug2');
/* LINUX26-END */
/* IPV6-BEGIN */
if (fom.f_nr_radvd.checked) a.push('radvd');
/* IPV6-END */
if (fom.f_nr_igmprt.checked) a.push('igmprt');
fom.debug_norestart.value = a.join(',');
form.submit(fom, 1);
}
</script>
<form id="_fom" method="post" action="tomato.cgi">
<input type="hidden" name="_nextpage" value="/#admin-misc.asp">
<input type="hidden" name="debug_nocommit">
<input type="hidden" name="debug_cprintf">
<input type="hidden" name="debug_cprintf_file">
<input type="hidden" name="debug_ddns">
<input type="hidden" name="debug_norestart">
<input type="hidden" name="t_cafree">
<input type="hidden" name="t_hidelr">
<div class="alert alert-warning icon">
<h5>Warning!</h5> The NVRAM Dump text file may contain information like wireless
encryption keys and usernames/passwords for the router, ISP and DDNS. Please
review & edit this file before sharing it with
anyone.
</div>
<div class="box">
<div class="heading">Debugging Settings & Information</div>
<div class="content">
<div id="debug"></div>
<script type="text/javascript">
a = [];
for (i = 1; i <= 8; ++i) a.push([i, i]);
$('#debug').forms([
{ title: 'Avoid performing an NVRAM commit', name: 'f_debug_nocommit', type: 'checkbox', value: nvram.debug_nocommit != '0' },
{ title: 'Enable cprintf output to console', name: 'f_debug_cprintf', type: 'checkbox', value: nvram.debug_cprintf != '0' },
{ title: 'Enable cprintf output to /tmp/cprintf', name: 'f_debug_cprintf_file', type: 'checkbox', value: nvram.debug_cprintf_file != '0' },
{ title: 'Enable DDNS output to /tmp/mdu-*', name: 'f_debug_ddns', type: 'checkbox', value: nvram.debug_ddns != '0' },
{ title: 'Count cache memory and buffers as free memory', name: 'f_cafree', type: 'checkbox', value: nvram.t_cafree == '1' },
{ title: 'Avoid displaying LAN to router connections', name: 'f_hidelr', type: 'checkbox', value: nvram.t_hidelr == '1' },
{ title: 'Console log level', name: 'console_loglevel', type: 'select', options: a, value: fixInt(nvram.console_loglevel, 1, 8, 1) },
{ title: 'Do not restart the following process if they die', multi: [
{ name: 'f_nr_crond', type: 'checkbox', suffix: ' crond<br>', value: (nvram.debug_norestart.indexOf('crond') != -1) },
{ name: 'f_nr_dnsmasq', type: 'checkbox', suffix: ' dnsmasq<br>', value: (nvram.debug_norestart.indexOf('dnsmasq') != -1) },
/* LINUX26-BEGIN */
{ name: 'f_nr_hotplug2', type: 'checkbox', suffix: ' hotplug2<br>', value: (nvram.debug_norestart.indexOf('hotplug2') != -1) },
/* LINUX26-END */
/* IPV6-BEGIN */
{ name: 'f_nr_radvd', type: 'checkbox', suffix: ' radvd<br>', value: (nvram.debug_norestart.indexOf('radvd') != -1) },
/* IPV6-END */
{ name: 'f_nr_igmprt', type: 'checkbox', suffix: ' igmprt<br>', value: (nvram.debug_norestart.indexOf('igmprt') != -1) }
] }
]);
</script>
<hr>
» <a href="#clearcookies.asp">Clear Cookies</a><br>
» <a href="javascript:nvramCommit()">NVRAM Commit</a><br>
<br>
» <a href="/cfe/cfe.bin?_http_id=<% nv(http_id); %>">Download CFE</a><br>
» <a href="/ipt/iptables.txt?_http_id=<% nv(http_id); %>">Download Iptables Dump</a><br>
<!-- IPV6-BEGIN -->
» <a href="/ip6t/ip6tables.txt?_http_id=<% nv(http_id); %>">Download Ip6tables Dump</a><br>
<!-- IPV6-END -->
» <a href="/logs/syslog.txt?_http_id=<% nv(http_id); %>">Download Logs</a><br>
» <a href="/nvram/nvram.txt?_http_id=<% nv(http_id); %>">Download NVRAM Dump</a>
</div>
</div>
<button type="button" value="Save" id="save-button" onclick="save()" class="btn btn-primary">Save <i class="icon-check"></i></button>
<button type="button" value="Cancel" id="cancel-button" onclick="javascript:reloadPage();" class="btn">Cancel <i class="icon-cancel"></i></button>
<span id="footer-msg" class="alert alert-warning" style="visibility: hidden;"></span>
</form>
</content>