diff options
Diffstat (limited to 'src/marlin.web/Views/VCS/Details.cshtml')
| -rw-r--r-- | src/marlin.web/Views/VCS/Details.cshtml | 74 |
1 files changed, 46 insertions, 28 deletions
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 |
