리플레이 저장
- stdout pipe를 통해 houston에 리플레이 upload 요청 기능 추가
This commit is contained in:
@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user