refine disk information page
Some checks failed
CI / test-build (push) Has been cancelled

This commit is contained in:
2025-12-20 13:21:12 +00:00
parent 45aaec9e47
commit a463a09329
5 changed files with 413 additions and 11 deletions

View File

@@ -137,6 +137,16 @@ func (a *App) handleZVOLOps(w http.ResponseWriter, r *http.Request) {
// handleSnapshotOps routes snapshot operations by method
func (a *App) handleSnapshotOps(w http.ResponseWriter, r *http.Request) {
// Check if it's a restore operation
if strings.HasSuffix(r.URL.Path, "/restore") {
if r.Method == http.MethodPost {
a.handleRestoreSnapshot(w, r)
} else {
writeError(w, errors.ErrBadRequest("method not allowed"))
}
return
}
methodHandler(
func(w http.ResponseWriter, r *http.Request) { a.handleGetSnapshot(w, r) },
func(w http.ResponseWriter, r *http.Request) { a.handleCreateSnapshot(w, r) },