feat: add favicon to Castbox web interface using relative path lookup
This commit is contained in:
@@ -1,11 +1,14 @@
|
|||||||
# frontend/app.py
|
# frontend/app.py
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import streamlit as st
|
|
||||||
import requests
|
|
||||||
from auracast import auracast_config
|
|
||||||
import logging as log
|
import logging as log
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
import requests
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
import streamlit as st
|
||||||
|
|
||||||
|
from auracast import auracast_config
|
||||||
from auracast.utils.frontend_auth import (
|
from auracast.utils.frontend_auth import (
|
||||||
is_pw_disabled,
|
is_pw_disabled,
|
||||||
load_pw_record,
|
load_pw_record,
|
||||||
@@ -15,7 +18,11 @@ from auracast.utils.frontend_auth import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Set page configuration (tab title and icon) before using other Streamlit APIs
|
# Set page configuration (tab title and icon) before using other Streamlit APIs
|
||||||
st.set_page_config(page_title="Castbox", page_icon="", layout="centered")
|
# Always use the favicon from the utils folder relative to this file
|
||||||
|
_THIS_DIR = os.path.dirname(__file__)
|
||||||
|
_FAVICON_PATH = os.path.abspath(os.path.join(_THIS_DIR, '..', 'utils', 'favicon.ico'))
|
||||||
|
favicon = Image.open(_FAVICON_PATH)
|
||||||
|
st.set_page_config(page_title="Castbox", page_icon=favicon, layout="centered")
|
||||||
|
|
||||||
# Load environment variables from a .env file if present
|
# Load environment variables from a .env file if present
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|||||||
BIN
src/auracast/utils/favicon.ico
Normal file
BIN
src/auracast/utils/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user