Skip to content

Commit

Permalink
Merge pull request #25 from ChatCRM/outline-integration
Browse files Browse the repository at this point in the history
outline-integration-001: added outline integration
  • Loading branch information
parsa-asgari authored Feb 14, 2024
2 parents 307e92e + 85e35c5 commit 3592c03
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 27 deletions.
14 changes: 7 additions & 7 deletions app/admin/components/sidebar-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const sidebarNavItems = [
title: "Knowledgebase",
href: "/admin",
},
{
title: "Knowledgebase Overview",
href: "/admin/knowledgebasedetails",
}
// {
// title: "Knowledgebase Overview",
// href: "/admin/knowledgebasedetails",
// }
]
},
{
Expand Down Expand Up @@ -62,10 +62,10 @@ export function SidebarNav({ className, ...props }: SidebarNavProps) {
"justify-start"
)}
>
{TranslationData["Upload"]}
{TranslationData["Details"]}

</Link>
<Link key="/admin/knowledgebase-details"
{/* <Link key="/admin/knowledgebase-details"
href="/admin/knowledgebase-details"
prefetch={false}
className={cn(
Expand All @@ -77,7 +77,7 @@ export function SidebarNav({ className, ...props }: SidebarNavProps) {
)}
>
{TranslationData["Details"]}
</Link>
</Link> */}

{/* Access Control */}
<h1 dir={TextDirection}> <strong>
Expand Down
20 changes: 16 additions & 4 deletions app/admin/knowledgebase-details/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import { GetTranslation } from "@/components/translation-helper/ClientTranslatio

const TextDirection = process.env.TEXT_DIRECTION
import GlobalConfig from '@/app/app.config.js'
import { Button } from "@/components/ui/button"
import Link from 'next/link'
import ArrowForwardIosOutlinedIcon from '@mui/icons-material/ArrowForwardIosOutlined';
import OutlineInstanceButton from "@/components/outline-instance-button"


export default async function KnowledgeBaseOverView() {

Expand All @@ -19,15 +24,22 @@ export default async function KnowledgeBaseOverView() {
<div className="space-y-6 w-full">
<div>
<h3 className="text-lg font-medium" dir={TextDirection}>
<GetTranslation text="Knowledgebase Details"/>
</h3>
<GetTranslation text="Knowledgebase Details"/>
</h3>
<p className="text-sm text-muted-foreground" dir={TextDirection}>
<GetTranslation text="Examine the data you have inserted so far"/>
<GetTranslation text="Examine the data you have inserted so far" />

</p>
</div>
<> </>
<KnowledgeBaseTable />
{/* <div>
<Button asChild>
<Link href={process.env.NEXT_PUBLIC_OUTLINE_ADDRESS} rel="noopener noreferrer" target="_blank">{TranslationData["Open Your Outline Instance"]} <ArrowForwardIosOutlinedIcon/></Link>
</Button>
</div> */}
<OutlineInstanceButton />
</div>


)
}
37 changes: 24 additions & 13 deletions app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
// @ts-nocheck
import { KnowledgeBase } from "@/app/admin/knowledgebase"
import { getVectorDataLogLocal } from "@/app/admin/actions"
import { Separator } from "@/components/ui/separator"
import { KnowledgeBaseTable } from "@/app/admin/knowledgebase-table"
import { GetTranslation } from "@/components/translation-helper/ClientTranslations"
import { KnowledgeBaseTable } from "@/app/admin/knowledgebase-details/knowledgebase-table"

export const runtime = 'nodejs'
export const preferredRegion = 'home'
export const dynamic = 'force-dynamic';
export const fetchCache = 'force-no-store';
import { GetTranslation } from "@/components/translation-helper/ClientTranslations"

const TextDirection = process.env.TEXT_DIRECTION
import GlobalConfig from '@/app/app.config.js'
import { Button } from "@/components/ui/button"
import Link from 'next/link'
import ArrowForwardIosOutlinedIcon from '@mui/icons-material/ArrowForwardIosOutlined';
import OutlineInstanceButton from "@/components/outline-instance-button"

export default async function AdminPage() {
// const vector_data_log = await getVectorDataLogLocal()

// Language and Translation
// var TranslationData = require(`@/translation/${process.env.BIZGPT_FRONTEND_LANGUAGE}.json`);
export default async function KnowledgeBaseOverView() {

// Language and Translation
var TranslationData = require(`@/translation/${GlobalConfig.LANG}.json`);
console.log(GlobalConfig.LANG)
return (
<div className="space-y-6 w-full" dir={TextDirection}>
<div className="space-y-6 w-full">
<div>
<h3 className="text-lg font-medium" dir={TextDirection}>
<GetTranslation text={"Knowledgebase Upload"} />
<GetTranslation text="Knowledgebase Details"/>
</h3>
<p className="text-sm text-muted-foreground" dir={TextDirection}>
<GetTranslation text={"Add data to your knowledgebase"} />
<GetTranslation text="Examine the data you have inserted so far" />

</p>
</div>
<> </>
<KnowledgeBase />
{/* <div>
<Button asChild>
<Link href={process.env.NEXT_PUBLIC_OUTLINE_ADDRESS} rel="noopener noreferrer" target="_blank">{TranslationData["Open Your Outline Instance"]} <ArrowForwardIosOutlinedIcon/></Link>
</Button>
</div> */}
<OutlineInstanceButton />
</div>


)
}
19 changes: 19 additions & 0 deletions components/outline-instance-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client'

import * as React from 'react'

import { Button } from '@/components/ui/button'
import Link from 'next/link'
import GlobalConfig from '@/app/app.config.js'
import ArrowForwardIosOutlinedIcon from '@mui/icons-material/ArrowForwardIosOutlined';

export default function OutlineInstanceButton() {
var TranslationData = require(`@/translation/${GlobalConfig.LANG}.json`);
return(
<div>
<Button asChild>
<Link href={process.env.NEXT_PUBLIC_OUTLINE_ADDRESS!} rel="noopener noreferrer" target="_blank">{TranslationData["Open Your Outline Instance"]} <ArrowForwardIosOutlinedIcon/></Link>
</Button>
</div>
)
}
3 changes: 2 additions & 1 deletion translation/EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"feedback_rating": "Feedback Rating",
"datetime_added": "Datetime Added",
"Document Chunk": "Document Chunk",
"metadata": "Source"
"metadata": "Source",
"Open Your Outline Instance": "Open Your Outline Instance"
}
3 changes: 2 additions & 1 deletion translation/FA.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"feedback_rating": "امتیاز بازخورد",
"datetime_added": "زمان ایجاد",
"Document Chunk": "قطعه مستند پردازش شده",
"metadata": "منبع"
"metadata": "منبع",
"Open Your Outline Instance": "دسترسی به مخزن دانش"
}
3 changes: 2 additions & 1 deletion translation/FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"feedback_rating": "Évaluation des commentaires",
"datetime_added": "Date et heure ajoutées",
"Document Chunk": "Segment de document",
"metadata": "Source"
"metadata": "Source",
"Open Your Outline Instance": "Ouvre ton instance de Outline"
}

0 comments on commit 3592c03

Please sign in to comment.