mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
Feat: optimize "application-resource-tree-view" (#6096)
* feature: Optimize "application-resource-tree-view" Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com> * fix: go fmt Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com> * fix: modif staticcheck Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com> --------- Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>
This commit is contained in:
@@ -14,6 +14,7 @@ data:
|
||||
name?: string
|
||||
cluster?: string
|
||||
clusterNs?: string
|
||||
queryNewest?: bool
|
||||
}
|
||||
response: ql.#GetApplicationTree & {
|
||||
app: {
|
||||
@@ -29,6 +30,9 @@ data:
|
||||
if parameter.name != _|_ {
|
||||
components: [parameter.name]
|
||||
}
|
||||
if parameter.queryNewest != _|_ {
|
||||
queryNewest: parameter.queryNewest
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +171,7 @@
|
||||
cluster?: string
|
||||
clusterNamespace?: string
|
||||
components?: [...string]
|
||||
queryNewest?: bool
|
||||
}
|
||||
withTree: true
|
||||
}
|
||||
|
||||
@@ -87,6 +87,9 @@ func (c *AppCollector) ListApplicationResources(ctx context.Context, app *v1beta
|
||||
}
|
||||
var managedResources []*types.AppliedResource
|
||||
existResources := make(map[common.ClusterObjectReference]bool, len(app.Spec.Components))
|
||||
if c.opt.Filter.QueryNewest {
|
||||
historyRTs = nil
|
||||
}
|
||||
for _, rt := range append(historyRTs, rootRT, currentRT) {
|
||||
if rt != nil {
|
||||
for _, managedResource := range rt.Spec.ManagedResources {
|
||||
|
||||
@@ -88,6 +88,7 @@ type FilterOption struct {
|
||||
Components []string `json:"components,omitempty"`
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
QueryNewest bool `json:"queryNewest,omitempty"`
|
||||
}
|
||||
|
||||
// ListResourcesInApp lists CRs created by Application, this provider queries the object data.
|
||||
|
||||
Reference in New Issue
Block a user