diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-14 06:15:40 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-14 06:15:40 +1000 |
| commit | 88ee626cb3686dc176cd7911b073c4e65fa54d34 (patch) | |
| tree | ffd4d27de8b6cce5a43add9fa4222b1d50f1e500 /src/marlin.web/Views/VCS | |
| parent | df0737e55afeb5c01eb39909605970d1d3a73ffc (diff) | |
feat: ui cleanup
Diffstat (limited to 'src/marlin.web/Views/VCS')
| -rw-r--r-- | src/marlin.web/Views/VCS/Create.cshtml | 1 | ||||
| -rw-r--r-- | src/marlin.web/Views/VCS/Details.cshtml | 74 | ||||
| -rw-r--r-- | src/marlin.web/Views/VCS/ListSecret.cshtml | 16 |
3 files changed, 61 insertions, 30 deletions
diff --git a/src/marlin.web/Views/VCS/Create.cshtml b/src/marlin.web/Views/VCS/Create.cshtml index e04592d..5f76192 100644 --- a/src/marlin.web/Views/VCS/Create.cshtml +++ b/src/marlin.web/Views/VCS/Create.cshtml @@ -4,7 +4,6 @@ <form method="post" asp-action="Create"> URL: <input type="text" name="@nameof(VersionControlSource.UpstreamUrl)" /><br/> Filter: <input type="text" name="@nameof(VersionControlSource.BranchFilter)" /><br/> - Main Branch: <input type="text" name="@nameof(VersionControlSource.MainBranch)" /><br/> Polling Interval: <input type="number" name="@nameof(VersionControlSource.MinPollingInterval)" /><br/> <button type="submit">Create</button> </form> diff --git a/src/marlin.web/Views/VCS/Details.cshtml b/src/marlin.web/Views/VCS/Details.cshtml index a9ef0ea..44fa91e 100644 --- a/src/marlin.web/Views/VCS/Details.cshtml +++ b/src/marlin.web/Views/VCS/Details.cshtml @@ -1,55 +1,73 @@ @using marlin.core @using marlin.core.models -@using marlin.web.Controllers -@model (VersionControlSource Source, List<VCSController.SecretOption> SecretOptions) +@model VersionControlSource -<form method="post" asp-route-id="@Model.Source.Id" asp-action="Edit"> - URL: <input type="text" name="@nameof(VersionControlSource.UpstreamUrl)" value="@Model.Source.UpstreamUrl"/><br/> - Filter: <input type="text" name="@nameof(VersionControlSource.BranchFilter)" value="@Model.Source.BranchFilter"/><br/> - Main Branch: <input type="text" name="@nameof(VersionControlSource.MainBranch)" value="@Model.Source.MainBranch"/><br/> - Polling Interval: <input type="number" name="@nameof(VersionControlSource.MinPollingInterval)" value="@Model.Source.MinPollingInterval"/><br/> - Access Secret: - <select name="@nameof(VersionControlSource.AccessSecretId)"> - <option value="">(none)</option> - @foreach (var secret in Model.SecretOptions) - { - <option value="@secret.Id" selected="@(secret.Id == Model.Source.AccessSecretId)">@secret.Label</option> - } - </select><br/> - <button type="submit">Save</button> -</form> +<div class="row"> + <div class="col"> + <h3>Details</h3> + <hr/> + <form method="post" asp-route-id="@Model.Id" asp-action="Edit"> + <dl> + <dt>URL</dt> + <dd><input type="text" name="@nameof(VersionControlSource.UpstreamUrl)" value="@Model.UpstreamUrl"/></dd> + <dt>Filter</dt> + <dd><input type="text" name="@nameof(VersionControlSource.BranchFilter)" value="@Model.BranchFilter"/></dd> + + <dt>Polling Interval</dt> + <dd><input type="number" name="@nameof(VersionControlSource.MinPollingInterval)" value="@Model.MinPollingInterval"/></dd> + </dl> + + <button type="submit">Save</button> + <a asp-action="ListSecret" asp-route-sourceId="@Model.Id">Secrets</a> + <a asp-action="List">Back</a> + </form> + </div> +</div> +<br/> + +<h3>Branches</h3> +<hr/> <table> <thead> <tr> - <th></th> <th>branch</th> <th>commit</th> - <th>status</th> + <th>actions</th> </tr> </thead> <tbody> - @foreach (var branch in Model.Source.Branches) + @foreach (var branch in Model.Branches.OrderByDescending(b => b.Name == Model.MainBranch)) { - <tr> - <td>@(branch.Name == Model.Source.MainBranch ? "@" : "")</td> - <td>@branch.Name</td> + <tr class="@(branch.Name == Model.MainBranch ? "highlighted" : "")"> + <td> + @branch.Name + @if (branch.Name == Model.MainBranch) + { + <span>(primary)</span> + } + </td> <td>@branch.Commit.Hash</td> <td> @if (branch.Commit.BlobsFetched) { <a asp-action="Blobs" asp-route-commitId="@branch.CommitId" asp-route-sourceId="@branch.SourceId">blobs</a> } - + @if (branch.Commit.WorkflowScanned) { <a asp-action="Workflow" asp-route-commitId="@branch.CommitId" asp-route-sourceId="@branch.SourceId">workflow</a> } + + @if (branch.Name != Model.MainBranch) + { + <form method="post" asp-action="SetMainBranch" asp-route-sourceId="@Model.Id" style="display:inline"> + <input type="hidden" name="branchName" value="@branch.Name"/> + <button type="submit" class="btn btn-link p-0">make primary</button> + </form> + } </td> </tr> } </tbody> -</table> - -<a asp-action="ListSecret" asp-route-sourceId="@Model.Source.Id">Secrets</a> -<a asp-action="List">Back</a> +</table>
\ No newline at end of file diff --git a/src/marlin.web/Views/VCS/ListSecret.cshtml b/src/marlin.web/Views/VCS/ListSecret.cshtml index 25db7fe..84e3061 100644 --- a/src/marlin.web/Views/VCS/ListSecret.cshtml +++ b/src/marlin.web/Views/VCS/ListSecret.cshtml @@ -1,5 +1,19 @@ @model (VersionControlSource Source, List<ISecret> Secrets) +<form method="post" asp-action="SetAccessSecret" asp-route-sourceId="@Model.Source.Id"> + <label> + Access Secret + <select name="secretId"> + <option value="">(none)</option> + @foreach (var secret in Model.Secrets) + { + <option value="@secret.Id" selected="@(secret.Id == Model.Source.AccessSecretId)">@secret.Label</option> + } + </select> + </label> + <button type="submit">Save</button> +</form> + <a asp-action="CreateSecret" asp-route-sourceId="@Model.Source.Id">New</a> <table> @@ -42,4 +56,4 @@ </tbody> </table> -<a asp-action="Details", asp-route-id="@Model.Source.Id">back</a> +<a asp-action="Details" asp-route-id="@Model.Source.Id">back</a> |
