{{define "dashboard-default/api"}}
{{template "common/header" .}}
{{template "common/menu" .}}
<div class="nb-container">
    <div class="ui container">
        <div class="ui grid">
            <div class="right floated right aligned twelve wide column">
                <button class="ui right labeled nezha-primary-btn icon button" onclick="issueNewApiToken()"><i class="add icon"></i>
                    {{tr "IssueNewApiToken"}}
                </button>
            </div>
        </div>
        <table class="ui basic table">
            <thead>
            <tr>
                <th>{{tr "Token"}}</th>
                <th>{{tr "Note"}}</th>
            </tr>
            </thead>
            <tbody>
            {{range $token := .Tokens}}
            <tr>
                <td>{{$token.Token}}</td>
                <td>{{$token.Note}}</td>
                <td>
                    <div class="ui mini icon buttons">
                        <button class="ui button"
                                onclick="showConfirm('{{tr "DeleteToken"}}','{{tr "ConfirmToDeleteThisToken"}}',deleteRequest,'/api/token/'+{{$token.Token}})">
                        <i class="trash alternate outline icon"></i>
                        </button>
                    </div>
                </td>
            </tr>
            {{end}}
            </tbody>
        </table>
    </div>
</div>
{{template "component/api"}}
{{template "common/footer" .}}
{{end}}