feat(wireguard): selektiver .conf-Import — Auswahl einzelner Interfaces per Modal

- GET /wireguard/importable listet alle .conf-Dateien in /etc/wireguard/
  mit already_in-Flag (bereits in DB)
- POST /wireguard/import nimmt optionale Names-Liste; ohne Namen → alles
- edgeguard-ctl wg-import [iface…] importiert nur die genannten Interfaces
- UI: Checkbox-Modal mit "Alle neuen auswählen" + Einzelauswahl;
  bereits importierte Interfaces disabled + grüner Tag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-24 22:09:37 +02:00
parent ac068bc9dd
commit 8d7a43bc8c
10 changed files with 230 additions and 13 deletions

View File

@@ -46,7 +46,9 @@ func cmdWGImport(args []string) int {
wireguard.NewPeersRepo(pool),
box,
)
res, err := im.ImportDir(ctx, *path)
// Positional args after flags = specific interface names to import.
names := fs.Args()
res, err := im.ImportSelected(ctx, *path, names)
if err != nil {
fmt.Fprintln(os.Stderr, "wg-import:", err)
return 1