|
|
@ -4,6 +4,8 @@ import ( |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"slices" |
|
|
|
|
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
scope "github.com/grafana/grafana/pkg/apis/scope/v0alpha1" |
|
|
|
scope "github.com/grafana/grafana/pkg/apis/scope/v0alpha1" |
|
|
|
"k8s.io/apimachinery/pkg/api/errors" |
|
|
|
"k8s.io/apimachinery/pkg/api/errors" |
|
|
@ -92,6 +94,11 @@ func (f *findScopeDashboardsREST) Connect(ctx context.Context, name string, opts |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sort the dashboard lists based on dashboard title.
|
|
|
|
|
|
|
|
slices.SortFunc(results.Items, func(i, j scope.ScopeDashboardBinding) int { |
|
|
|
|
|
|
|
return strings.Compare(i.Status.DashboardTitle, j.Status.DashboardTitle) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
logger.FromContext(req.Context()).Debug("find scopedashboardbinding", "raw", len(all.Items), "filtered", len(results.Items)) |
|
|
|
logger.FromContext(req.Context()).Debug("find scopedashboardbinding", "raw", len(all.Items), "filtered", len(results.Items)) |
|
|
|
|
|
|
|
|
|
|
|
responder.Object(200, results) |
|
|
|
responder.Object(200, results) |
|
|
|