feat: banners

Co-Authored-By: Jun Siang Cheah <me@jscheah.me>
This commit is contained in:
Timothy J. BaekandJun Siang Cheah committed 2024-05-26 12:18:43 -07:00
1 parent 00f32e2651
commit 242d4f0c8d
11 files changed
+461 -1

No files matched your search

+18
View File
@@ -8,6 +8,8 @@ from chromadb import Settings
from base64 import b64encode
from bs4 import BeautifulSoup
from typing import TypeVar, Generic, Union
from pydantic import BaseModel
from typing import Optional
from pathlib import Path
import json
@@ -566,6 +568,22 @@ WEBHOOK_URL = PersistentConfig(
ENABLE_ADMIN_EXPORT = os.environ.get("ENABLE_ADMIN_EXPORT", "True").lower() == "true"
class BannerModel(BaseModel):
id: str
type: str
title: Optional[str] = None
content: str
dismissible: bool
timestamp: int
WEBUI_BANNERS = PersistentConfig(
"WEBUI_BANNERS",
"ui.banners",
[BannerModel(**banner) for banner in json.loads("[]")],
)
####################################
# WEBUI_SECRET_KEY
####################################