Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

refactor: reposition OpenRAG docs refresh action in knowledge toolbar

Olfa Maslah667839216340
diff --git a/frontend/app/knowledge/page.tsx b/frontend/app/knowledge/page.tsx
index 3fc2c3f3a..ea7d87605 100644
--- a/frontend/app/knowledge/page.tsx
+++ b/frontend/app/knowledge/page.tsx
@@ -499,37 +499,7 @@ function SearchPage() {
{/* Search Input Area */}
<div className="flex-1 flex items-center flex-shrink-0 flex-wrap-reverse gap-3 mb-6">
<KnowledgeSearchInput />
- <Button
- type="button"
- variant="outline"
- className="rounded-lg flex-shrink-0"
- disabled={refreshOpenragDocsMutation.isPending}
- onClick={async () => {
- try {
- toast.info("Refreshing OpenRAG docs...");
- const result = await refreshOpenragDocsMutation.mutateAsync();
- toast.success(result.message);
- } catch (error) {
- toast.error(
- error instanceof Error
- ? error.message
- : "Failed to refresh OpenRAG docs",
- );
- }
- }}
- >
- {refreshOpenragDocsMutation.isPending ? (
- <>
- <RefreshCw className="h-4 w-4 mr-2 animate-spin" />
- Refreshing docs...
- </>
- ) : (
- <>
- <RefreshCw className="h-4 w-4 mr-2" />
- Fetch latest docs
- </>
- )}
- </Button>
+
<Button
type="button"
variant="outline"
@@ -575,6 +545,35 @@ function SearchPage() {
</>
)}
</Button>
+ <Button
+ type="button"
+ variant="outline"
+ className="rounded-lg flex-shrink-0"
+ disabled={refreshOpenragDocsMutation.isPending}
+ onClick={async () => {
+ try {
+ toast.info("Refreshing OpenRAG docs...");
+ const result = await refreshOpenragDocsMutation.mutateAsync();
+ toast.success(result.message);
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : "Failed to refresh OpenRAG docs",
+ );
+ }
+ }}
+ >
+ {refreshOpenragDocsMutation.isPending ? (
+ <>
+ Refreshing docs...
+ </>
+ ) : (
+ <>
+ Fetch latest docs
+ </>
+ )}
+ </Button>
{selectedRows.length > 0 && (
<Button
type="button"