websocket support and route fixes

This commit is contained in:
HRG @ SCExC 2024-06-08 18:29:31 -04:00
parent 897dd38151
commit c40bdcbbed
6 changed files with 218 additions and 84 deletions

View file

@ -10,7 +10,7 @@
<form hx-post="/workshop/<%= it.structure.id %>/route" hx-target="#response">
<div class="field-row-stacked" style="width: 300px">
<label for="path">Path (e.g. /foo/bar)</label>
<div class="flex items-center"><%= it.structure.route_prefix %>/<input name="path" id="name" type="text" class="flex-grow" /></div>
<div class="flex items-center"><%= it.structure.route_prefix || "" %>/<input name="path" id="name" type="text" class="flex-grow" /></div>
</div>
<fieldset>
<legend>verb</legend>
@ -30,6 +30,10 @@
<input id="delete" type="radio" name="verb" value="DELETE">
<label for="delete">DELETE</label>
</div>
<div class="field-row">
<input id="ws" type="radio" name="verb" value="WS">
<label for="ws">WS</label>
</div>
</fieldset>
<section class="field-row" style="justify-content: flex-end">
<button type="submit">OK</button>

View file

@ -7,7 +7,7 @@
<li>
<a href="/workshop/<%= it.structure.id %>/route/<%= route.id %>">
<%= route.verb %> -
<% if (it.structure.route_prefix) { %><span class="text-gray-500"><%= it.structure.route_prefix %></span><% } %><span class="bold"><%= route.path %></span>
<% if (it.structure.route_prefix) { %><span class="text-gray-500"><%= it.structure.route_prefix %></span><% } %><span class="bold"><%= route.path %></span><% if (route.error) { %>⚠️<% } %>
</a>
</li>
<% }) %>