fix: fix bugs

This commit is contained in:
xion 2025-02-26 01:35:37 +08:00
parent 6eba0ac564
commit 5f7bd0de5f
8 changed files with 447 additions and 440 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "@kevisual/center", "name": "@kevisual/center",
"private": true, "private": true,
"version": "0.0.4", "version": "0.0.6",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@ -9,8 +9,8 @@
"dev:kv": "cross-env VITE_USE_KV=true vite", "dev:kv": "cross-env VITE_USE_KV=true vite",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview", "preview": "vite preview",
"prepub": "envision switchMe", "prepub": "envision switch root",
"pub": "envision deploy ./dist -k center -v 0.0.5 -u" "pub": "envision deploy ./dist -k center -v 0.0.6 -u"
}, },
"dependencies": { "dependencies": {
"@abearxiong/flows": "0.0.1-alpha.9", "@abearxiong/flows": "0.0.1-alpha.9",
@ -22,10 +22,10 @@
"@kevisual/query": "^0.0.6", "@kevisual/query": "^0.0.6",
"@kevisual/ui": "^0.0.2", "@kevisual/ui": "^0.0.2",
"@monaco-editor/react": "^4.7.0", "@monaco-editor/react": "^4.7.0",
"@tailwindcss/vite": "^4.0.6", "@tailwindcss/vite": "^4.0.8",
"@uiw/react-textarea-code-editor": "^3.1.0", "@uiw/react-textarea-code-editor": "^3.1.0",
"@xyflow/react": "^12.4.3", "@xyflow/react": "^12.4.4",
"antd": "^5.24.0", "antd": "^5.24.2",
"classnames": "^2.5.1", "classnames": "^2.5.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"copy-to-clipboard": "^3.3.3", "copy-to-clipboard": "^3.3.3",
@ -34,42 +34,42 @@
"immer": "^10.1.1", "immer": "^10.1.1",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"marked": "^15.0.7", "marked": "^15.0.7",
"nanoid": "^5.1.0", "nanoid": "^5.1.2",
"react": "19.0.0", "react": "19.0.0",
"react-dom": "19.0.0", "react-dom": "19.0.0",
"react-resizable-panels": "^2.1.7", "react-resizable-panels": "^2.1.7",
"react-router": "^7.1.5", "react-router": "^7.2.0",
"react-router-dom": "^7.1.5", "react-router-dom": "^7.2.0",
"react-toastify": "^11.0.3", "react-toastify": "^11.0.5",
"vite-plugin-tsconfig-paths": "^1.4.1", "vite-plugin-tsconfig-paths": "^1.4.1",
"zustand": "^5.0.3" "zustand": "^5.0.3"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.20.0", "@eslint/js": "^9.21.0",
"@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/typography": "^0.5.16",
"@types/d3": "^7.4.3", "@types/d3": "^7.4.3",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/node": "^22.13.4", "@types/node": "^22.13.5",
"@types/path-browserify": "^1.0.3", "@types/path-browserify": "^1.0.3",
"@types/react": "^19.0.8", "@types/react": "^19.0.10",
"@types/react-dom": "^19.0.3", "@types/react-dom": "^19.0.4",
"@vitejs/plugin-react": "^4.3.4", "@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^9.20.1", "eslint": "^9.21.0",
"eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19", "eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0", "globals": "^16.0.0",
"path-browserify": "^1.0.1", "path-browserify": "^1.0.1",
"postcss-import": "^16.1.0", "postcss-import": "^16.1.0",
"pretty-bytes": "^6.1.1", "pretty-bytes": "^6.1.1",
"react-is": "19.0.0", "react-is": "19.0.0",
"tailwind-merge": "^3.0.1", "tailwind-merge": "^3.0.2",
"tailwindcss": "^4.0.6", "tailwindcss": "^4.0.8",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.3", "typescript": "^5.7.3",
"typescript-eslint": "^8.24.0", "typescript-eslint": "^8.25.0",
"vite": "^6.1.0" "vite": "^6.2.0"
} }
} }

782
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ import { useNavigation, useParams } from 'react-router';
import { useAppVersionStore } from '../store'; import { useAppVersionStore } from '../store';
import { useShallow } from 'zustand/react/shallow'; import { useShallow } from 'zustand/react/shallow';
import { useCallback, useEffect, useMemo, useState } from 'react'; import { useCallback, useEffect, useMemo, useState } from 'react';
import { Button, Form, Input, message, Modal, Tooltip } from 'antd'; import { Button, Form, Input, message, Modal, Space, Tooltip } from 'antd';
import { CloudUploadOutlined, DeleteOutlined, EditOutlined, FileOutlined, LeftOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'; import { CloudUploadOutlined, DeleteOutlined, EditOutlined, FileOutlined, LeftOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons';
import { isObjectNull } from '@/utils/is-null'; import { isObjectNull } from '@/utils/is-null';
import { FileUpload } from '../modules/FileUpload'; import { FileUpload } from '../modules/FileUpload';
@ -99,6 +99,7 @@ export const AppVersionList = () => {
}), }),
); );
const navigate = useNewNavigate(); const navigate = useNewNavigate();
const [modal, contextHolder] = Modal.useModal();
const [isUpload, setIsUpload] = useState(false); const [isUpload, setIsUpload] = useState(false);
useEffect(() => { useEffect(() => {
// fetch app version list // fetch app version list
@ -151,7 +152,7 @@ export const AppVersionList = () => {
</Tooltip> </Tooltip>
</div> </div>
<div className='mt-4'> <div className='mt-4'>
<Button.Group> <Space.Compact>
{/* <Button {/* <Button
onClick={() => { onClick={() => {
versionStore.setFormData(item); versionStore.setFormData(item);
@ -162,7 +163,7 @@ export const AppVersionList = () => {
<Tooltip title='Delete'> <Tooltip title='Delete'>
<Button <Button
onClick={(e) => { onClick={(e) => {
Modal.confirm({ modal.confirm({
title: 'Delete', title: 'Delete',
content: 'Are you sure delete this data?', content: 'Are you sure delete this data?',
onOk: () => { onOk: () => {
@ -207,7 +208,7 @@ export const AppVersionList = () => {
}} }}
/> />
</Tooltip> </Tooltip>
</Button.Group> </Space.Compact>
</div> </div>
</div> </div>
); );
@ -216,6 +217,7 @@ export const AppVersionList = () => {
</div> </div>
</div> </div>
</div> </div>
{contextHolder}
<div className='shark h-full'> <div className='shark h-full'>
{isUpload && ( {isUpload && (
<div className='bg-white p-2 w-[600px] h-full flex flex-col'> <div className='bg-white p-2 w-[600px] h-full flex flex-col'>

View File

@ -1,10 +1,9 @@
import { useShallow } from 'zustand/react/shallow'; import { useShallow } from 'zustand/react/shallow';
import { useUserAppStore } from '../store'; import { useUserAppStore } from '../store';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { Button, Form, Input, message, Modal, Select, Tooltip } from 'antd'; import { Button, Form, Input, message, Space, Modal, Select, Tooltip } from 'antd';
import { CodeOutlined, DashboardOutlined, DeleteOutlined, EditOutlined, LinkOutlined, PlusOutlined, UnorderedListOutlined } from '@ant-design/icons'; import { CodeOutlined, DeleteOutlined, EditOutlined, LinkOutlined, PlusOutlined, UnorderedListOutlined } from '@ant-design/icons';
import { isObjectNull } from '@/utils/is-null'; import { isObjectNull } from '@/utils/is-null';
import { FileUpload } from '../modules/FileUpload';
import { useNewNavigate } from '@/modules'; import { useNewNavigate } from '@/modules';
import { marked } from 'marked'; import { marked } from 'marked';
import clsx from 'clsx'; import clsx from 'clsx';
@ -94,6 +93,8 @@ const FormModal = () => {
}; };
export const List = () => { export const List = () => {
const [modal, contextHolder] = Modal.useModal();
const userAppStore = useUserAppStore( const userAppStore = useUserAppStore(
useShallow((state) => { useShallow((state) => {
return { return {
@ -150,7 +151,7 @@ export const List = () => {
</div> </div>
</div> </div>
<div className='mt-2'> <div className='mt-2'>
<Button.Group> <Space.Compact>
<Tooltip title={'Edit'}> <Tooltip title={'Edit'}>
<Button <Button
icon={<EditOutlined />} icon={<EditOutlined />}
@ -171,9 +172,13 @@ export const List = () => {
icon={<LinkOutlined />} icon={<LinkOutlined />}
onClick={() => { onClick={() => {
if (isRunning) { if (isRunning) {
let baseUri = 'https://kevisual.xiongxiao.me'; let baseUri = location.origin;
if (item.domain) { if (item.domain) {
baseUri = item.domain; if (item.domain.startsWith('http://') || item.domain.startsWith('https://')) {
baseUri = item.domain;
} else {
baseUri = new URL(item.domain).origin;
}
} }
if (DEV_SERVER) { if (DEV_SERVER) {
baseUri = 'http://localhost:3005'; baseUri = 'http://localhost:3005';
@ -189,7 +194,8 @@ export const List = () => {
<Button <Button
icon={<DeleteOutlined />} icon={<DeleteOutlined />}
onClick={(e) => { onClick={(e) => {
Modal.confirm({ console.log('delete', item);
modal.confirm({
title: 'Delete', title: 'Delete',
content: 'Are you sure delete this data?', content: 'Are you sure delete this data?',
onOk: () => { onOk: () => {
@ -199,7 +205,7 @@ export const List = () => {
e.stopPropagation(); e.stopPropagation();
}}></Button> }}></Button>
</Tooltip> </Tooltip>
</Button.Group> </Space.Compact>
</div> </div>
</div> </div>
); );
@ -208,6 +214,7 @@ export const List = () => {
</div> </div>
</div> </div>
</div> </div>
{contextHolder}
<FormModal /> <FormModal />
</div> </div>
); );

View File

@ -1,4 +1,4 @@
import { Button, Input, message, Modal, Select, Switch, Table, Tooltip } from 'antd'; import { Button, Input, message, Modal, Select, Space, Switch, Table, Tooltip } from 'antd';
import { Fragment, useEffect, useState } from 'react'; import { Fragment, useEffect, useState } from 'react';
import { TextArea } from '../components/TextArea'; import { TextArea } from '../components/TextArea';
import { useContainerStore } from '../store'; import { useContainerStore } from '../store';
@ -187,6 +187,7 @@ const PublishFormModal = () => {
}; };
export const ContainerList = () => { export const ContainerList = () => {
const navicate = useNewNavigate(); const navicate = useNewNavigate();
const [modal, contextHolder] = Modal.useModal();
const containerStore = useContainerStore( const containerStore = useContainerStore(
useShallow((state) => { useShallow((state) => {
return { return {
@ -253,7 +254,7 @@ export const ContainerList = () => {
<TextArea className='max-h-[240px] scrollbar' value={item.code} readonly /> <TextArea className='max-h-[240px] scrollbar' value={item.code} readonly />
</div> </div>
<div className='flex mt-2 '> <div className='flex mt-2 '>
<Button.Group> <Space.Compact>
<Button <Button
onClick={() => { onClick={() => {
// containerStore.publishData(item); // containerStore.publishData(item);
@ -290,7 +291,7 @@ export const ContainerList = () => {
<Button <Button
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
Modal.confirm({ modal.confirm({
title: 'Delete', title: 'Delete',
content: 'Are you sure delete this data?', content: 'Are you sure delete this data?',
onOk: () => { onOk: () => {
@ -301,7 +302,7 @@ export const ContainerList = () => {
}} }}
icon={<DeleteOutlined />}></Button> icon={<DeleteOutlined />}></Button>
</Tooltip> </Tooltip>
</Button.Group> </Space.Compact>
</div> </div>
</div> </div>
</Fragment> </Fragment>
@ -358,6 +359,7 @@ export const ContainerList = () => {
</div> </div>
<FormModal /> <FormModal />
<PublishFormModal /> <PublishFormModal />
{contextHolder}
</div> </div>
); );
}; };

View File

@ -114,6 +114,7 @@ export const List = () => {
}), }),
); );
const [codeEdit, setCodeEdit] = useState(false); const [codeEdit, setCodeEdit] = useState(false);
const [modal, contextHolder] = Modal.useModal();
const [code, setCode] = useState(''); const [code, setCode] = useState('');
useEffect(() => { useEffect(() => {
userStore.getList(); userStore.getList();
@ -176,7 +177,7 @@ export const List = () => {
</Tooltip> </Tooltip>
<Button <Button
onClick={(e) => { onClick={(e) => {
Modal.confirm({ modal.confirm({
title: 'Delete', title: 'Delete',
content: 'Are you sure delete this data?', content: 'Are you sure delete this data?',
onOk: () => { onOk: () => {
@ -233,6 +234,7 @@ export const List = () => {
</div> </div>
</div> </div>
<FormModal /> <FormModal />
{contextHolder}
</div> </div>
); );
}; };

View File

@ -1,4 +1,4 @@
import { Button, Input, message, Modal, Table } from 'antd'; import { Button, Input, message, Modal, Space, Table } from 'antd';
import { Fragment, useEffect, useMemo, useState } from 'react'; import { Fragment, useEffect, useMemo, useState } from 'react';
import { useUserStore } from '../store'; import { useUserStore } from '../store';
import { useShallow } from 'zustand/react/shallow'; import { useShallow } from 'zustand/react/shallow';
@ -81,6 +81,7 @@ const FormModal = () => {
}; };
export const List = () => { export const List = () => {
const navicate = useNewNavigate(); const navicate = useNewNavigate();
const [modal, contextHolder] = Modal.useModal();
const userStore = useUserStore( const userStore = useUserStore(
useShallow((state) => { useShallow((state) => {
return { return {
@ -137,7 +138,7 @@ export const List = () => {
<div className='font-light text-xs mt-2'>{item.description ? item.description : '-'}</div> <div className='font-light text-xs mt-2'>{item.description ? item.description : '-'}</div>
</div> </div>
<div className='flex mt-2 '> <div className='flex mt-2 '>
<Button.Group> <Space.Compact>
<Button <Button
onClick={(e) => { onClick={(e) => {
userStore.setFormData(item); userStore.setFormData(item);
@ -148,7 +149,7 @@ export const List = () => {
icon={<EditOutlined />}></Button> icon={<EditOutlined />}></Button>
<Button <Button
onClick={(e) => { onClick={(e) => {
Modal.confirm({ modal.confirm({
title: 'Delete', title: 'Delete',
content: 'Are you sure delete this data?', content: 'Are you sure delete this data?',
onOk: () => { onOk: () => {
@ -158,7 +159,7 @@ export const List = () => {
e.stopPropagation(); e.stopPropagation();
}} }}
icon={<DeleteOutlined />}></Button> icon={<DeleteOutlined />}></Button>
</Button.Group> </Space.Compact>
</div> </div>
</div> </div>
</Fragment> </Fragment>
@ -202,6 +203,7 @@ export const List = () => {
</div> </div>
</div> </div>
<FormModal /> <FormModal />
{contextHolder}
</div> </div>
); );
}; };

View File

@ -23,19 +23,19 @@ let proxy = {};
if (isKV) { if (isKV) {
proxy = { proxy = {
'/api': { '/api': {
target: 'https://envision.xiongxiao.me', target: 'https://kevisual.xiongxiao.me',
changeOrigin: true, changeOrigin: true,
rewrite: (path: any) => path.replace(/^\/api/, '/api'), rewrite: (path: any) => path.replace(/^\/api/, '/api'),
}, },
'/api/router': { '/api/router': {
target: 'wss://envision.xiongxiao.me', target: 'wss://kevisual.xiongxiao.me',
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
rewriteWsOrigin: true, rewriteWsOrigin: true,
rewrite: (path: any) => path.replace(/^\/api/, '/api'), rewrite: (path: any) => path.replace(/^\/api/, '/api'),
}, },
'/resources': { '/resources': {
target: 'https://envision.xiongxiao.me', target: 'https://kevisual.xiongxiao.me',
changeOrigin: true, changeOrigin: true,
rewrite: (path: any) => path.replace(/^\/resources/, '/resources'), rewrite: (path: any) => path.replace(/^\/resources/, '/resources'),
}, },
@ -78,7 +78,7 @@ export default defineConfig({
rewrite: (path) => path.replace(/^\/api/, '/api'), rewrite: (path) => path.replace(/^\/api/, '/api'),
}, },
'/resources': { '/resources': {
target: 'https://envision.xiongxiao.me', target: 'https://kevisual.xiongxiao.me',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/resources/, '/resources'), rewrite: (path) => path.replace(/^\/resources/, '/resources'),
}, },