mirror of
https://github.com/coaidev/coai.git
synced 2025-06-03 20:30:19 +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 &&
|
hash.length > 0 &&
|
||||||
<div className={`hash-box`}>
|
<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`} />
|
<FileDown className={`h-6 w-6`} />
|
||||||
<p>{ t('generate.download', { name: "tar.gz"}) }</p>
|
<p>{ t('generate.download', { name: "tar.gz"}) }</p>
|
||||||
</a>
|
</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`} />
|
<FileDown className={`h-6 w-6`} />
|
||||||
<p>{ t('generate.download', { name: "zip"}) }</p>
|
<p>{ t('generate.download', { name: "zip"}) }</p>
|
||||||
</a>
|
</a>
|
||||||
|
@ -23,11 +23,13 @@ type WebsocketGenerationForm struct {
|
|||||||
|
|
||||||
func ProjectTarDownloadAPI(c *gin.Context) {
|
func ProjectTarDownloadAPI(c *gin.Context) {
|
||||||
hash := strings.TrimSpace(c.Query("hash"))
|
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))
|
c.File(fmt.Sprintf("generation/data/out/%s.tar.gz", hash))
|
||||||
}
|
}
|
||||||
|
|
||||||
func ProjectZipDownloadAPI(c *gin.Context) {
|
func ProjectZipDownloadAPI(c *gin.Context) {
|
||||||
hash := strings.TrimSpace(c.Query("hash"))
|
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))
|
c.File(fmt.Sprintf("generation/data/out/%s.zip", hash))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user