Make chat the landing page for the web app

Chat, unlike search, doesn't knowledge base indexing setup.
So you can get started with chat much faster.
This commit is contained in:
Debanjum Singh Solanky 2023-11-02 20:35:43 -07:00
parent 0d4e7d46c2
commit 3801105b2a
3 changed files with 20 additions and 3 deletions

View file

@ -5,7 +5,7 @@
</a>
<nav class="khoj-nav">
<a class="khoj-nav" href="/chat">💬 Chat</a>
<a class="khoj-nav" href="/">🔎 Search</a>
<a class="khoj-nav" href="/search">🔎 Search</a>
<!-- Dropdown Menu -->
<div id="khoj-nav-menu-container" class="khoj-nav dropdown">
{% if user_photo and user_photo != "None" %}

View file

@ -36,7 +36,7 @@ def index(request: Request):
user_picture = request.session.get("user", {}).get("picture")
return templates.TemplateResponse(
"index.html",
"chat.html",
context={
"request": request,
"demo": state.demo,
@ -53,7 +53,24 @@ def index_post(request: Request):
user_picture = request.session.get("user", {}).get("picture")
return templates.TemplateResponse(
"index.html",
"chat.html",
context={
"request": request,
"demo": state.demo,
"username": user.username,
"user_photo": user_picture,
},
)
@web_client.get("/search", response_class=FileResponse)
@requires(["authenticated"], redirect="login_page")
def search_page(request: Request):
user = request.user.object
user_picture = request.session.get("user", {}).get("picture")
return templates.TemplateResponse(
"search.html",
context={
"request": request,
"demo": state.demo,