add start/pause (to improve further)

This commit is contained in:
Ettore Di Giacinto
2024-04-13 00:38:58 +02:00
parent 74b158e9f1
commit 54de6221d1
4 changed files with 77 additions and 0 deletions

View File

@@ -40,6 +40,12 @@
<th scope="col" class="px-6 py-3 text-center">
<span class="sr-only">Talk</span>
</th>
<th scope="col" class="px-6 py-3 text-center">
<span class="sr-only">Start</span>
</th>
<th scope="col" class="px-6 py-3 text-center">
<span class="sr-only">Stop</span>
</th>
<th scope="col" class="px-6 py-3 text-center">
<span class="sr-only">Delete</span>
</th>
@@ -47,10 +53,12 @@
</thead>
<tbody class="bg-gray-800 divide-y divide-gray-700">
<!-- Dynamic agent rows go here -->
{{ $status := .Status }}
{{ range .Agents }}
<tr hx-ext="sse">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-300">{{.}}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-300">
Online: {{ index $status . }}
<a href="/status/{{.}}" class="text-indigo-500 hover:text-indigo-400">
<i class="fas fa-info"></i> Status
</a>
@@ -60,6 +68,16 @@
<i class="fas fa-comments"></i> Talk
</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-center text-sm font-medium">
<button hx-put="/start/{{.}}" class="text-indigo-500 hover:text-indigo-400">
Start
</button>
</td>
<td class="px-6 py-4 whitespace-nowrap text-center text-sm font-medium">
<button hx-put="/pause/{{.}}" class="text-indigo-500 hover:text-indigo-400">
Pause
</button>
</td>
<td class="px-6 py-4 whitespace-nowrap text-center text-sm font-medium">
<a href="/delete/{{.}}" class="text-red-500 hover:text-red-400">
<i class="fas fa-trash-alt"></i> Delete