-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Description
1Panel Version
v2.0.16
Please describe your needs or suggestions for improvements
The current "Import Image" feature only supports selecting one .tar file at a time. When users need to import multiple image files (e.g., offline deployment, server migration), they have to repeat the operation multiple times, which is inefficient.
It would be helpful to support multi-select in the file picker, allowing batch import of multiple image files at once.
Please describe the solution you suggest
This feature involves both frontend and backend changes. The implementation can reference the existing batch image pull (ImagePull) pattern.
Backend Changes:
| File | Changes |
|---|---|
| agent/app/dto/image.go | ImageLoad.Path string → Paths []string |
| agent/app/service/image.go | Loop to add subtasks, reference ImagePull implementation |
| agent/app/api/v2/image.go | Adapt to new DTO structure |
Frontend Changes:
| File | Changes |
|---|---|
| frontend/src/components/file-list/index.vue | Add optional multi-select mode (multiple: boolean), maintain backward compatibility |
| frontend/src/views/container/image/load/index.vue | Support displaying list of selected files |
| frontend/src/api/interface/container.ts | Update ImageLoad interface definition |
Expected TaskLog Output:
2026/01/13 23:05:04 ImportMirror [image1.tar,image2.tar,image3.tar] task starts [START]
2026/01/13 23:05:04 ----------------- image1.tar -----------------
2026/01/13 23:05:04 Import succeeded
2026/01/13 23:05:05 ----------------- image2.tar -----------------
2026/01/13 23:05:05 Import succeeded
2026/01/13 23:05:06 ----------------- image3.tar -----------------
2026/01/13 23:05:06 Import succeeded
2026/01/13 23:05:06 [TASK-END]
Reference Implementation:
- Batch image pull PR feat: Support batch image pulling #10532
- ImagePull service: agent/app/service/image.go:266
Additional Information
- Similar batch operation features already exist: batch image pull (feat: Support batch image pulling #10532), batch image tag operations (feat: Support batch operations for image tags #10597), batch container image upgrade (feat: Support batch upgrades for container images #9915)
- FileList is a shared component (used in 40+ places), backward compatibility will be ensured when adding multi-select mode
- Reuse existing TaskLog component to display batch import progress, no additional UI components needed
- I'm willing to contribute the code for this feature if the approach is acceptable