Add run now button for jobs with HTMX

This commit is contained in:
StarFleetCPTN
2025-03-08 07:50:44 -08:00
parent 30ded57293
commit f4c8c2121c
3 changed files with 11 additions and 1 deletions
View File
+3
View File
@@ -50,3 +50,6 @@ data/
# Ignore the tmp directory # Ignore the tmp directory
tmp/ tmp/
# Ignore the configs directory
configs/
+7
View File
@@ -68,6 +68,13 @@ templ Jobs(ctx context.Context, data JobsData) {
} }
</div> </div>
<div class="ml-2 flex-shrink-0 flex space-x-2"> <div class="ml-2 flex-shrink-0 flex space-x-2">
<button
hx-post={ fmt.Sprintf("/jobs/%d/run", job.ID) }
hx-swap="none"
class="btn-primary btn-sm">
<i class="fas fa-play mr-1"></i>
Run Now
</button>
<a href={ templ.SafeURL(fmt.Sprintf("/jobs/%d", job.ID)) } class="btn-secondary btn-sm"> <a href={ templ.SafeURL(fmt.Sprintf("/jobs/%d", job.ID)) } class="btn-secondary btn-sm">
<i class="fas fa-edit mr-1"></i> <i class="fas fa-edit mr-1"></i>
Edit Edit