agent-zero/python/api/settings_set.py
Alessandro b823fcfb5d refactor settings and scheduler
- Simplified task detail opening logic by integrating it into the `settingsModalStore`
- Updated the visibility condition for the task detail view in `scheduler-task-detail.html` to rely solely on the selected task state

rm attributes from components

simplify task display logic

settings components init

scheduler componentize

- Removed the inline scheduler settings script from `index.html` and replaced it with a new component structure in `scheduler-settings.html`, `scheduler-task-editor.html`, `scheduler-task-list.html`, and `scheduler-task-detail.html`.
- Introduced a dedicated `scheduler-store.js` to manage state and logic for the scheduler, enhancing maintainability and separation of concerns.
- Updated the `index.js` to remove the now obsolete `openTaskDetail` function, integrating task detail handling within the new store.
- Removed the deprecated `scheduler.js` file, consolidating functionality into the new component architecture.

settings modal store rename

- Replaced all instances of `$store.settingsModalStore` with `$store.settingsStore` across various settings components.

scheduler tab content x-if
2025-12-22 05:05:36 +01:00

14 lines
572 B
Python

from python.helpers.api import ApiHandler, Request, Response
from python.helpers import settings
from typing import Any
class SetSettings(ApiHandler):
async def process(self, input: dict[Any, Any], request: Request) -> dict[Any, Any] | Response:
# Convert SettingsOutput (sections/fields) into internal flat Settings,
# persist it, then return the updated SettingsOutput back to the UI.
internal = settings.convert_in(input)
settings.set_settings(internal)
return {"settings": settings.convert_out(settings.get_settings())}