diff --git a/api/advent22_api/core/settings.py b/api/advent22_api/core/settings.py index 04c3ea5..c509978 100644 --- a/api/advent22_api/core/settings.py +++ b/api/advent22_api/core/settings.py @@ -41,14 +41,6 @@ class RedisSettings(BaseModel): db: int = 0 protocol: int = 3 - @property - def url(self) -> str: - """ - Combined DAV URL. - """ - - return f"redis_v{self.protocol}://{self.host}:{self.port}/db_{self.db}" - class Settings(BaseSettings): """ diff --git a/api/advent22_api/routers/admin.py b/api/advent22_api/routers/admin.py index 63b523f..e3cc78b 100644 --- a/api/advent22_api/routers/admin.py +++ b/api/advent22_api/routers/admin.py @@ -8,7 +8,7 @@ from advent22_api.core.helpers import EventDates from ..core.calendar_config import CalendarConfig, DoorsSaved, get_calendar_config from ..core.config import Config, Image, get_config from ..core.depends import get_all_event_dates, get_all_image_names, get_all_parts -from ..core.settings import SETTINGS +from ..core.settings import SETTINGS, RedisSettings from ._security import require_admin, user_is_admin router = APIRouter(prefix="/admin", tags=["admin"]) @@ -48,7 +48,7 @@ class ConfigModel(BaseModel): puzzle: __Puzzle calendar: __Calendar image: Image - redis_url: str + redis: RedisSettings webdav: __WebDAV @@ -83,7 +83,7 @@ async def get_config_model( "background": cal_cfg.background, }, "image": cfg.image, - "redis_url": SETTINGS.redis.url, + "redis": SETTINGS.redis, "webdav": { "url": SETTINGS.webdav.url, "cache_ttl": SETTINGS.webdav.cache_ttl, diff --git a/ui/src/components/admin/ConfigView.vue b/ui/src/components/admin/ConfigView.vue index 80c77ae..ba5e44a 100644 --- a/ui/src/components/admin/ConfigView.vue +++ b/ui/src/components/admin/ConfigView.vue @@ -139,7 +139,10 @@