mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
Compare commits
9 Commits
v0.20.3
...
1ca226e43b
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ca226e43b | |||
| 830cda6a3a | |||
| c66dbbe433 | |||
| 3b218b2dc0 | |||
| d58ef6127f | |||
| 55173c7201 | |||
| f860bdf0ad | |||
| 997627861a | |||
| 9f9d32d2cd |
@ -131,7 +131,16 @@ class Canvas:
|
||||
|
||||
self.path = self.dsl["path"]
|
||||
self.history = self.dsl["history"]
|
||||
self.globals = self.dsl["globals"]
|
||||
if "globals" in self.dsl:
|
||||
self.globals = self.dsl["globals"]
|
||||
else:
|
||||
self.globals = {
|
||||
"sys.query": "",
|
||||
"sys.user_id": "",
|
||||
"sys.conversation_turns": 0,
|
||||
"sys.files": []
|
||||
}
|
||||
|
||||
self.retrieval = self.dsl["retrieval"]
|
||||
self.memory = self.dsl.get("memory", [])
|
||||
|
||||
|
||||
@ -150,10 +150,10 @@ def update(tenant_id, chat_id):
|
||||
if not DialogService.query(tenant_id=tenant_id, id=chat_id, status=StatusEnum.VALID.value):
|
||||
return get_error_data_result(message="You do not own the chat")
|
||||
req = request.json
|
||||
ids = req.get("dataset_ids")
|
||||
ids = req.get("dataset_ids", [])
|
||||
if "show_quotation" in req:
|
||||
req["do_refer"] = req.pop("show_quotation")
|
||||
if ids is not None:
|
||||
if ids:
|
||||
for kb_id in ids:
|
||||
kbs = KnowledgebaseService.accessible(kb_id=kb_id, user_id=tenant_id)
|
||||
if not kbs:
|
||||
|
||||
@ -14,7 +14,7 @@ module.exports = {
|
||||
'error',
|
||||
{
|
||||
'**/*.{jsx,tsx}': 'KEBAB_CASE',
|
||||
'**/*.{js,ts}': 'KEBAB_CASE',
|
||||
'**/*.{js,ts}': '[a-z0-9.-]*',
|
||||
},
|
||||
],
|
||||
'check-file/folder-naming-convention': [
|
||||
|
||||
@ -31,7 +31,7 @@ export function HomeCard({ data, onClick, moreDropdown }: IProps) {
|
||||
</div>
|
||||
<div className="flex flex-col justify-between gap-1 flex-1 h-full w-[calc(100%-50px)]">
|
||||
<section className="flex justify-between">
|
||||
<div className="text-[20px] font-bold w-80% leading-5">
|
||||
<div className="text-[20px] font-bold w-80% leading-5 text-ellipsis overflow-hidden">
|
||||
{data.name}
|
||||
</div>
|
||||
{moreDropdown}
|
||||
|
||||
@ -57,8 +57,8 @@ export function Segmented({
|
||||
className={cn(
|
||||
'inline-flex items-center px-6 py-2 text-base font-normal rounded-3xl cursor-pointer',
|
||||
{
|
||||
'bg-text-primary': selectedValue === actualValue,
|
||||
'text-bg-base': selectedValue === actualValue,
|
||||
'text-bg-base bg-metallic-gradient border-b-[#00BEB4] border-b-2':
|
||||
selectedValue === actualValue,
|
||||
},
|
||||
)}
|
||||
onClick={() => handleOnChange(actualValue)}
|
||||
|
||||
@ -62,8 +62,8 @@ export function SideBar({ refreshCount }: PropType) {
|
||||
name={data.name}
|
||||
className="size-16"
|
||||
></RAGFlowAvatar>
|
||||
<div className=" text-text-secondary text-xs space-y-1">
|
||||
<h3 className="text-lg font-semibold line-clamp-1 text-text-primary">
|
||||
<div className=" text-text-secondary text-xs space-y-1 overflow-hidden">
|
||||
<h3 className="text-lg font-semibold line-clamp-1 text-text-primary text-ellipsis overflow-hidden">
|
||||
{data.name}
|
||||
</h3>
|
||||
<div className="flex justify-between">
|
||||
|
||||
@ -89,25 +89,28 @@ export function ChatSettings({ switchSettingVisible }: ChatSettingsProps) {
|
||||
}, [data, form]);
|
||||
|
||||
return (
|
||||
<section className="p-5 w-[440px] border-l">
|
||||
<section className="p-5 w-[440px] border-l flex flex-col">
|
||||
<div className="flex justify-between items-center text-base pb-2">
|
||||
{t('chat.chatSetting')}
|
||||
<X className="size-4 cursor-pointer" onClick={switchSettingVisible} />
|
||||
</div>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit, onInvalid)}>
|
||||
<section className="space-y-6 overflow-auto max-h-[82vh] pr-4">
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit, onInvalid)}
|
||||
className="flex-1 flex flex-col min-h-0"
|
||||
>
|
||||
<section className="space-y-6 overflow-auto flex-1 pr-4 min-h-0">
|
||||
<ChatBasicSetting></ChatBasicSetting>
|
||||
<Separator />
|
||||
<ChatPromptEngine></ChatPromptEngine>
|
||||
<Separator />
|
||||
<ChatModelSettings></ChatModelSettings>
|
||||
</section>
|
||||
<div className="space-x-5 text-right">
|
||||
<div className="space-x-5 text-right pt-4">
|
||||
<Button variant={'outline'} onClick={switchSettingVisible}>
|
||||
{t('chat.cancel')}
|
||||
</Button>
|
||||
<ButtonLoading className=" my-4" type="submit" loading={loading}>
|
||||
<ButtonLoading type="submit" loading={loading}>
|
||||
{t('common.save')}
|
||||
</ButtonLoading>
|
||||
</div>
|
||||
|
||||
@ -70,116 +70,73 @@ const routes = [
|
||||
component: `@/pages${Routes.AgentShare}`,
|
||||
layout: false,
|
||||
},
|
||||
// {
|
||||
// path: '/',
|
||||
// component: '@/layouts',
|
||||
// layout: false,
|
||||
// wrappers: ['@/wrappers/auth'],
|
||||
// routes: [
|
||||
// { path: '/', redirect: '/knowledge' },
|
||||
// {
|
||||
// path: '/knowledge',
|
||||
// component: '@/pages/knowledge',
|
||||
// // component: '@/pages/knowledge/datasets',
|
||||
// },
|
||||
// {
|
||||
// path: '/knowledge',
|
||||
// component: '@/pages/add-knowledge',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/knowledge/dataset',
|
||||
// component: '@/pages/add-knowledge/components/knowledge-dataset',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/knowledge/dataset',
|
||||
// component: '@/pages/add-knowledge/components/knowledge-file',
|
||||
// },
|
||||
// {
|
||||
// path: '/knowledge/dataset/chunk',
|
||||
// component: '@/pages/add-knowledge/components/knowledge-chunk',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/knowledge/configuration',
|
||||
// component: '@/pages/add-knowledge/components/knowledge-setting',
|
||||
// },
|
||||
// {
|
||||
// path: '/knowledge/testing',
|
||||
// component: '@/pages/add-knowledge/components/knowledge-testing',
|
||||
// },
|
||||
// {
|
||||
// path: '/knowledge/knowledgeGraph',
|
||||
// component: '@/pages/add-knowledge/components/knowledge-graph',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/chat',
|
||||
// component: '@/pages/chat',
|
||||
// },
|
||||
// {
|
||||
// path: '/user-setting',
|
||||
// component: '@/pages/user-setting',
|
||||
// routes: [
|
||||
// { path: '/user-setting', redirect: '/user-setting/profile' },
|
||||
// {
|
||||
// path: '/user-setting/profile',
|
||||
// // component: '@/pages/user-setting/setting-profile',
|
||||
// component: '@/pages/user-setting/setting-profile',
|
||||
// },
|
||||
// {
|
||||
// path: '/user-setting/locale',
|
||||
// component: '@/pages/user-setting/setting-locale',
|
||||
// },
|
||||
// {
|
||||
// path: '/user-setting/password',
|
||||
// component: '@/pages/user-setting/setting-password',
|
||||
// },
|
||||
// {
|
||||
// path: '/user-setting/model',
|
||||
// component: '@/pages/user-setting/setting-model',
|
||||
// },
|
||||
// {
|
||||
// path: '/user-setting/team',
|
||||
// component: '@/pages/user-setting/setting-team',
|
||||
// },
|
||||
// {
|
||||
// path: '/user-setting/system',
|
||||
// component: '@/pages/user-setting/setting-system',
|
||||
// },
|
||||
// {
|
||||
// path: '/user-setting/api',
|
||||
// component: '@/pages/user-setting/setting-api',
|
||||
// },
|
||||
// {
|
||||
// path: `/user-setting${Routes.Mcp}`,
|
||||
// component: `@/pages${Routes.ProfileMcp}`,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/file',
|
||||
// component: '@/pages/file-manager',
|
||||
// },
|
||||
// {
|
||||
// path: '/flow',
|
||||
// component: '@/pages/flow/list',
|
||||
// },
|
||||
// {
|
||||
// path: Routes.AgentList,
|
||||
// component: `@/pages/${Routes.Agents}`,
|
||||
// },
|
||||
// {
|
||||
// path: '/flow/:id',
|
||||
// component: '@/pages/flow',
|
||||
// },
|
||||
// {
|
||||
// path: '/search',
|
||||
// component: '@/pages/search',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
path: Routes.Home,
|
||||
component: '@/layouts',
|
||||
layout: false,
|
||||
redirect: '/knowledge',
|
||||
},
|
||||
{
|
||||
path: '/knowledge',
|
||||
component: '@/pages/knowledge',
|
||||
},
|
||||
{
|
||||
path: '/knowledge',
|
||||
component: '@/pages/add-knowledge',
|
||||
routes: [
|
||||
{
|
||||
path: 'dataset',
|
||||
component: '@/pages/add-knowledge/components/knowledge-dataset',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/add-knowledge/components/knowledge-file',
|
||||
},
|
||||
{
|
||||
path: 'chunk',
|
||||
component: '@/pages/add-knowledge/components/knowledge-chunk',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'configuration',
|
||||
component: '@/pages/add-knowledge/components/knowledge-setting',
|
||||
},
|
||||
{
|
||||
path: 'testing',
|
||||
component: '@/pages/add-knowledge/components/knowledge-testing',
|
||||
},
|
||||
{
|
||||
path: 'knowledgeGraph',
|
||||
component: '@/pages/add-knowledge/components/knowledge-graph',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
path: '/chat',
|
||||
component: '@/pages/chat',
|
||||
},
|
||||
{
|
||||
path: '/file',
|
||||
component: '@/pages/file-manager',
|
||||
},
|
||||
{
|
||||
path: '/flow',
|
||||
component: '@/pages/flow/list',
|
||||
},
|
||||
{
|
||||
path: Routes.AgentList,
|
||||
component: `@/pages/${Routes.Agents}`,
|
||||
},
|
||||
{
|
||||
path: '/flow/:id',
|
||||
component: '@/pages/flow',
|
||||
},
|
||||
{
|
||||
path: '/search',
|
||||
component: '@/pages/search',
|
||||
},
|
||||
{
|
||||
path: '/document/:id',
|
||||
component: '@/pages/document-viewer',
|
||||
|
||||
@ -58,6 +58,8 @@ module.exports = {
|
||||
|
||||
'bg-base': 'var(--bg-base)',
|
||||
'bg-card': 'var(--bg-card)',
|
||||
'bg-component': 'var(--bg-component)',
|
||||
'bg-input': 'var(--bg-input)',
|
||||
'text-primary': 'var(--text-primary)',
|
||||
'text-secondary': 'var(--text-secondary)',
|
||||
'text-disabled': 'var(--text-disabled)',
|
||||
@ -206,6 +208,10 @@ module.exports = {
|
||||
ring: 'hsl(var(--sidebar-ring))',
|
||||
},
|
||||
},
|
||||
backgroundImage: {
|
||||
'metallic-gradient':
|
||||
'linear-gradient(104deg, var(--text-primary) 30%, var(--metallic) 50%, var(--text-primary) 70%)',
|
||||
},
|
||||
borderRadius: {
|
||||
lg: `var(--radius)`,
|
||||
md: `calc(var(--radius) - 2px)`,
|
||||
|
||||
@ -90,11 +90,15 @@
|
||||
|
||||
--input-border: rgba(22, 22, 24, 0.2);
|
||||
|
||||
--metallic: #46464a;
|
||||
/* design colors */
|
||||
|
||||
--bg-base: #f6f6f7;
|
||||
--bg-base: #ffffff;
|
||||
/* card color , dividing line */
|
||||
--bg-card: rgba(0, 0, 0, 0.05);
|
||||
--bg-component: #ffffff;
|
||||
--bg-input: rgba(255, 255, 255, 0);
|
||||
--bg-accent: rgba(76, 164, 231, 0.05);
|
||||
/* Button ,Body text, Input completed text */
|
||||
--text-primary: #161618;
|
||||
--text-secondary: #75787a;
|
||||
@ -107,7 +111,7 @@
|
||||
--border-accent: #000000;
|
||||
--border-button: rgba(0, 0, 0, 0.1);
|
||||
/* Regulators, parsing, switches, variables */
|
||||
--accent-primary: #4ca4e7;
|
||||
--accent-primary: #00beb4;
|
||||
/* Output Variables Box */
|
||||
--bg-accent: rgba(76, 164, 231, 0.05);
|
||||
|
||||
@ -230,10 +234,13 @@
|
||||
|
||||
--input-border: rgba(255, 255, 255, 0.2);
|
||||
|
||||
--metallic: #fafafa;
|
||||
/* design colors */
|
||||
|
||||
--bg-base: #161618;
|
||||
--bg-card: rgba(255, 255, 255, 0.05);
|
||||
--bg-component: #202025;
|
||||
--bg-input: rgba(255, 255, 255, 0.05);
|
||||
--text-primary: #f6f6f7;
|
||||
--text-secondary: #b2b5b7;
|
||||
--text-disabled: #75787a;
|
||||
|
||||
Reference in New Issue
Block a user