Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e2baacb
refactor: 重构前端项目结构并迁移至Vite
239573049 Sep 15, 2025
7cb17e3
fix(前端): 修复仓库分支选择逻辑和用户认证字段
239573049 Sep 15, 2025
74530c6
feat(文档): 添加文档页面及Markdown渲染功能
239573049 Sep 15, 2025
a23d79c
feat(文档): 支持多分支和国际化文档获取
239573049 Sep 15, 2025
a2b7bb4
新增思维导图页面及多项功能优化
239573049 Sep 15, 2025
3c812c5
条件加载插件与改进流程图生成逻辑
239573049 Sep 15, 2025
50c3e3f
优化 Mermaid 图表生成逻辑并改进错误处理
239573049 Sep 15, 2025
a0bd837
feat(admin): 添加管理员控制台功能
239573049 Sep 16, 2025
cd33212
移除无用服务及环境配置以简化Docker Compose
239573049 Sep 16, 2025
7b78c9f
feat: 前端性能优化及组件卡顿修复
239573049 Sep 16, 2025
036b033
feat: 新增文档生成进度显示和错误边界处理
239573049 Sep 16, 2025
8457003
refactor: Update Document Settings Tab and System Settings Page
239573049 Sep 16, 2025
d5be338
feat: 集成 md-editor-rt 实现 Markdown 编辑器
239573049 Sep 16, 2025
15894db
feat(仓库同步): 实现仓库自动同步功能
239573049 Sep 18, 2025
ee3d01a
feat(仓库管理): 实现仓库同步功能及AI文档生成
239573049 Sep 18, 2025
613eff7
refactor: 清理未使用的代码和依赖项
239573049 Sep 18, 2025
b549935
ci(docker): 重构docker构建流程并添加前端构建步骤
239573049 Sep 18, 2025
6924ae2
build: 更新主版本号至0.9
239573049 Sep 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 36 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,32 @@ on:
branches: [ main ]
jobs:
build:
strategy:
matrix:
image: [
{ name: 'koala-wiki', type: 'backend', dockerfile: 'src/KoalaWiki/Dockerfile', context: '.' },
{ name: 'koala-wiki-web', type: 'frontend', dockerfile: 'web/Dockerfile', context: 'web' }
]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'web-site/package.json'

- name: Install frontend dependencies
run: |
cd web-site
npm ci

- name: Build frontend
run: |
cd web-site
npm run build

- name: Copy frontend build to backend wwwroot
run: |
rm -rf src/KoalaWiki/wwwroot/*
cp -r web-site/dist/* src/KoalaWiki/wwwroot/

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -26,11 +41,21 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push ${{ matrix.image.name }}
- name: Extract version from Directory.Packages.props
id: version
run: |
$versionSuffix = (Select-Xml -Path "Directory.Packages.props" -XPath "//VersionSuffix").Node.InnerText
$version = "0.7.$versionSuffix"
echo "version=$version" >> $env:GITHUB_OUTPUT
echo "Version: $version"

- name: Build and push koala-wiki
uses: docker/build-push-action@v5
with:
context: ${{ matrix.image.context }}
file: ${{ matrix.image.dockerfile }}
context: .
file: src/KoalaWiki/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/${{ matrix.image.name }}${{ matrix.image.tag || '' }}
tags: |
crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:latest
crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:${{ steps.version.outputs.version }}
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ jobs:
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
# 从标签名称中提取版本号
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
# 从Directory.Packages.props文件中提取版本号
version=$(powershell -Command "[xml]\$xml = Get-Content 'Directory.Packages.props'; \$xml.Project.PropertyGroup.Version")
echo "version=v$version" >> $GITHUB_OUTPUT
fi
shell: bash

- name: 生成Release说明
id: release_notes
Expand Down Expand Up @@ -301,4 +303,4 @@ jobs:
artifacts/backend-macos-arm64/koala-wiki-backend-macos-arm64.tar.gz
artifacts/frontend/koala-wiki-frontend.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ $RECYCLE.BIN/

# Vim temporary swap files
*.swp
/web/.next
*/.next
/src/KoalaWiki/repositories
/src/KoalaWiki/KoalaWiki.db
/src/KoalaWiki/KoalaWiki.db-*
Expand All @@ -492,3 +492,4 @@ $RECYCLE.BIN/
/history
/repositories/aidotnet/Thor
*lock.json
seo-web
37 changes: 18 additions & 19 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<VersionSuffix>0</VersionSuffix>
<TimeStamp>$([System.DateTime]::UtcNow.ToString("yyyyMMdd"))</TimeStamp>
<Version>0.5.$(VersionSuffix)</Version>
<Version>0.9.$(VersionSuffix)</Version>
<!-- 项目信息 -->
<Product>OpenDeepWiki</Product>
<Title>OpenDeepWiki - AI驱动的代码知识库</Title>
Expand All @@ -20,7 +20,6 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!-- 项目标签 -->
<PackageTags>AI;CodeAnalysis;Documentation;SemanticKernel;Knowledge;Wiki;OpenSource;dotnet9;csharp</PackageTags>
<!-- 技术信息 -->
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -32,14 +31,15 @@
</PropertyGroup>
<ItemGroup>
<!-- Web API 和 框架包 -->
<PackageVersion Include="AngleSharp" Version="1.3.0" />
<PackageVersion Include="AngleSharp" Version="1.3.1-beta.491" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.7" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.7" />
<PackageVersion Include="MySql.EntityFrameworkCore" Version="9.0.3" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.6.5" />
<PackageVersion Include="MySql.EntityFrameworkCore" Version="9.0.6" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.8.3" />
<!-- Entity Framework Core -->
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="9.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -48,7 +48,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.6" />
<!-- 数据库提供程序 -->
Expand All @@ -57,9 +56,9 @@
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.7" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<!-- AI 和 机器学习 -->
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.62.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.AzureOpenAI" Version="1.62.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.62.0" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.65.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.AzureOpenAI" Version="1.65.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.65.0" />
<PackageVersion Include="Lost.SemanticKernel.Connectors.Anthropic" Version="1.25.0-alpha3" />
<PackageVersion Include="Mem0.NET" Version="1.1.3" />
<!-- AWS SDK - 解决版本冲突 -->
Expand All @@ -73,20 +72,20 @@
<!-- JSON 和 序列化 -->
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<!-- 映射和对象转换 -->
<PackageVersion Include="Mapster.DependencyInjection" Version="1.0.1" />
<PackageVersion Include="Mapster.DependencyInjection" Version="1.0.3-pre02" />
<!-- 日志记录 -->
<PackageVersion Include="Serilog" Version="4.3.0" />
<PackageVersion Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="9.0.2" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
<!-- 弹性和重试 -->
<PackageVersion Include="Polly" Version="8.6.2" />
<PackageVersion Include="Polly" Version="8.6.3" />
<!-- 服务和分析 -->
<PackageVersion Include="FastService" Version="0.2.2" />
<PackageVersion Include="FastService.Analyzers" Version="0.2.2" />
<!-- 协议支持 -->
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.3.0-preview.3" />
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.3.0-preview.4" />
<PackageVersion Include="SharpToken" Version="2.0.4" />
<!-- Thor 框架相关包 (来自子模块) -->
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.6.1" />
Expand All @@ -101,13 +100,13 @@
<PackageVersion Include="StackExchange.Redis" Version="2.8.31" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="9.0.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.0.0" />
<PackageVersion Include="Aspire.Hosting.NodeJs" Version="9.0.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.12.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.4.2" />
<PackageVersion Include="Aspire.Hosting.NodeJs" Version="9.4.2" />
<!-- 测试框架 -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
Expand Down
2 changes: 2 additions & 0 deletions KoalaWiki.Core/DataAccess/IKoalaWikiContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public interface IKoalaWikiContext

public DbSet<WarehouseInRole> WarehouseInRoles { get; set; }

public DbSet<WarehouseSyncRecord> WarehouseSyncRecords { get; set; }

public DbSet<AccessRecord> AccessRecords { get; set; }

public DbSet<DailyStatistics> DailyStatistics { get; set; }
Expand Down
31 changes: 31 additions & 0 deletions KoalaWiki.Core/DataAccess/KoalaWikiContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class KoalaWikiContext<TContext>(DbContextOptions<TContext> options)

public DbSet<WarehouseInRole> WarehouseInRoles { get; set; }

public DbSet<WarehouseSyncRecord> WarehouseSyncRecords { get; set; }

public DbSet<AccessRecord> AccessRecords { get; set; }

public DbSet<DailyStatistics> DailyStatistics { get; set; }
Expand Down Expand Up @@ -475,5 +477,34 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
options.HasIndex(x => x.WarehouseId);
options.HasComment("小地图表");
});

modelBuilder.Entity<WarehouseSyncRecord>(options =>
{
options.HasKey(x => x.Id);
options.Property(x => x.Id).HasComment("主键Id");
options.Property(x => x.WarehouseId).IsRequired().HasComment("仓库Id");
options.Property(x => x.Status).IsRequired().HasComment("同步状态");
options.Property(x => x.StartTime).IsRequired().HasComment("同步开始时间");
options.Property(x => x.EndTime).HasComment("同步结束时间");
options.Property(x => x.FromVersion).HasComment("同步前的版本");
options.Property(x => x.ToVersion).HasComment("同步后的版本");
options.Property(x => x.ErrorMessage).HasComment("错误信息");
options.Property(x => x.FileCount).HasComment("同步的文件数量");
options.Property(x => x.UpdatedFileCount).HasComment("更新的文件数量");
options.Property(x => x.AddedFileCount).HasComment("新增的文件数量");
options.Property(x => x.DeletedFileCount).HasComment("删除的文件数量");
options.Property(x => x.Trigger).IsRequired().HasComment("同步触发方式");
options.Property(x => x.CreatedAt).IsRequired().HasComment("创建时间");
options.HasIndex(x => x.WarehouseId);
options.HasIndex(x => x.Status);
options.HasIndex(x => x.StartTime);
options.HasIndex(x => x.Trigger);
options.HasIndex(x => x.CreatedAt);
options.HasOne(x => x.Warehouse)
.WithMany()
.HasForeignKey(x => x.WarehouseId)
.OnDelete(DeleteBehavior.Cascade);
options.HasComment("仓库同步记录表");
});
}
}
22 changes: 21 additions & 1 deletion KoalaWiki.Domains/Users/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,25 @@ public class User : Entity<string>
/// <summary>
/// 用户最后登录IP
/// </summary>
public string? LastLoginIp { get; set; }
public string? LastLoginIp { get; set; }

/// <summary>
/// 用户简介
/// </summary>
public string? Bio { get; set; }

/// <summary>
/// 用户位置
/// </summary>
public string? Location { get; set; }

/// <summary>
/// 用户个人网站
/// </summary>
public string? Website { get; set; }

/// <summary>
/// 用户公司
/// </summary>
public string? Company { get; set; }
}
5 changes: 5 additions & 0 deletions KoalaWiki.Domains/Warehouse/Warehouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,9 @@ public class Warehouse : Entity<string>
/// 创建用户id
/// </summary>
public string? UserId { get; set; }

/// <summary>
/// 是否启用同步
/// </summary>
public bool EnableSync { get; set; }
}
75 changes: 75 additions & 0 deletions KoalaWiki.Domains/Warehouse/WarehouseSyncRecord.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using System;
using KoalaWiki.Entities;

namespace KoalaWiki.Domains.Warehouse;

/// <summary>
/// 仓库同步记录
/// </summary>
public class WarehouseSyncRecord : Entity<string>
{
/// <summary>
/// 仓库ID
/// </summary>
public string WarehouseId { get; set; } = string.Empty;

/// <summary>
/// 同步状态 (Success, Failed, InProgress)
/// </summary>
public WarehouseSyncStatus Status { get; set; }

/// <summary>
/// 同步开始时间
/// </summary>
public DateTime StartTime { get; set; }

/// <summary>
/// 同步结束时间
/// </summary>
public DateTime? EndTime { get; set; }

/// <summary>
/// 同步前的版本
/// </summary>
public string? FromVersion { get; set; }

/// <summary>
/// 同步后的版本
/// </summary>
public string? ToVersion { get; set; }

/// <summary>
/// 错误信息
/// </summary>
public string? ErrorMessage { get; set; }

/// <summary>
/// 同步的文件数量
/// </summary>
public int FileCount { get; set; }

/// <summary>
/// 更新的文件数量
/// </summary>
public int UpdatedFileCount { get; set; }

/// <summary>
/// 新增的文件数量
/// </summary>
public int AddedFileCount { get; set; }

/// <summary>
/// 删除的文件数量
/// </summary>
public int DeletedFileCount { get; set; }

/// <summary>
/// 同步触发方式 (Auto, Manual)
/// </summary>
public WarehouseSyncTrigger Trigger { get; set; }

/// <summary>
/// 关联的仓库
/// </summary>
public virtual Warehouse? Warehouse { get; set; }
}
22 changes: 22 additions & 0 deletions KoalaWiki.Domains/Warehouse/WarehouseSyncStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace KoalaWiki.Domains.Warehouse;

/// <summary>
/// 仓库同步状态
/// </summary>
public enum WarehouseSyncStatus
{
/// <summary>
/// 同步中
/// </summary>
InProgress = 0,

/// <summary>
/// 同步成功
/// </summary>
Success = 1,

/// <summary>
/// 同步失败
/// </summary>
Failed = 2
}
Loading