fixing UI and iscsi sync
Some checks failed
CI / test-build (push) Has been cancelled

This commit is contained in:
2025-12-20 19:16:50 +00:00
parent 2bb892dfdc
commit 6202ef8e83
12 changed files with 1436 additions and 116 deletions

View File

@@ -24,19 +24,31 @@ type NFSExport struct {
Enabled bool `json:"enabled"`
}
// ISCSITargetType represents the type of iSCSI target
type ISCSITargetType string
const (
ISCSITargetTypeDisk ISCSITargetType = "disk" // For ZVOL/block devices
ISCSITargetTypeTape ISCSITargetType = "tape" // For tape library passthrough
)
// ISCSITarget represents an iSCSI target
type ISCSITarget struct {
ID string `json:"id"`
IQN string `json:"iqn"` // iSCSI Qualified Name
LUNs []LUN `json:"luns"`
Initiators []string `json:"initiators"` // ACL list
Enabled bool `json:"enabled"`
ID string `json:"id"`
IQN string `json:"iqn"` // iSCSI Qualified Name
Type ISCSITargetType `json:"type"` // "disk" or "tape"
LUNs []LUN `json:"luns"`
Initiators []string `json:"initiators"` // ACL list
Enabled bool `json:"enabled"`
}
// LUN represents a Logical Unit Number backed by a ZVOL
// LUN represents a Logical Unit Number backed by various storage types
type LUN struct {
ID int `json:"id"` // LUN number
ZVOL string `json:"zvol"` // ZVOL name
Size uint64 `json:"size"` // bytes
Backend string `json:"backend"` // "zvol"
ID int `json:"id"` // LUN number
ZVOL string `json:"zvol"` // ZVOL name (for block backstore)
Device string `json:"device"` // Device path (e.g., /dev/st0 for tape, /dev/sdX for disk)
Size uint64 `json:"size"` // bytes (0 for unknown/tape devices)
Backend string `json:"backend"` // "zvol", "block", "pscsi", "fileio"
Backstore string `json:"backstore"` // Backstore type: "block", "pscsi", "fileio" (default: "block")
BackstoreName string `json:"backstore_name"` // Name used in targetcli
}

View File

@@ -13,6 +13,37 @@ type Pool struct {
CreatedAt time.Time `json:"created_at"`
}
// PoolDetail represents detailed pool information from zpool status
type PoolDetail struct {
Name string `json:"name"`
State string `json:"state"` // ONLINE, DEGRADED, FAULTED
Status string `json:"status"` // Full status message
VDEVs []VDEV `json:"vdevs"` // Virtual devices
Spares []string `json:"spares"` // Spare disks
Errors string `json:"errors"` // Error summary
ScrubInfo string `json:"scrub_info"` // Scrub information
}
// VDEV represents a virtual device in a pool
type VDEV struct {
Name string `json:"name"` // VDEV name or type
Type string `json:"type"` // mirror, raidz, raidz2, etc.
State string `json:"state"` // ONLINE, DEGRADED, etc.
Disks []Disk `json:"disks"` // Disks in this VDEV
Read int `json:"read"` // Read errors
Write int `json:"write"` // Write errors
Checksum int `json:"checksum"` // Checksum errors
}
// Disk represents a disk in a VDEV
type Disk struct {
Name string `json:"name"` // Disk name (e.g., sdb)
State string `json:"state"` // ONLINE, DEGRADED, FAULTED, etc.
Read int `json:"read"` // Read errors
Write int `json:"write"` // Write errors
Checksum int `json:"checksum"` // Checksum errors
}
// Dataset represents a ZFS filesystem
type Dataset struct {
Name string `json:"name"`