2024-11-17 20:53:05 +01:00
|
|
|
//go:build !pro
|
|
|
|
|
2024-11-17 11:47:04 +01:00
|
|
|
package projects
|
|
|
|
|
|
|
|
import (
|
2024-11-17 20:53:05 +01:00
|
|
|
"net/http"
|
|
|
|
|
2024-11-17 11:47:04 +01:00
|
|
|
"github.com/gorilla/context"
|
|
|
|
"github.com/semaphoreui/semaphore/api/helpers"
|
|
|
|
"github.com/semaphoreui/semaphore/db"
|
|
|
|
)
|
|
|
|
|
|
|
|
func GetRunners(w http.ResponseWriter, r *http.Request) {
|
|
|
|
project := context.Get(r, "project").(db.Project)
|
2024-11-17 19:13:11 +01:00
|
|
|
runners, err := helpers.Store(r).GetRunners(project.ID, false)
|
2024-11-17 11:47:04 +01:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2024-11-17 20:53:05 +01:00
|
|
|
helpers.WriteJSON(w, http.StatusOK, runners)
|
2024-11-17 11:47:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func AddRunner(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.WriteHeader(http.StatusNotFound)
|
|
|
|
}
|
|
|
|
|
|
|
|
func RunnerMiddleware(next http.Handler) http.Handler {
|
|
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
|
|
next.ServeHTTP(w, r)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetRunner(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.WriteHeader(http.StatusNotFound)
|
|
|
|
}
|
|
|
|
|
|
|
|
func UpdateRunner(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.WriteHeader(http.StatusNotFound)
|
|
|
|
}
|
|
|
|
|
|
|
|
func DeleteRunner(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.WriteHeader(http.StatusNotFound)
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetRunnerActive(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.WriteHeader(http.StatusNotFound)
|
|
|
|
}
|