feat: add xlsx export wherever csv export exists (#31690)

This commit is contained in:
andig 2026-07-12 11:58:02 +02:00 • committed by GitHub
parent 3158ff16ef
commit 3ce6600143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 873 additions and 425 deletions

View file

@ -25,7 +25,14 @@ func gridSessionsHandler(w http.ResponseWriter, r *http.Request) {
return
}
if r.URL.Query().Get("format") == "csv" {
format := r.URL.Query().Get("format")
if format == "json" {
jsonAttachment(w, &res, "gridsessions")
return
}
if format == "csv" || format == "xlsx" {
lang := r.URL.Query().Get("lang")
if lang == "" {
// get request language
@ -36,7 +43,7 @@ func gridSessionsHandler(w http.ResponseWriter, r *http.Request) {
}
ctx := context.WithValue(context.Background(), locale.Locale, lang)
csvResult(ctx, w, &res, "gridsessions")
exportResult(ctx, w, format, &res, "gridsessions")
return
}