Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chat-query
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
jaden
chat-query
Commits
43ba1a03
Commit
43ba1a03
authored
Jul 10, 2023
by
jaden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix bug
parent
41a93931
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
30 deletions
+48
-30
README-zh.md
README-zh.md
+2
-1
README.md
README.md
+2
-4
dockerfile
dockerfile
+1
-0
pages/actions/View/chatView.tsx
pages/actions/View/chatView.tsx
+22
-21
pages/index.tsx
pages/index.tsx
+16
-1
public/detail.mp4
public/detail.mp4
+0
-0
public/logo.png
public/logo.png
+0
-0
styles/globals.css
styles/globals.css
+5
-0
styles/home.scss
styles/home.scss
+0
-3
No files found.
README-zh.md
View file @
43ba1a03
...
...
@@ -7,7 +7,8 @@
## 演示
> [view](https://chat-query.netlify.app/) **由于netlify网络限制问题,请尽量选择一下模式:**
> [view](https://chat-query.vercel.app/)
> [国内](http://139.198.179.193:32205/)
+
选择网站设置 !
[
Choose website settings
](
./public/image.png
)
+
允许不安全内容 !
[
Allow Unsafe
](
./public/image1.png
)
...
...
README.md
View file @
43ba1a03
...
...
@@ -5,10 +5,8 @@
> Chat-Query is a data query tool based on metadata models and AI technology, enabling natural language queries.
## Demo
> [view](https://chat-query.netlify.app/) **Due to network restrictions on Netlify, please try to choose one of the following modes:**
+
Choose website settings !
[
Choose website settings
](
./public/image.png
)
+
Allow Unsafe Content !
[
Allow Unsafe
](
./public/image1.png
)
> [view](https://chat-query.vercel.app/)
> [zh](http://139.198.179.193:32205/)
> [demo](https://cdn.glitch.me/fd139a45-4a65-41b6-9634-41617ab20cdc/%E6%BC%94%E7%A4%BA.gif?v=1686907695067)
...
...
dockerfile
View file @
43ba1a03
...
...
@@ -23,6 +23,7 @@ ENV OPENAI_PROXY_URL $OPENAI_PROXY_URL
# 执行构建命令
COPY
.next ./.next
COPY
public ./public
# 暴露 3000 端口
EXPOSE
3000
...
...
pages/actions/View/chatView.tsx
View file @
43ba1a03
...
...
@@ -96,7 +96,7 @@ export function ChatView({
defaultNode
,
props
:
propsRaw
,
id
,
functions
,
functions
=
init
,
}:
{
defaultNode
?:
ReactElement
;
props
:
Record
<
string
,
any
>
;
...
...
@@ -300,24 +300,23 @@ export function ChatView({
showSearch=
{
{
retainInputValue
:
true
,
}
}
onFocus=
{
()
=>
{
if
(
editor
)
{
onClick=
{
()
=>
{
const
root
:
any
=
Parser
.
parse
(
editor
.
getValue
()
,
editor
?.
getValue
()
||
functions
,
{
ecmaVersion
:
6
,
}
);
console
.
log
(
root
,
'
content
'
);
const
body
:
ReturnType
<
typeof
Parser
.
parse
>
[]
=
get
(
root
,
'
body
'
);
const
body
:
ReturnType
<
typeof
Parser
.
parse
>
[]
=
get
(
root
,
'
body
'
);
setFunctionOption
(
body
.
filter
(
v
=>
v
.
type
===
'
FunctionDeclaration
'
)
);
}
}
}
onChange=
{
setFunctionName
}
>
...
...
@@ -339,11 +338,13 @@ export function ChatView({
}
const
data
=
await
workerFn
(
propsRaw
,
`${editor?.getValue()};\n return ${functionName}(data);`
`${
editor?.getValue() || functions
};\n return ${functionName}(data);`
);
ConnectDb
.
updateQuery
(
id
,
`${editor?.getValue()}\n`
`${editor?.getValue()
|| functions
}\n`
);
setProps
(
data
);
}
}
...
...
@@ -363,7 +364,7 @@ export function ChatView({
}
}
height=
"300px"
defaultLanguage=
"javascript"
defaultValue=
{
functions
||
init
}
defaultValue=
{
functions
}
/>
</
CollapseItem
>
</
Collapse
>
...
...
pages/index.tsx
View file @
43ba1a03
...
...
@@ -8,9 +8,15 @@ import { HTML5Backend } from 'react-dnd-html5-backend';
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'
react-dnd
'
;
import
Link
from
'
next/link
'
;
import
{
useTranslation
,
Trans
}
from
'
react-i18next
'
;
import
{
useEffect
}
from
'
react
'
;
import
Script
from
'
next/script
'
;
function
Home
()
{
const
{
t
}
=
useTranslation
();
useEffect
(()
=>
{
return
()
=>
{
document
.
querySelector
(
'
#fireworks
'
)?.
remove
();
};
},
[]);
return
(
<>
<
Head
>
...
...
@@ -23,6 +29,15 @@ function Home() {
<
link
rel=
"icon"
href=
"/favicon.ico"
/>
</
Head
>
<
main
className=
"home bg-scroll"
>
<
Script
src=
"https://cdn.jsdelivr.net/npm/tsparticles-fireworks@2.10.1/tsparticles.fireworks.bundle.min.js"
onLoad=
{
()
=>
{
if
(
window
?.
fireworks
)
{
document
.
querySelector
(
'
#fireworks
'
)?.
remove
();
fireworks
();
}
}
}
/>
<
Layout
className=
"main"
>
<
Layout
>
<
div
className=
"container"
>
...
...
public/detail.mp4
deleted
100644 → 0
View file @
41a93931
File deleted
public/logo.png
deleted
100644 → 0
View file @
41a93931
2.41 KB
styles/globals.css
View file @
43ba1a03
...
...
@@ -253,3 +253,8 @@ background:rgba(255, 166, 0, 0.53) !important;
.shadow-t
{
box-shadow
:
0
-5px
10px
0px
rgba
(
130
,
130
,
130
,
0.1
);
}
#fireworks
{
position
:
relative
;
z-index
:
-1
;
}
\ No newline at end of file
styles/home.scss
View file @
43ba1a03
.home
{
color
:
#fff
;
font-family
:
"Roboto Condensed"
,
sans-serif
;
background-image
:
url(https://images.unsplash.com/photo-1508389377389-b8221c0bcc9e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80)
;
background-size
:
110%
;
background-position
:
0%
0%
;
margin
:
0
;
animation
:
change-background
15s
linear
infinite
alternate-reverse
;
width
:
100%
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment