-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
[workspace] | ||
|
||
members = [ | ||
"search", | ||
"client" | ||
] | ||
resolver = "2" | ||
members = ["search", "client"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,84 +4,45 @@ | |
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>search-rs</title> | ||
|
||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> | ||
|
||
<!-- htmx --> | ||
<script src="https://unpkg.com/[email protected]"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"></script> | ||
<script src="https://unpkg.com/htmx.org/dist/ext/json-enc.js"></script> | ||
|
||
<!-- css --> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,200;0,7..72,300;0,7..72,400;0,7..72,500;0,7..72,600;0,7..72,700;0,7..72,800;0,7..72,900;1,7..72,200;1,7..72,300;1,7..72,400;1,7..72,500;1,7..72,600;1,7..72,700;1,7..72,800;1,7..72,900&display=swap" | ||
rel="stylesheet"> | ||
|
||
<style> | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
/* align-items: center; */ | ||
/* Center vertically */ | ||
/* height: 100vh; */ | ||
width: 60vw; | ||
margin: auto; | ||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | ||
background-color: #1a1a1a; | ||
color: #fff; | ||
} | ||
|
||
.search-container { | ||
text-align: center; | ||
margin-top: 100px; | ||
} | ||
|
||
.search-title { | ||
font-size: 60px; | ||
padding-bottom: 10px; | ||
} | ||
|
||
.search-bar-container { | ||
position: relative; | ||
display: inline-block; | ||
} | ||
|
||
.search-bar { | ||
padding: 15px; | ||
border: none; | ||
border-radius: 10px; | ||
outline: none; | ||
font-size: 18px; | ||
width: 400px; | ||
background-color: #333; | ||
color: #fff; | ||
padding-left: 40px; | ||
} | ||
|
||
.search-icon { | ||
position: absolute; | ||
left: 15px; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
color: #ccc; | ||
font-family: 'Literata', serif; | ||
} | ||
</style> | ||
|
||
.search-time { | ||
margin: 10px; | ||
} | ||
|
||
.search-result { | ||
margin: 10px; | ||
} | ||
</style> | ||
<title>search-rs</title> | ||
</head> | ||
|
||
<body> | ||
<body class="bg-neutral-900 text-white"> | ||
|
||
<!-- Main Content --> | ||
<div class="container mx-auto mt-16 max-w-3xl"> | ||
|
||
<div class="search-container"> | ||
<h1 class="search-title">index on {{index_path}}</h1> | ||
<div class="search-bar-container"> | ||
<i class="fas fa-search search-icon"></i> | ||
<input type="text" class="search-bar" name="query" autofocus hx-post="/query" hx-ext='json-enc' | ||
<!-- Search Heading --> | ||
<div class="mb-6"> | ||
<h1 class="text-3xl font-bold my-3">Index on {{index_path}}</h1> | ||
<input type="text" class="w-full mt-10 p-4 rounded-md bg-neutral-800 text-white" | ||
placeholder="Enter your search query..." autofocus name="query" hx-post="/query" hx-ext='json-enc' | ||
hx-target=".search-results" hx-trigger="keyup[keyCode==13]"> | ||
</div> | ||
|
||
|
||
<div class="search-results" hx-target=".search-results"> | ||
<!-- Search results will appear here --> | ||
|
||
</div> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
<div class="search-time">Query completed in {{ time_ms }} ms<div> | ||
{% for doc in documents %} | ||
<div class="search-result">{{ loop.index }} - {{ doc.path }}</div> | ||
{% endfor %} | ||
<div> | ||
|
||
<!-- Title --> | ||
<h1 class="text-xl"> Search results</h1> | ||
<h1 class=" font-light text-sm mt-1 mb-6">Query time: {{ time_ms }}ms</h1> | ||
|
||
<!-- Documents --> | ||
{% for doc in documents %} | ||
|
||
<div> | ||
<div class="bg-neutral-800 p-4 rounded-md shadow-md mb-6"> | ||
<h2 class="text-xl font-semibold mb-2"> | ||
{{ doc.path }} | ||
</h2> | ||
<p class="text-neutral-300"> | ||
{{ doc.content }} | ||
</p> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
|
||
</div> |