summaryrefslogtreecommitdiff
path: root/src/marlin.web/Views/VCS/ListSecret.cshtml
blob: 84e306129bdc1374828d525c5fec8794bb88ba22 (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
56
57
58
59
@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>
    <thead>
    <tr>
        <th>id</th>
        <th>label</th>
        <th>kind</th>
        <th>value</th>
        <th>actions</th>
    </tr>
    </thead>
    <tbody>
    @foreach (var secret in Model.Secrets)
    {
        <tr>
            <td>@secret.Id</td>
            <td>@secret.Label</td>
            <td>@secret.Kind</td>
            <td>
                @if (secret.MayReveal)
                {
                    @foreach (var pair in secret.Content)
                    {
                        <span>@pair.Key = @pair.Value</span>
                    }
                }
                else
                {
                    <span>secret cannot be revealed</span>
                }
            </td>
            <td>
                <form asp-action="DeleteSecret" method="post" asp-route-sourceId="@Model.Source.Id" asp-route-id="@secret.Id">
                    <button type="submit">delete</button>   
                </form>
            </td>
        </tr>
    }
    </tbody>
</table>

<a asp-action="Details" asp-route-id="@Model.Source.Id">back</a>