리플레이 저장

- stdout pipe를 통해 houston에 리플레이 upload 요청 기능 추가
This commit is contained in:
2025-01-09 16:21:29 +09:00
parent 3ab055008c
commit 5f68795185
6 changed files with 258 additions and 4 deletions

View File

@ -522,6 +522,34 @@ func (h *houstonHandler) GetLogFileLinks(w http.ResponseWriter, r *http.Request)
enc.Encode(out)
}
func (h *houstonHandler) GetDemoFileLink(w http.ResponseWriter, r *http.Request) {
// <form action="/houston" method="post" enctype="multipart/form-data">
// <input type="text" name="name">
// <input type="text" name="version">
// <input type="text" name="filename">
// </form>
name := r.FormValue("name")
version := r.FormValue("version")
fileName := r.FormValue("filename")
logger.Println("GetDemoFileLink :", name, version, fileName)
if len(name) == 0 || len(version) == 0 || len(fileName) == 0 {
w.WriteHeader(http.StatusBadRequest)
return
}
demoFilePath := path.Join(h.downloadPath, name, version, fileName)
demoFileInfo, err := os.Stat(demoFilePath)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
return
}
link := path.Join(sub_folder_name_downloads, name, version, demoFileInfo.Name())
enc := json.NewEncoder(w)
enc.Encode(link)
}
func (h *houstonHandler) GetDeployingProgress(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(h.Operation().DeplyingProgress())
}