Skip to content

v1.0.4

Choose a tag to compare

@dhannyjsb dhannyjsb released this 08 Dec 16:28
3de40f1

πŸŽ“ Erapor 2025 Integration

✨ Fitur Baru

  • Smart Port 8239 Detection
    • Automatic detection port 8239 untuk Erapor 2025 application
    • Check keberadaan file C:\appraporsmaref25\wwwroot\app\Config\App.php
    • Validasi konfigurasi baseURL di CodeIgniter App.php
    • Real-time monitoring changes pada port mappings
  • Auto-Configuration System
    • Banner notification saat port 8239 terdeteksi dan file App.php ditemukan
    • One-click apply configuration dengan tombol "Apply Erapor 2025"
    • Automatic backup file sebelum modification (.backup.{timestamp})
    • Domain matching validation: pastikan hostname mapping = baseURL config
    • Insert/update public __construct() method dengan markers
  • Auto-Cleanup on Delete
    • Automatic restore ke default config saat mapping port 8239 dihapus
    • Marker-based precise block detection dan removal
    • START/END markers untuk clean deletion tanpa code fragments
    • Restore backup dengan timestamp sebelum cleanup
  • Visual Status Indicators
    • Yellow Banner: Muncul saat port 8239 aktif tapi config belum applied
      • Menampilkan domain comparison (Expected vs Current)
      • Tombol "Apply Erapor 2025" dan "Dismiss"
    • Green Badge: Muncul di tabel mapping saat konfigurasi sudah benar
      • Badge "Erapor Online βœ“" dengan checkmark icon
      • Ditampilkan di sebelah hostname untuk port 8239
      • Hanya muncul saat configuration verified dan match

🎨 UI/UX Improvements

  • Non-Intrusive Banner Design
    • Positioned di bawah tombol "Add Mapping"
    • Dapat di-dismiss tanpa apply jika belum siap
    • Shows clear comparison antara expected vs current baseURL
    • Loading state pada tombol apply
    • Success/error messages dengan auto-hide
  • Status Badge in Mapping Table
    • Compact green badge dengan border dan subtle background
    • Icon checkmark (βœ“) untuk visual confirmation
    • Badge text: "Erapor Online βœ“"
    • Only visible when port 8239 properly configured
    • Professional color scheme: green-500/20 background, green-400 text

πŸ”§ Technical Implementation

  • IPC Handlers (electron/main/ipcHandlers.js):
    • portMapping:checkErapor2025Config - Validate config vs mapping
    • portMapping:applyErapor2025Config - Apply constructor with markers
    • portMapping:restoreErapor2025Config - Clean removal of config block
  • PHP File Parsing:
    • Regex-based detection of existing constructor
    • Marker detection: //AUTO-CONFIG-FROM-CTM-START dan END
    • baseURL extraction dan domain comparison
    • Safe file operations dengan backup mechanism
  • React Components:
    • Erapor2025Banner.jsx - Configuration prompt banner
    • Enhanced PortMappingManager.jsx dengan auto-check dan badge rendering
    • State management untuk config status
    • Auto-refresh after apply/restore operations

πŸ”’ Security & Reliability

  • File Safety:
    • Automatic backup sebelum ANY modification
    • Backup naming: App.php.backup.{timestamp}
    • Restore capability jika terjadi error
  • Validation:
    • File existence check sebelum operations
    • Domain format validation
    • Config integrity verification
    • Marker presence validation
  • Error Handling:
    • Graceful degradation jika file tidak accessible
    • Clear error messages untuk user
    • Logging untuk debugging
    • Rollback capability via backups

πŸ“¦ User Experience Flow

  1. Detection Phase:
    • User create mapping dengan port 8239
    • System check file App.php existence
    • Validate current configuration
  2. Configuration Phase:
    • Yellow banner appears jika config needed
    • User click "Apply Erapor 2025"
    • System backup file β†’ insert constructor β†’ refresh UI
    • Green badge appears confirming success
  3. Active Phase:
    • Green "Erapor Online βœ“" badge visible di table
    • Configuration active dan working
    • No banner shown (clean UI)
  4. Cleanup Phase:
    • User delete port 8239 mapping
    • System auto-restore ke default config
    • Remove constructor block cleanly
    • Create restore backup

🎯 Benefits

βœ… Zero manual PHP file editing
βœ… One-click configuration management
βœ… Automatic backup protection
βœ… Visual confirmation of status
βœ… Clean auto-cleanup on delete
βœ… No code fragments left behind
βœ… Professional visual indicators
βœ… Seamless integration dengan existing workflow