add tui features
Some checks failed
CI / test-build (push) Failing after 2m26s

This commit is contained in:
2025-12-15 01:08:17 +07:00
parent 96a6b5a4cf
commit 507961716e
12 changed files with 2793 additions and 8 deletions

View File

@@ -9,7 +9,8 @@ import (
var (
// Valid pool/dataset name pattern (ZFS naming rules)
zfsNamePattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_\-\.:]*$`)
// Note: Forward slash (/) is allowed for dataset paths (e.g., "tank/data")
zfsNamePattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_\-\.:/]*$`)
// Valid username pattern
usernamePattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_\-\.]{2,31}$`)
@@ -51,7 +52,7 @@ func ValidateZFSName(name string) error {
}
if !zfsNamePattern.MatchString(name) {
return &ValidationError{Field: "name", Message: "invalid characters (allowed: a-z, A-Z, 0-9, _, -, ., :)"}
return &ValidationError{Field: "name", Message: "invalid characters (allowed: a-z, A-Z, 0-9, _, -, ., :, /)"}
}
// ZFS names cannot start with certain characters