reverse order of release list

Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
LiHui
2021-04-08 11:20:37 +08:00
parent c023fb13a0
commit 74fb76a48e
2 changed files with 7 additions and 11 deletions

View File

@@ -707,24 +707,19 @@ func (h *openpitrixHandler) ListApplications(req *restful.Request, resp *restful
clusterName := req.PathParameter("cluster")
namespace := req.PathParameter("namespace")
workspace := req.PathParameter("workspace")
orderBy := params.GetStringValueWithDefault(req, params.OrderByParam, openpitrix.CreateTime)
reverse := params.GetBoolValueWithDefault(req, params.ReverseParam, false)
orderBy := params.GetStringValueWithDefault(req, params.OrderByParam, openpitrix.StatusTime)
conditions, err := params.ParseConditions(req)
if offset < 0 {
offset = 0
}
if limit <= 0 {
limit = 10
}
if err != nil {
klog.V(4).Infoln(err)
api.HandleBadRequest(resp, nil, err)
return
}
reverse := false
if conditions.Match[openpitrix.Ascending] == "true" {
reverse = true
}
result, err := h.openpitrix.ListApplications(workspace, clusterName, namespace, conditions, limit, offset, orderBy, reverse)
if err != nil {

View File

@@ -909,5 +909,6 @@ const (
ActionReject = "reject"
ActionSubmit = "submit"
ActionRelease = "release"
Ascending = "ascending"
ActionIndex = "index"
)