more stuff

This commit is contained in:
HRG @ SCExC 2024-06-08 11:42:27 -04:00
parent 835c5fdd66
commit d2ad994716
6 changed files with 84 additions and 50 deletions

View file

@ -10,10 +10,13 @@
<label class="text-xs">Route Prefix</label>
<input name="route_prefix" id="route_prefix" type="text" value="<%= it.defaultRoutePrefix %>" />
</div>
<div class="flex gap-2">
<input id="default-checkbox" type="checkbox" name="cloneDBs" value="true">
<label class="text-xs">Clone DBs</label>
</div>
<div class="text-xs">Clone DBs</div>
<% for (let db of it.dbs) { %>
<div class="flex gap-2">
<input id="<%= db.id %>" type="checkbox" name="clone_dbs" value="<%= db.id %>" <% if (!db.is_aliased) { %> <%= "checked" %> <% } %>>
<label for="<%= db.id %>" class="text-xs"><%= db.alias %> <% if (db.is_aliased) { %>(aliased)<% } %></label>
</div>
<% } %>
<section class="flex flex-end gap-2" style="justify-content: flex-end">
<button class="bg-green-500 rounded p-2 hover:bg-green-700 text-white" type="submit">Clone</button>
<button class="bg-gray-400 rounded p-2 hover:bg-gray-700 text-white" type="button" _="on click trigger closeModal">Cancel</button>

View file

@ -8,9 +8,9 @@
</div>
<div class="window-body">
<form hx-post="/workshop/<%= it.structure.id %>/route" hx-target="#response">
<div class="field-row-stacked" style="width: 200px">
<div class="field-row-stacked" style="width: 300px">
<label for="path">Path (e.g. /foo/bar)</label>
<input name="path" id="name" type="text" />
<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>

View file

@ -20,7 +20,7 @@
<form hx-put="/workshop/<%= it.structure.id %>/settings" hx-target="#result" class="p-2 flex flex-col gap-2 max-w-48">
<div class="field-row-stacked">
<label for="name">Route Prefix</label>
<input name="route_prefix" value="<%= it.structure.route_prefix %>">
<input name="route_prefix" value="<%= it.structure.route_prefix || "" %>">
</div>
<button id="save-btn" type="submit">Save</button>
<div id="result"></div>

View file

@ -6,8 +6,8 @@
<% it.routes.map(route => { %>
<li>
<a href="/workshop/<%= it.structure.id %>/route/<%= route.id %>">
<%= route.verb %> -
<%= it.structure.route_prefix %><%= route.path %>
<%= route.verb %> -
<% if (it.structure.route_prefix) { %><span class="text-gray-500"><%= it.structure.route_prefix %></span><% } %><span class="bold"><%= route.path %></span>
</a>
</li>
<% }) %>
@ -46,6 +46,7 @@
<li class="<% if (it.db?.id == db.id) { %>font-bold text-green-800<% } %>">
<a href="/workshop/<%= it.structure.id %>/db/<%= db.id %>">
<%= db.alias %>
<% if (db.is_aliased) { %>(alias)<% } %>
</a>
</li>
<% }) %>