zdravko/web/templates/pages/settings_worker_groups.tmpl

93 lines
3.1 KiB
Cheetah
Raw Normal View History

2024-02-29 11:15:15 +00:00
{{ define "settings" }}
{{ $description := "Worker Groups are used to match multiple workers together. They can be used to difirentiate between regions, environments, networks etc." }}
{{ $length := len .WorkerGroups }}
{{ if eq $length 0 }}
2024-02-29 11:15:15 +00:00
<div class="py-8 px-4 mx-auto max-w-screen-xl text-center lg:py-16">
<h1
class="mb-4 text-2xl font-extrabold tracking-tight leading-none text-gray-900 md:text-3xl lg:text-4xl"
>
There are no worker groups yet.
</h1>
<p
class="mb-8 text-l font-normal text-gray-700 lg:text-l sm:px-8 lg:px-40"
2024-02-29 11:15:15 +00:00
>
{{ $description }}
</p>
<div class="flex flex-col gap-4 sm:flex-row sm:justify-center">
2024-02-29 11:15:15 +00:00
<a
href="/settings/worker-groups/create"
class="inline-flex justify-center items-center py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300"
>
2024-02-24 21:07:49 +00:00
Create First Worker Group
2024-02-29 11:15:15 +00:00
<svg class="feather ml-1 h-5 w-5 overflow-visible">
<use href="/static/icons/feather-sprite.svg#plus" />
</svg>
2024-02-23 11:18:02 +00:00
</a>
2024-02-29 11:15:15 +00:00
</div>
2024-02-23 11:18:02 +00:00
</div>
2024-02-29 11:15:15 +00:00
{{ else }}
<section>
<table>
<caption>
List of Worker Groups
2024-02-29 14:12:20 +00:00
<div class="mt-1 gap-4 grid grid-cols-1 md:grid-cols-[1fr,20%]">
2024-02-29 11:15:15 +00:00
<p>
{{ $description }}
</p>
<a
href="/settings/worker-groups/create"
2024-02-29 14:12:20 +00:00
class="h-min inline-flex justify-center items-center py-2 px-4 text-sm font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300"
2024-02-29 11:15:15 +00:00
>
Create New
<svg class="feather h-5 w-5 overflow-visible">
<use href="/static/icons/feather-sprite.svg#plus" />
</svg>
</a>
</div>
</caption>
<thead>
2024-02-23 11:18:02 +00:00
<tr>
2024-02-29 11:15:15 +00:00
<th>Name</th>
<th>Workers</th>
<th>Monitors</th>
<th>Action</th>
2024-02-23 11:18:02 +00:00
</tr>
2024-02-29 11:15:15 +00:00
</thead>
2024-03-03 14:28:25 +00:00
<tbody>
{{ range .WorkerGroups }}
2024-02-29 11:15:15 +00:00
<tr>
2024-02-24 21:07:49 +00:00
<th scope="row">
2024-02-29 11:15:15 +00:00
{{ .Name }}
2024-02-23 11:18:02 +00:00
</th>
2024-02-24 21:07:49 +00:00
<td>
{{ if eq ( len .ActiveWorkers) 0 }}
2024-02-29 11:15:15 +00:00
<span
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800"
>
NONE
</span>
{{ else }}
2024-02-29 11:15:15 +00:00
<span
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"
>
{{ len .ActiveWorkers }} ONLINE
</span>
{{ end }}
2024-02-23 11:18:02 +00:00
</td>
2024-02-24 21:07:49 +00:00
<td>
2024-02-29 11:15:15 +00:00
{{ len .Monitors }}
2024-02-24 21:07:49 +00:00
</td>
<td>
2024-02-29 22:42:56 +00:00
<a href="/settings/worker-groups/{{ .Id }}" class="link"
2024-02-29 11:15:15 +00:00
>Details</a
>
2024-02-23 11:18:02 +00:00
</td>
2024-02-29 11:15:15 +00:00
</tr>
2024-03-03 14:28:25 +00:00
{{ end }}
</tbody>
2024-02-29 11:15:15 +00:00
</table>
</section>
{{ end }}
{{ end }}