ui
This commit is contained in:
@@ -57,7 +57,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
|
|||||||
|
|
||||||
const { data: unread = 0 } = useQuery(['getUnreadCount'], getUnreadCount, {
|
const { data: unread = 0 } = useQuery(['getUnreadCount'], getUnreadCount, {
|
||||||
enabled: !!userInfo,
|
enabled: !!userInfo,
|
||||||
refetchInterval: 5000
|
refetchInterval: 10000
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export interface Props extends GridProps {
|
|||||||
onChange: (id: string) => void;
|
onChange: (id: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SlideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) => {
|
const SideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) => {
|
||||||
const sizeMap = useMemo(() => {
|
const sizeMap = useMemo(() => {
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 'sm':
|
case 'sm':
|
||||||
@@ -68,4 +68,4 @@ const SlideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) =
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(SlideTabs);
|
export default React.memo(SideTabs);
|
||||||
@@ -110,8 +110,6 @@ const TokenUsage = ({ appId }: { appId: string }) => {
|
|||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
boundaryGap: false,
|
|
||||||
splitNumber: 5,
|
|
||||||
max: Math.max(...data.map((item) => item.tokenLen)),
|
max: Math.max(...data.map((item) => item.tokenLen)),
|
||||||
min: 0
|
min: 0
|
||||||
},
|
},
|
||||||
@@ -180,12 +178,6 @@ const TokenUsage = ({ appId }: { appId: string }) => {
|
|||||||
myChart.current.setOption(option);
|
myChart.current.setOption(option);
|
||||||
}, [data, option]);
|
}, [data, option]);
|
||||||
|
|
||||||
// limit changed, update
|
|
||||||
useEffect(() => {
|
|
||||||
if (!myChart.current || !myChart?.current?.getOption()) return;
|
|
||||||
myChart.current.setOption(option);
|
|
||||||
}, [option]);
|
|
||||||
|
|
||||||
// resize chart
|
// resize chart
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!myChart.current || !myChart.current.getOption()) return;
|
if (!myChart.current || !myChart.current.getOption()) return;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dynamic from 'next/dynamic';
|
|||||||
import { defaultApp } from '@/constants/model';
|
import { defaultApp } from '@/constants/model';
|
||||||
|
|
||||||
import Tabs from '@/components/Tabs';
|
import Tabs from '@/components/Tabs';
|
||||||
import SlideTabs from '@/components/SlideTabs';
|
import SideTabs from '@/components/SideTabs';
|
||||||
import Settings from './components/Settings';
|
import Settings from './components/Settings';
|
||||||
import Avatar from '@/components/Avatar';
|
import Avatar from '@/components/Avatar';
|
||||||
import MyIcon from '@/components/Icon';
|
import MyIcon from '@/components/Icon';
|
||||||
@@ -81,7 +81,7 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
|
|||||||
{appDetail.name}
|
{appDetail.name}
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
<SlideTabs
|
<SideTabs
|
||||||
flex={1}
|
flex={1}
|
||||||
mx={'auto'}
|
mx={'auto'}
|
||||||
mt={2}
|
mt={2}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import PageContainer from '@/components/PageContainer';
|
|||||||
import Avatar from '@/components/Avatar';
|
import Avatar from '@/components/Avatar';
|
||||||
const CreateModal = dynamic(() => import('./component/CreateModal'));
|
const CreateModal = dynamic(() => import('./component/CreateModal'));
|
||||||
import styles from './index.module.scss';
|
import styles from './index.module.scss';
|
||||||
|
import MyTooltip from '@/components/MyTooltip';
|
||||||
|
|
||||||
const MyApps = () => {
|
const MyApps = () => {
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
@@ -117,7 +118,7 @@ const MyApps = () => {
|
|||||||
aria-label={'delete'}
|
aria-label={'delete'}
|
||||||
display={['', 'none']}
|
display={['', 'none']}
|
||||||
_hover={{
|
_hover={{
|
||||||
bg: 'myGray.100'
|
bg: 'red.100'
|
||||||
}}
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -140,7 +141,11 @@ const MyApps = () => {
|
|||||||
right={4}
|
right={4}
|
||||||
bottom={4}
|
bottom={4}
|
||||||
size={'sm'}
|
size={'sm'}
|
||||||
icon={<MyIcon name={'chatLight'} w={'14px'} />}
|
icon={
|
||||||
|
<MyTooltip label={'去聊天'}>
|
||||||
|
<MyIcon name={'chatLight'} w={'14px'} />
|
||||||
|
</MyTooltip>
|
||||||
|
}
|
||||||
variant={'base'}
|
variant={'base'}
|
||||||
borderRadius={'md'}
|
borderRadius={'md'}
|
||||||
aria-label={'delete'}
|
aria-label={'delete'}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const BillSchema = new Schema({
|
|||||||
try {
|
try {
|
||||||
BillSchema.index({ userId: 1 });
|
BillSchema.index({ userId: 1 });
|
||||||
// BillSchema.index({ time: -1 });
|
// BillSchema.index({ time: -1 });
|
||||||
// BillSchema.index({ time: 1 }, { expireAfterSeconds: 90 * 24 * 60 });
|
BillSchema.index({ time: 1 }, { expireAfterSeconds: 90 * 24 * 60 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user