mirror of
https://github.com/coaidev/coai.git
synced 2025-05-28 17:30:15 +09:00
fix code suffix
This commit is contained in:
parent
b723cb5821
commit
f05e3658c4
@ -90,11 +90,11 @@ function Wrapper({ onSend }: WrapperProps) {
|
||||
{
|
||||
hash.length > 0 &&
|
||||
<div className={`hash-box`}>
|
||||
<a className={`download-box`} target={`_blank`} href={`${rest_api}/generation/download/tar?hash=${hash}`}>
|
||||
<a className={`download-box`} href={`${rest_api}/generation/download/tar?hash=${hash}`}>
|
||||
<FileDown className={`h-6 w-6`} />
|
||||
<p>{ t('generate.download', { name: "tar.gz"}) }</p>
|
||||
</a>
|
||||
<a className={`download-box`} target={`_blank`} href={`${rest_api}/generation/download/zip?hash=${hash}`}>
|
||||
<a className={`download-box`} href={`${rest_api}/generation/download/zip?hash=${hash}`}>
|
||||
<FileDown className={`h-6 w-6`} />
|
||||
<p>{ t('generate.download', { name: "zip"}) }</p>
|
||||
</a>
|
||||
|
@ -23,11 +23,13 @@ type WebsocketGenerationForm struct {
|
||||
|
||||
func ProjectTarDownloadAPI(c *gin.Context) {
|
||||
hash := strings.TrimSpace(c.Query("hash"))
|
||||
c.Writer.Header().Add("Content-Disposition", "attachment; filename=code.tar.gz")
|
||||
c.File(fmt.Sprintf("generation/data/out/%s.tar.gz", hash))
|
||||
}
|
||||
|
||||
func ProjectZipDownloadAPI(c *gin.Context) {
|
||||
hash := strings.TrimSpace(c.Query("hash"))
|
||||
c.Writer.Header().Add("Content-Disposition", "attachment; filename=code.zip")
|
||||
c.File(fmt.Sprintf("generation/data/out/%s.zip", hash))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user