This repository has been archived on 2026-07-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
GoEdgeAdmin/internal/web/actions/default/ui/download.go
T

24 lines
441 B
Go

package ui
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
)
// 下载指定的文本内容
type DownloadAction struct {
actionutils.ParentAction
}
func (this *DownloadAction) Init() {
this.Nav("", "", "")
}
func (this *DownloadAction) RunGet(params struct {
File string
Text string
}) {
this.AddHeader("Content-Disposition", "attachment; filename=\""+params.File+"\";")
this.WriteString(params.Text)
}