Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Platform/Shared/VMContextMenuModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,36 @@ struct VMContextMenuModifier: ViewModifier {
Label("New from template…", systemImage: "doc.on.clipboard")
}.help("Create a new VM with the same configuration as this one but without any data.")
Divider()
Menu {
let groups = data.sortedGroups
let activeGroupID = data.groupContaining(vmID: vm.id)?.id
Button("New Group…") {
data.requestCreateGroup(assigning: vm.id)
}
if !groups.isEmpty {
Divider()
}
ForEach(groups) { group in
Button {
data.addVM(vmID: vm.id, toGroupID: group.id)
} label: {
if activeGroupID == group.id {
Label(group.title, systemImage: "checkmark")
} else {
Text(group.title)
}
}
}
if activeGroupID != nil {
Divider()
Button("Remove from Group") {
data.removeVMFromGroup(vm.id)
}
}
} label: {
Label("Group", systemImage: "folder")
}
Divider()
if vm.isShortcut {
DestructiveButton {
confirmAction = .confirmDeleteShortcut
Expand Down
Loading