1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
12 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
13 <meta name='robots' content='noindex,nofollow'
>
14 <title>[<%
ident(); %>] Access Restrictions
</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'
>
16 <link rel='stylesheet' type='text/css' href='color.css'
>
17 <script type='text/javascript' src='tomato.js'
></script>
21 <style type='text/css'
>
28 #res-over-grid .footer
{
36 <script type='text/javascript' src='debug.js'
></script>
38 <script type='text/javascript'
>
39 // <% nvram(''); %> // http_id
40 // <% nvramseq("rrules", "rrule%d", 0, 49); %>
42 var dowNames
= ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
44 var og
= new TomatoGrid();
45 og
.setup = function() {
46 this.init('res-over-grid', 'sort');
47 this.headerSet(['Description', 'Schedule']);
48 var r
= this.footerSet(['<input type="button" value="Add" onclick="TGO(this).addEntry()" id="res-over-add">']);
49 r
.cells
[0].colSpan
= 2;
51 og
.populate = function() {
53 for (var i
= 0; i
< rrules
.length
; ++i
) {
55 if ((v
= rrules
[i
].match(/^(\d+)\|(-?\d+)\|(-?\d+)\|(\d+)\|(.*?)\|(.*?)\|([^|]*?)\|(\d+)\|(.*)$/m)) == null) {
60 if (isNaN(v
[1] *= 1)) continue;
61 if (isNaN(v
[2] *= 1)) continue;
62 if (isNaN(v
[3] *= 1)) continue;
69 for (var j
= 0; j
< 7; ++j
) {
70 if (v
[3] & (1 << j
)) {
71 if (s
.length
) s
+= ', ';
77 if ((v
[1] >= 0) && (v
[2] >= 0)) {
78 s
+= '<br>' + timeString(v
[1]) + ' to ' + timeString(v
[2]);
79 if (v
[2] <= v
[1]) s
+= ' <small>(the following day)</small>';
81 if (v
[0] != '1') s
+= '<br><i><b>Disabled</b></i>';
82 this.insertData(-1, [i
, v
[8], s
]);
86 og
.dataToView = function(data
) {
87 return [escapeHTML(data
[1]), data
[2]];
89 og
.onClick = function(cell
) {
90 E('_rruleN').value
= PR(cell
).getRowData()[0];
93 og
.addEntry = function() {
94 for (var i
= 0; i
< 140; ++i
) {
95 if ((rrules
[i
] == null) || (rrules
[i
] == '')) {
96 E('_rruleN').value
= i
;
109 <body onload='init()'
>
110 <form name='_fom' id='_fom' method='post' action='tomato.cgi'
>
111 <table id='container' cellspacing=
0>
112 <tr><td colspan=
2 id='header'
>
113 <div class='title'
>Tomato
</div>
114 <div class='version'
>Version <%
version(); %></div>
116 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
118 <div id='ident'
><%
ident(); %></div>
122 <input type='hidden' name='_redirect' value='restrict-edit.asp'
>
123 <input type='hidden' name='_commit' value='
0'
>
124 <input type='hidden' name='rruleN' id='_rruleN' value=''
>
126 <div class='section-title'
>Access Restriction Overview
</div>
127 <div class='section'
>
128 <table class='tomato-grid' cellspacing=
1 id='res-over-grid'
></table>
132 <script type='text/javascript'
>show_notice1('<% notice("iptables"); %>');</script>
134 <script type='text/javascript'
>show_notice1('<% notice("ip6tables"); %>');</script>
139 <tr><td id='footer' colspan=
2> </td></tr>
142 <script text='text/javascript'
>og.setup();
</script>