更新项目名称为 CodePod,调整相关配置和依赖版本

This commit is contained in:
2026-01-30 17:34:58 +08:00
parent f9adaeca4d
commit 8261ddd0bc
6 changed files with 35 additions and 17 deletions

View File

@@ -1,16 +1,15 @@
{ {
"name": "@kevisual/ai-pages", "name": "@kevisual/codepod",
"version": "0.0.3", "version": "0.0.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"basename": "/root/ai-pages", "basename": "/root/codepod",
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev",
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"pub": "ev deploy ./dist -k ai-pages -v 0.0.3 -u", "pub": "ev deploy ./dist -k codepod -v 0.0.3 -u -y y",
"git:submodule": "git submodule update --init --recursive", "ui": "pnpm dlx shadcn@latest add "
"sn": "pnpm dlx shadcn@latest add "
}, },
"keywords": [], "keywords": [],
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)", "author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
@@ -66,7 +65,7 @@
"access": "public" "access": "public"
}, },
"devDependencies": { "devDependencies": {
"@kevisual/api": "^0.0.34", "@kevisual/api": "^0.0.35",
"@kevisual/query": "^0.0.38", "@kevisual/query": "^0.0.38",
"@kevisual/router": "^0.0.63", "@kevisual/router": "^0.0.63",
"@kevisual/store": "^0.0.9", "@kevisual/store": "^0.0.9",

10
pnpm-lock.yaml generated
View File

@@ -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)) 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: devDependencies:
'@kevisual/api': '@kevisual/api':
specifier: ^0.0.34 specifier: ^0.0.35
version: 0.0.34 version: 0.0.35
'@kevisual/query': '@kevisual/query':
specifier: ^0.0.38 specifier: ^0.0.38
version: 0.0.38 version: 0.0.38
@@ -865,8 +865,8 @@ packages:
'@jridgewell/trace-mapping@0.3.31': '@jridgewell/trace-mapping@0.3.31':
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
'@kevisual/api@0.0.34': '@kevisual/api@0.0.35':
resolution: {integrity: sha512-v04L5jtrp6+LCZjhEmudEdd5zo3uBntWkiPUbIw3w/72KLaqa26lmsDEc7VVDMXz9lOilbUzG7vX8eJjTEOZNQ==} resolution: {integrity: sha512-NbaOasecbG+O9Ju2/LWC2eWeqcPc5yZYXXyT4vHpU2W5SoPzBf7H3W7+i3py/JcEXF6adcHZVofftCYpecmGMQ==}
'@kevisual/cache@0.0.5': '@kevisual/cache@0.0.5':
resolution: {integrity: sha512-fgtUYGUUq/DY0KFV4CkWszNqvQUaA8XvMTUjoR9ZXRpau5IIDolD/Wen2TFsZ7G3Rfy+lef5dnaiZVDkZwdVKg==} resolution: {integrity: sha512-fgtUYGUUq/DY0KFV4CkWszNqvQUaA8XvMTUjoR9ZXRpau5IIDolD/Wen2TFsZ7G3Rfy+lef5dnaiZVDkZwdVKg==}
@@ -3939,7 +3939,7 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2 '@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/sourcemap-codec': 1.5.5
'@kevisual/api@0.0.34': '@kevisual/api@0.0.35':
dependencies: dependencies:
'@kevisual/js-filter': 0.0.5 '@kevisual/js-filter': 0.0.5
'@kevisual/load': 0.0.6 '@kevisual/load': 0.0.6

View File

@@ -409,10 +409,23 @@ const RootContextMenu: React.FC<{ children: React.ReactNode }> = ({ children })
export const Sidebar: React.FC = () => { export const Sidebar: React.FC = () => {
const { menu, isLoading } = useMenuStore(); const { menu, isLoading } = useMenuStore();
const [folder, setFolder] = useState<string>('');
const [mount, setMount] = useState(false);
useEffect(() => { useEffect(() => {
const folder = getFolder(); 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 rootItems = useMemo(() => {
const _menu = menu.filter((item) => { 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> <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' />} {isLoading && <Loader2 className='w-4 h-4 animate-spin text-gray-400' />}
</div> </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 ? ( {menu.length === 0 && !isLoading ? (
<div className='text-sm text-gray-400 px-2'></div> <div className='text-sm text-gray-400 px-2'></div>
) : ( ) : (

View File

@@ -251,8 +251,14 @@ export const init = async (resource: string = '', prefix: string = '') => {
export const getCurrentContent = async (currentPath: string): Promise<string | null> => { export const getCurrentContent = async (currentPath: string): Promise<string | null> => {
if (!currentPath) return null; if (!currentPath) return null;
const loadingToast = toast.loading('正在加载文件内容...'); const loadingToast = toast.loading('正在加载文件内容...');
const res = await queryResources.fetchFile(currentPath); const res = await queryResources.fetchFile(currentPath, {});
toast.dismiss(loadingToast); toast.dismiss(loadingToast);
if (res instanceof Response) {
const text = await res.text();
toast.success('文件内容加载成功');
return text;
}
if (res.code === 200) { if (res.code === 200) {
return res.data || ''; return res.data || '';
} else { } else {

View File

@@ -6,7 +6,7 @@
<head> <head>
<meta charset='UTF-8' /> <meta charset='UTF-8' />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AI Pages</title> <title>CodePod</title>
<style> <style>
html, html,
body { body {

View File

@@ -48,8 +48,8 @@ body {
overflow: auto; overflow: auto;
/* 整个滚动条 */ /* 整个滚动条 */
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 8px; width: 4px;
height: 8px; height: 4px;
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
background-color: var(--color-scrollbar-track); background-color: var(--color-scrollbar-track);