-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
276 lines (273 loc) · 8.01 KB
/
index.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
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="txt/html; charset=utf-8" />
<title>接口测试</title>
<link href="s.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<fieldset>
<legend>当前地址</legend>
<input id="locationText" style="width:100%" type="text" />
</fieldset>
<fieldset>
<legend>接口地址</legend>
<input id="actionText" style="width:100%" type="text" />
</fieldset>
<fieldset id="apiPanel" onclick="onApiChange()">
<legend>Api方法</legend>
<label>
<input type="radio" value="ajax" checked name="api" />
AJAX
</label>
<label>
<input type="radio" value="form" name="api" />
FORM
</label>
<label>
<input type="radio" value="fetch" name="api" />
FETCH
</label>
<label>
<input type="radio" value="beacon" name="api" />
BEACON
</label>
</fieldset>
<fieldset id="methodPanel" >
<legend>请求方法</legend>
<label>
<input type="radio" value="post" checked name="method" />
POST
</label>
<label>
<input type="radio" value="get" name="method" />
GET
</label>
</fieldset>
<fieldset id="targetPanel" style="display: none;" onclick="onTargetChange()">
<legend>Form打开位置</legend>
<label>
<input type="radio" value="resultFrame" checked name="target" />
当前页面iframe
</label>
<label>
<input type="radio" value="_blank" name="target" />
新页面
</label>
</fieldset>
<fieldset id="enctypePanel" style="display: none;">
<legend>Form编码</legend>
<label>
<input type="radio" value="" checked name="enctype" />
默认
</label>
<label>
<input type="radio" value="application/x-www-form-urlencoded" name="enctype" />
application/x-www-form-urlencoded
</label>
<label>
<input type="radio" value="multipart/form-data" name="enctype" />
multipart/form-data
</label>
<label>
<input type="radio" value="text/plain" name="enctype" />
text/plain
</label>
</fieldset>
<fieldset id="contentTypePanel">
<legend>Content-Type</legend>
<label>
<input type="radio" value="" checked name="contentType" />
默认
</label>
<label>
<input type="radio" value="application/x-www-form-urlencoded" name="contentType" />
application/x-www-form-urlencoded
</label>
<label>
<input type="radio" value="multipart/form-data" name="contentType" />
multipart/form-data
</label>
<label>
<input type="radio" value="text/plain;charset=UTF-8" name="contentType" />
text/plain;charset=UTF-8
</label>
</fieldset>
<fieldset id="responseTypePanel">
<legend>响应类型</legend>
<label>
<input type="radio" value="" checked name="responseType" />
默认
</label>
<label>
<input type="radio" value="json" name="responseType" />
json
</label>
<label>
<input type="radio" value="text" name="responseType" />
text
</label>
<label>
<input type="radio" value="document" name="responseType" />
document
</label>
<label>
<input type="radio" value="arraybuffer" name="responseType" />
arrayBuffer
</label>
<label>
<input type="radio" value="blob" name="responseType" />
blob
</label>
</fieldset>
<fieldset id="corsPanel">
<legend>跨域授权</legend>
<label>
<input id="withCredentialsCheck" type="checkbox" />
withCredentials
</label>
</fieldset>
<fieldset id="fetchModelPanel" style="display: none;">
<legend>Fetch请求模式</legend>
<label>
<input type="radio" value="" checked name="fetchMode" />
默认
</label>
<label>
<input type="radio" value="cors" name="fetchMode" />
cors
</label>
<label>
<input type="radio" value="no-cors" name="fetchMode" />
no-cors
</label>
<label>
<input type="radio" value="same-origin" name="fetchMode" />
same-origin
</label>
<label>
<input type="radio" value="navigate" name="fetchMode" />
navigate
</label>
</fieldset>
<fieldset id="fetchResponseTypePanel" style="display: none;">
<legend>Fetch处理方法</legend>
<label>
<input type="radio" checked value="text" name="fetchResponseType" />
text
</label>
<label>
<input type="radio" value="json" name="fetchResponseType" />
json
</label>
<label>
<input type="radio" value="blob" name="fetchResponseType" />
blob
</label>
<label>
<input type="radio" value="formData" name="fetchResponseType" />
FormData
</label>
<label>
<input type="radio" value="arrayBuffer" name="fetchResponseType" />
arrayBuffer
</label>
</fieldset>
<fieldset id="dataTypePanel" onclick="onDataTypeChange()" >
<legend>数据内容</legend>
<label>
<input type="radio" checked value="kv" name="dataType" />
使用键值对
</label>
<label>
<input type="radio" value="formData" name="dataType" />
使用FormData
</label>
<label>
<input type="radio" value="text" name="dataType" />
使用文本
</label>
<label>
<input type="radio" value="blob" name="dataType" />
使用blob
</label>
</fieldset>
<fieldset id="headerListPanel">
<legend>请求头</legend>
<button onclick="addHeaderItem()">添加请求头</button><br>
<div id="headerList">
</div>
</fieldset>
<fieldset id="dataListPanel">
<legend>请求数据</legend>
<div id="dataKvListBtns">
<button onclick="addKvDataItem()">添加数据</button>
</div>
<div id="dataKvList"></div>
<div id="dataFormListBtns" style="display: none;">
<button onclick="addFormDataItem()">添加数据</button><button onclick="addFormFileItem()">添加文件</button>
</div>
<form id="dataFormList" style="display: none;"></form>
<textarea style="display: none;width: 100%;" id="dataText"></textarea>
<input style="display: none;" type="file" id="dataFile" />
</fieldset>
<div id="submitPanel">
<button onclick="doSubmit()">提交</button><button onclick="clearResult()">清空结果</button>
</div>
<fieldset id="responsePanel">
<legend>响应信息</legend>
<div id="responseText"></div>
</fieldset>
<fieldset id="resultPanel">
<legend>返回结果</legend>
<div id="resultBtns">
<button id="resultClipBtn" data-clipboard-target="#resultText" >复制</button><button onclick="doFormatJson()">格式化为JSON</button>
</div>
<textarea id="resultText" style="width: 100%;">
</textarea>
<div id="jsonResultPanel" style="display: none;">
<span id="TabSizeHolder">
缩进量
<select id="TabSize" onchange="TabSizeChanged()">
<option value="1">1</option>
<option value="2" selected="true">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</span>
<label for="QuoteKeys">
<input type="checkbox" id="QuoteKeys" onclick="QuoteKeysClicked()" checked="true" />
引号
</label>
<span id="CollapsibleViewHolder" >
<label for="CollapsibleView">
<input type="checkbox" id="CollapsibleView" onclick="CollapsibleViewClicked()" checked="true" />
显示控制
</label>
</span>
<span id="CollapsibleViewDetail">
<a href="javascript:void(0);" onclick="ExpandAllClicked()">展开</a>
<a href="javascript:void(0);" onclick="CollapseAllClicked()">叠起</a>
<a href="javascript:void(0);" onclick="CollapseLevel(3)">2级</a>
<a href="javascript:void(0);" onclick="CollapseLevel(4)">3级</a>
<a href="javascript:void(0);" onclick="CollapseLevel(5)">4级</a>
<a href="javascript:void(0);" onclick="CollapseLevel(6)">5级</a>
<a href="javascript:void(0);" onclick="CollapseLevel(7)">6级</a>
<a href="javascript:void(0);" onclick="CollapseLevel(8)">7级</a>
<a href="javascript:void(0);" onclick="CollapseLevel(9)">8级</a>
</span>
<div id="Canvas" class="Canvas"></div>
</div>
</fieldset>
<fieldset id="resultFramePanel">
<legend>IFrame页面</legend>
<iframe id="resultFrameEle" style="display:none;width: 100%;" name="resultFrame"></iframe>
</fieldset>
<script src="ui.js" type="text/javascript"></script>
<script src="api.js" type="text/javascript"></script>
<script src="c.js" type="text/javascript"></script>
</body>
</html>