chore: enhance data source configuration and mock data handling
Docker images / backend-image (push) Successful in 39s
Docker images / frontend-image (push) Successful in 1m38s
Docker images / updater-image (push) Successful in 35s
Docker images / notify-webhook (push) Has been skipped

- Added support for mock data mode in the frontend by introducing a new environment variable in the Dockerfile and workflow configuration.
- Updated the settings page to conditionally display options based on the availability of mock data, improving user experience.
- Refactored data source logic to include a check for mock data availability, ensuring proper mode handling in the application.
This commit is contained in:
Denozordec committed 2026-05-12 15:38:27 +07:00
1 parent 4489dfb2d6
commit 1fefed2aa0
5 files changed
+48 -23

No files matched your search

+5
View File
@@ -13,9 +13,14 @@ export function configuredBackendUrl(): ConfiguredBackendUrl {
}
export function defaultDataSourceMode(): "mock" | "live" {
if (!isMockDataSourceAvailable()) return "live"
return process.env.NEXT_PUBLIC_DEFAULT_DATA_SOURCE === "live" ? "live" : "mock"
}
export function isMockDataSourceAvailable(): boolean {
return process.env.NEXT_PUBLIC_ALLOW_MOCK_DATA !== "false"
}
export function isBackendUrlLocked(): boolean {
const cfg = configuredBackendUrl()
return cfg.kind === "same-origin" || cfg.kind === "fixed"