Allow the application name to be configurable in settings (#80)
* Make app name configurable * Use app name in browser tab
This commit is contained in:
parent
04e602161b
commit
56dfc8fb53
|
@ -35,6 +35,7 @@ class BaseApp:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.dev_mode = getattr(settings, "KH_MODE", "") == "dev"
|
self.dev_mode = getattr(settings, "KH_MODE", "") == "dev"
|
||||||
|
self.app_name = getattr(settings, "KH_APP_NAME", "Kotaemon")
|
||||||
self.f_user_management = getattr(settings, "KH_FEATURE_USER_MANAGEMENT", False)
|
self.f_user_management = getattr(settings, "KH_FEATURE_USER_MANAGEMENT", False)
|
||||||
self._theme = gr.Theme.from_hub("lone17/kotaemon")
|
self._theme = gr.Theme.from_hub("lone17/kotaemon")
|
||||||
|
|
||||||
|
@ -158,7 +159,7 @@ class BaseApp:
|
||||||
with gr.Blocks(
|
with gr.Blocks(
|
||||||
theme=self._theme,
|
theme=self._theme,
|
||||||
css=self._css,
|
css=self._css,
|
||||||
title="Kotaemon",
|
title=self.app_name,
|
||||||
analytics_enabled=False,
|
analytics_enabled=False,
|
||||||
) as demo:
|
) as demo:
|
||||||
self.app = demo
|
self.app = demo
|
||||||
|
|
|
@ -9,7 +9,7 @@ class ChatPanel(BasePage):
|
||||||
|
|
||||||
def on_building_ui(self):
|
def on_building_ui(self):
|
||||||
self.chatbot = gr.Chatbot(
|
self.chatbot = gr.Chatbot(
|
||||||
label="Kotaemon",
|
label=self._app.app_name,
|
||||||
placeholder=(
|
placeholder=(
|
||||||
"This is the beginning of a new conversation.\nMake sure to have added"
|
"This is the beginning of a new conversation.\nMake sure to have added"
|
||||||
" a LLM by following the instructions in the Help tab."
|
" a LLM by following the instructions in the Help tab."
|
||||||
|
|
|
@ -31,7 +31,7 @@ class LoginPage(BasePage):
|
||||||
self.on_building_ui()
|
self.on_building_ui()
|
||||||
|
|
||||||
def on_building_ui(self):
|
def on_building_ui(self):
|
||||||
gr.Markdown("# Welcome to Kotaemon")
|
gr.Markdown(f"# Welcome to {self._app.app_name}!")
|
||||||
self.usn = gr.Textbox(label="Username", visible=False)
|
self.usn = gr.Textbox(label="Username", visible=False)
|
||||||
self.pwd = gr.Textbox(label="Password", type="password", visible=False)
|
self.pwd = gr.Textbox(label="Password", type="password", visible=False)
|
||||||
self.btn_login = gr.Button("Login", visible=False)
|
self.btn_login = gr.Button("Login", visible=False)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user