added conference export backend (untested)

This commit is contained in:
2026-02-14 23:09:53 -07:00
parent 8cce306308
commit fc92f4038a
6 changed files with 310 additions and 1 deletions
+14
View File
@@ -12,6 +12,7 @@ package ui
import (
"context"
"errors"
"fmt"
"mime/multipart"
"net/http"
@@ -51,6 +52,7 @@ type AmContext interface {
FormField(string) string
FormFieldInt(string) (int, error)
FormFieldIsSet(string) bool
FormFieldValues(string) ([]string, error)
FormFile(string) (*multipart.FileHeader, error)
FrameTitle() string
FrameMetadata(int) map[string]string
@@ -236,6 +238,18 @@ func (c *amContext) FormFieldIsSet(name string) bool {
return req.Form.Has(name)
}
// FormFieldValues returns all values for a specified parameter name.
func (c *amContext) FormFieldValues(name string) ([]string, error) {
vals, err := c.echoContext.FormParams()
if err != nil {
return make([]string, 0), err
}
if rc, ok := vals[name]; ok {
return rc, nil
}
return make([]string, 0), errors.New("parameter not found")
}
// FormFile returns a "file" parameter from a multipart upload form.
func (c *amContext) FormFile(name string) (*multipart.FileHeader, error) {
return c.echoContext.FormFile(name)
+5
View File
@@ -12,6 +12,7 @@ package ui
import (
"fmt"
"io"
"net/http"
"time"
@@ -88,8 +89,12 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an
switch command {
case "bytes":
err = ctxt.Blob(httprc, amctxt.OutputType(), data.([]byte))
case "stream":
err = ctxt.Stream(httprc, amctxt.OutputType(), data.(io.Reader))
case "redirect":
err = ctxt.Redirect(http.StatusFound, data.(string))
case "nocontent":
err = ctxt.NoContent(http.StatusNoContent)
case "string":
err = ctxt.String(httprc, data.(string))
case "template":