mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: dashboard
This commit is contained in:
6
src/view/dashboard/index.scss
vendored
6
src/view/dashboard/index.scss
vendored
@@ -20,7 +20,9 @@
|
||||
}
|
||||
|
||||
.txt {
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
|
||||
a {
|
||||
color: #1677ff;
|
||||
@@ -37,6 +39,10 @@
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
&.preview {
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.group-item {
|
||||
margin-bottom: 20px;
|
||||
|
||||
|
||||
11
src/view/dashboard/index.tsx
vendored
11
src/view/dashboard/index.tsx
vendored
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { Row, Col, Card } from 'antd';
|
||||
import { InboxOutlined } from '@ant-design/icons';
|
||||
import { os, invoke } from '@tauri-apps/api';
|
||||
@@ -10,6 +11,7 @@ import { CHAT_AWESOME_JSON, CHAT_CONF_JSON, readJSON } from '@/utils';
|
||||
import './index.scss';
|
||||
|
||||
export default function Dashboard() {
|
||||
const [params] = useSearchParams();
|
||||
const { json } = useJson<Record<string, any>[]>(CHAT_AWESOME_JSON);
|
||||
const [list, setList] = useState<Array<[string, Record<string, any>[]]>>();
|
||||
const [hasClass, setClass] = useState(false);
|
||||
@@ -56,14 +58,19 @@ export default function Dashboard() {
|
||||
</div>
|
||||
<div className="txt">
|
||||
Go to <a onClick={() => invoke('control_window')}>{'Control Center -> Awesome'}</a> to add
|
||||
data
|
||||
data and make sure they are enabled.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={clsx('dashboard', theme, { 'has-top-dom': hasClass })}>
|
||||
<div
|
||||
className={clsx('dashboard', theme, {
|
||||
'has-top-dom': hasClass,
|
||||
preview: params.get('type') === 'preview',
|
||||
})}
|
||||
>
|
||||
<div>
|
||||
{list.map((i) => {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user