forked from andrewvc/elastic-hammer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
198 lines (171 loc) · 8.46 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Elastic-Hammer</title>
<link type='text/css' rel='stylesheet' style type='text/css' href="assets/codemirror.css"></link>
<link type='text/css' rel='stylesheet' style type='text/css' href="assets/codemirror-addons/lint/lint.css"></link>
<link type='text/css' rel='stylesheet' style type='text/css' href="assets/codemirror-addons/fold/foldgutter.css"></link>
<link type='text/css' rel='stylesheet' style type='text/css' href="assets/codemirror-addons/hint/show-hint.css"></link>
<link type='text/css' rel='stylesheet' style type='text/css' href="assets/style.css"></link>
<script type='text/javascript' src='assets/jquery.js'></script>
<script type='text/javascript' src='assets/knockback.js'></script>
<script type="text/javascript" src="assets/backbone.localStorage.js"></script>
<script type='text/javascript' src="assets/json2.js"></script>
<script type='text/javascript' src='assets/codemirror.js'></script>
<script type='text/javascript' src="assets/codemirror-addons/hint/show-hint.js"></script>
<script type='text/javascript' src="assets/codemirror-addons/hint/javascript-hint.js"></script>
<script type='text/javascript' src="assets/codemirror-addons/fold/foldcode.js"></script>
<script type='text/javascript' src="assets/codemirror-addons/fold/foldgutter.js"></script>
<script type='text/javascript' src="assets/codemirror-addons/fold/brace-fold.js"></script>
<script type='text/javascript' src="assets/codemirror-addons/lint/lint.js"></script>
<script type='text/javascript' src='assets/codemirror-addons/lint/javascript-lint.js'></script>
<script type='text/javascript' src='assets/jsonlint.js'></script>
<script type='text/javascript' src='assets/jshint.js'></script>
<script type='text/javascript' src='assets/codemirror-addons/lint/json-lint.js'></script>
<script type='text/javascript' src='assets/main.js'></script>
<script type='text/javascript'>
window.onbeforeunload = function(e) {
return "Leaving will lose the current state. Request history is always saved.";
};
</script>
</head>
<body>
<header>
<span class='hammerpick'>⚒</span><h1>elastic hammer</h1>
<div class="links">
[
<span id="clear-request-history" data-bind="event: {click: clear}">Clear Hist.</span> |
<a href="http://exploringelasticsearch.com">book</a> |
<a href="https://github.com/andrewvc/elastic-hammer">github</a>
]
</div>
</header>
<datalist id="pathauto" data-bind="foreach: indexes">
<option data-bind="text: index"></option>
</datalist>
<section id="working-data">
<section id="current-request" class="request-form ui-left">
<form data-bind="submit: exec, event: {keypress: checkCtrlEnter}">
<input type='submit' data-bind="value: apiSubmit" id="submit-req" value='▶ Submit (⏎ or CTRL+⏎)' />
<div class='fields'>
<select id="method" class='method' name='method' data-bind="value: method">
<option value='GET'>GET</option>
<option value='PUT'>PUT</option>
<option value='POST'>POST</option>
<option value='DELETE'>DELETE</option>
<option value='HEAD'>HEAD</option>
</select>
<input id='server' class="server" placeholder='http://server:port' name='server' type='text' data-bind="value: server" />
/
<input id='path' placeholder='path' name='path' type='text' data-bind="value: path, event: {focus: fetchIndexes, keyup: updatePath, paste: updatePath}" list="pathauto" />
</div>
<div class="body-cont" data-bind="if: bodyCapable">
<div class="errors" data-bind="text: errors"></div>
<textarea id="current-request-body" name='body' class="body" data-bind="value: body, codemirror: { 'lineNumbers': true, 'matchBrackets': true, 'mode': 'text/typescript', json: true, lint: CodeMirror.lint.json, gutters: ['CodeMirror-lint-markers', 'CodeMirror-foldgutter']}"></textarea>
<br />
<small>
<a href="#" id="format-req" data-bind="event: {click: format}">» Reformat Request</a>
</small>
</div>
</form>
</section>
<section id="last-request" class="request-form ui-right">
<!-- ko if: completed -->
<div data-bind="template: {name: 'historical-request-tmpl'}"></div>
<!-- /ko -->
<!-- ko if: running -->
Executing Request...
<!-- /ko -->
</section>
<div style="clear: both"></div>
</section>
<section id="request-history">
<div id="request-history-title"></div>
<div id="historical-reqs" data-bind="foreach: requests">
<div class="historical-req-cont" data-bind="template: {name: 'historical-request-tmpl'}"></div>
</div>
</section>
<script id="historical-request-tmpl" type="text/html">
<div class="historical-req request">
<div class='body-cont ui-left' data-bind="if: body">
<div class="body">
<textarea readonly='readonly' class='body' data-bind="text: body, autoTextArea: body"></textarea>
</div>
</div>
<div class="resp-info">
<div class="method-path" data-bind="attr: {'data-status-group': statusGroup}">
<span class="method" data-bind="text: method"></span>
<span class="url" data-bind="text: slashPath"></span>
<div>
<table class="req-meta">
<thead>
<th>API</th>
<th>server</th>
<th>rtt</th>
<th>status</th>
<th>state</th>
</thead>
<tbody>
<tr>
<td class='api' data-bind="text: api, attr: {'data-api': api}"></td>
<td class='server' data-bind="text: serverNoProto"></td>
<td class='rtt' data-bind="text: rtt"></td>
<td class='status' data-bind="attr: {'data-status-group': statusGroup}, text: status"></td>
<td class='state' data-bind="attr: {'data-status-group': state}, text: state"></td>
</tr>
</tbody>
</table>
<span class="misc-tools">
<span class='run-again' data-bind="event: {click: runAgain}">↺R<span class="small">un Again</span></span>
/
<span class='save' data-bind="event: {click: save}">↯S<span class="small">ave</span></span>
</span>
</div>
</div>
<!-- ko if: contextMeta -->
<table class='context-meta req-meta' data-bind="with: contextMeta, attr: {'data-shard-failure': shardFailure}">
<thead>
<tr data-bind="foreach: ths">
<th data-bind="text: th"></th>
</tr>
</thead>
<tbody>
<tr data-bind="foreach: tds">
<td data-bind="text: td"></td>
</tr>
</tbody>
</table>
<!-- /ko -->
<div class='response-cont' data-bind="attr: {'data-status-group': statusGroup, 'data-shard-failure': shardFailure}, if: response">
<!-- ko if: formattableResponse -->
<div class="response-switches">
<div class='showResponse' data-bind="event: {click: togglePretty}, attr: {'data-selected': prettyChosen}">Pretty Response</div>
<div class='showResponse' data-bind="event: {click: toggleJson}, attr: {'data-selected': jsonChosen}">JSON Response</div>
<div style="clear: both"></div>
</div>
<!-- /ko -->
<!-- ko if: formattableResponse -->
<!-- ko if: prettyActivated -->
<div class='fmt-nodes fmt-nodes-top' data-bind="html: formattedResponse, event: {click: toggleExpansion}"></div>
<!-- /ko -->
<!-- /ko -->
<!-- ko if: jsonActivated -->
<textarea readonly='readonly' class="response" data-bind="text: responseFmt, autoTextArea: responseFmt" ></textarea>
<!-- /ko -->
</div>
</div>
</div>
</script>
<script type="text/javascript">
if (window.location.hostname === "elastichammer.exploringelasticsearch.com") {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-39929520-2', 'exploringelasticsearch.com');
ga('send', 'pageview');
}
</script>
</body>
</html>