Skip to content
Merged

Dev #416

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<p align="center">
<img src="frontend/docs/src/public/logo.png" width="150" height="150" alt="logo" />
<img src="frontend/web/public/logo.png" width="150" height="150" alt="logo" />
</p>
<h1>FastApiAdmin <img src="https://img.shields.io/badge/Version-v2.0.0-blue" alt="Version"></h1>
<h3>Modern Full-Stack Rapid Development Platform</h3>
Expand Down Expand Up @@ -191,16 +191,16 @@ With **Pydantic v2** and **PostgreSQL (asyncpg)**, ORM writes expect native Pyth

| Module | Screenshot |
|------------|---------------------------------|
| Login | ![login](frontend/docs/src/public/login.png) |
| Dashboard | ![Dashboard](frontend/docs/src/public/dashboard.png) |
| Generator | ![Generator](frontend/docs/src/public/gencode.png) |
| AI | ![AI](frontend/docs/src/public/ai.png) |
| Login | ![login](frontend/web/public/login.png) |
| Dashboard | ![Dashboard](frontend/web/public/dashboard.png) |
| Generator | ![Generator](frontend/web/public/gencode.png) |
| AI | ![AI](frontend/web/public/ai.png) |

### Mobile

| Login <div style="width:60px"/> | Home <div style="width:60px"/> | Profile <div style="width:60px"/> |
|----------|----------|----------|
| ![Mobile Login](frontend/docs/src/public/app_login.png) | ![Mobile Home](frontend/docs/src/public/app_home.png) | ![Mobile Personal Info](frontend/docs/src/public/app_mine.png) |
| ![Mobile Login](frontend/web/public/app_login.png) | ![Mobile Home](frontend/web/public/app_home.png) | ![Mobile Personal Info](frontend/web/public/app_mine.png) |

## 🚀 Quick Start

Expand Down Expand Up @@ -652,7 +652,7 @@ Thanks to the contributions and support of the following open-source projects:

| Group QR Code | WeChat Pay QR Code |
| --- | --- |
| ![Group QR Code](frontend/docs/src/public/group.jpg) | ![WeChat Pay QR Code](frontend/docs/src/public/wechatPay.jpg) |
| ![Group QR Code](frontend/web/public/group.jpg) | ![WeChat Pay QR Code](frontend/web/public/wechatPay.jpg) |

## ❤️ Support the Project

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<p align="center">
<img src="frontend/docs/src/public/logo.png" width="150" height="150" alt="logo" />
<img src="frontend/web/public/logo.png" width="150" height="150" alt="logo" />
</p>
<h1>FastApiAdmin <sup style="background-color: #28a745; color: white; padding: 2px 6px; border-radius: 3px; font-size: 0.4em; vertical-align: super; margin-left: 5px;">v2.0.0</h1>
<h3>现代化全栈快速开发平台</h3>
Expand Down Expand Up @@ -193,16 +193,16 @@ flowchart LR

| 模块名 <div style="width:60px"/> | 截图 |
| ----- | --- |
| 登录 | ![仪表盘](frontend/docs/src/public/login.png) |
| 仪表盘 | ![仪表盘](frontend/docs/src/public/dashboard.png) |
| 代码生成 | ![代码生成](frontend/docs/src/public/gencode.png) |
| 智能助手 | ![智能助手](frontend/docs/src/public/ai.png) |
| 登录 | ![仪表盘](frontend/web/public/login.png) |
| 仪表盘 | ![仪表盘](frontend/web/public/dashboard.png) |
| 代码生成 | ![代码生成](frontend/web/public/gencode.png) |
| 智能助手 | ![智能助手](frontend/web/public/ai.png) |

### 移动端

| 登录 <div style="width:60px"/> | 首页 <div style="width:60px"/> | 个人中心 <div style="width:60px"/> |
|----------|----------|----------|
| ![移动端登录](frontend/docs/src/public/app_login.png) | ![移动端首页](frontend/docs/src/public/app_home.png) | ![移动端个人中心](frontend/docs/src/public/app_mine.png) |
| ![移动端登录](frontend/web/public/app_login.png) | ![移动端首页](frontend/web/public/app_home.png) | ![移动端个人中心](frontend/web/public/app_mine.png) |

## 🚀 快速开始

Expand Down Expand Up @@ -613,7 +613,7 @@ A:使用 `./deploy.sh` 脚本一键部署到生产环境。

| 群组二维码 | 微信支付二维码 |
| --- | --- |
| ![群组二维码](frontend/docs/src/public/group.jpg) | ![微信支付二维码](frontend/docs/src/public/wechatPay.jpg) |
| ![群组二维码](frontend/web/public/group.jpg) | ![微信支付二维码](frontend/web/public/wechatPay.jpg) |

## ❤️ 支持项目

Expand Down
20 changes: 10 additions & 10 deletions deploy.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ echo.
echo %BLUE%服务说明:%RESET%
echo 🚀 后端服务 - FastAPI 后端 (端口: 8001)
echo 🌐 前端 Web - Vue 前端 (端口: 5173)
echo 📱 前端 App - UniApp 应用 (端口: 8080)
echo 📚 文档服务 - VitePress 文档 (端口: 5174)
REM echo 📱 前端 App - UniApp 应用 (端口: 8080) [已禁用:不开源]
REM echo 📚 文档服务 - VitePress 文档 (端口: 5174) [已禁用:不开源]
echo.
echo %BLUE%日志位置:%RESET%
echo %LOG_DIR%\
Expand All @@ -50,17 +50,17 @@ echo.

call :start_service "backend" "%SCRIPT_DIR%backend" "uv run main.py run --env=dev" "FastapiAdmin.Backend" "%BACKEND_PID%"
call :start_service "frontend" "%SCRIPT_DIR%frontend\web" "pnpm dev" "FastapiAdmin.Web" "%WEB_PID%"
call :start_service "app" "%SCRIPT_DIR%frontend\app" "pnpm dev:h5" "FastapiAdmin.App" "%APP_PID%"
call :start_service "docs" "%SCRIPT_DIR%frontend\docs" "pnpm dev" "FastapiAdmin.Docs" "%DOCS_PID%"
REM call :start_service "app" "%SCRIPT_DIR%frontend\app" "pnpm dev:h5" "FastapiAdmin.App" "%APP_PID%"
REM call :start_service "docs" "%SCRIPT_DIR%frontend\docs" "pnpm dev" "FastapiAdmin.Docs" "%DOCS_PID%"

echo.
echo %GREEN%🎉 所有服务启动完成!%RESET%
echo.
echo %BLUE%访问地址:%RESET%
echo 🚀 后端 API: http://localhost:8001/api/v1/docs
echo 🌐 前端 Web: http://localhost:5173
echo 📱 前端 App: http://localhost:8080
echo 📚 文档服务: http://localhost:5174
REM echo 📱 前端 App: http://localhost:8080 [已禁用]
REM echo 📚 文档服务: http://localhost:5174 [已禁用]
echo.
goto :end

Expand Down Expand Up @@ -99,8 +99,8 @@ echo %CYAN%⏹️ 开始停止所有服务...%RESET%
echo.
call :stop_service "backend"
call :stop_service "frontend"
call :stop_service "app"
call :stop_service "docs"
REM call :stop_service "app"
REM call :stop_service "docs"
echo %GREEN%🎉 所有服务已停止!%RESET%
echo.
goto :end
Expand Down Expand Up @@ -136,8 +136,8 @@ echo %CYAN%🔍 检查服务状态...%RESET%
echo.
call :check_service "backend"
call :check_service "frontend"
call :check_service "app"
call :check_service "docs"
REM call :check_service "app"
REM call :check_service "docs"
goto :end

:check_service
Expand Down
10 changes: 6 additions & 4 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ docker/
│ │ └── server.key # SSL 私钥文件
│ │ └── server.pem # SSL 证书文件
│ ├── web/ # 前端静态文件(Web)
│ ├── app/ # 前端静态文件(小程序 H5)
│ └── docs/ # 前端静态文件(官网文档)
│ ├── app/ # 前端静态文件(小程序 H5)[已禁用:不开源]
│ └── docs/ # 前端静态文件(官网文档)[已禁用:不开源]
├── mysql/ # MySQL 数据目录
│ └── data/ # MySQL 数据持久化目录
├── redis/ # Redis 数据目录
Expand Down Expand Up @@ -147,12 +147,14 @@ docker compose up -d --no-deps --build [service_name]

部署完成后,可以通过以下地址访问:

- **官网**: https://域名(或 ip)/docs
- **官网**: https://域名(或 ip)/docs [已禁用:不开源]
- **前端**: https://域名(或 ip)/web
- **小程序**: https://域名(或 ip)/app
- **小程序**: https://域名(或 ip)/app [已禁用:不开源]
- **API 文档**: https://域名(或 ip)/api/v1/docs
- **登录信息**: 账号 admin,密码 123456

> **注意**: `docs` 和 `app` 已禁用开源部署,如需使用请取消相关配置注释。

## 日志管理

### 查看容器日志
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ services:
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/web:/usr/share/nginx/html/web:ro
- ./nginx/app:/usr/share/nginx/html/app:ro
- ./nginx/docs:/usr/share/nginx/html/docs:ro
# - ./nginx/app:/usr/share/nginx/html/app:ro
# - ./nginx/docs:/usr/share/nginx/html/docs:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
depends_on:
backend:
Expand Down
2 changes: 2 additions & 0 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ http {
ssl_session_timeout 10m;

# ==================== 官网(根路径) ====================
# 已禁用:docs 不开源,如需使用请取消注释
location / {
root /usr/share/nginx/html/docs/dist;
index index.html index.htm;
Expand All @@ -104,6 +105,7 @@ http {
}

# ==================== 小程序 H5(/app) ====================
# 已禁用:app 不开源,如需使用请取消注释
location /app {
alias /usr/share/nginx/html/app/dist/build/h5;
try_files $uri $uri/ /app/index.html; #解决页面刷新404问题
Expand Down
Binary file added frontend/web/public/ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/app_home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/app_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/app_mine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/gencode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/group.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/web/public/wechatPay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion frontend/web/src/components/others/fa-pagination/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,10 @@ function handleCurrentChange(val: number) {
}
</script>

<style lang="scss" scoped></style>
<style lang="scss" scoped>
.pagination {
display: flex;
justify-content: center;
padding: 12px 0;
}
</style>
125 changes: 67 additions & 58 deletions frontend/web/src/views/dashboard/home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,10 @@
<!-- CardList 概览统计(含在线用户/UV/PV/访问量等) -->
<CardList />

<!-- 日程日历 + 我的收藏 -->
<!-- 关于项目 + 我的收藏 -->
<ElRow :gutter="16">
<ElCol :xs="24" :span="12" class="flex flex-col">
<ElCard shadow="hover" class="workplace-surface workplace-ops-card flex flex-col h-full">
<template #header>
<div class="workplace-section-card__head">
<div>
<span class="workplace-panel-title">日程日历</span>
<p class="workplace-section-sub workplace-section-sub--inline">
点击日期添加或编辑(本地演示)
</p>
</div>
</div>
</template>
<div class="workplace-ops-card__body">
<FaCalendar />
</div>
</ElCard>
<AboutProject />
</ElCol>
<ElCol :xs="24" :span="12" class="flex flex-col">
<ElCard shadow="hover" class="flex flex-col h-full">
Expand Down Expand Up @@ -152,51 +138,60 @@
</div>
</div>
</template>
<div v-if="quickLinks.length > 0">
<ElTooltip
<ElRow v-if="quickLinks.length > 0" :gutter="12">
<ElCol
v-for="(item, index) in quickLinks"
:key="item.id || `${item.href}-${index}`"
placement="top"
:show-after="400"
:content="item.title"
:xs="24"
:sm="12"
:md="8"
:lg="8"
:xl="8"
class="mb-3"
>
<div
class="workplace-quick-row workplace-quick-row--compact workplace-quick-row--chip"
role="button"
tabindex="0"
@click="handleQuickLinkClick(item)"
@keydown.enter.prevent="handleQuickLinkClick(item)"
@keydown.space.prevent="handleQuickLinkClick(item)"
<ElTooltip
placement="top"
:show-after="400"
:content="item.title"
>
<span
class="workplace-quick-row__accent"
:style="{ backgroundColor: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
/>
<div
class="workplace-quick-row__icon"
:style="{ color: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
class="workplace-quick-row workplace-quick-row--compact workplace-quick-row--chip"
role="button"
tabindex="0"
@click="handleQuickLinkClick(item)"
@keydown.enter.prevent="handleQuickLinkClick(item)"
@keydown.space.prevent="handleQuickLinkClick(item)"
>
<FaMenuRouteIcon :icon="item.icon || 'menu'" />
</div>
<div class="workplace-quick-row__text">
<span class="workplace-quick-row__title">{{ item.title }}</span>
</div>
<div class="workplace-quick-row__actions">
<button
type="button"
class="workplace-quick-row__remove"
:disabled="!item.id && !item.href"
:title="item.id || item.href ? '移除收藏' : '无法移除(缺少路径)'"
:aria-label="`移除收藏 ${item.title}`"
@click.stop="handleDeleteLink(item)"
<span
class="workplace-quick-row__accent"
:style="{ backgroundColor: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
/>
<div
class="workplace-quick-row__icon"
:style="{ color: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
>
<ElIcon><Close /></ElIcon>
</button>
<FaMenuRouteIcon :icon="item.icon || 'menu'" />
</div>
<div class="workplace-quick-row__text">
<span class="workplace-quick-row__title">{{ item.title }}</span>
</div>
<div class="workplace-quick-row__actions">
<button
type="button"
class="workplace-quick-row__remove"
:disabled="!item.id && !item.href"
:title="item.id || item.href ? '移除收藏' : '无法移除(缺少路径)'"
:aria-label="`移除收藏 ${item.title}`"
@click.stop="handleDeleteLink(item)"
>
<ElIcon><Close /></ElIcon>
</button>
</div>
</div>
</div>
</ElTooltip>
</div>
<ElEmpty v-else :image-size="48">
</ElTooltip>
</ElCol>
</ElRow>
<ElEmpty v-else :image-size="100">
<template #description>
<p class="workplace-quick-empty__title">暂无收藏</p>
<p class="workplace-quick-empty__hint">
Expand All @@ -210,8 +205,25 @@
</ElCol>
</ElRow>

<!-- 最新动态 + 关于项目 -->
<!-- 日程日历 + 最新动态 -->
<ElRow :gutter="16">
<ElCol :span="12" class="flex flex-col">
<ElCard shadow="hover" class="workplace-surface workplace-ops-card flex flex-col h-full">
<template #header>
<div class="workplace-section-card__head">
<div>
<span class="workplace-panel-title">日程日历</span>
<p class="workplace-section-sub workplace-section-sub--inline">
点击日期添加或编辑(本地演示)
</p>
</div>
</div>
</template>
<div class="workplace-ops-card__body">
<FaCalendar />
</div>
</ElCard>
</ElCol>
<ElCol :span="12" class="flex flex-col">
<ElCard shadow="hover" class="h-full flex flex-col">
<template #header>
Expand All @@ -228,7 +240,7 @@
</ElLink>
</div>
</template>
<ElScrollbar height="300px">
<ElScrollbar class="h-full">
<ElTimeline class="p-2">
<ElTimelineItem
v-for="(item, index) in vesionList"
Expand Down Expand Up @@ -263,9 +275,6 @@
</ElScrollbar>
</ElCard>
</ElCol>
<ElCol :span="12" class="flex flex-col">
<AboutProject />
</ElCol>
</ElRow>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script setup lang="ts">
import { ref, nextTick, watch } from "vue";
import WelcomeScreen from "./FaWelcomeScreen.vue";
import FaMessageItem from "./FaMessageItem.vue";
import type { ChatMessage } from "../types";

interface Props {
Expand Down
4 changes: 4 additions & 0 deletions frontend/web/src/views/module_ai/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ import { ElMessage, ElMessageBox } from "element-plus";
import AiChatAPI, { ChatSession } from "@/api/module_ai/chat";
import { Auth } from "@utils/auth";
import type { ChatMessage, UploadedFile } from "./types";
import FaSidebar from "./components/FaSidebar.vue";
import FaChatNavbar from "./components/FaChatNavbar.vue";
import FaChatMessages from "./components/FaChatMessages.vue";
import FaChatInput from "./components/FaChatInput.vue";

// 状态
const messages = ref<ChatMessage[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/src/views/module_ai/memory/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
:items="memoryDialogFormItems"
:rules="rules"
label-suffix=":"
:label-width="'auto'"
:label-width="'70px'"
label-position="right"
:span="24"
:gutter="16"
Expand Down
Loading