Skip to content

[Feat] Faction Activity Log GUI with filtering #68

@derrickmehaffy

Description

@derrickmehaffy

Scope

Enhance the existing activity log system with an admin global log view and improved filtering:

  1. Per-faction activity log GUI already exists (LogsViewerPage.java) with 17 event types, pagination (10/page), and type filtering
  2. NEW: Admin global activity log — shows events across ALL factions, accessible via /f admin log
  3. NEW: Player filter — filter activity log entries by specific player (actor)
  4. NEW: Date range filter — filter by time period (last hour, day, week, custom)
  5. ENHANCE: Existing per-faction log — add player filter capability

Implementation Details

Existing activity log (LogsViewerPage.java):

  • 17 FactionLog.LogType values: MEMBER_JOIN, MEMBER_LEAVE, MEMBER_KICK, MEMBER_PROMOTE, MEMBER_DEMOTE, CLAIM, UNCLAIM, OVERCLAIM, HOME_SET, RELATION_ALLY, RELATION_ENEMY, RELATION_NEUTRAL, LEADER_TRANSFER, SETTINGS_CHANGE, POWER_CHANGE, ECONOMY, ADMIN_POWER
  • Pagination: 10 per page (line 31)
  • Type filtering exists (lines 42-49)
  • Sorting: newest first (line 71)

Admin global log implementation:

  • Create AdminActivityLogPage.java — iterates factionManager.getAllFactions(), collects all logs, merges + sorts by timestamp
  • Add faction name/tag to each log entry display for context
  • Register in admin GUI section of FactionPageRegistry
  • Command: /f admin log [type] [player]

Player filter enhancement:

  • Add player UUID filter to LogsViewerPage data model
  • Filter using FactionLog.actorUuid() match
  • UI: dropdown or search field for player selection

Risks and Alternatives

  1. Storage concern: Aggregating logs across all factions for the admin view could be expensive — consider lazy loading or time-window limits
  2. Retention: May need configurable log retention/pruning (e.g., keep last 30 days) to prevent unbounded growth
  3. Alternative: Text-only /f admin log output without GUI for simpler implementation first

References and Media

Enhances the existing LogsViewerPage.java pattern. Global log follows the AdminEconomyPage.java pattern for admin-level aggregate views.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions