sessions.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 "integrations" }}">{{ t "Integrations" }}</a>
  11. </li>
  12. {{ if .user.IsAdmin }}
  13. <li>
  14. <a href="{{ route "users" }}">{{ t "Users" }}</a>
  15. </li>
  16. <li>
  17. <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
  18. </li>
  19. {{ end }}
  20. <li>
  21. <a href="{{ route "about" }}">{{ t "About" }}</a>
  22. </li>
  23. </ul>
  24. </section>
  25. <table>
  26. <tr>
  27. <th>{{ t "Date" }}</th>
  28. <th>{{ t "IP Address" }}</th>
  29. <th>{{ t "User Agent" }}</th>
  30. <th>{{ t "Actions" }}</th>
  31. </tr>
  32. {{ range .sessions }}
  33. <tr {{ if eq .Token $.currentSessionToken }}class="row-highlighted"{{ end }}>
  34. <td class="column-20" title="{{ isodate .CreatedAt }}">{{ elapsed $.user.Timezone .CreatedAt }}</td>
  35. <td class="column-20" title="{{ .IP }}">{{ .IP }}</td>
  36. <td title="{{ .UserAgent }}">{{ .UserAgent }}</td>
  37. <td class="column-20">
  38. {{ if eq .Token $.currentSessionToken }}
  39. {{ t "Current session" }}
  40. {{ else }}
  41. <a href="#"
  42. data-confirm="true"
  43. data-label-question="{{ t "Are you sure?" }}"
  44. data-label-yes="{{ t "yes" }}"
  45. data-label-no="{{ t "no" }}"
  46. data-label-loading="{{ t "Work in progress..." }}"
  47. data-url="{{ route "removeSession" "sessionID" .ID }}">{{ t "Remove" }}</a>
  48. {{ end }}
  49. </td>
  50. </tr>
  51. {{ end }}
  52. </table>
  53. {{ end }}