github.com/nais/knorten@v0.0.0-20240104110906-55926958e361/templates/oversikt/index.tmpl (about)

     1  {{ define "oversikt/index" }}
     2      {{ template "head" . }}
     3      {{ with .errors }}
     4          {{ . }}
     5      {{ end }}
     6      {{ with .flashes }}
     7          {{ . }}
     8      {{ end }}
     9  
    10      <article class="bg-white rounded-md p-4">
    11          <div class="flex flex-col gap-4">
    12              <div class="flex items-center gap-4">
    13                  <h2>Personlige tjenester</h2>
    14                  {{ if .user.Compute }}
    15                      <a class="navds-button--small navds-button--secondary" href="compute/edit">Rediger</a>
    16                  {{ end }}
    17              </div>
    18              <p>
    19                  Google Secret Manager er en tjeneste som gir en sikker og praktisk metode for å lagre API-nøkler,
    20                  passord,
    21                  sertifikater og annen sensitiv data.
    22                  Vi tilbyr personlige hemmeligheter i Google Secret Manager som kun du har tilgang til.
    23              </p>
    24              <p>
    25                  Vi tilbyr private virtuelle maskiner gjennom Knorten, disse kjører i GCP prosjektet knada-gcp. Denne
    26                  maskinen vil ha tilgang til on-premise kilder på lik linje som Notebooks og Airflow som kjører i KNADA.
    27              </p>
    28          </div>
    29          <table class="navds-table navds-table--small">
    30              <thead class="navds-table__header">
    31              <tr class="navds-table__row">
    32                  <th class="navds-table__header-cell navds-label navds-label--small">Tjeneste</th>
    33                  <th class="navds-table__header-cell navds-label navds-label--small">Dokumentasjon</th>
    34                  <th class="navds-table__header-cell navds-label navds-label--small"></th>
    35              </tr>
    36              </thead>
    37              <tbody class="navds-table__body">
    38              <tr class="navds-table__row navds-table__row--shade-on-hover">
    39                  <th class="navds-table__header-cell navds-label navds-label--small">
    40                      {{ with .user.Compute }}
    41                          <a class="navds-link" target="_blank"
    42                             href="https://console.cloud.google.com/compute/instancesDetail/zones/{{ $.gcpZone }}/instances/{{ .Name }}?project={{ $.gcpProject }}">
    43                              {{ .Name }}
    44                          </a>
    45                      {{ else }}
    46                          Compute instans
    47                      {{ end }}
    48                  </th>
    49                  <td class="navds-table__data-cell navds-body-short navds-body-short--small">
    50                      <a class="navds-link" target="_blank"
    51                         href="https://docs.knada.io/analyse/knada-vm/#koble-til-vm-med-ssh">docs.knada.io</a>
    52                  </td>
    53                  <td class="navds-table__data-cell navds-body-short navds-body-short--small">
    54                      {{ if .user.Compute }}
    55                          <a class="navds-link" href="compute/edit">rediger</a>
    56                      {{ else }}
    57                          <a class="navds-link" href="/compute/new">opprett</a>
    58                      {{ end }}
    59                  </td>
    60              </tr>
    61              <tr class="navds-table__row navds-table__row--shade-on-hover">
    62                  <th class="navds-table__header-cell navds-label navds-label--small">
    63                      {{ with .user.UserGSM }}
    64                          <a class="navds-link" target="_blank"
    65                             href="https://console.cloud.google.com/security/secret-manager/secret/{{ .Name }}/versions?project={{ $.gcpProject }}">
    66                              Secret Manager
    67                          </a>
    68                      {{ else }}
    69                          Secret Manager
    70                      {{ end }}
    71                  </th>
    72                  <td class="navds-table__data-cell navds-body-short navds-body-short--small">
    73                      <a class="navds-link" href="https://docs.knada.io/analyse/google-secret-manager/">docs.knada.io</a>
    74                  </td>
    75                  <td class="navds-table__data-cell navds-body-short navds-body-short--small">
    76                      {{ with .user.UserGSM }}
    77                          <form action="/secret/delete" method="POST">
    78                              <fieldset class="flex gap-2 items-center">
    79                                  <button type="submit"
    80                                          onclick="return confirm('Er du sikker på at du vil slette hemmelighetene dine? Det er ikke mulig å gjenopprette hemmelighetene.')"
    81                                          class="navds-link">
    82                                      slett
    83                                  </button>
    84                              </fieldset>
    85                          </form>
    86                      {{ else }}
    87                          <form action="/secret/new" method="POST">
    88                              <fieldset class="flex gap-2 items-center">
    89                                  <button type="submit"
    90                                          onclick="return confirm('Er du sikker på at du vil opprette en privat secret?')"
    91                                          class="navds-link">
    92                                      opprett
    93                                  </button>
    94                              </fieldset>
    95                          </form>
    96                      {{ end }}
    97                  </td>
    98              </tr>
    99              </tbody>
   100          </table>
   101          <br>
   102          {{ template "event/logs/rows" .user.UserEvents }}
   103      </article>
   104  
   105      {{ range .user.Services }}
   106          {{ $teamID := .TeamID }}
   107          <article class="bg-white rounded-md p-4">
   108              <div class="flex flex-col gap-4">
   109                  <div class="flex items-center gap-4">
   110                      <h2>
   111                          {{ .Slug }}
   112                      </h2>
   113                      <a class="navds-button--small navds-button--secondary" href="team/{{ .Slug }}/edit">Rediger</a>
   114                  </div>
   115              </div>
   116              {{ with .Airflow }}
   117                  <p>
   118                      <b>Service account:</b> <code class="text-base p-1 bg-gray-50">
   119                          {{ $teamID }}@{{ $.gcpProject }}.iam.gserviceaccount.com</code>
   120                  </p>
   121              {{ end }}
   122              <table class="navds-table navds-table--small">
   123                  <thead class="navds-table__header">
   124                  <tr class="navds-table__row">
   125                      <th class="navds-table__header-cell navds-label navds-label--small">Tjeneste</th>
   126                      <th class="navds-table__header-cell navds-label navds-label--small">Adresse</th>
   127                      <th class="navds-table__header-cell navds-label navds-label--small"></th>
   128                  </tr>
   129                  </thead>
   130                  <tbody class="navds-table__body">
   131                  <tr class="navds-table__row navds-table__row--shade-on-hover">
   132                      <th class="navds-table__header-cell navds-label navds-label--small">Secret Manager</th>
   133                      <td class="navds-table__data-cell navds-body-short navds-body-short--small"><a class="navds-link" target="_blank"
   134                                                                                                     href="https://console.cloud.google.com/security/secret-manager/secret/{{ $teamID }}/versions?project={{ $.gcpProject }}">
   135                              Google Cloud Platform
   136                          </a></td>
   137                      <td class="navds-table__data-cell navds-body-short navds-body-short--small">
   138                      </td>
   139                  </tr>
   140                  {{ with .Jupyterhub }}
   141                      {{ template "oversikt/row" . }}
   142                  {{ else }}
   143                      <tr class="navds-table__row navds-table__row--shade-on-hover">
   144                          <th class="navds-table__header-cell navds-label navds-label--small">Jupyter</th>
   145                          <td class="navds-table__data-cell navds-body-short navds-body-short--small"></td>
   146                          <td class="navds-table__data-cell navds-body-short navds-body-short--small">
   147                              <a class="navds-link" href="/team/{{ .Slug }}/jupyterhub/new">Installer</a>
   148                          </td>
   149                      </tr>
   150                  {{ end }}
   151                  {{ with .Airflow }}
   152                      {{ template "oversikt/row" . }}
   153                  {{ else }}
   154                      <tr class="navds-table__row navds-table__row--shade-on-hover">
   155                          <th class="navds-table__header-cell navds-label navds-label--small">Airflow</th>
   156                          <td class="navds-table__data-cell navds-body-short navds-body-short--small"></td>
   157                          <td class="navds-table__data-cell navds-body-short navds-body-short--small">
   158                              <a class="navds-link" href="/team/{{ .Slug }}/airflow/new">Installer</a>
   159                          </td>
   160                      </tr>
   161                  {{ end }}
   162                  </tbody>
   163              </table>
   164              <br>
   165              {{ template "event/logs/rows" .Events }}
   166              <a class="navds-link" href="team/{{ .Slug }}/events">Se alle events</a>
   167          </article>
   168      {{ end }}
   169      <article class="bg-white rounded-md p-4 flex flex-col gap-4">
   170          <a class="navds-button navds-button--secondary" href="/team/new">Legg til nytt team</a>
   171      </article>
   172      {{ template "footer" }}
   173  {{ end }}