diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-13 13:22:20 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-13 13:22:20 +1000 |
| commit | df0737e55afeb5c01eb39909605970d1d3a73ffc (patch) | |
| tree | 09823eaa310c60eefd2420dc305acae45c81900f /src/marlin.web/Views/Agents | |
| parent | ee69ce25b2fba871920260028bb10c2d6b62b26f (diff) | |
refactor: cleanup; feat: connection to agent
Diffstat (limited to 'src/marlin.web/Views/Agents')
| -rw-r--r-- | src/marlin.web/Views/Agents/Create.cshtml | 9 | ||||
| -rw-r--r-- | src/marlin.web/Views/Agents/Details.cshtml | 67 | ||||
| -rw-r--r-- | src/marlin.web/Views/Agents/List.cshtml | 32 |
3 files changed, 108 insertions, 0 deletions
diff --git a/src/marlin.web/Views/Agents/Create.cshtml b/src/marlin.web/Views/Agents/Create.cshtml new file mode 100644 index 0000000..4f0f31a --- /dev/null +++ b/src/marlin.web/Views/Agents/Create.cshtml @@ -0,0 +1,9 @@ +@using marlin.core.models + +<form method="post" asp-action="Create"> + Name: <input type="text" name="@nameof(Agent.Name)" /><br/> + Max Concurrent Jobs: <input type="number" name="@nameof(Agent.MaxConcurrentJobs)" value="1"/><br/> + <button type="submit">Create</button> +</form> + +<a asp-action="List">Back</a> diff --git a/src/marlin.web/Views/Agents/Details.cshtml b/src/marlin.web/Views/Agents/Details.cshtml new file mode 100644 index 0000000..3512a98 --- /dev/null +++ b/src/marlin.web/Views/Agents/Details.cshtml @@ -0,0 +1,67 @@ +@using marlin.core.models +@model Agent + +<div class="row"> + <div class="col"> + <h3>Details</h3> + <hr/> + <form method="post" asp-route-id="@Model.Id" asp-action="Edit"> + <dl> + <dt>Name</dt> + <dd> + <input type="text" name="@nameof(Agent.Name)" value="@Model.Name"/> + </dd> + + <dt>Max Concurrent Jobs</dt> + <dd> + <input type="number" name="@nameof(Agent.MaxConcurrentJobs)" value="@Model.MaxConcurrentJobs"/> + </dd> + + <dt>Last Seen</dt> + <dd> + @Model.LastSeen.ToString("G") + </dd> + + <button type="submit">Save</button> + </dl> + </form> + </div> + + <div class="col"> + <h3>Setup</h3> + <hr/> + <form method="post" asp-route-id="@Model.Id" asp-action="RegenerateToken"> + <dl> + <dt>Agent ID</dt> + <dd> + @Model.Id + </dd> + + <dt>Auth Token</dt> + <dd> + @Model.AuthToken + </dd> + + <button type="submit">Regenerate</button> + </dl> + </form> + </div> +</div> + +<h3>Capabilities</h3> +<hr/> +<table class="vertable"> + <tbody> + @foreach (var capability in Model.Capabilities.Items) + { + <tr> + <td>@capability.Key</td> + <td>@capability.Value</td> + </tr> + } + </tbody> +</table> + +<a asp-controller="Jobs" asp-action="List" asp-route-Agent="@Model.Id" asp-route-Status="@JobStatus.Active">Active + jobs</a> +<a asp-action="List">Back</a> diff --git a/src/marlin.web/Views/Agents/List.cshtml b/src/marlin.web/Views/Agents/List.cshtml new file mode 100644 index 0000000..cb0e0df --- /dev/null +++ b/src/marlin.web/Views/Agents/List.cshtml @@ -0,0 +1,32 @@ +@model ICollection<Agent> + +<a asp-action="Create">New</a> + +<table> + <thead> + <tr> + <th>name</th> + <th>seen</th> + <th>status</th> + </tr> + </thead> + <tbody> + @foreach (var agent in Model) + { + <tr> + <td><a asp-action="Details" asp-route-id="@agent.Id">@agent.Name</a></td> + <td>@agent.LastSeen.ToString("G")</td> + <td> + @if (agent.Jobs.Any()) + { + <span>processing @agent.Jobs.Count jobs</span> + } + else + { + <span>idling</span> + } + </td> + </tr> + } + </tbody> +</table>
\ No newline at end of file |
