mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
Automatic merge from release/2.2.0 -> release/2.3.0
* commit '557d28244c144ac079fa3b5e12b2822c8988069a': support export filter
This commit is contained in:
@@ -342,6 +342,12 @@ func query2List(manager IModelManager, ctx context.Context, userCred mcclient.To
|
||||
}
|
||||
jsonDict = getModelExtraDetails(item, ctx, jsonDict)
|
||||
}
|
||||
if query.Contains("export_keys") {
|
||||
exportDict := item.GetExportItems(ctx, userCred, query)
|
||||
if exportDict != nil {
|
||||
jsonDict.Update(exportDict)
|
||||
}
|
||||
}
|
||||
results = append(results, jsonDict)
|
||||
}
|
||||
return results, nil
|
||||
|
||||
@@ -78,6 +78,7 @@ type IModel interface {
|
||||
// get hooks
|
||||
AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool
|
||||
GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict
|
||||
GetExportItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict
|
||||
|
||||
// create hooks
|
||||
CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerProjId string, query jsonutils.JSONObject, data jsonutils.JSONObject) error
|
||||
|
||||
@@ -193,6 +193,10 @@ func (model *SModelBase) GetCustomizeColumns(ctx context.Context, userCred mccli
|
||||
return jsonutils.NewDict()
|
||||
}
|
||||
|
||||
func (model *SModelBase) GetExportItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) *jsonutils.JSONDict {
|
||||
return jsonutils.NewDict()
|
||||
}
|
||||
|
||||
// get hooks
|
||||
func (model *SModelBase) AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user