更新项目名称为 CodePod,调整相关配置和依赖版本
This commit is contained in:
11
package.json
11
package.json
@@ -1,16 +1,15 @@
|
||||
{
|
||||
"name": "@kevisual/ai-pages",
|
||||
"name": "@kevisual/codepod",
|
||||
"version": "0.0.3",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"basename": "/root/ai-pages",
|
||||
"basename": "/root/codepod",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"pub": "ev deploy ./dist -k ai-pages -v 0.0.3 -u",
|
||||
"git:submodule": "git submodule update --init --recursive",
|
||||
"sn": "pnpm dlx shadcn@latest add "
|
||||
"pub": "ev deploy ./dist -k codepod -v 0.0.3 -u -y y",
|
||||
"ui": "pnpm dlx shadcn@latest add "
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
||||
@@ -66,7 +65,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kevisual/api": "^0.0.34",
|
||||
"@kevisual/api": "^0.0.35",
|
||||
"@kevisual/query": "^0.0.38",
|
||||
"@kevisual/router": "^0.0.63",
|
||||
"@kevisual/store": "^0.0.9",
|
||||
|
||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -142,8 +142,8 @@ importers:
|
||||
version: 5.0.10(@types/react@19.2.10)(react@19.2.4)(use-sync-external-store@1.6.0(react@19.2.4))
|
||||
devDependencies:
|
||||
'@kevisual/api':
|
||||
specifier: ^0.0.34
|
||||
version: 0.0.34
|
||||
specifier: ^0.0.35
|
||||
version: 0.0.35
|
||||
'@kevisual/query':
|
||||
specifier: ^0.0.38
|
||||
version: 0.0.38
|
||||
@@ -865,8 +865,8 @@ packages:
|
||||
'@jridgewell/trace-mapping@0.3.31':
|
||||
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
||||
|
||||
'@kevisual/api@0.0.34':
|
||||
resolution: {integrity: sha512-v04L5jtrp6+LCZjhEmudEdd5zo3uBntWkiPUbIw3w/72KLaqa26lmsDEc7VVDMXz9lOilbUzG7vX8eJjTEOZNQ==}
|
||||
'@kevisual/api@0.0.35':
|
||||
resolution: {integrity: sha512-NbaOasecbG+O9Ju2/LWC2eWeqcPc5yZYXXyT4vHpU2W5SoPzBf7H3W7+i3py/JcEXF6adcHZVofftCYpecmGMQ==}
|
||||
|
||||
'@kevisual/cache@0.0.5':
|
||||
resolution: {integrity: sha512-fgtUYGUUq/DY0KFV4CkWszNqvQUaA8XvMTUjoR9ZXRpau5IIDolD/Wen2TFsZ7G3Rfy+lef5dnaiZVDkZwdVKg==}
|
||||
@@ -3939,7 +3939,7 @@ snapshots:
|
||||
'@jridgewell/resolve-uri': 3.1.2
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
|
||||
'@kevisual/api@0.0.34':
|
||||
'@kevisual/api@0.0.35':
|
||||
dependencies:
|
||||
'@kevisual/js-filter': 0.0.5
|
||||
'@kevisual/load': 0.0.6
|
||||
|
||||
@@ -409,10 +409,23 @@ const RootContextMenu: React.FC<{ children: React.ReactNode }> = ({ children })
|
||||
|
||||
export const Sidebar: React.FC = () => {
|
||||
const { menu, isLoading } = useMenuStore();
|
||||
const [folder, setFolder] = useState<string>('');
|
||||
const [mount, setMount] = useState(false);
|
||||
useEffect(() => {
|
||||
const folder = getFolder();
|
||||
init('', folder);
|
||||
setFolder(folder);
|
||||
|
||||
setMount(true);
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (mount) {
|
||||
if (!folder.endsWith('/')) {
|
||||
toast.error('文件夹路径必须以 / 结尾');
|
||||
return;
|
||||
}
|
||||
init('', folder);
|
||||
}
|
||||
}, [mount, folder]);
|
||||
|
||||
const rootItems = useMemo(() => {
|
||||
const _menu = menu.filter((item) => {
|
||||
@@ -431,7 +444,7 @@ export const Sidebar: React.FC = () => {
|
||||
<h2 className='text-sm font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider'>文件</h2>
|
||||
{isLoading && <Loader2 className='w-4 h-4 animate-spin text-gray-400' />}
|
||||
</div>
|
||||
<div className='overflow-y-auto scrollbar p-2' style={{ maxHeight: 'calc(100% - 68px)' }}>
|
||||
<div className='overflow-y-auto scrollbar p-2' style={{ maxHeight: 'calc(100% - 68px - 54px)' }}>
|
||||
{menu.length === 0 && !isLoading ? (
|
||||
<div className='text-sm text-gray-400 px-2'>暂无文件</div>
|
||||
) : (
|
||||
|
||||
@@ -251,8 +251,14 @@ export const init = async (resource: string = '', prefix: string = '') => {
|
||||
export const getCurrentContent = async (currentPath: string): Promise<string | null> => {
|
||||
if (!currentPath) return null;
|
||||
const loadingToast = toast.loading('正在加载文件内容...');
|
||||
const res = await queryResources.fetchFile(currentPath);
|
||||
const res = await queryResources.fetchFile(currentPath, {});
|
||||
|
||||
toast.dismiss(loadingToast);
|
||||
if (res instanceof Response) {
|
||||
const text = await res.text();
|
||||
toast.success('文件内容加载成功');
|
||||
return text;
|
||||
}
|
||||
if (res.code === 200) {
|
||||
return res.data || '';
|
||||
} else {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta charset='UTF-8' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>AI Pages</title>
|
||||
<title>CodePod</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
|
||||
@@ -48,8 +48,8 @@ body {
|
||||
overflow: auto;
|
||||
/* 整个滚动条 */
|
||||
&::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
}
|
||||
&::-webkit-scrollbar-track {
|
||||
background-color: var(--color-scrollbar-track);
|
||||
|
||||
Reference in New Issue
Block a user