summaryrefslogtreecommitdiff
path: root/src/marlin.web/Views/VCS/Details.cshtml
blob: a9ef0ea6ad7bcd200a6143eda4b9b7703fca5224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@using marlin.core
@using marlin.core.models
@using marlin.web.Controllers
@model (VersionControlSource Source, List<VCSController.SecretOption> SecretOptions)

<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>

<table>
    <thead>
    <tr>
        <th></th>
        <th>branch</th>
        <th>commit</th>
        <th>status</th>
    </tr>
    </thead>
    <tbody>
    @foreach (var branch in Model.Source.Branches)
    {
        <tr>
            <td>@(branch.Name == Model.Source.MainBranch ? "@" : "")</td>
            <td>@branch.Name</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>
                }
            </td>
        </tr>
    }
    </tbody>
</table>

<a asp-action="ListSecret" asp-route-sourceId="@Model.Source.Id">Secrets</a>
<a asp-action="List">Back</a>