Browse Source

fix-3319

pull/3451/head
liuzx 2 years ago
parent
commit
dd426bcca5
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      models/cloudbrain.go
  2. +1
    -1
      routers/api/v1/repo/cloudbrain_dashboard.go

+ 2
- 2
models/cloudbrain.go View File

@@ -466,7 +466,7 @@ type CloudbrainsOptions struct {
NeedDeleteInfo string
Cluster string
AccCardType string
AccCardsNum string
AccCardsNum int
WorkServerNumber int
}

@@ -2341,7 +2341,7 @@ func CloudbrainAll(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) {
if opts.AccCardType != "" {
cond = cond.And(builder.Eq{"cloudbrain_spec.acc_card_type": opts.AccCardType})
}
if opts.AccCardsNum != "" {
if opts.AccCardsNum >= 0 {
cond = cond.And(builder.Eq{"cloudbrain_spec.acc_cards_num": opts.AccCardsNum})
}



+ 1
- 1
routers/api/v1/repo/cloudbrain_dashboard.go View File

@@ -719,7 +719,7 @@ func GetCloudbrainsDetailData(ctx *context.Context) {
needDeleteInfo := ctx.Query("needDeleteInfo")

accCardType := ctx.Query("accCardType")
accCardsNum := ctx.Query("accCardsNum")
accCardsNum := ctx.QueryInt("accCardsNum")
workServerNumber := ctx.QueryInt("workServerNumber")
beginTimeStr := ctx.QueryTrim("beginTime")
endTimeStr := ctx.QueryTrim("endTime")


Loading…
Cancel
Save