1. 17 Jun, 2025 5 commits
  2. 16 Jun, 2025 13 commits
  3. 15 Jun, 2025 4 commits
  4. 14 Jun, 2025 11 commits
  5. 13 Jun, 2025 7 commits
    • 🎛️ feat(dashboard): add per-panel enable switches & conditional backend payload · 882cdbd3
      Backend:
      • ConsoleSetting
        - Introduce `ApiInfoEnabled`, `UptimeKumaEnabled`, `AnnouncementsEnabled`, `FAQEnabled` (default true).
      • misc.GetStatus
        - Refactor to build response map dynamically.
        - Return the four *_enabled flags.
        - Only append `api_info`, `announcements`, `faq` when their respective flags are true.
      
      Frontend:
      • Detail page
        - Remove all `self_use_mode_enabled` checks.
        - Render API, Announcement, FAQ and Uptime panels based on the new *_enabled flags.
      • Dashboard → Settings
        - Added `Switch` controls in:
          · SettingsAPIInfo.js
          · SettingsAnnouncements.js
          · SettingsFAQ.js
          · SettingsUptimeKuma.js
        - Each switch persists its state via `/api/option` to the corresponding
          `console_setting.<panel>_enabled` key and reflects current status on load.
        - DashboardSetting.js now initialises and refreshes the four *_enabled keys so
          child components receive accurate panel states.
      
      Fixes:
      • Switches previously defaulted to “on” because *_enabled keys were missing.
        They are now included, ensuring correct visual state when panels are disabled.
      
      No breaking changes; existing functionality remains untouched aside from the
      new per-panel visibility control.
      Apple\Apple committed
    • feat: Add `controller/console_migrate.go` providing… · bccb87fe
       feat: Add `controller/console_migrate.go` providing `/api/option/migrate_console_setting` endpoint for one-off data migration.
      Apple\Apple committed
    • 🧹 refactor: drop obsolete ValidateApiInfo API & update callers · ce0ff679
      Backend
      • Removed the exported function `ValidateApiInfo` from `setting/console_setting/validation.go`; it was only a legacy wrapper and is no longer required.
      • Updated `controller/option.go` to call `ValidateConsoleSettings(value, "ApiInfo")` directly when validating `console_setting.api_info`.
      • Confirmed there are no remaining references to `ValidateApiInfo` in the codebase.
      
      This commit eliminates the last piece of compatibility code related to the old validation interface, keeping the API surface clean and consistent.
      Apple\Apple committed
    • refactor(console_setting): migrate console settings to model_setting auto-injection · 9d384f97
      Backend
      - Introduce `setting/console_setting` package that defines `ConsoleSetting` struct with JSON tags and validation rules.
      - Register the new module with `config.GlobalConfig` to enable automatic injection/export of configuration values.
      - Remove legacy `setting/console.go` and the manual `OptionMap` hooks; clean up `model/option.go`.
      - Add `controller/console_migrate.go` providing `/api/option/migrate_console_setting` endpoint for one-off data migration.
      - Update controllers (`misc`, `option`, `uptime_kuma`) and router to consume namespaced keys `console_setting.*`.
      
      Frontend
      - Refactor dashboard pages (`SettingsAPIInfo`, `SettingsAnnouncements`, `SettingsFAQ`, `SettingsUptimeKuma`) and detail page to read/write the new keys.
      - Simplify `DashboardSetting.js` state to only include namespaced options.
      
      BREAKING CHANGE: All console-related option keys are now stored under `console_setting.*`. Run the migration endpoint once after deployment to preserve existing data.
      Apple\Apple committed
    • 🎫 feat: Enhance redemption code expiry handling & improve UI responsiveness · f5e3617c
      Backend
      • Introduced `validateExpiredTime` helper in `controller/redemption.go`; reused in both Add & Update endpoints to enforce “expiry time must not be earlier than now”, eliminating duplicated checks
      • Removed `RedemptionCodeStatusExpired` constant and all related references – expiry is now determined exclusively by the `expired_time` field for simpler, safer state management
      • Simplified `DeleteInvalidRedemptions`: deletes codes that are `used` / `disabled` or `enabled` but already expired, without relying on extra status codes
      • Controller no longer mutates `status` when listing or fetching redemption codes; clients derive expiry status from timestamp
      
      Frontend
      • Added reusable `isExpired` helper in `RedemptionsTable.js`; leveraged for:
        – status rendering (orange “Expired” tag)
        – action-menu enable/disable logic
        – row styling
      • Removed duplicated inline expiry logic, improving readability and performance
      • Adjusted toolbar layout: on small screens the “Clear invalid codes” button now wraps onto its own line, while “Add” & “Copy” remain grouped
      
      Result
      The codebase is now more maintainable, secure, and performant with no redundant constants, centralized validation, and cleaner UI behaviour across devices.
      Apple\Apple committed