sessions.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {{ define "title"}}{{ t "Sessions" }}{{ end }}
  2. {{ define "content"}}
  3. <section class="page-header">
  4. <h1>{{ t "Sessions" }}</h1>
  5. <ul>
  6. <li>
  7. <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
  8. </li>
  9. <li>
  10. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  11. </li>
  12. <li>
  13. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  14. </li>
  15. </ul>
  16. </section>
  17. <table>
  18. <tr>
  19. <th>{{ t "Date" }}</th>
  20. <th>{{ t "IP Address" }}</th>
  21. <th>{{ t "User Agent" }}</th>
  22. <th>{{ t "Actions" }}</th>
  23. </tr>
  24. {{ range .sessions }}
  25. <tr {{ if eq .Token $.currentSessionToken }}class="row-highlighted"{{ end }}>
  26. <td class="column-20" title="{{ isodate .CreatedAt }}">{{ elapsed .CreatedAt }}</td>
  27. <td class="column-20" title="{{ .IP }}">{{ .IP }}</td>
  28. <td title="{{ .UserAgent }}">{{ .UserAgent }}</td>
  29. <td class="column-20">
  30. {{ if eq .Token $.currentSessionToken }}
  31. {{ t "Current session" }}
  32. {{ else }}
  33. <a href="#"
  34. data-confirm="true"
  35. data-label-question="{{ t "Are you sure?" }}"
  36. data-label-yes="{{ t "yes" }}"
  37. data-label-no="{{ t "no" }}"
  38. data-label-loading="{{ t "Work in progress..." }}"
  39. data-url="{{ route "removeSession" "sessionID" .ID }}">{{ t "Remove" }}</a>
  40. {{ end }}
  41. </td>
  42. </tr>
  43. {{ end }}
  44. </table>
  45. {{ end }}