支持部署KVM XFCE桌面系统

This commit is contained in:
MengMengCode
2026-06-07 23:10:19 +08:00
parent b993e57d05
commit 2ab42e7f57
5 changed files with 109 additions and 11 deletions
+3 -1
View File
@@ -28,6 +28,7 @@ type ImageInfo struct {
Downloading bool `json:"downloading"`
SizeBytes int64 `json:"size_bytes"`
ManualPath string `json:"manual_path,omitempty"`
Desktop string `json:"desktop,omitempty"`
}
var imageDownloadsMu sync.Mutex
@@ -140,6 +141,7 @@ func HandleImages(w http.ResponseWriter, r *http.Request) {
Downloading: downloading,
SizeBytes: size,
ManualPath: manualPath,
Desktop: t.Desktop,
})
}
@@ -336,7 +338,7 @@ func HandleEnabledImages(w http.ResponseWriter, r *http.Request) {
if downloaded, _ := kvm.ImageDownloadedInfo(t.ID); enabledSet[t.ID] && downloaded {
result = append(result, map[string]string{
"id": t.ID, "name": t.Name, "distro": t.Distro, "release": t.Release, "arch": t.Arch,
"description": t.Description, "type": config.VirtualizationKVM,
"description": t.Description, "type": config.VirtualizationKVM, "desktop": t.Desktop,
})
}
}