mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-21 01:34:24 +00:00
feat: change the style
This commit is contained in:
parent
51c6f0064a
commit
6ddc5d4377
@ -44,8 +44,8 @@ const ChunkList = () => {
|
|||||||
{chunkList.length ? (
|
{chunkList.length ? (
|
||||||
<>
|
<>
|
||||||
<Table
|
<Table
|
||||||
color="info"
|
color="primary"
|
||||||
variant="soft"
|
variant="plain"
|
||||||
size="lg"
|
size="lg"
|
||||||
sx={{
|
sx={{
|
||||||
'& tbody tr: hover': {
|
'& tbody tr: hover': {
|
||||||
|
@ -33,8 +33,8 @@ const Item = styled(Sheet)(({ theme }) => ({
|
|||||||
color: theme.vars.palette.text.secondary
|
color: theme.vars.palette.text.secondary
|
||||||
}))
|
}))
|
||||||
const stepsOfAddingDocument = [
|
const stepsOfAddingDocument = [
|
||||||
'Choose a Datasource type',
|
'1.Choose a Datasource type',
|
||||||
'Setup the Datasource'
|
'2.Setup the Datasource'
|
||||||
]
|
]
|
||||||
const documentTypeList = [
|
const documentTypeList = [
|
||||||
{
|
{
|
||||||
@ -121,6 +121,7 @@ const Documents = () => {
|
|||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => setIsAddDocumentModalShow(true)}
|
onClick={() => setIsAddDocumentModalShow(true)}
|
||||||
|
sx={{ marginBottom: '20px' }}
|
||||||
>
|
>
|
||||||
+ Add Datasource
|
+ Add Datasource
|
||||||
</Button>
|
</Button>
|
||||||
@ -128,8 +129,8 @@ const Documents = () => {
|
|||||||
{documents.length ? (
|
{documents.length ? (
|
||||||
<>
|
<>
|
||||||
<Table
|
<Table
|
||||||
color="info"
|
color="primary"
|
||||||
variant="soft"
|
variant="plain"
|
||||||
size="lg"
|
size="lg"
|
||||||
sx={{
|
sx={{
|
||||||
'& tbody tr: hover': {
|
'& tbody tr: hover': {
|
||||||
@ -157,9 +158,9 @@ const Documents = () => {
|
|||||||
<td>{row.doc_name}</td>
|
<td>{row.doc_name}</td>
|
||||||
<td>
|
<td>
|
||||||
<Chip
|
<Chip
|
||||||
variant="soft"
|
variant="solid"
|
||||||
color="neutral"
|
color="neutral"
|
||||||
sx={{ fontWeight: 300 }}
|
sx={{ opacity: .5 }}
|
||||||
>
|
>
|
||||||
{row.doc_type}
|
{row.doc_type}
|
||||||
</Chip>
|
</Chip>
|
||||||
@ -168,8 +169,8 @@ const Documents = () => {
|
|||||||
<td>{moment(row.last_sync).format('YYYY-MM-DD HH:MM:SS')}</td>
|
<td>{moment(row.last_sync).format('YYYY-MM-DD HH:MM:SS')}</td>
|
||||||
<td>
|
<td>
|
||||||
<Chip
|
<Chip
|
||||||
sx={{ fontWeight: 300 }}
|
sx={{ opacity: .5 }}
|
||||||
variant="soft"
|
variant="solid"
|
||||||
color={(function () {
|
color={(function () {
|
||||||
switch (row.status) {
|
switch (row.status) {
|
||||||
case 'TODO':
|
case 'TODO':
|
||||||
@ -192,6 +193,9 @@ const Documents = () => {
|
|||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
sx={{
|
||||||
|
marginRight: '20px'
|
||||||
|
}}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`${fetchBaseURL}/knowledge/${spaceName}/document/sync`,
|
`${fetchBaseURL}/knowledge/${spaceName}/document/sync`,
|
||||||
@ -297,7 +301,7 @@ const Documents = () => {
|
|||||||
{stepsOfAddingDocument.map((item: any, index: number) => (
|
{stepsOfAddingDocument.map((item: any, index: number) => (
|
||||||
<Item
|
<Item
|
||||||
key={item}
|
key={item}
|
||||||
sx={{ fontWeight: activeStep === index ? 'bold' : '' }}
|
sx={{ fontWeight: activeStep === index ? 'bold' : '', color: activeStep === index ? '#814DDE' : '' }}
|
||||||
>
|
>
|
||||||
{item}
|
{item}
|
||||||
</Item>
|
</Item>
|
||||||
@ -389,6 +393,7 @@ const Documents = () => {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
|
variant='outlined'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (documentName === '') {
|
if (documentName === '') {
|
||||||
message.error('Please input the name')
|
message.error('Please input the name')
|
||||||
|
@ -4,7 +4,7 @@ import { useRouter } from 'next/navigation'
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import { InboxOutlined } from '@ant-design/icons'
|
import { InboxOutlined } from '@ant-design/icons'
|
||||||
import type { UploadProps } from 'antd'
|
import type { UploadProps } from 'antd'
|
||||||
import { message, Upload } from 'antd'
|
import { message, Upload, Popover } from 'antd'
|
||||||
import {
|
import {
|
||||||
useColorScheme,
|
useColorScheme,
|
||||||
Modal,
|
Modal,
|
||||||
@ -34,9 +34,9 @@ const Item = styled(Sheet)(({ theme }) => ({
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
const stepsOfAddingSpace = [
|
const stepsOfAddingSpace = [
|
||||||
'Knowledge Space Configuration',
|
'1.Knowledge Space Config',
|
||||||
'Choose a Datasource type',
|
'2.Choose a Datasource type',
|
||||||
'Setup the Datasource'
|
'3.Setup the Datasource'
|
||||||
]
|
]
|
||||||
const documentTypeList = [
|
const documentTypeList = [
|
||||||
{
|
{
|
||||||
@ -128,8 +128,8 @@ const Index = () => {
|
|||||||
<div className="page-body p-4">
|
<div className="page-body p-4">
|
||||||
{knowledgeSpaceList.length ? (
|
{knowledgeSpaceList.length ? (
|
||||||
<Table
|
<Table
|
||||||
color="info"
|
color="primary"
|
||||||
variant="soft"
|
variant="plain"
|
||||||
size="lg"
|
size="lg"
|
||||||
sx={{
|
sx={{
|
||||||
'& tbody tr: hover': {
|
'& tbody tr: hover': {
|
||||||
@ -146,6 +146,7 @@ const Index = () => {
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Vector</th>
|
<th>Vector</th>
|
||||||
<th>Owner</th>
|
<th>Owner</th>
|
||||||
|
<th>Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -165,23 +166,22 @@ const Index = () => {
|
|||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Chip
|
<Chip variant="solid" color="neutral" sx={{ opacity: 0.5 }}>
|
||||||
variant="soft"
|
|
||||||
color="neutral"
|
|
||||||
sx={{ fontWeight: 300 }}
|
|
||||||
>
|
|
||||||
{row.vector_type}
|
{row.vector_type}
|
||||||
</Chip>
|
</Chip>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Chip
|
<Chip variant="solid" color="neutral" sx={{ opacity: 0.5 }}>
|
||||||
variant="soft"
|
|
||||||
color="neutral"
|
|
||||||
sx={{ fontWeight: 300 }}
|
|
||||||
>
|
|
||||||
{row.owner}
|
{row.owner}
|
||||||
</Chip>
|
</Chip>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<Popover content={row.desc} trigger="hover">
|
||||||
|
{row.desc.length > 10
|
||||||
|
? `${row.desc.slice(0, 10)}...`
|
||||||
|
: row.desc}
|
||||||
|
</Popover>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -214,7 +214,7 @@ const Index = () => {
|
|||||||
{stepsOfAddingSpace.map((item: any, index: number) => (
|
{stepsOfAddingSpace.map((item: any, index: number) => (
|
||||||
<Item
|
<Item
|
||||||
key={item}
|
key={item}
|
||||||
sx={{ fontWeight: activeStep === index ? 'bold' : '' }}
|
sx={{ fontWeight: activeStep === index ? 'bold' : '', color: activeStep === index ? '#814DDE' : '' }}
|
||||||
>
|
>
|
||||||
{item}
|
{item}
|
||||||
</Item>
|
</Item>
|
||||||
@ -237,7 +237,9 @@ const Index = () => {
|
|||||||
message.error('please input the name')
|
message.error('please input the name')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const res = await fetch(`${fetchBaseURL}/knowledge/space/add`, {
|
const res = await fetch(
|
||||||
|
`${fetchBaseURL}/knowledge/space/add`,
|
||||||
|
{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -248,7 +250,8 @@ const Index = () => {
|
|||||||
owner: 'keting',
|
owner: 'keting',
|
||||||
desc: 'test1'
|
desc: 'test1'
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
)
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
message.success('success')
|
message.success('success')
|
||||||
@ -360,6 +363,7 @@ const Index = () => {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
|
variant='outlined'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (documentName === '') {
|
if (documentName === '') {
|
||||||
message.error('Please input the name')
|
message.error('Please input the name')
|
||||||
|
@ -12,28 +12,6 @@ body {
|
|||||||
background-color: var(--joy-palette-background-body);
|
background-color: var(--joy-palette-background-body);
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
th, td {
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
text-align: left;
|
|
||||||
padding: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr:nth-child(even) {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
}
|
|
||||||
tr:hover {
|
|
||||||
background-color: #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
body .ant-btn-primary {
|
body .ant-btn-primary {
|
||||||
background-color: #1677ff;
|
background-color: #1677ff;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user