forked from gorhill/httpswitchboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrulemanager.html
More file actions
219 lines (214 loc) · 5.53 KB
/
rulemanager.html
File metadata and controls
219 lines (214 loc) · 5.53 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HTTP Switchboard — Rule manager</title>
<style>
body {
padding: 0 0 8em 0;
font: 15px httpsb,sans-serif;
box-sizing: border-box;
}
h2 + *, h1 + * {
margin: 0 2em;
}
table {
border: 0;
border-collapse: collapse;
}
table td {
margin: 0;
border: 0;
padding: 4px 0;
vertical-align: top;
}
table td h2 {
margin: 0 0 0.75em 0;
}
textarea {
box-sizing: border-box;
width: 99%;
height: 20em;
}
#recipeDecode, #recipeImport, #recipeEncode, #recipeExport {
cursor: pointer;
opacity: 0.5;
}
#recipeImport, #recipeExport {
padding-top: 32px;
display: inline-block;
}
#recipeDecode, #recipeEncode {
margin: 0 4px;
padding-top: 28px;
display: inline-block;
height: 28px;
}
#recipeDecode {
margin-bottom: 1em;
background: url('img/decode.png') no-repeat center top;
}
#recipeEncode {
margin-top: 1em;
background: url('img/encode.png') no-repeat center top;
}
#recipeImport {
background: url('img/import.png') no-repeat center top;
}
#recipeExport {
background: url('img/export.png') no-repeat center top;
}
#recipeDecode:hover, #recipeImport:hover, #recipeEncode:hover, #recipeExport:hover {
opacity: 1;
}
.recipe {
margin: 2px;
border: 1px solid #ddd;
padding: 1px;
font-family: monospace;
font-size: smaller;
line-height: 110%;
color: #888;
background-color: #f2f2f2;
white-space: pre;
overflow-x: hidden;
}
.scopes ul {
padding-left: 1em;
list-style: none;
}
.scopes > ul {
padding: 0;
}
.scopes > ul > li {
margin: 4px;
border: 1px dotted #ccc;
display: inline-block;
vertical-align: top;
}
.scopes > ul > li:hover {
border: 1px solid #ccc;
}
.scopes > ul > li > *:first-child {
margin: 0;
border: 0;
padding: 2px;
display: block;
}
#global.scopes > ul > li > *:first-child {
background-color: #eee;
}
#global.scopes > ul > li > ul > li > ul {
min-width: 16em;
}
#perpage.scopes > ul > li > *:first-child {
background-color: #eef;
}
#global.scopes > ul > li.scope > ul > li {
margin-left: 2em;
display: inline-block;
vertical-align: top;
}
#global.scopes > ul > li.scope > ul > li:first-child {
margin-left: 0;
}
.scopes > ul > li > .recipe {
margin: 1em 2px 2px 2px;
border: 1px solid #ddd;
padding: 1px;
font-size: 12px;
line-height: 110%;
display: inline-block;
vertical-align: bottom;
width: 20em;
height: 2em;
color: #888;
background-color: #f2f2f2;
white-space: pre;
overflow: hidden;
opacity: 0.25;
}
.scopes > ul > li .recipe:hover {
opacity: 1.0;
}
.scopes > ul > li > ul > li.white {
color: #080;
}
.scopes > ul > li > ul > li.black {
color: #c00;
}
.scopes > ul > li > ul > li.gray {
color: #aaa;
}
.scopes > ul > li > ul > li > ul > li {
cursor: pointer;
}
.scopes > ul > li > ul > li > ul > li:hover {
background-color: #eef;
}
.scopes > ul > li > ul > li > ul > li > span {
display: inline-block;
width: 20px;
height: 20px;
float: right;
}
.scopes > ul > li > ul > li > ul > li.rdp > span {
background: url('img/persist-rd.png') no-repeat;
}
.scopes > ul > li > ul > li > ul > li.gdp > span {
background: url('img/persist-gd.png') no-repeat;
}
.bad {
background-color: #fdd;
}
</style>
<link href='css/fonts.css' rel='stylesheet' type='text/css'>
</head>
<body>
<h1>HTTP Switchboard — Rule manager</h1>
<div>
<p>Consider this feature early <i>beta</i>, use at your own risk. Useful to backup
all of your rules.</p>
<table>
<tr>
<td colspan="2" style="width:49%;"><h2>Rules</h2>
<td>
<td colspan="2" style="width:49%;"><h2>Recipe</h2>
<tr>
<td colspan="2">
Syntax is very strict, only the most geeky users should risk editing here.
If you are importing a recipe from an untrusted source, be sure there is nothing
wrong with it (ex.: <b>“whitelist * evil.com”</b>)
<td>
<td colspan="2">
A “recipe” is just a set of rules encoded in a way to make it easy to
backup or exchange set of rules between users. Hopefully geekier users will share
their carefully crafted recipes to help less geeky users.
<tr>
<td colspan="2">
<textarea id="recipeBeautiful" class="recipe"></textarea>
<td style="vertical-align:middle;">
<span id="recipeDecode" title="Decode recipe">Decode recipe</span>
<span id="recipeEncode" title="Encode recipe">Encode recipe</span>
<td colspan="2">
<textarea id="recipeUgly" class="recipe"></textarea>
<tr>
<td style="text-align:center;">
<span id="recipeImport" title="Import rules">Import rules</span>
<td style="text-align:center;">
<span id="recipeExport" title="Export rules">Export rules</span>
<td>
<td>
<td>
</table>
<h2>Global permissions</h2>
<p>Here are the current rules which apply by default.</p>
<div class="scopes" id="global"></div>
<h2>Per-page permissions</h2>
<p>Here are the current rules which apply to specific web pages.</p>
<div class="scopes" id="perpage"></div>
</div>
<script src="lib/jquery-2.min.js"></script>
<script src="js/rulemanager.js"></script>
</body>
</html>