MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / getOperation

Function getOperation

agent/app/service/runtime_utils.go:1119–1131  ·  view source on GitHub ↗
(operate, pkgManager string)

Source from the content-addressed store, hash-verified

1117}
1118
1119func getOperation(operate, pkgManager string) string {
1120 operations := map[string][2]string{
1121 constant.RuntimeInstall: {"install", "add"},
1122 constant.RuntimeUninstall: {"uninstall", "remove"},
1123 constant.RuntimeUpdate: {"update", "upgrade"},
1124 }
1125
1126 ops := operations[operate]
1127 if pkgManager == constant.RuntimeNpm {
1128 return ops[0]
1129 }
1130 return ops[1]
1131}
1132
1133func handleRuntimeDetailID(runtime model.Runtime) (uint, uint) {
1134 app, _ := appRepo.GetFirst(appRepo.WithKey(runtime.Type))

Callers 1

OperateNodeModulesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected