- Add dedicated image serving API endpoint (/admin/images/<filename>) with security whitelist
- Update image paths from /static/ to /fs-ai-asistant/api/workflow/lawrisk/admin/images/
- Add permit import sample file download endpoint
- Enhance import wizard UI with template/sample preview section
- Add risk count column to unbound permits table
- Filter out "不涉及" (not applicable) theme from theme list
- Improve permit import UX with better visual organization
This ensures images load correctly in server deployments (nginx, gunicorn) by using
the same API prefix as other admin resources, avoiding static file routing issues.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added 'Enabled Status' dropdown filter to db_admin.html for filtering permits by visibility (visible/hidden/all)
- Updated admin_permits_advanced_filter API to accept and process visibility parameter
- Modified filter_permits_advanced in licensing_repo.py to filter by is_v2_visible column
- Fixed role-based access control to allow department_admin to toggle permit visibility
- Improved parameter parsing in API endpoints for more robust handling
1. Bind 'City-level' permits to 'SYSADMIN' department to ensure they are managed by admin.
2. Ensure Foshan 5 regions exist and Service Departments (FSSJSS etc.) are correctly bound to their regions.
3. Update specific permit binding logic to prevent leakage of 'City-level' data to district admins.
4. UI: Restrict region filter in Admin Console for non-admin users to their own region only.
- Added contact_info to permit details view and database schema
- Renamed display labels: 'Responsible Department' -> 'Contact Info (Internal)', 'Contact Info' -> 'Contact Info (External)', 'Jurisdiction Scope' -> 'Implementation Level'
- Implemented risk sorting by serial number and display of serial numbers
- Updated .gitignore to exclude temporary debug/fix/verify scripts
- Cleaned up the project directory by removing temporary files from tracking
- Remove "用户与系统管理" tab and its content from db_admin page
- Delete admin-only CSS styles and role-based logic
- Set "许可事项管理" as the default active tab
- Simplify setupTabsByRole function to remove role checks
- Update DOMContentLoaded handler to use simplified logic
Now users accessing /db_admin will directly see the permits management interface by default.
## Major Changes
### Authentication System
- Added passlib dependency for password hashing and security
- Integrated auth_service module with automatic admin seeding
- Added authentication blueprint and middleware
- Updated app initialization to ensure auth schema and default accounts
### Service Department Management
- Added build_service_department_tree() function for hierarchical data structure
- Supports nested parent-child relationships for department hierarchy
- Recursive sorting for consistent tree visualization
- Enables advanced admin interface features
### Dependencies
- Added passlib>=1.7.4 for secure password hashing
- Added openpyxl>=3.1.2 for Excel file processing
### UI Improvements
- Enhanced db_admin.html with tabbed interface styling
- Improved spacing and visual layout
- Better organization for multiple admin functions
## Technical Details
- Refactored app.py to use auth_service instead of deprecated ensure_database
- Maintains backward compatibility with existing v2 API
- Clean separation of authentication and business logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changed "管辖范围" to "权限划分" in the permit details section.
This more accurately reflects the actual meaning of the jurisdiction_scope field.
Modified:
- static/db_admin.html: Line 1208
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Issue:
- Restore operation lacked visual feedback during long-running process
- Users couldn't tell if restore was in progress or completed
- No indication of which checkpoint was being restored
Solution:
- Added dedicated progress modal that appears immediately after clicking "恢复"
- Progress modal displays:
* Large spinning loader animation
* Clear "正在恢复检查点..." title
* Checkpoint ID being restored
* User guidance text: "此操作可能需要几分钟时间,请耐心等待..."
Benefits:
- Users clearly see restore operation is in progress
- Modal blocks interaction until operation completes
- Provides checkpoint ID for confirmation
- Improves user confidence during long operations
This ensures users understand the system is working and prevents confusion.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Issues Fixed:
1. Recovery success notification not showing properly
2. Users uncertain about checkpoint persistence after restart
Improvements:
- Added delay before alert() calls to ensure modals close first
- Added success icons (✅/❌) to all operation notifications
- Added detailed success messages showing checkpoint ID and row counts
- Added informational box explaining checkpoint storage location
- Added cache-busting timestamp to checkpoint list API calls
- Ensured list refresh after create/delete/restore operations
User Experience:
- Clear success/failure feedback for all operations
- Visible confirmation that checkpoints persist across app restarts
- Detailed statistics for each checkpoint operation
This provides clear feedback and transparency about checkpoint management.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Issue:
- Restore checkpoint confirmation dialog (dangerModal) was hidden behind checkpoint management modal
- z-index of dangerModal (1000) was same as checkpointModal, causing layering issues
Solution:
- Increased z-index of .modal (dangerModal) from 1000 to 9999
- Now危险操作 confirmation dialog always appears on top of other modals
- Users can now properly see and interact with restore confirmation
This ensures critical operation confirmations are always visible and accessible.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Removed checkpoint from main workflow (step 5)
- Added standalone "检查点管理" button in top toolbar
- Created dedicated modal window for checkpoint management
- Updated UI to be more user-friendly and separate concerns
Benefits:
- Checkpoint management is now a standalone feature
- Doesn't interfere with the main database maintenance flow
- Modal window provides better focused interface
- Users can access checkpoints anytime without losing their place in the workflow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Features:
- Create manual database checkpoints with descriptions
- List all available checkpoints with statistics
- Restore database from checkpoints (with dangerous operation warning)
- Delete unwanted checkpoints
- Frontend UI integrated into database admin panel
- JSON-based checkpoint storage in data/checkpoints/
Backend Changes:
- Added checkpoint management functions to licensing_repo.py:
* create_checkpoint() - backup all tables to JSON
* list_checkpoints() - enumerate checkpoint files
* restore_checkpoint() - restore from checkpoint
* delete_checkpoint() - remove checkpoint file
- Added 4 new API endpoints to v2.py:
* GET /admin/checkpoints - list checkpoints
* POST /admin/checkpoints - create checkpoint
* POST /admin/checkpoints/{id}/restore - restore checkpoint
* DELETE /admin/checkpoints/{id} - delete checkpoint
Frontend Changes (db_admin.html):
- Added step 5 "检查点管理" to navigation
- Created checkpoint management UI with forms and lists
- Added dangerous operation confirmation modal
- Integrated into existing breadcrumb navigation system
Safety Features:
- All dangerous operations require explicit confirmation
- Restore operations show warning about data loss
- Checkpoints include row counts and table statistics
- Timestamped checkpoint IDs for easy identification
Note: Checkpoint files are stored in data/checkpoints/ directory
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
✨ Major Improvements:
- Layout optimization: Reduced navigation panel to 350px, maximized content area
- Navigation centralization: All operations in left panel with unified workflow
- History stack management: Implemented step-by-step back navigation
- Loading animations: Added loading spinners for all async operations
- Scrollable lists: Added custom scrollbar for long theme lists (max-height: 600px)
- Breadcrumb navigation: Visual path tracking with quick jump functionality
🎨 User Experience:
- Navigation paths show current position (e.g., Home › 市级 › 开办电影院)
- Clickable breadcrumbs for fast navigation to any step
- "Back" button for sequential navigation
- "Home" button to reset all selections
- Custom scrollbar styling matching UI design
- Responsive design with proper overflow handling
🔧 Technical Implementation:
- Step state machine (1→2→3→4 workflow)
- History stack for multi-step navigation
- Dynamic breadcrumb generation
- Smart state cleanup on quick jumps
- Loading states for all API operations
📁 Files Modified:
- static/db_admin.html: Complete UI/UX overhaul (734 lines)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>