@import com.gu.janus.model.{AuditLog, JConsole, JanusData} @import com.gu.googleauth.UserIdentity @import play.api.Mode @import java.time.{Instant, ZonedDateTime, ZoneOffset} @(auditLogs: Seq[scala.Either[String, AuditLog]], key: Either[String, String], startDate: Instant, prevNextWeeks: (Option[Instant], Option[Instant]), user: UserIdentity, janusData: JanusData)(implicit req: RequestHeader, mode: Mode, assetsFinder: AssetsFinder) @import logic.Date.{formatDateTime, formatDate, formatDuration, rawDate} @import helper._ @main("Audit trail", Some(user), janusData) {

Audit trail

For @key.fold(s => s, s => s), week commencing Monday @formatDate(startDate).

@if(startDate.isBefore(ZonedDateTime.of(2016, 7, 6, 0, 0, 0, 0, ZoneOffset.UTC).toInstant) && startDate.isAfter(ZonedDateTime.of(2016, 3, 9, 0, 0, 0, 0, ZoneOffset.UTC).toInstant)) {

info Between 9th March 2016 and 6th July 2016 all Credentials access will show up as Console, due to a bug in the audit collection code.

} @for(log <- auditLogs) { @log match { case Right(auditLog) => { } case Left(errorMessage) => { } } } @if(auditLogs.isEmpty) { }
@if(key.isLeft){ Account } else { User } Access Type Time (UTC) Duration External error
@if(key.isLeft){ @auditLog.account } else{ @auditLog.username } @auditLog.accessLevel @if(auditLog.accessType == JConsole){ Console cloud } else { Credentials vpn_key } @formatDateTime(auditLog.instant) @formatDuration(auditLog.duration) @if(auditLog.external){ done } else { - } report_problem There was an error retrieving this log entry, check the application logs (@errorMessage)
No records found for the week commencing @formatDate(startDate)
@prevNextWeeks._1.map { prevWeek => Previous week }.getOrElse { No data }
@CSRF.formField
@prevNextWeeks._2.map { nextWeek => Next week }.getOrElse { No data }
}