|
@@ -14,7 +14,7 @@ import ConstructLayout from '@/new-components/layout/Construct';
|
|
|
import { IApp } from '@/types/app';
|
|
|
import { BulbOutlined, DingdingOutlined, PlusOutlined, SearchOutlined, WarningOutlined } from '@ant-design/icons';
|
|
|
import { useDebounceFn, useRequest } from 'ahooks';
|
|
|
-import { App, Button, Input, Modal, Pagination, Popover, Segmented, SegmentedProps, Select, Spin, Tag } from 'antd';
|
|
|
+import { App, Avatar, Button, Input, Modal, Pagination, Popover, Segmented, SegmentedProps, Select, Spin, Tag } from 'antd';
|
|
|
import copy from 'copy-to-clipboard';
|
|
|
import moment from 'moment';
|
|
|
import { useRouter } from 'next/router';
|
|
@@ -290,148 +290,162 @@ export default function AppContent() {
|
|
|
return (
|
|
|
<ConstructLayout>
|
|
|
<Spin spinning={spinning}>
|
|
|
- <div className='h-screen w-full p-4 md:p-6 overflow-y-auto'>
|
|
|
- <div className='flex justify-between items-center mb-6'>
|
|
|
- <div className='flex items-center gap-4'>
|
|
|
+ <div className='h-screen w-full px-4 bg-[#fff] overflow-y-auto mt-0'>
|
|
|
+ <div className='mt-2 rounded-[10px] flex h-16 justify-between items-center px-2'>
|
|
|
+ <Input
|
|
|
+ variant='filled'
|
|
|
+ prefix={<SearchOutlined />}
|
|
|
+ placeholder={t('please_enter_the_keywords')}
|
|
|
+ onChange={onSearch}
|
|
|
+ onPressEnter={onSearch}
|
|
|
+ allowClear
|
|
|
+ className='w-[400px] h-[40px]
|
|
|
+ border-1 border-[#d1d1d1]
|
|
|
+ backdrop-filter
|
|
|
+ backdrop-blur-lg
|
|
|
+ dark:border-[#6f7f95]
|
|
|
+ dark:bg-[#6f7f95]
|
|
|
+ dark:bg-opacity-60'
|
|
|
+ />
|
|
|
+ <span className='flex gap-2 items-center'>
|
|
|
+ <Avatar className='bg-gradient-to-tr from-[#31afff] to-[#1677ff] cursor-pointer'>
|
|
|
+
|
|
|
+ </Avatar>
|
|
|
+ <span
|
|
|
+ >
|
|
|
+ admin
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div className='rounded-[10px] h-full mt-4 relative bg-slate-200 p-4 border-1 mb-2'>
|
|
|
+ <div className='flex justify-between items-center'>
|
|
|
<Segmented
|
|
|
className='backdrop-filter h-10 backdrop-blur-lg bg-white bg-opacity-30 border border-white rounded-lg shadow p-1 dark:border-[#6f7f95] dark:bg-[#6f7f95] dark:bg-opacity-60'
|
|
|
options={items as any}
|
|
|
onChange={handleTabChange}
|
|
|
value={activeKey}
|
|
|
/>
|
|
|
- <Input
|
|
|
- variant='filled'
|
|
|
- value={filterValue}
|
|
|
- prefix={<SearchOutlined />}
|
|
|
- placeholder={t('please_enter_the_keywords')}
|
|
|
- onChange={onSearch}
|
|
|
- onPressEnter={onSearch}
|
|
|
- allowClear
|
|
|
- className='w-[230px] h-[40px] border-1 border-white backdrop-filter backdrop-blur-lg bg-white bg-opacity-30 dark:border-[#6f7f95] dark:bg-[#6f7f95] dark:bg-opacity-60'
|
|
|
- />
|
|
|
+ <Button
|
|
|
+ className='border-none text-white bg-button-gradient flex items-center'
|
|
|
+ onClick={handleCreate}
|
|
|
+ >
|
|
|
+ {'创建应用'}
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
-
|
|
|
- <Button
|
|
|
- className='border-none text-white bg-button-gradient flex items-center'
|
|
|
- icon={<PlusOutlined className='text-base' />}
|
|
|
- onClick={handleCreate}
|
|
|
- >
|
|
|
- {t('create_app')}
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- <div className=' w-full flex flex-wrap pb-12 mx-[-8px]'>
|
|
|
- {apps.map(item => {
|
|
|
- return (
|
|
|
- <BlurredCard
|
|
|
- key={item.app_code}
|
|
|
- code={item.app_code}
|
|
|
- name={item.app_name}
|
|
|
- description={item.app_describe}
|
|
|
- RightTop={
|
|
|
- <div className='flex items-center gap-2'>
|
|
|
- <Popover
|
|
|
- content={
|
|
|
- <div className='flex flex-col gap-2'>
|
|
|
- <div className='flex items-center gap-2'>
|
|
|
- <BulbOutlined
|
|
|
- style={{
|
|
|
- color: 'rgb(252,204,96)',
|
|
|
- fontSize: 12,
|
|
|
- }}
|
|
|
- />
|
|
|
- <span className='text-sm text-gray-500'>{t('copy_url')}</span>
|
|
|
- </div>
|
|
|
- <div className='flex items-center gap-2'>
|
|
|
- <BulbOutlined
|
|
|
- style={{
|
|
|
- color: 'rgb(252,204,96)',
|
|
|
- fontSize: 12,
|
|
|
- }}
|
|
|
- />
|
|
|
- <span className='text-sm text-gray-500'>{t('double_click_open')}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- }
|
|
|
- >
|
|
|
- <DingdingOutlined
|
|
|
- className='cursor-pointer text-[#0069fe] hover:bg-white hover:dark:bg-black p-2 rounded-md'
|
|
|
- onClick={() => shareDingding(item)}
|
|
|
- onDoubleClick={() => openDingding(item)}
|
|
|
- />
|
|
|
- </Popover>
|
|
|
- <InnerDropdown
|
|
|
- menu={{
|
|
|
- items: [
|
|
|
- {
|
|
|
- key: 'publish',
|
|
|
- label: (
|
|
|
- <span
|
|
|
- onClick={e => {
|
|
|
- e.stopPropagation();
|
|
|
- operate(item);
|
|
|
+ <div className='w-full flex flex-wrap pb-12 mx-[-8px]'>
|
|
|
+ {apps.map(item => {
|
|
|
+ return (
|
|
|
+ <BlurredCard
|
|
|
+ key={item.app_code}
|
|
|
+ code={item.app_code}
|
|
|
+ name={item.app_name}
|
|
|
+ description={item.app_describe}
|
|
|
+ RightTop={
|
|
|
+ <div className='flex items-center gap-2'>
|
|
|
+ <Popover
|
|
|
+ content={
|
|
|
+ <div className='flex flex-col gap-2'>
|
|
|
+ <div className='flex items-center gap-2'>
|
|
|
+ <BulbOutlined
|
|
|
+ style={{
|
|
|
+ color: 'rgb(252,204,96)',
|
|
|
+ fontSize: 12,
|
|
|
}}
|
|
|
- >
|
|
|
- {item.published === 'true' ? t('unpublish') : t('publish')}
|
|
|
- </span>
|
|
|
- ),
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'del',
|
|
|
- label: (
|
|
|
- <span
|
|
|
- className='text-red-400'
|
|
|
- onClick={e => {
|
|
|
- e.stopPropagation();
|
|
|
- showDeleteConfirm(item);
|
|
|
+ />
|
|
|
+ <span className='text-sm text-gray-500'>{t('copy_url')}</span>
|
|
|
+ </div>
|
|
|
+ <div className='flex items-center gap-2'>
|
|
|
+ <BulbOutlined
|
|
|
+ style={{
|
|
|
+ color: 'rgb(252,204,96)',
|
|
|
+ fontSize: 12,
|
|
|
}}
|
|
|
- >
|
|
|
- {t('Delete')}
|
|
|
- </span>
|
|
|
- ),
|
|
|
- },
|
|
|
- ],
|
|
|
+ />
|
|
|
+ <span className='text-sm text-gray-500'>{t('double_click_open')}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <DingdingOutlined
|
|
|
+ className='cursor-pointer text-[#0069fe] hover:bg-white hover:dark:bg-black p-2 rounded-md'
|
|
|
+ onClick={() => shareDingding(item)}
|
|
|
+ onDoubleClick={() => openDingding(item)}
|
|
|
+ />
|
|
|
+ </Popover>
|
|
|
+ <InnerDropdown
|
|
|
+ menu={{
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ key: 'publish',
|
|
|
+ label: (
|
|
|
+ <span
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation();
|
|
|
+ operate(item);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {item.published === 'true' ? t('unpublish') : t('publish')}
|
|
|
+ </span>
|
|
|
+ ),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'del',
|
|
|
+ label: (
|
|
|
+ <span
|
|
|
+ className='text-red-400'
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation();
|
|
|
+ showDeleteConfirm(item);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {t('Delete')}
|
|
|
+ </span>
|
|
|
+ ),
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ Tags={
|
|
|
+ <div>
|
|
|
+ <Tag>{languageMap[item.language]}</Tag>
|
|
|
+ <Tag>{item.team_mode}</Tag>
|
|
|
+ <Tag>{item.published === 'true' ? t('published') : t('unpublished')}</Tag>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ rightTopHover={false}
|
|
|
+ LeftBottom={
|
|
|
+ <div className='flex gap-2'>
|
|
|
+ <span>{item.owner_name}</span>
|
|
|
+ <span>•</span>
|
|
|
+ {item?.updated_at && <span>{moment(item?.updated_at).fromNow() + ' ' + t('update')}</span>}
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ RightBottom={
|
|
|
+ <ChatButton
|
|
|
+ onClick={() => {
|
|
|
+ handleChat(item);
|
|
|
}}
|
|
|
/>
|
|
|
- </div>
|
|
|
- }
|
|
|
- Tags={
|
|
|
- <div>
|
|
|
- <Tag>{languageMap[item.language]}</Tag>
|
|
|
- <Tag>{item.team_mode}</Tag>
|
|
|
- <Tag>{item.published === 'true' ? t('published') : t('unpublished')}</Tag>
|
|
|
- </div>
|
|
|
- }
|
|
|
- rightTopHover={false}
|
|
|
- LeftBottom={
|
|
|
- <div className='flex gap-2'>
|
|
|
- <span>{item.owner_name}</span>
|
|
|
- <span>•</span>
|
|
|
- {item?.updated_at && <span>{moment(item?.updated_at).fromNow() + ' ' + t('update')}</span>}
|
|
|
- </div>
|
|
|
- }
|
|
|
- RightBottom={
|
|
|
- <ChatButton
|
|
|
- onClick={() => {
|
|
|
- handleChat(item);
|
|
|
- }}
|
|
|
- />
|
|
|
- }
|
|
|
- onClick={() => {
|
|
|
- handleEdit(item);
|
|
|
+ }
|
|
|
+ onClick={() => {
|
|
|
+ handleEdit(item);
|
|
|
+ }}
|
|
|
+ scene={item?.team_context?.chat_scene || 'chat_agent'}
|
|
|
+ />
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ <div className='w-full flex justify-end shrink-0 pb-12'>
|
|
|
+ <Pagination
|
|
|
+ total={totalRef.current?.total_count || 0}
|
|
|
+ pageSize={12}
|
|
|
+ current={totalRef.current?.current_page}
|
|
|
+ onChange={async (page, _page_size) => {
|
|
|
+ await initData({ page });
|
|
|
}}
|
|
|
- scene={item?.team_context?.chat_scene || 'chat_agent'}
|
|
|
/>
|
|
|
- );
|
|
|
- })}
|
|
|
- <div className='w-full flex justify-end shrink-0 pb-12'>
|
|
|
- <Pagination
|
|
|
- total={totalRef.current?.total_count || 0}
|
|
|
- pageSize={12}
|
|
|
- current={totalRef.current?.current_page}
|
|
|
- onChange={async (page, _page_size) => {
|
|
|
- await initData({ page });
|
|
|
- }}
|
|
|
- />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
{open && (
|