Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +19 -8
templates/index.html
CHANGED
@@ -29,14 +29,24 @@
|
|
29 |
<button type="submit" class="w-full bg-blue-500 text-white p-2 rounded-lg hover:bg-blue-600 transition">Parse & Store</button>
|
30 |
</form>
|
31 |
|
32 |
-
<!-- Query
|
33 |
-
<
|
34 |
-
<
|
35 |
-
<
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
<!-- Results Section -->
|
42 |
<div id="results" class="mt-8">
|
@@ -49,6 +59,7 @@
|
|
49 |
<div class="bg-gray-700 p-4 rounded-lg">
|
50 |
<h3 class="text-lg font-semibold text-blue-300">Program ID: {{ result.id }}</h3>
|
51 |
<p class="text-gray-200">Similarity: {{ result.similarity | round(3) }}</p>
|
|
|
52 |
<pre class="bg-gray-800 p-2 rounded mt-2 text-gray-300">{{ result.code }}</pre>
|
53 |
</div>
|
54 |
{% endfor %}
|
|
|
29 |
<button type="submit" class="w-full bg-blue-500 text-white p-2 rounded-lg hover:bg-blue-600 transition">Parse & Store</button>
|
30 |
</form>
|
31 |
|
32 |
+
<!-- Query Forms -->
|
33 |
+
<div class="space-y-4 mb-8">
|
34 |
+
<form hx-post="/" hx-target="#results" hx-swap="innerHTML" class="space-y-4">
|
35 |
+
<div>
|
36 |
+
<label class="block text-sm font-medium text-gray-300 mb-2">Query Programs by Operations (e.g., function,assignment,return)</label>
|
37 |
+
<input type="text" name="query_ops" class="w-full p-2 border rounded-lg bg-gray-700 text-gray-200" placeholder="Enter operations (comma-separated)">
|
38 |
+
</div>
|
39 |
+
<button type="submit" class="w-full bg-green-500 text-white p-2 rounded-lg hover:bg-green-600 transition">Find Programs by Operations</button>
|
40 |
+
</form>
|
41 |
+
|
42 |
+
<form hx-post="/" hx-target="#results" hx-swap="innerHTML" class="space-y-4">
|
43 |
+
<div>
|
44 |
+
<label class="block text-sm font-medium text-gray-300 mb-2">Query Programs by Description (e.g., "function that adds numbers")</label>
|
45 |
+
<input type="text" name="semantic_query" class="w-full p-2 border rounded-lg bg-gray-700 text-gray-200" placeholder="Enter description">
|
46 |
+
</div>
|
47 |
+
<button type="submit" class="w-full bg-purple-500 text-white p-2 rounded-lg hover:bg-purple-600 transition">Find Programs by Description</button>
|
48 |
+
</form>
|
49 |
+
</div>
|
50 |
|
51 |
<!-- Results Section -->
|
52 |
<div id="results" class="mt-8">
|
|
|
59 |
<div class="bg-gray-700 p-4 rounded-lg">
|
60 |
<h3 class="text-lg font-semibold text-blue-300">Program ID: {{ result.id }}</h3>
|
61 |
<p class="text-gray-200">Similarity: {{ result.similarity | round(3) }}</p>
|
62 |
+
<p class="text-gray-300">Description Tokens: {{ result.description }}</p>
|
63 |
<pre class="bg-gray-800 p-2 rounded mt-2 text-gray-300">{{ result.code }}</pre>
|
64 |
</div>
|
65 |
{% endfor %}
|