fix storage pool, datasets,volume and disk
Some checks failed
CI / test-build (push) Has been cancelled
Some checks failed
CI / test-build (push) Has been cancelled
This commit is contained in:
@@ -2,6 +2,7 @@ package httpapp
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"gitea.avt.data-center.id/othman.suseno/atlas/internal/errors"
|
||||
@@ -58,6 +59,22 @@ func pathParam(r *http.Request, prefix string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// pathParamFull extracts the full path after prefix (for dataset/zvol names that may contain slashes)
|
||||
func pathParamFull(r *http.Request, prefix string) string {
|
||||
path := strings.TrimPrefix(r.URL.Path, prefix)
|
||||
path = strings.Trim(path, "/")
|
||||
if path == "" {
|
||||
return ""
|
||||
}
|
||||
// URL decode the path
|
||||
decoded, err := url.PathUnescape(path)
|
||||
if err != nil {
|
||||
// If decoding fails, return original path
|
||||
return path
|
||||
}
|
||||
return decoded
|
||||
}
|
||||
|
||||
// handlePoolOps routes pool operations by method
|
||||
func (a *App) handlePoolOps(w http.ResponseWriter, r *http.Request) {
|
||||
// Extract pool name from path like /api/v1/pools/tank
|
||||
|
||||
Reference in New Issue
Block a user