Compare commits
2 Commits
7ca06de217
...
b7cfbe3622
Author | SHA1 | Date | |
---|---|---|---|
b7cfbe3622 | |||
24a7344b6e |
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/center",
|
"name": "@kevisual/center",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.9",
|
"version": "0.0.10",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@ -9,7 +9,7 @@
|
|||||||
"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",
|
||||||
"pub": "envision deploy ./dist -k center -v 0.0.9 -u -o root",
|
"pub": "envision deploy ./dist -k center -v 0.0.10 -u -o root",
|
||||||
"turbo:dev": "turbo dev:lib",
|
"turbo:dev": "turbo dev:lib",
|
||||||
"dev:lib": "turbo dev:lib",
|
"dev:lib": "turbo dev:lib",
|
||||||
"dev:query": "turbo dev:lib --filter=@kevisual/query",
|
"dev:query": "turbo dev:lib --filter=@kevisual/query",
|
||||||
@ -87,7 +87,7 @@
|
|||||||
"turbo": "^2.4.4",
|
"turbo": "^2.4.4",
|
||||||
"typescript": "^5.8.2",
|
"typescript": "^5.8.2",
|
||||||
"typescript-eslint": "^8.29.0",
|
"typescript-eslint": "^8.29.0",
|
||||||
"vite": "^6.2.4"
|
"vite": "^6.2.5"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.7.1"
|
"packageManager": "pnpm@10.7.1"
|
||||||
}
|
}
|
@ -18,7 +18,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.18.6",
|
"@codemirror/autocomplete": "^6.18.6",
|
||||||
"@codemirror/commands": "^6.8.0",
|
"@codemirror/commands": "^6.8.1",
|
||||||
"@codemirror/lang-css": "^6.3.1",
|
"@codemirror/lang-css": "^6.3.1",
|
||||||
"@codemirror/lang-html": "^6.4.9",
|
"@codemirror/lang-html": "^6.4.9",
|
||||||
"@codemirror/lang-javascript": "^6.2.3",
|
"@codemirror/lang-javascript": "^6.2.3",
|
||||||
@ -27,13 +27,13 @@
|
|||||||
"@codemirror/lang-yaml": "^6.1.2",
|
"@codemirror/lang-yaml": "^6.1.2",
|
||||||
"@codemirror/language": "^6.11.0",
|
"@codemirror/language": "^6.11.0",
|
||||||
"@codemirror/state": "^6.5.2",
|
"@codemirror/state": "^6.5.2",
|
||||||
"@codemirror/view": "^6.36.4",
|
"@codemirror/view": "^6.36.5",
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
"@emotion/styled": "^11.14.0",
|
"@emotion/styled": "^11.14.0",
|
||||||
"@kevisual/components": "workspace:*",
|
"@kevisual/components": "workspace:*",
|
||||||
"@kevisual/router": "^0.0.9",
|
"@kevisual/router": "^0.0.10",
|
||||||
"@kevisual/store": "^0.0.2",
|
"@kevisual/store": "^0.0.4",
|
||||||
"@mui/material": "^6.4.8",
|
"@mui/material": "^7.0.1",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/nprogress": "^0.2.3",
|
"@types/nprogress": "^0.2.3",
|
||||||
"@uiw/codemirror-theme-duotone": "^4.23.10",
|
"@uiw/codemirror-theme-duotone": "^4.23.10",
|
||||||
@ -44,16 +44,16 @@
|
|||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"lucide-react": "^0.483.0",
|
"lucide-react": "^0.487.0",
|
||||||
"marked": "^15.0.7",
|
"marked": "^15.0.7",
|
||||||
"marked-highlight": "^2.2.1",
|
"marked-highlight": "^2.2.1",
|
||||||
"nanoid": "^5.1.5",
|
"nanoid": "^5.1.5",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"pretty-bytes": "^6.1.1",
|
"pretty-bytes": "^6.1.1",
|
||||||
"react": "19.0.0",
|
"react": "19.1.0",
|
||||||
"react-datepicker": "^8.2.1",
|
"react-datepicker": "^8.2.1",
|
||||||
"react-dom": "19.0.0",
|
"react-dom": "19.1.0",
|
||||||
"react-dropzone": "^14.3.8",
|
"react-dropzone": "^14.3.8",
|
||||||
"react-toastify": "^11.0.5",
|
"react-toastify": "^11.0.5",
|
||||||
"zustand": "^5.0.3"
|
"zustand": "^5.0.3"
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit a857afbb2c8f5b5f98771824e875dfffd23b6ad2
|
Subproject commit 967c2f94f27d0cd7f6733c5293d2f201eacad090
|
@ -24,8 +24,6 @@
|
|||||||
"@kevisual/router": "^0.0.9",
|
"@kevisual/router": "^0.0.9",
|
||||||
"@kevisual/store": "^0.0.2",
|
"@kevisual/store": "^0.0.2",
|
||||||
"@mui/material": "^6.4.8",
|
"@mui/material": "^6.4.8",
|
||||||
"@types/lodash-es": "^4.17.12",
|
|
||||||
"@types/nprogress": "^0.2.3",
|
|
||||||
"@vitejs/plugin-basic-ssl": "^2.0.0",
|
"@vitejs/plugin-basic-ssl": "^2.0.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
@ -42,7 +40,9 @@
|
|||||||
"zustand": "^5.0.3"
|
"zustand": "^5.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@kevisual/types": "^0.0.6"
|
"@kevisual/types": "^0.0.6",
|
||||||
|
"@types/lodash-es": "^4.17.12",
|
||||||
|
"@types/nprogress": "^0.2.3"
|
||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.tsx",
|
".": "./src/index.tsx",
|
||||||
|
@ -43,19 +43,19 @@ export const QuickPreview = () => {
|
|||||||
let accordionList: AccordionItem[] = [];
|
let accordionList: AccordionItem[] = [];
|
||||||
const encodeUrl = encodeURIComponent(url);
|
const encodeUrl = encodeURIComponent(url);
|
||||||
const previewUrl = `${baseUrl}/app/preview?fileUrl=${encodeUrl}&fileType=${fileType}`;
|
const previewUrl = `${baseUrl}/app/preview?fileUrl=${encodeUrl}&fileType=${fileType}`;
|
||||||
accordionList.push({
|
// accordionList.push({
|
||||||
title: '文件预览',
|
// title: '文件预览',
|
||||||
key: 'preview-file',
|
// key: 'preview-file',
|
||||||
url: previewUrl,
|
// url: previewUrl,
|
||||||
content: (
|
// content: (
|
||||||
<div className=''>
|
// <div className=''>
|
||||||
<div className='text-sm break-words'>{previewUrl}</div>
|
// <div className='text-sm break-words'>{previewUrl}</div>
|
||||||
<Button variant='contained' color='primary' style={{ color: 'white' }} onClick={() => window.open(previewUrl, '_blank')}>
|
// <Button variant='contained' color='primary' style={{ color: 'white' }} onClick={() => window.open(previewUrl, '_blank')}>
|
||||||
点击查看
|
// 点击查看
|
||||||
</Button>
|
// </Button>
|
||||||
</div>
|
// </div>
|
||||||
),
|
// ),
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (fileType === 'image') {
|
if (fileType === 'image') {
|
||||||
accordionList.push({
|
accordionList.push({
|
||||||
|
@ -3,8 +3,8 @@ import 'nprogress/nprogress.css';
|
|||||||
import { Id, toast } from 'react-toastify';
|
import { Id, toast } from 'react-toastify';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { toastLogin } from '@kevisual/resources/pages/message/ToastLogin';
|
import { toastLogin } from '@kevisual/resources/pages/message/ToastLogin';
|
||||||
import { uploadFileChunked, UploadProgress } from '@kevisual/query-upload/query-upload';
|
import { uploadFileChunked, UploadProgress } from '@kevisual/query-upload/query-upload.js';
|
||||||
import { toFile } from '@kevisual/query-upload/query-upload';
|
import { toFile } from '@kevisual/query-upload/query-upload.js';
|
||||||
export type ConvertOpts = {
|
export type ConvertOpts = {
|
||||||
appKey?: string;
|
appKey?: string;
|
||||||
version?: string;
|
version?: string;
|
||||||
|
1051
pnpm-lock.yaml
generated
1051
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -92,5 +92,6 @@
|
|||||||
"Check username introduction": "Check your username, if the username is not available, you can contact the customer service to modify.",
|
"Check username introduction": "Check your username, if the username is not available, you can contact the customer service to modify.",
|
||||||
"Delete and remove file": "Delete and remove file",
|
"Delete and remove file": "Delete and remove file",
|
||||||
"Delete App Introduce": "Delete App, when you click the delete button, the file will be deleted from the file management system.",
|
"Delete App Introduce": "Delete App, when you click the delete button, the file will be deleted from the file management system.",
|
||||||
"Detect Files": "Detect Files"
|
"Detect Files": "Detect Files",
|
||||||
|
"Change Password": "Change Password"
|
||||||
}
|
}
|
@ -92,5 +92,6 @@
|
|||||||
"Check username introduction": "查看是否可以取名,如果当前用户名已存在,请更换其他用户名。其中用户名以@开头",
|
"Check username introduction": "查看是否可以取名,如果当前用户名已存在,请更换其他用户名。其中用户名以@开头",
|
||||||
"Delete and remove file": "删除并删除文件",
|
"Delete and remove file": "删除并删除文件",
|
||||||
"Delete App Introduce": "删除应用, 当点击同时删除文件,会把文件管理中,应用相关的存储的资源同步删除。",
|
"Delete App Introduce": "删除应用, 当点击同时删除文件,会把文件管理中,应用相关的存储的资源同步删除。",
|
||||||
"Detect Files": "检测文件"
|
"Detect Files": "检测文件",
|
||||||
|
"Change Password": "修改密码"
|
||||||
}
|
}
|
12
src/App.tsx
12
src/App.tsx
@ -11,8 +11,7 @@ import { App as DomainApp } from './pages/domain';
|
|||||||
import { App as HomeApp } from './pages/home';
|
import { App as HomeApp } from './pages/home';
|
||||||
import { basename } from './modules/basename';
|
import { basename } from './modules/basename';
|
||||||
import { Redirect } from './modules/Redirect';
|
import { Redirect } from './modules/Redirect';
|
||||||
import { CustomThemeProvider } from '@kevisual/components/theme/index.tsx';
|
import { CustomThemeProvider, useTheme, themeOptions, theme } from '@kevisual/components/theme/index.tsx';
|
||||||
import { useTheme } from '@mui/material/styles';
|
|
||||||
import { ToastContainer } from 'react-toastify';
|
import { ToastContainer } from 'react-toastify';
|
||||||
import 'dayjs/locale/zh-cn';
|
import 'dayjs/locale/zh-cn';
|
||||||
import 'dayjs/locale/en';
|
import 'dayjs/locale/en';
|
||||||
@ -21,7 +20,10 @@ import enUS from 'antd/locale/en_US';
|
|||||||
import ConfigProvider from 'antd/es/config-provider';
|
import ConfigProvider from 'antd/es/config-provider';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { ThemeProvider, createTheme } from '@mui/material';
|
||||||
|
export const CustomThemeProvider2 = ({ children }: { children: React.ReactNode }) => {
|
||||||
|
return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
|
||||||
|
};
|
||||||
const AntProvider = ({ children }: { children: React.ReactNode }) => {
|
const AntProvider = ({ children }: { children: React.ReactNode }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const primaryColor = theme.palette.primary.main;
|
const primaryColor = theme.palette.primary.main;
|
||||||
@ -67,7 +69,7 @@ const AntProvider = ({ children }: { children: React.ReactNode }) => {
|
|||||||
};
|
};
|
||||||
export const App = () => {
|
export const App = () => {
|
||||||
return (
|
return (
|
||||||
<CustomThemeProvider>
|
<CustomThemeProvider2>
|
||||||
<AntProvider>
|
<AntProvider>
|
||||||
<div className='w-full h-full'>
|
<div className='w-full h-full'>
|
||||||
<Router basename={basename}>
|
<Router basename={basename}>
|
||||||
@ -93,6 +95,6 @@ export const App = () => {
|
|||||||
<div id='for-drawer'></div>
|
<div id='for-drawer'></div>
|
||||||
<div id='for-modal'></div>
|
<div id='for-modal'></div>
|
||||||
<ToastContainer />
|
<ToastContainer />
|
||||||
</CustomThemeProvider>
|
</CustomThemeProvider2>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -17,6 +17,7 @@ import { IconButton } from '@kevisual/components/button/index.tsx';
|
|||||||
import { Languages, QrCode } from 'lucide-react';
|
import { Languages, QrCode } from 'lucide-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
import { useTheme } from '@kevisual/components/theme/index.tsx';
|
||||||
|
|
||||||
type LayoutMainProps = {
|
type LayoutMainProps = {
|
||||||
title?: React.ReactNode;
|
title?: React.ReactNode;
|
||||||
|
@ -10,9 +10,10 @@ import UploadOutlined from '@ant-design/icons/UploadOutlined';
|
|||||||
import PandaPNG from '@/assets/panda.png';
|
import PandaPNG from '@/assets/panda.png';
|
||||||
import { FileUpload } from '../module/FileUpload';
|
import { FileUpload } from '../module/FileUpload';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Edit } from 'lucide-react';
|
import { Edit, UserCog } from 'lucide-react';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import { useAdminStore } from '../admin/store/admin-store';
|
import { useAdminStore } from '../admin/store/admin-store';
|
||||||
|
import { IconButton } from '@kevisual/components/button/index.tsx';
|
||||||
export const CheckUserExistModal = () => {
|
export const CheckUserExistModal = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const userStore = useUserStore(
|
const userStore = useUserStore(
|
||||||
@ -62,7 +63,57 @@ export const CheckUserExistModal = () => {
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
export const ChangePasswordModal = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const userStore = useUserStore(
|
||||||
|
useShallow((state) => {
|
||||||
|
return {
|
||||||
|
showChangePassword: state.showChangePassword,
|
||||||
|
setShowChangePassword: state.setShowChangePassword,
|
||||||
|
updateSelf: state.updateSelf,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
const [newPassword, setNewPassword] = useState('');
|
||||||
|
const [confirmPassword, setConfirmPassword] = useState('');
|
||||||
|
const onSubmit = async () => {
|
||||||
|
if (newPassword !== confirmPassword) {
|
||||||
|
toast.error('两次密码不一致');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const res = await userStore.updateSelf({
|
||||||
|
password: newPassword,
|
||||||
|
});
|
||||||
|
if (res.code === 200) {
|
||||||
|
onClose();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onClose = () => {
|
||||||
|
setNewPassword('');
|
||||||
|
setConfirmPassword('');
|
||||||
|
userStore.setShowChangePassword(false);
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<Dialog open={userStore.showChangePassword} onClose={onClose}>
|
||||||
|
<DialogTitle>{t('Change Password')}</DialogTitle>
|
||||||
|
<DialogContent>
|
||||||
|
<div className='flex flex-col w-[400px] p-4 gap-4 pt-2'>
|
||||||
|
{/* <TextField label='oldPassword' /> */}
|
||||||
|
<TextField label='New Password' type='password' value={newPassword} onChange={(e) => setNewPassword(e.target.value)} />
|
||||||
|
<TextField label='Confirm Password' type='password' value={confirmPassword} onChange={(e) => setConfirmPassword(e.target.value)} />
|
||||||
|
<div className='flex justify-end gap-2 '>
|
||||||
|
<Button variant='contained' color='primary' onClick={onSubmit}>
|
||||||
|
{t('Submit')}
|
||||||
|
</Button>
|
||||||
|
<Button variant='contained' color='primary' onClick={onClose}>
|
||||||
|
{t('Cancel')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
export const Profile = () => {
|
export const Profile = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { control, handleSubmit, setValue, reset, formState, getValues } = useForm({
|
const { control, handleSubmit, setValue, reset, formState, getValues } = useForm({
|
||||||
@ -83,6 +134,7 @@ export const Profile = () => {
|
|||||||
setFormData: state.setFormData,
|
setFormData: state.setFormData,
|
||||||
updateSelf: state.updateSelf,
|
updateSelf: state.updateSelf,
|
||||||
setShowCheckUserExist: state.setShowCheckUserExist,
|
setShowCheckUserExist: state.setShowCheckUserExist,
|
||||||
|
setShowChangePassword: state.setShowChangePassword,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -201,8 +253,16 @@ export const Profile = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div className='mt-2'>
|
||||||
|
<Tooltip title={t('Change Password')}>
|
||||||
|
<IconButton className='' onClick={() => userStore.setShowChangePassword(true)}>
|
||||||
|
<UserCog size={16} />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<CheckUserExistModal />
|
<CheckUserExistModal />
|
||||||
|
<ChangePasswordModal />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -17,6 +17,8 @@ type UserStore = {
|
|||||||
updateData: (data: any) => Promise<void>;
|
updateData: (data: any) => Promise<void>;
|
||||||
updateSelf: (data: any) => Promise<any>;
|
updateSelf: (data: any) => Promise<any>;
|
||||||
deleteData: (id: string) => Promise<void>;
|
deleteData: (id: string) => Promise<void>;
|
||||||
|
showChangePassword: boolean;
|
||||||
|
setShowChangePassword: (showChangePassword: boolean) => void;
|
||||||
};
|
};
|
||||||
export const useUserStore = create<UserStore>((set, get) => {
|
export const useUserStore = create<UserStore>((set, get) => {
|
||||||
return {
|
return {
|
||||||
@ -88,5 +90,7 @@ export const useUserStore = create<UserStore>((set, get) => {
|
|||||||
message.error(res.message || 'Request failed');
|
message.error(res.message || 'Request failed');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
showChangePassword: false,
|
||||||
|
setShowChangePassword: (showChangePassword) => set({ showChangePassword }),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 862b29cfa4e5faa4a581f0bc68d885c20da889dd
|
Subproject commit 53cd97454dc4300a1a1040c25dd26d86c390f1c8
|
@ -1 +1 @@
|
|||||||
Subproject commit a7faaca4188cae055deb1af1d1b758b6d5439f8d
|
Subproject commit efa7fbe62e32a432b509629f4fe2f04719ef8a43
|
@ -1 +1 @@
|
|||||||
Subproject commit d70118ad3db513a4ae95a925f0dd651929a8f632
|
Subproject commit 351b2e336624b05e1b2c9f8b67d9a45cda7ebf9d
|
@ -1 +1 @@
|
|||||||
Subproject commit 4d0e945a92eea77784dd4fdf790fc2471e20b8c7
|
Subproject commit 3eaf262ee87feeacfdd5dbdab6d46c086971b5a6
|
@ -32,7 +32,8 @@
|
|||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src",
|
"src",
|
||||||
"packages/**/*"
|
// "packages/**/*"
|
||||||
|
"@kevisual/components/**/*"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user