Update templates/index.html
Browse files- templates/index.html +28 -0
templates/index.html
CHANGED
|
@@ -125,6 +125,7 @@
|
|
| 125 |
<option value="simple">Simple Path</option>
|
| 126 |
<option value="list_search">List Filter (Get X where Y=Z)</option>
|
| 127 |
<option value="python">Custom Python</option>
|
|
|
|
| 128 |
</select>
|
| 129 |
</div>
|
| 130 |
<div class="col-md-5 text-end">
|
|
@@ -192,6 +193,16 @@
|
|
| 192 |
<input type="text" class="form-control python-expr" placeholder="row['text'].upper() or json.loads(row['meta'])['id']">
|
| 193 |
</div>`;
|
| 194 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
}
|
| 196 |
|
| 197 |
function getRecipe() {
|
|
@@ -264,6 +275,23 @@
|
|
| 264 |
expression: expr
|
| 265 |
});
|
| 266 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
});
|
| 268 |
|
| 269 |
const recipe = {
|
|
|
|
| 125 |
<option value="simple">Simple Path</option>
|
| 126 |
<option value="list_search">List Filter (Get X where Y=Z)</option>
|
| 127 |
<option value="python">Custom Python</option>
|
| 128 |
+
<option value="requests">Request</option>
|
| 129 |
</select>
|
| 130 |
</div>
|
| 131 |
<div class="col-md-5 text-end">
|
|
|
|
| 193 |
<input type="text" class="form-control python-expr" placeholder="row['text'].upper() or json.loads(row['meta'])['id']">
|
| 194 |
</div>`;
|
| 195 |
}
|
| 196 |
+
else if (mode === 'requests') {
|
| 197 |
+
badge.innerText = "Request";
|
| 198 |
+
area.innerHTML = `
|
| 199 |
+
<div class="input-group input-group-sm">
|
| 200 |
+
<span class="input-group-text">url = </span>
|
| 201 |
+
<input type="text" class="form-control request-url" placeholder="row['text'].upper() or json.loads(row['meta'])['id']">
|
| 202 |
+
<span class="input-group-text">payload = </span>
|
| 203 |
+
<input type="text" class="form-control request-payload" placeholder="row['text'].upper() or json.loads(row['meta'])['id']">
|
| 204 |
+
</div>`;
|
| 205 |
+
}
|
| 206 |
}
|
| 207 |
|
| 208 |
function getRecipe() {
|
|
|
|
| 275 |
expression: expr
|
| 276 |
});
|
| 277 |
}
|
| 278 |
+
else if(mode === 'requests') {
|
| 279 |
+
const rurl = r.querySelector('.request-url').value.trim();
|
| 280 |
+
const rpay = r.querySelector('.request-payload').value.trim();
|
| 281 |
+
|
| 282 |
+
if(!rurl || !rpay) {
|
| 283 |
+
console.error(`Python column "${name}" has no expression`);
|
| 284 |
+
alert(`Error: Column "${name}" has no Python expression!`);
|
| 285 |
+
return;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
columns.push({
|
| 289 |
+
type: 'request',
|
| 290 |
+
name: name,
|
| 291 |
+
rurl: rurl,
|
| 292 |
+
rpay: rpay
|
| 293 |
+
});
|
| 294 |
+
}
|
| 295 |
});
|
| 296 |
|
| 297 |
const recipe = {
|