aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/html/sessions.html
blob: 6e639d6ba1b4d5d4b486e97915e8c8cb17a227cd (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
{{ define "title"}}{{ t "Sessions" }}{{ end }}

{{ define "content"}}
<section class="page-header">
    <h1>{{ t "Sessions" }}</h1>
    <ul>
        <li>
            <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
        </li>
        <li>
            <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
        </li>
        {{ if .user.IsAdmin }}
        <li>
            <a href="{{ route "users" }}">{{ t "Users" }}</a>
        </li>
        <li>
            <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
        </li>
        {{ end }}
        <li>
            <a href="{{ route "about" }}">{{ t "About" }}</a>
        </li>
    </ul>
</section>

<table>
    <tr>
        <th>{{ t "Date" }}</th>
        <th>{{ t "IP Address" }}</th>
        <th>{{ t "User Agent" }}</th>
        <th>{{ t "Actions" }}</th>
    </tr>
    {{ range .sessions }}
    <tr {{ if eq .Token $.currentSessionToken }}class="row-highlighted"{{ end }}>
        <td class="column-20" title="{{ isodate .CreatedAt }}">{{ elapsed $.user.Timezone .CreatedAt }}</td>
        <td class="column-20" title="{{ .IP }}">{{ .IP }}</td>
        <td title="{{ .UserAgent }}">{{ .UserAgent }}</td>
        <td class="column-20">
            {{ if eq .Token $.currentSessionToken }}
                {{ t "Current session" }}
            {{ else }}
                <a href="#"
                    data-confirm="true"
                    data-label-question="{{ t "Are you sure?" }}"
                    data-label-yes="{{ t "yes" }}"
                    data-label-no="{{ t "no" }}"
                    data-label-loading="{{ t "Work in progress..." }}"
                    data-url="{{ route "removeSession" "sessionID" .ID }}">{{ t "Remove" }}</a>
            {{ end }}
        </td>
    </tr>
    {{ end }}
</table>

{{ end }}