going somewhere
This commit is contained in:
1 parent
e7cec774d8
commit
8449cf94ee
9 files changed
+106
-24
No files matched your search
+6
-12
@@ -14,25 +14,19 @@
|
||||
class="uk-select"
|
||||
aria-label="Select"
|
||||
class="uk-button uk-button-default"
|
||||
hx-get="/partials/overview/submit_button"
|
||||
hx-get="/partials/actions/action-form"
|
||||
hx-trigger="change,load"
|
||||
hx-target="#submit-button"
|
||||
hx-swap="outerHTML">>
|
||||
hx-target="#action-form"
|
||||
hx-swap="innerHTML">>
|
||||
<option value="create_user">Create User</option>
|
||||
<option value="create_security">Create Security</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label">Event [JSON5]</label>
|
||||
<textarea class="uk-textarea"
|
||||
name="event"
|
||||
style="font: 0.875rem/1.5 Consolas,monaco,monospace"
|
||||
rows="5"
|
||||
placeholder="JSON"></textarea>
|
||||
</div>
|
||||
<div id="action-form"></div>
|
||||
|
||||
|
||||
<div id="submit-button"></div>
|
||||
<div id="parent-div"></div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/uikit@3.15.23/dist/js/uikit.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/uikit@3.15.23/dist/js/uikit-icons.min.js"></script>
|
||||
<script src="https://unpkg.com/htmx.org@1.8.5"></script>
|
||||
<script src="https://unpkg.com/htmx.org/dist/ext/json-enc.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
<label class="uk-label">
|
||||
<input type="text" name="event.name">
|
||||
|
||||
</label>
|
||||
|
||||
{%include "partials/actions/submit_button.html"%}
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label">Event [JSON5]</label>
|
||||
<textarea class="uk-textarea"
|
||||
name="event"
|
||||
style="font: 0.875rem/1.5 Consolas,monaco,monospace"
|
||||
rows="5"
|
||||
placeholder="JSON"></textarea>
|
||||
</div>
|
||||
|
||||
{%include "partials/actions/submit_button.html"%}
|
||||
+2
-1
@@ -3,6 +3,7 @@
|
||||
hx-post="/v1/events/{{event_type}}"
|
||||
hx-trigger="click"
|
||||
hx-target="#event-table-first-row"
|
||||
hx-ext="json-enc"
|
||||
hx-swap="outerHTML">
|
||||
Submit
|
||||
Submit ss
|
||||
</button>
|
||||
@@ -0,0 +1,14 @@
|
||||
(function() {
|
||||
htmx.defineExtension('embedded-json-enc', {
|
||||
onEvent: function (name, evt) {
|
||||
if (name === "htmx:configRequest") {
|
||||
evt.detail.headers['Content-Type'] = "application/json";
|
||||
}
|
||||
},
|
||||
|
||||
encodeParameters : function(xhr, parameters, elt) {
|
||||
xhr.overrideMimeType('text/json');
|
||||
return (JSON.stringify(parameters));
|
||||
}
|
||||
});
|
||||
})()
|
||||
Reference in new issue
Block a user