aceberg/miniboard

View on GitHub
internal/web/templates/panels.html

Summary

Maintainability
Test Coverage
{{ define "panels" }}

<body>
    <div class="container">
        <br>
        <div class="row">
            <div class="col">
            <table class="table table-striped">
                <thead>
                    <th style="width: 1em;"></th>
                    <th>Name</th>
                    <th>Scan</th>
                    <th style="width: 10em;">Timeout</th>
                    <th style="width: 1em;"></th>
                </thead>
                {{ range $key, $value := .Links.Panels }}
                <tr>
                    <td><a href="/panel_edit/?edit={{ $key }}">
                        <button type="submit" class="btn btn-outline-warning">
                            <i class="bi bi-pencil"></i>
                        </button></a>
                    </td>
                    <form action="/panels/" method="post">
                    <td>
                        <input name="oldkey" type="hidden" class="form-control" value="{{ $key }}">
                        <input name="key" type="text" class="form-control" value="{{ $key }}">
                    </td>
                    <td>
                        <div class="form-check">
                            {{ if .Scan }}
                            <input class="form-check-input" type="checkbox" name="scan" checked>
                            {{ else }}
                            <input class="form-check-input" type="checkbox" name="scan">
                            {{ end }}
                        </div>
                    </td>
                    <td>
                        <input name="timeout" type="text" class="form-control" value="{{ .Timeout }}">
                    </td>
                    <td>
                        <button type="submit" class="btn btn-outline-success"><i class="bi bi-check2"></i></button>
                    </td>
                    </form>
                </tr>
                {{ end }}
                <tr>
                    <td>New:</td>
                    <form action="/panels/" method="post">
                        <td>
                            <input name="key" type="text" class="form-control" placeholder="Unique string">
                        </td>
                        <td>
                            <div class="form-check">
                                <input class="form-check-input" type="checkbox" name="scan">
                            </div>
                        </td>
                        <td>
                            <input name="timeout" type="text" class="form-control" placeholder="Minutes">
                        </td>
                        <td>
                            <button type="submit" class="btn btn-outline-success"><i class="bi bi-check2"></i></button>
                        </td>
                    </form>
                </tr>
            </table>
            </div>
            <div class="col">
                <div class="alert alert-info" role="alert">
                    <p>● <b>Name</b> - unique string</p>
                    <p>● <b>Scan</b> - check if hosts of this panel are online</p>
                    <p>● <b>Timeout</b> - time between scans (minutes). Default: 1</p>
                </div>
                <br>
                <p>Create panel from Docker API</p>
                <form action="/panel_edit/" method="post" class="input-group">
                    <input name="docker" type="text" class="form-control" placeholder="New panel name">
                    <button type="submit" class="btn btn-outline-success"><i class="bi bi-check2"></i></button>
                </form>
            </div>
        </div>
    </div>

{{ template "footer" }}
{{ end }}