Handle disabled core log file#52523
Conversation
|
@abmantis this is the frontend follow-up for home-assistant/core#170374. It shows a warning when Core is not managing a log file, hides the unavailable raw/download log actions, and skips the debug-log download path in that state. |
|
Please use the PR template |
|
Thanks @MindFreeze, updated the PR description to use the template. |
| managed_log_file: boolean; | ||
| managed_log_file_disabled_reason: ManagedLogFileDisabledReason | null; |
There was a problem hiding this comment.
I don't see where these come from. I don't see them in the core PR
| (hass.config as HomeAssistant["config"] & { logging?: LoggingConfig }) | ||
| .logging; |
There was a problem hiding this comment.
We shouldn't need this casting
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Thanks, addressed both. The I also removed the local cast here and added the logging metadata to the local |
1f505e8 to
1bd4662
Compare
Proposed change
Handle Core instances that report no managed log file. This keeps the Logs panel usable when Core is running with
HA_DISABLE_LOG_FILE=1, but avoids exposing raw log-file actions that cannot work because there is no Home Assistant-managed log file to serve.The PR:
Screenshots
After this change, the Logs panel shows a warning alert explaining that raw log view and log download are unavailable because Core is not managing a log file.
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests:
Testing
yarn prettier --check gallery/src/components/page-description.ts gallery/src/ha-gallery.ts src/data/error_log.ts src/panels/config/integrations/ha-config-integration-page.ts src/panels/config/logs/error-log-card.ts src/panels/config/logs/system-log-card.ts src/translations/en.jsonyarn eslint gallery/src/components/page-description.ts gallery/src/ha-gallery.ts src/data/error_log.ts src/panels/config/integrations/ha-config-integration-page.ts src/panels/config/logs/error-log-card.ts src/panels/config/logs/system-log-card.ts --max-warnings=0yarn lint:typesyarn lint:litexited successfully with existing repo-wide warnings.HA_DISABLE_LOG_FILE=1and verified the warning alert and hidden log download controls in the Logs panel.