diff --git a/lenticular_cloud/config_development.toml b/lenticular_cloud/config_development.toml index 306e0d9..4bc9b6e 100644 --- a/lenticular_cloud/config_development.toml +++ b/lenticular_cloud/config_development.toml @@ -32,6 +32,8 @@ ADMINS = [ [LENTICULAR_CLOUD_SERVICES.jabber] app_token = true # client_cert= true +icon = "https://seafile.milliways.info/media/favicons/favicon.png" +href = "https://seafile.milliways.info" [LENTICULAR_CLOUD_SERVICES.mail-cardav] diff --git a/lenticular_cloud/lenticular_services.py b/lenticular_cloud/lenticular_services.py index 784416c..51d8a22 100644 --- a/lenticular_cloud/lenticular_services.py +++ b/lenticular_cloud/lenticular_services.py @@ -1,11 +1,12 @@ from flask import Flask -from .model import Service import logging +from .model import Service + logger = logging.getLogger(__name__) -class LenticularServices(dict): +class LenticularServices(dict[str, Service]): def init_app(self, app: Flask) -> None: for service_name, service_config in app.config['LENTICULAR_CLOUD_SERVICES'].items(): diff --git a/lenticular_cloud/model.py b/lenticular_cloud/model.py index 27a1f82..135b937 100644 --- a/lenticular_cloud/model.py +++ b/lenticular_cloud/model.py @@ -58,6 +58,9 @@ class Service(object): def __init__(self, name: str): self._name = name self._app_token = False + self._icon: Optional[str] = None + self._href: Optional[str] = None + self._client_cert = False self._pki_config = { 'cn': '{username}', @@ -66,8 +69,6 @@ class Service(object): @staticmethod def from_config(name, config) -> 'Service': - """ - """ service = Service(name) if 'app_token' in config: service._app_token = bool(config['app_token']) @@ -75,6 +76,10 @@ class Service(object): service._client_cert = bool(config['client_cert']) if 'pki_config' in config: service._pki_config.update(config['pki_config']) + if 'icon' in config: + service._icon = str(config['icon']) + if 'href' in config: + service._href = str(config['href']) return service @@ -96,6 +101,14 @@ class Service(object): raise Exception('invalid call') return self._pki_config + @property + def icon(self) -> Optional[str]: + return self._icon + + @property + def href(self) -> Optional[str]: + return self._href + class Certificate(object): diff --git a/lenticular_cloud/template/frontend/fido2.html.j2 b/lenticular_cloud/template/frontend/fido2.html.j2 deleted file mode 100644 index e69de29..0000000 diff --git a/lenticular_cloud/template/frontend/index.html.j2 b/lenticular_cloud/template/frontend/index.html.j2 index ffe0a48..f2af783 100644 --- a/lenticular_cloud/template/frontend/index.html.j2 +++ b/lenticular_cloud/template/frontend/index.html.j2 @@ -1,2 +1,19 @@ {% extends 'frontend/base.html.j2' %} + + +{% block content %} +