-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
196 lines (180 loc) · 6.92 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0" />
<title>restclient</title>
<link rel="shortcut icon" href="css/favicon.ico">
<link rel="stylesheet" href="css/vendor/normalize.css">
<link rel="stylesheet" href="css/vendor/foundation.css" />
<link rel="stylesheet" href="css/fonts/foundation-icons.css" />
<link rel="stylesheet" href="css/vendor/pace.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars">
{{outlet}}
{{outlet modal}}
</script>
<script type="text/x-handlebars" id="index">
<div class="row">
<div class="row collapse">
<div class="small-2 columns">
{{view Ember.Select contentBinding="Methods" selectionBinding="method"
optionLabelPath="content" optionValuePath="content" }}
</div>
<div class="small-7 columns">
{{input value=url action="call"}}
</div>
<div class="small-1 columns">
<a class="button icon postfix" {{action call}}>
<i class="fi-play"></i>
</a>
</div>
<div class="small-1 columns">
<a class="button icon secondary postfix" {{action call true}}>
<i class="fi-refresh"></i>
</a>
</div>
<div class="small-1 columns">
<a class="button icon secondary postfix" {{action clean}}>
<i class="fi-asterisk"></i>
</a>
</div>
</div>
</div>
<div class="row collapse">
<div class="large-4 medium-12 columns foreground">
{{#if History.length}}
<div class="history">
<table class="clickable small-12">
{{#each item in History}}
<tr {{action select item}}>
<td class="small-1">
<span {{bind-attr class="item.methodColor"}}>{{item.method}}</span>
</td>
<td class="small-10">
<div class="over">
{{#if item.serverPath.server}}
<span class=server>{{item.serverPath.server}}</span><br/>
{{/if}}
{{item.serverPath.path}}
</div>
</td>
<td class="small-1 text-right" {{action remove item}}>
<a><i class="fi-x"></i></a>
</td>
</tr>
{{/each}}
</table>
</div>
{{/if}}
<h4>request</h4>
{{view TextAreaView value=body}}
{{view HeadersView}}
<div style="margin-bottom: 1.5em;"><a {{action openModal 'settingsModal'}}>
<i class="fi-wrench"></i> settings
</a></div>
</div>
<div class="large-8 medium-12 columns response">
{{#if selected}}
{{view ResponseView}}
{{/if}}
</div>
</div>
</script>
<script type="text/x-handlebars" id="response">
<div class="clearfix">
<h4 class="left">response </h4>
<a class="button icon tiny right" {{action remove selected}}>
<i class="fi-x"></i>
</a>
<a class="button icon secondary tiny right" {{action toggle target="view"}}>
<i class="fi-list"></i>
</a>
</div>
{{#if selected.response.code}}
<span {{bind-attr class="success"}}>{{selected.response.code}}</span>
{{/if}}
<table class="small-12">
{{#if view.headers}}
{{#if selected.response.headers}}
{{#each item in selected.response.headers}}
<tr><td>{{item.name}}</td><td>{{item.value}}</td></tr>
{{/each}}
{{else}}
<tr><td><i>no headers</i></td><td></td></tr>
{{/if}}
{{/if}}
</table>
<pre>{{selected.response.body}}</pre>
</script>
<script type="text/x-handlebars" id="headers">
{{#if headers.length}}
<table class="small-12">
{{#each h in headers}}
<tr>
<td class="large-5 small-4">
<div class="input-inline">{{view Ember.TextField value=h.name list="headers" }}</div>
</td>
<td class="large-7 small-8">
<div class="input-inline">{{view Ember.TextField value=h.value class="input-inline"}}</div>
</td>
<td>
<a {{action removeHeader h}}> <i class="fi-x"></i></a>
</td>
</tr>
{{/each}}
</table>
{{/if}}
<a {{action addHeader}}><i class="fi-plus"></i> header</a>
<datalist id=headers >
{{#each ch in CommonHeaders}}
<option>{{ch}}
{{/each}}
</datalist>
</script>
<script type="text/x-handlebars" id="settingsModal">
{{view SettingsView}}
</script>
<script type="text/x-handlebars" id="settings">
<div id="settingsModal" class="reveal-modal">
<a class="close-reveal-modal" {{action closeModal}}>×</a>
<h3>Settings</h3>
<p>Here you can restore or backup your request history.</p>
<a {{action toggleResponse target=view}}>
{{view Ember.Checkbox checkedBinding="view.withoutResponse"}}
ignore responses
</a>
<a {{action toggleCleanHistory target=view}}>
{{view Ember.Checkbox checkedBinding="view.cleanHistory"}} clean history
</a>
<h4>History</h4>
{{view TextAreaView value=data}}
<h4>Apiary Blueprint</h4>
{{view TextAreaView value=blueprint}}
<p>
You can also import Apiary blueprint to the request history.
Note that blueprint will be sent to the Apiary server for parsing.
Same-origin policy has to be disabled for this to work, or you can import already parsed
blueprint in <a target="_blank" href="http://apiblueprint.org/#examples">AST json format</a>.
</p>
<a class="button small" {{action saveSettings}}>OK</a>
<a class="button small secondary" {{action closeModal}}>Cancel</a>
</div>
<div class="reveal-modal-bg" style="display: block;"></div>
</script>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.3.1.js"></script>
<script src="js/libs/foundation.min.js"></script>
<script src="js/libs/pace.min.js"></script>
<script src="js/libs/vkbeautify.0.99.00.beta.js"></script>
<script src="js/app.js"></script>
<!-- plugins -->
<script src="js/plugins/headerBasicAuth.js"></script>
<script src="js/plugins/headerSignature.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
</body>
</html>