github.com/navikt/knorten@v0.0.0-20240419132333-1333f46ed8b6/templates/event/rows.tmpl (about)

     1  {{ define "event/logs/rows" }}
     2      {{ range . }}
     3      <label for="machine_types" class="navds-form-field__label navds-label">Eventlogs for {{ .Type }}</label>
     4      <div id="{{ .ID }}" class="flex flex-col gap-2">      
     5          <table id="table" class="navds-table navds-table--small">
     6              <thead class="navds-table__header">
     7              <tr class="navds-table__row">
     8                  <th class="navds-table__header-cell navds-label navds-label--small">Level</th>
     9                  <th class="navds-table__header-cell navds-label navds-label--small">Message</th>
    10                  <th class="navds-table__header-cell navds-label navds-label--small">Created at</th>
    11              </tr>
    12              </thead>
    13              <tbody class="navds-table__body">
    14                  {{ range $i, $logs := .Logs }}
    15                      {{ template "event/logs/row" toArray $i $logs}}
    16                  {{ end }}
    17              </tbody>
    18          </table>
    19          {{ if and .Logs (gt (len .Logs) 2) }}
    20          <button type="button" class="navds-button navds-button--secondary navds-button--small w-fit"
    21                      onClick="toggleShowAll(event)">Vis mer</button>
    22          {{ end }}
    23      </div>
    24      <br/>
    25      {{ end }}
    26      <script>
    27          {{ template "event/logs/script" }}
    28      </script>
    29  {{ end }}