MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / loadGuestCreateData

Function loadGuestCreateData

internal/ui/components/guest_create_helpers.go:26–46  ·  view source on GitHub ↗
(
	a *App,
	loadingMessage string,
	node *api.Node,
	load func(*api.Node) (T, error),
	onLoaded func(T),
	onErrorMessage string,
)

Source from the content-addressed store, hash-verified

24}
25
26func loadGuestCreateData[T any](
27 a *App,
28 loadingMessage string,
29 node *api.Node,
30 load func(*api.Node) (T, error),
31 onLoaded func(T),
32 onErrorMessage string,
33) {
34 a.header.ShowLoading(loadingMessage)
35 go func() {
36 data, err := load(node)
37 a.QueueUpdateDraw(func() {
38 a.header.ShowActiveProfile(a.header.GetCurrentProfile())
39 if err != nil {
40 a.showMessageSafe(fmt.Sprintf("%s: %v", onErrorMessage, err))
41 return
42 }
43 onLoaded(data)
44 })
45 }()
46}
47
48func (a *App) enqueueGuestCreateTask(
49 node *api.Node,

Callers 4

showVMCreateFormMethod · 0.85
displayVMCreateFormMethod · 0.85
showLXCCreateFormMethod · 0.85
displayLXCCreateFormMethod · 0.85

Calls 5

QueueUpdateDrawMethod · 0.80
showMessageSafeMethod · 0.80
ShowLoadingMethod · 0.65
ShowActiveProfileMethod · 0.65
GetCurrentProfileMethod · 0.65

Tested by

no test coverage detected