feat(explorer): preview archive file content and extract selected files (#2852)

This commit is contained in:
Aaron Liu
2025-09-02 11:54:04 +08:00
parent 4acf9401b8
commit 9f1cb52cfb
14 changed files with 329 additions and 56 deletions

View File

@@ -699,6 +699,8 @@ func LockSessionToContext(ctx context.Context, session LockSession) context.Cont
return context.WithValue(ctx, LockSessionCtxKey{}, session)
}
// FindDesiredEntity finds the desired entity from the file.
// entityType is optional, if it is not nil, it will only return the entity with the given type.
func FindDesiredEntity(file File, version string, hasher hashid.Encoder, entityType *types.EntityType) (bool, Entity) {
if version == "" {
return true, file.PrimaryEntity()