|
130 | 130 | <label for="json-input">JSON Data:</label><br> |
131 | 131 | <textarea class="json-input form-control" rows="10"></textarea><br> |
132 | 132 | <button class="btn btn-beautify">Beautify JSON</button><br><br> |
133 | | - <label for="json-path">JSON Path (optional):</label><br> |
134 | | - <input type="text" class="json-path form-control" placeholder="e.g., data.chart"><br> |
| 133 | + <label for="json-path-json">JSON Path (optional):</label><br> |
| 134 | + <input type="text" class="json-path-json form-control" placeholder="e.g., data.chart"><br> |
135 | 135 | </div> |
136 | 136 | <div class="view-http hidden"> |
137 | 137 | <form id="requestForm"> |
|
150 | 150 | <label for="body">Body</label><br> |
151 | 151 | <textarea class="http-body form-control" placeholder='{"key1": "value1", "key2": "value2"}'></textarea><br> |
152 | 152 | </div> |
| 153 | + <div class="jsonPathContainer"> |
| 154 | + <label for="json-path-http">JSON Path (optional):</label><br> |
| 155 | + <input type="text" class="json-path-http form-control" placeholder="e.g., data.chart"><br> |
| 156 | + </div> |
153 | 157 | </form> |
154 | 158 | </div> |
155 | 159 | <div class="view-chart" style="display:none;"> |
|
227 | 231 | try { |
228 | 232 | if (inputType === 'json') { |
229 | 233 | const jsonData = box.querySelector('.json-input').value; |
230 | | - const jsonPath = box.querySelector('.json-path').value; |
| 234 | + const jsonPath = box.querySelector('.json-path-json').value; |
231 | 235 | plotData = JSON.parse(jsonData); |
232 | 236 | if (jsonPath) { |
233 | 237 | const pathParts = jsonPath.split('.'); |
|
254 | 258 | body: method === 'POST' ? body : null |
255 | 259 | }); |
256 | 260 | const jsonData = await response.json(); |
257 | | - const jsonPath = box.querySelector('.json-path').value; |
| 261 | + const jsonPath = box.querySelector('.json-path-http').value; |
258 | 262 | plotData = jsonData; |
259 | 263 | if (jsonPath) { |
260 | 264 | const pathParts = jsonPath.split('.'); |
|
0 commit comments