ZMB Webui: Complete Project – Rebrand & Initial Clean Commit
ARCHITECTURE ============ Backend: FastAPI + uvicorn (port 8000) - JWT authentication with PAM system users - ZFS CLI wrapper with caching (30-60s TTL) - WebSocket pool status broadcaster (30s interval) - Services: auth, zfs_runner, file_manager, shares, identities, system_info - Routers: pools, datasets, snapshots, shares, identities, navigator, system Frontend: Next.js 15 + TypeScript (static export) - Incremental Static Regeneration (ISR) for weak hardware - Type-safe API client (lib/api.ts) - Dark mode + custom Tailwind theme - Pages: Dashboard, Login, Snapshots, Datasets, Shares, etc. DEPLOYMENT ========== Test Target: 192.168.1.179:8090 (Debian LXC) Production: 10.66.120.3:9090 (Raspberry Pi 4GB ARM64) Updater: Automated Gitea-based deployment (update-test.sh, update-pi.sh) FEATURES COMPLETED ================== Phase 3a: Dashboard Quick Stats (System, CPU, Memory, Storage) - Real-time stats with color-coded progress bars - Responsive grid layout (mobile: 1, tablet: 2, desktop: 4 columns) - ISR-optimized for fast loads on weak hardware REBRANDING ========== Renamed throughout: - Project: 'ZFS Manager' → 'ZMB Webui' - Services: 'zfs-manager' → 'zmb-webui' - Systemd units: zfs-manager-backend → zmb-webui-backend - Configuration files and documentation Co-Authored-By: Patrick <patrick@perlbach24.de>
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
# Bug Fixes – April 18, 2026
|
||||
|
||||
## Summary
|
||||
✅ All reported bugs fixed and verified
|
||||
|
||||
---
|
||||
|
||||
## Bug #1: Recent Logins Missing Usernames
|
||||
|
||||
**Reported**: "Recent Logins hat keine user name drin!"
|
||||
|
||||
**Root Cause**:
|
||||
- Frontend was looking for `login.user` field
|
||||
- Backend API returns `login.username` field (different name)
|
||||
|
||||
**Fix Applied**:
|
||||
- Updated `frontend/app/identities/page.tsx` line 559
|
||||
- Changed to: `(login as any).username || (login as any).user`
|
||||
- Added fallback for compatibility
|
||||
|
||||
**Verification**:
|
||||
```
|
||||
Backend Response: {"username":"administrator","login_str":"Wed Apr 15 22:45 2026"}
|
||||
Frontend Now Shows: → administrator (Wed Apr 15 22:45 2026)
|
||||
Status: ✅ FIXED
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Bug #2: File Properties Owner – No Name Autocomplete
|
||||
|
||||
**Reported**: "File Properties Owner macht keine vervollständigung der namen"
|
||||
|
||||
**Root Cause**:
|
||||
- Owner input field was plain `<input type="text">`
|
||||
- No autocomplete or data suggestions
|
||||
- Users had to type UID numbers or guess names
|
||||
|
||||
**Fix Applied**:
|
||||
1. Added state variables to track available users/groups:
|
||||
```typescript
|
||||
const [usernames, setUsernames] = useState<string[]>([])
|
||||
const [groupnames, setGroupnames] = useState<string[]>([])
|
||||
```
|
||||
|
||||
2. Added `loadUsersAndGroups()` function to fetch from API:
|
||||
- Calls `/api/identities/users` on component mount
|
||||
- Calls `/api/identities/groups` on component mount
|
||||
- Extracts username and groupname arrays
|
||||
|
||||
3. Updated Owner input field:
|
||||
```html
|
||||
<input list="owners-list" ... />
|
||||
<datalist id="owners-list">
|
||||
{usernames.map(name => <option key={name} value={name} />)}
|
||||
</datalist>
|
||||
```
|
||||
|
||||
4. Added same for Group field
|
||||
|
||||
**Verification**:
|
||||
```
|
||||
Available Users: root, administrator, testuser, wsdd2, nobody
|
||||
Available Groups: root, sudo, administrator, tape, ...
|
||||
Owner Dropdown: ✅ NOW shows autocomplete
|
||||
Group Dropdown: ✅ NOW shows autocomplete
|
||||
Status: ✅ FIXED
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Bug #3: File Properties Group – Same Autocomplete Issue
|
||||
|
||||
**Reported**: Same as #2, applies to both Owner and Group
|
||||
|
||||
**Status**: ✅ **FIXED** (both handled in same code change)
|
||||
|
||||
---
|
||||
|
||||
## Positive Feedback
|
||||
|
||||
**Comment**: "Samba Users gefällt mir so gut!"
|
||||
|
||||
**Response**: ✅ **Feature Noted and Appreciated**
|
||||
- Samba Users feature is working well
|
||||
- Provides easy visibility into Samba-configured users
|
||||
- Allows password management for Samba accounts
|
||||
- Consider expanding with more Samba-specific features in Phase 3
|
||||
|
||||
---
|
||||
|
||||
## Files Modified
|
||||
|
||||
1. `frontend/app/identities/page.tsx`
|
||||
- Fixed login history username display
|
||||
- Lines 556-567: Updated field mapping
|
||||
|
||||
2. `frontend/app/files/page.tsx`
|
||||
- Added user/group loading on mount
|
||||
- Added state variables for usernames/groupnames
|
||||
- Updated Owner input with datalist
|
||||
- Updated Group input with datalist
|
||||
- Lines 91-93: New state variables
|
||||
- Lines 113-131: New `loadUsersAndGroups()` function
|
||||
- Lines 1005-1033: Updated input fields with autocomplete
|
||||
|
||||
---
|
||||
|
||||
## Build & Deployment
|
||||
|
||||
```
|
||||
Frontend Build: ✅ SUCCESS
|
||||
- Identities page: 4.49 kB (no change)
|
||||
- Files page: 8 kB → 8.17 kB (minimal increase)
|
||||
- Total bundle: 130 kB
|
||||
|
||||
Deployment: ✅ SUCCESS
|
||||
- All files copied to 192.168.1.179:/opt/zmb-webui/backend/static/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Testing Results
|
||||
|
||||
### Login History
|
||||
```
|
||||
✅ Field Names Match: username (was user)
|
||||
✅ Data Displays: "administrator" visible
|
||||
✅ Time Format: "Wed Apr 15 22:45 2026" displays correctly
|
||||
```
|
||||
|
||||
### File Properties Autocomplete
|
||||
```
|
||||
✅ Owner Field: Dropdown shows all 5 users
|
||||
✅ Group Field: Dropdown shows available groups
|
||||
✅ Type-as-you-filter: Native HTML5 datalist filtering
|
||||
✅ Smooth UX: No lag, built-in browser behavior
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## How to Use New Features
|
||||
|
||||
### Login History - View Users
|
||||
1. Go to **Identities → History**
|
||||
2. See login records with usernames displayed
|
||||
|
||||
### File Properties - Owner/Group Autocomplete
|
||||
1. Go to **Files → Select File → Edit Mode**
|
||||
2. Click Owner field → dropdown appears with suggestions
|
||||
3. Start typing → browser filters suggestions
|
||||
4. Click to select → sets owner/group automatically
|
||||
|
||||
---
|
||||
|
||||
## Browser Compatibility
|
||||
|
||||
HTML5 `<datalist>` element supported in:
|
||||
- ✅ Chrome/Edge 17+
|
||||
- ✅ Firefox 4+
|
||||
- ✅ Safari 12.1+
|
||||
- ✅ All modern browsers
|
||||
|
||||
Fallback for older browsers: manual text input still works
|
||||
|
||||
---
|
||||
|
||||
## Next Phase Improvements
|
||||
|
||||
Consider for Phase 3:
|
||||
- [ ] Add UID/GID fallback display in autocomplete
|
||||
- [ ] Add search/filter UI above autocomplete
|
||||
- [ ] Add "new user" quick-create option in dropdown
|
||||
- [ ] Add recent users history cache (browser localStorage)
|
||||
|
||||
---
|
||||
|
||||
**All bugs fixed, tested, and ready for production.**
|
||||
Reference in New Issue
Block a user