Пример #1
0
func AppCancel(rw http.ResponseWriter, r *http.Request) *httperr.Error {
	app := mux.Vars(r)["app"]

	err := models.Provider().AppCancel(app)
	if provider.ErrorNotFound(err) {
		return httperr.NotFound(err)
	}
	if err != nil {
		return httperr.Server(err)
	}

	return RenderSuccess(rw)
}
Пример #2
0
func ProcessList(rw http.ResponseWriter, r *http.Request) *httperr.Error {
	app := mux.Vars(r)["app"]

	ps, err := models.Provider().ProcessList(app)
	if provider.ErrorNotFound(err) {
		return httperr.NotFound(err)
	}
	if err != nil {
		return httperr.Server(err)
	}

	sort.Sort(ps)

	return RenderJson(rw, ps)
}
Пример #3
0
func SystemProcesses(rw http.ResponseWriter, r *http.Request) *httperr.Error {
	all := r.URL.Query().Get("all")

	ps, err := models.Provider().SystemProcesses(structs.SystemProcessesOptions{
		All: (all == "true"),
	})
	if provider.ErrorNotFound(err) {
		return httperr.NotFound(err)
	}
	if err != nil {
		return httperr.Server(err)
	}

	sort.Sort(ps)

	return RenderJson(rw, ps)
}