Build 2602260022: enterprise UI refresh and users bulk auto-search
This commit is contained in:
@@ -1 +1 @@
|
||||
2502262321
|
||||
2602260022
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
BUILD_NUMBER = "2502262321"
|
||||
BUILD_NUMBER = "2602260022"
|
||||
CHANGELOG = '2026-01-22\\n- Initial commit\\n- Ignore build artifacts\\n- Update README\\n- Update README with Docker-first guide\\n\\n2026-01-23\\n- Fix cache titles via Jellyseerr media lookup\\n- Split search actions and improve download options\\n- Fallback manual grab to qBittorrent\\n- Hide header actions when signed out\\n- Add feedback form and webhook\\n- Fix cache titles and move feedback link\\n- Show available status on landing when in Jellyfin\\n- Add default branding assets when missing\\n- Use bundled branding assets\\n- Remove password fields from users page\\n- Add Docker Hub compose override\\n- Fix backend Dockerfile paths for root context\\n- Copy public assets into frontend image\\n- Use backend branding assets for logo and favicon\\n\\n2026-01-24\\n- Route grabs through Sonarr/Radarr only\\n- Document fix buttons in how-it-works\\n- Clarify how-it-works steps and fixes\\n- Map Prowlarr releases to Arr indexers for manual grab\\n- Improve request handling and qBittorrent categories\\n\\n2026-01-25\\n- Add site banner, build number, and changelog\\n- Automate build number tagging and sync\\n- Improve mobile header layout\\n- Move account actions into avatar menu\\n- Add user stats and activity tracking\\n- Add Jellyfin login cache and admin-only stats\\n- Tidy request sync controls\\n- Seed branding logo from bundled assets\\n- Serve bundled branding assets by default\\n- Harden request cache titles and cache-only reads\\n- Build 2501262041\\n\\n2026-01-26\\n- Fix cache title hydration\\n- Fix sync progress bar animation\\n\\n2026-01-27\\n- Add cache control artwork stats\\n- Improve cache stats performance (build 271261145)\\n- Fix backend cache stats import (build 271261149)\\n- Clarify request sync settings (build 271261159)\\n- Bump build number to 271261202\\n- Fix request titles in snapshots (build 271261219)\\n- Fix snapshot title fallback (build 271261228)\\n- Add cache load spinner (build 271261238)\\n- Bump build number (process 2) 271261322\\n- Add service test buttons (build 271261335)\\n- Fallback to TMDB when artwork cache fails (build 271261524)\\n- Hydrate missing artwork from Jellyseerr (build 271261539)\\n\\n2026-01-29\\n- release: 2901262036\\n- release: 2901262044\\n- release: 2901262102\\n- Hardcode build number in backend\\n- Bake build number and changelog\\n- Update full changelog\\n- Tidy full changelog\\n- Build 2901262240: cache users\n\n2026-01-30\n- Merge backend and frontend into one container'
|
||||
|
||||
@@ -569,6 +569,17 @@ def set_user_auto_search_enabled(username: str, enabled: bool) -> None:
|
||||
)
|
||||
|
||||
|
||||
def set_auto_search_enabled_for_non_admin_users(enabled: bool) -> int:
|
||||
with _connect() as conn:
|
||||
cursor = conn.execute(
|
||||
"""
|
||||
UPDATE users SET auto_search_enabled = ? WHERE role != 'admin'
|
||||
""",
|
||||
(1 if enabled else 0,),
|
||||
)
|
||||
return cursor.rowcount
|
||||
|
||||
|
||||
def verify_user_password(username: str, password: str) -> Optional[Dict[str, Any]]:
|
||||
user = get_user_by_username(username)
|
||||
if not user:
|
||||
|
||||
@@ -25,6 +25,7 @@ from ..db import (
|
||||
set_setting,
|
||||
set_user_blocked,
|
||||
set_user_auto_search_enabled,
|
||||
set_auto_search_enabled_for_non_admin_users,
|
||||
set_user_password,
|
||||
set_user_role,
|
||||
run_integrity_check,
|
||||
@@ -673,6 +674,20 @@ async def update_user_auto_search(username: str, payload: Dict[str, Any]) -> Dic
|
||||
return {"status": "ok", "username": username, "auto_search_enabled": enabled}
|
||||
|
||||
|
||||
@router.post("/users/auto-search/bulk")
|
||||
async def update_users_auto_search_bulk(payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
enabled = payload.get("enabled") if isinstance(payload, dict) else None
|
||||
if not isinstance(enabled, bool):
|
||||
raise HTTPException(status_code=400, detail="enabled must be true or false")
|
||||
updated = set_auto_search_enabled_for_non_admin_users(enabled)
|
||||
return {
|
||||
"status": "ok",
|
||||
"enabled": enabled,
|
||||
"updated": updated,
|
||||
"scope": "non-admin-users",
|
||||
}
|
||||
|
||||
|
||||
@router.post("/users/{username}/password")
|
||||
async def update_user_password(username: str, payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
new_password = payload.get("password") if isinstance(payload, dict) else None
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -182,82 +182,92 @@ export default function UserDetailPage() {
|
||||
) : (
|
||||
<>
|
||||
<div className="user-detail-card">
|
||||
<div className="user-detail-header">
|
||||
<div>
|
||||
<strong>{user.username}</strong>
|
||||
<div className="user-detail-meta">
|
||||
<span className="meta">Jellyseerr ID: {user.jellyseerr_user_id ?? user.id ?? 'Unknown'}</span>
|
||||
<span className="meta">Role: {user.role}</span>
|
||||
<span className="meta">Login type: {user.auth_provider || 'local'}</span>
|
||||
<span className="meta">Last login: {formatDateTime(user.last_login_at)}</span>
|
||||
<div className="user-detail-layout">
|
||||
<div className="user-detail-identity">
|
||||
<div className="user-detail-title-row">
|
||||
<strong className="user-detail-name">{user.username}</strong>
|
||||
<span className={`user-grid-pill ${user.is_blocked ? 'is-blocked' : ''}`}>
|
||||
{user.is_blocked ? 'Blocked' : 'Active'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="user-detail-meta-pills">
|
||||
<span className="user-detail-chip">
|
||||
Jellyseerr ID: {user.jellyseerr_user_id ?? user.id ?? 'Unknown'}
|
||||
</span>
|
||||
<span className="user-detail-chip">Role: {user.role}</span>
|
||||
<span className="user-detail-chip">Login type: {user.auth_provider || 'local'}</span>
|
||||
<span className="user-detail-chip">Last login: {formatDateTime(user.last_login_at)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="user-actions">
|
||||
<label className="toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={user.role === 'admin'}
|
||||
onChange={(event) => updateUserRole(event.target.checked ? 'admin' : 'user')}
|
||||
/>
|
||||
<span>Make admin</span>
|
||||
</label>
|
||||
<label className="toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={Boolean(user.auto_search_enabled ?? true)}
|
||||
disabled={user.role === 'admin'}
|
||||
onChange={(event) => updateAutoSearchEnabled(event.target.checked)}
|
||||
/>
|
||||
<span>Allow auto search/download</span>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="ghost-button"
|
||||
onClick={() => toggleUserBlock(!user.is_blocked)}
|
||||
>
|
||||
{user.is_blocked ? 'Allow access' : 'Block access'}
|
||||
</button>
|
||||
<div className="user-detail-controls">
|
||||
<div className="user-detail-controls-title">User controls</div>
|
||||
<div className="user-detail-actions">
|
||||
<label className="toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={user.role === 'admin'}
|
||||
onChange={(event) => updateUserRole(event.target.checked ? 'admin' : 'user')}
|
||||
/>
|
||||
<span>Make admin</span>
|
||||
</label>
|
||||
<label className="toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={Boolean(user.auto_search_enabled ?? true)}
|
||||
disabled={user.role === 'admin'}
|
||||
onChange={(event) => updateAutoSearchEnabled(event.target.checked)}
|
||||
/>
|
||||
<span>Allow auto search/download</span>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="ghost-button"
|
||||
onClick={() => toggleUserBlock(!user.is_blocked)}
|
||||
>
|
||||
{user.is_blocked ? 'Allow access' : 'Block access'}
|
||||
</button>
|
||||
</div>
|
||||
{user.role === 'admin' && (
|
||||
<div className="user-detail-helper">
|
||||
Admins always have auto search/download access.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{user.role === 'admin' && (
|
||||
<div className="user-detail-meta">
|
||||
<span className="meta">Admins always have auto search/download access.</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="user-detail-grid">
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">Total</span>
|
||||
<span className="value">{stats?.total ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">Ready</span>
|
||||
<span className="value">{stats?.ready ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">Pending</span>
|
||||
<span className="value">{stats?.pending ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">Approved</span>
|
||||
<span className="value">{stats?.approved ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">Working</span>
|
||||
<span className="value">{stats?.working ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">Partial</span>
|
||||
<span className="value">{stats?.partial ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">Declined</span>
|
||||
<span className="value">{stats?.declined ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat">
|
||||
<span className="label">In progress</span>
|
||||
<span className="value">{stats?.in_progress ?? 0}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="user-detail-stat user-detail-stat--wide">
|
||||
<span className="label">Last request</span>
|
||||
<span className="value">{formatDateTime(stats?.last_request_at)}</span>
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,7 @@ type AdminUser = {
|
||||
authProvider?: string | null
|
||||
lastLoginAt?: string | null
|
||||
isBlocked?: boolean
|
||||
autoSearchEnabled?: boolean
|
||||
stats?: UserStats
|
||||
}
|
||||
|
||||
@@ -74,6 +75,7 @@ export default function UsersPage() {
|
||||
const [jellyseerrSyncStatus, setJellyseerrSyncStatus] = useState<string | null>(null)
|
||||
const [jellyseerrSyncBusy, setJellyseerrSyncBusy] = useState(false)
|
||||
const [jellyseerrResyncBusy, setJellyseerrResyncBusy] = useState(false)
|
||||
const [bulkAutoSearchBusy, setBulkAutoSearchBusy] = useState(false)
|
||||
|
||||
const loadUsers = async () => {
|
||||
try {
|
||||
@@ -100,6 +102,7 @@ export default function UsersPage() {
|
||||
authProvider: user.auth_provider ?? 'local',
|
||||
lastLoginAt: user.last_login_at ?? null,
|
||||
isBlocked: Boolean(user.is_blocked),
|
||||
autoSearchEnabled: Boolean(user.auto_search_enabled ?? true),
|
||||
id: Number(user.id ?? 0),
|
||||
stats: normalizeStats(user.stats ?? emptyStats),
|
||||
}))
|
||||
@@ -208,6 +211,33 @@ export default function UsersPage() {
|
||||
}
|
||||
}
|
||||
|
||||
const bulkUpdateAutoSearch = async (enabled: boolean) => {
|
||||
setBulkAutoSearchBusy(true)
|
||||
setJellyseerrSyncStatus(null)
|
||||
try {
|
||||
const baseUrl = getApiBase()
|
||||
const response = await authFetch(`${baseUrl}/admin/users/auto-search/bulk`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ enabled }),
|
||||
})
|
||||
if (!response.ok) {
|
||||
const text = await response.text()
|
||||
throw new Error(text || 'Bulk update failed')
|
||||
}
|
||||
const data = await response.json()
|
||||
setJellyseerrSyncStatus(
|
||||
`${enabled ? 'Enabled' : 'Disabled'} auto search/download for ${data?.updated ?? 0} non-admin users.`
|
||||
)
|
||||
await loadUsers()
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
setError('Could not update auto search/download for all users.')
|
||||
} finally {
|
||||
setBulkAutoSearchBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!getToken()) {
|
||||
router.push('/login')
|
||||
@@ -220,6 +250,9 @@ export default function UsersPage() {
|
||||
return <main className="card">Loading users...</main>
|
||||
}
|
||||
|
||||
const nonAdminUsers = users.filter((user) => user.role !== 'admin')
|
||||
const autoSearchEnabledCount = nonAdminUsers.filter((user) => user.autoSearchEnabled !== false).length
|
||||
|
||||
return (
|
||||
<AdminShell
|
||||
title="Users"
|
||||
@@ -241,6 +274,31 @@ export default function UsersPage() {
|
||||
<section className="admin-section">
|
||||
{error && <div className="error-banner">{error}</div>}
|
||||
{jellyseerrSyncStatus && <div className="status-banner">{jellyseerrSyncStatus}</div>}
|
||||
<div className="user-bulk-toolbar">
|
||||
<div className="user-bulk-summary">
|
||||
<strong>Auto search/download</strong>
|
||||
<span>
|
||||
{autoSearchEnabledCount} of {nonAdminUsers.length} non-admin users enabled
|
||||
</span>
|
||||
</div>
|
||||
<div className="user-bulk-actions">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => bulkUpdateAutoSearch(true)}
|
||||
disabled={bulkAutoSearchBusy}
|
||||
>
|
||||
{bulkAutoSearchBusy ? 'Working...' : 'Enable for all users'}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="ghost-button"
|
||||
onClick={() => bulkUpdateAutoSearch(false)}
|
||||
disabled={bulkAutoSearchBusy}
|
||||
>
|
||||
{bulkAutoSearchBusy ? 'Working...' : 'Disable for all users'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{users.length === 0 ? (
|
||||
<div className="status-banner">No users found yet.</div>
|
||||
) : (
|
||||
@@ -260,6 +318,11 @@ export default function UsersPage() {
|
||||
{user.isBlocked ? 'Blocked' : 'Active'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="user-grid-subpills">
|
||||
<span className={`user-grid-pill ${user.autoSearchEnabled === false ? 'is-disabled' : ''}`}>
|
||||
Auto search {user.autoSearchEnabled === false ? 'Off' : 'On'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="user-grid-stats">
|
||||
<div>
|
||||
<span className="label">Total</span>
|
||||
|
||||
Reference in New Issue
Block a user