Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SaltWood-Studio/CSharp-OpenBMCLAPI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.10.4-1
Choose a base ref
...
head repository: SaltWood-Studio/CSharp-OpenBMCLAPI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Apr 27, 2024

  1. Copy the full SHA
    4ac9645 View commit details

Commits on Apr 29, 2024

  1. Copy the full SHA
    716480e View commit details
  2. Copy the full SHA
    403863d View commit details

Commits on Apr 30, 2024

  1. Copy the full SHA
    a9a7ee9 View commit details

Commits on May 2, 2024

  1. Merge pull request #2 from SaltWood-Studio/dev

    fix: 因为作用域导致无法访问 length 的编译时错误
    SALTWOOD authored May 2, 2024
    Copy the full SHA
    fe6b212 View commit details
  2. feat: 增量更新

    SALTWOOD committed May 2, 2024
    Copy the full SHA
    7b62a4c View commit details
  3. Copy the full SHA
    12f50b2 View commit details
  4. Copy the full SHA
    db47bbb View commit details
  5. modify: 删除面板

    SALTWOOD committed May 2, 2024
    Copy the full SHA
    4f543bc View commit details
  6. Copy the full SHA
    e825412 View commit details

Commits on May 3, 2024

  1. Copy the full SHA
    c75415e View commit details
  2. Copy the full SHA
    d95f6a1 View commit details
  3. Copy the full SHA
    024a129 View commit details

Commits on May 4, 2024

  1. feat: 当 CachedStorage 占用过大时会自动清理占用

    opti: 现在 CachedStorage 能够被禁用
    SALTWOOD committed May 4, 2024
    Copy the full SHA
    3648eed View commit details
  2. readme: 更新鸣谢

    SALTWOOD committed May 4, 2024
    Copy the full SHA
    c7be47f View commit details
  3. Copy the full SHA
    85f030c View commit details
  4. Copy the full SHA
    68f410a View commit details
  5. Copy the full SHA
    9b3c4f8 View commit details
  6. Copy the full SHA
    d9cc46f View commit details
  7. opti: 小更改

    SALTWOOD committed May 4, 2024
    Copy the full SHA
    775aa23 View commit details
  8. Copy the full SHA
    2316fda View commit details
  9. opti: 调整写错的注释

    SALTWOOD committed May 4, 2024
    Copy the full SHA
    e466bd9 View commit details

Commits on May 12, 2024

  1. readme: 更新了 todo

    SALTWOOD authored May 12, 2024
    Copy the full SHA
    f077a04 View commit details

Commits on May 18, 2024

  1. Copy the full SHA
    32e9a2a View commit details

Commits on May 19, 2024

  1. feat: WebDavStorage

    SALTWOOD committed May 19, 2024
    Copy the full SHA
    bde16e5 View commit details
  2. Copy the full SHA
    05c5e99 View commit details

Commits on May 20, 2024

  1. Copy the full SHA
    6d28af8 View commit details

Commits on May 24, 2024

  1. Copy the full SHA
    40e0a1c View commit details
  2. feat: docker 容器版本支持

    remove: 删除无用的 FunctionTest
    SALTWOOD committed May 24, 2024
    Copy the full SHA
    f919ac8 View commit details
  3. readme: 更新 TODO

    SALTWOOD committed May 24, 2024
    Copy the full SHA
    a8a1e8c View commit details
  4. Copy the full SHA
    4d8143a View commit details
  5. Copy the full SHA
    d1952e1 View commit details
  6. Copy the full SHA
    7f13f15 View commit details
  7. Copy the full SHA
    ee52fdc View commit details
  8. readme: 移除“特性”

    SALTWOOD authored May 24, 2024
    Copy the full SHA
    5d7a39f View commit details
  9. Copy the full SHA
    dcdd80f View commit details

Commits on May 25, 2024

  1. Copy the full SHA
    3e8b077 View commit details
  2. opti: workflow 微调

    SALTWOOD committed May 25, 2024
    Copy the full SHA
    bf2e90e View commit details
  3. Copy the full SHA
    e7b5c12 View commit details
  4. opti: 调整解决方案项

    SALTWOOD committed May 25, 2024
    Copy the full SHA
    4bde459 View commit details
  5. fix: 忘记映射 4000 端口

    fix: Config 的构造器忘记给 clusterFileDirectory 赋值
    SALTWOOD committed May 25, 2024
    Copy the full SHA
    6d44739 View commit details
  6. Copy the full SHA
    3b185ee View commit details
  7. Copy the full SHA
    39b1bf1 View commit details
  8. fix: docker-compose.dev.yml 未同步更改

    fix:  当使用 docker build 模式启动时,文件外溢
    SALTWOOD committed May 25, 2024
    Copy the full SHA
    3e3af16 View commit details

Commits on May 26, 2024

  1. Copy the full SHA
    e155244 View commit details
  2. Copy the full SHA
    ea9ece9 View commit details
  3. Copy the full SHA
    0cf9c74 View commit details
  4. Copy the full SHA
    0e551e5 View commit details
  5. fix: 修复进度条无法正常显示小数点后位的问题

    opti: 调整部分代码和进度条的颜色
    SALTWOOD committed May 26, 2024
    Copy the full SHA
    37b02ab View commit details
  6. readme: 添加“鸣谢”

    nuget: 删除无用的包
    code: 移除无用的代码
    SALTWOOD committed May 26, 2024
    Copy the full SHA
    042fdf2 View commit details
Showing with 1,473 additions and 3,949 deletions.
  1. BIN .github/CSharp-OpenBMCLAPI.png
  2. +0 −41 .github/workflows/dotnet.yml
  3. +74 −0 .github/workflows/on-dev.yml
  4. +43 −0 .github/workflows/on-release.yml
  5. +44 −0 .github/workflows/on-tag.yml
  6. +8 −1 .gitignore
  7. +17 −6 CSharp-OpenBMCLAPI.sln
  8. +12 −33 CSharp-OpenBMCLAPI/CSharp-OpenBMCLAPI.csproj
  9. +3 −5 CSharp-OpenBMCLAPI/Logger.cs
  10. +3 −9 CSharp-OpenBMCLAPI/Modules/AvroParser.cs
  11. +440 −194 CSharp-OpenBMCLAPI/Modules/Cluster.cs
  12. +4 −6 CSharp-OpenBMCLAPI/Modules/ClusterRequiredData.cs
  13. +59 −17 CSharp-OpenBMCLAPI/Modules/Config.cs
  14. +19 −0 CSharp-OpenBMCLAPI/Modules/Configuration.cs
  15. +0 −16 CSharp-OpenBMCLAPI/Modules/Dashboard/index.html
  16. +0 −1 CSharp-OpenBMCLAPI/Modules/Dashboard/static/js/echarts.min.js
  17. +0 −1,204 CSharp-OpenBMCLAPI/Modules/Dashboard/static/js/index.min.js
  18. +0 −887 CSharp-OpenBMCLAPI/Modules/Dashboard/static/js/ttb.min.js
  19. +0 −1 CSharp-OpenBMCLAPI/Modules/Dashboard/关于面板部分的说明.txt
  20. +0 −4 CSharp-OpenBMCLAPI/Modules/ExtensionMethods.cs
  21. +1 −7 CSharp-OpenBMCLAPI/Modules/FileVerificationMode.cs
  22. +9 −3 CSharp-OpenBMCLAPI/Modules/HttpRequest.cs
  23. +87 −124 CSharp-OpenBMCLAPI/Modules/HttpServiceProvider.cs
  24. +0 −15 CSharp-OpenBMCLAPI/Modules/Plugin/ClientEventType.cs
  25. +0 −14 CSharp-OpenBMCLAPI/Modules/Plugin/PluginAttribute.cs
  26. +0 −52 CSharp-OpenBMCLAPI/Modules/Plugin/PluginBase.cs
  27. +0 −98 CSharp-OpenBMCLAPI/Modules/Plugin/PluginManager.cs
  28. +0 −16 CSharp-OpenBMCLAPI/Modules/Plugin/ProgramEventType.cs
  29. +0 −37 CSharp-OpenBMCLAPI/Modules/Statistician/AccessDataStatistician.cs
  30. +0 −143 CSharp-OpenBMCLAPI/Modules/Statistician/DataStatistician.cs
  31. +0 −17 CSharp-OpenBMCLAPI/Modules/Statistician/Pair.cs
  32. +8 −13 CSharp-OpenBMCLAPI/Modules/Storage/AccessCounter.cs
  33. +162 −0 CSharp-OpenBMCLAPI/Modules/Storage/AlistStorage.cs
  34. +1 −7 CSharp-OpenBMCLAPI/Modules/Storage/ApiFileInfo.cs
  35. +66 −13 CSharp-OpenBMCLAPI/Modules/Storage/CachedStorage.cs
  36. +9 −15 CSharp-OpenBMCLAPI/Modules/Storage/FileAccessInfo.cs
  37. +19 −10 CSharp-OpenBMCLAPI/Modules/Storage/FileStorage.cs
  38. +1 −7 CSharp-OpenBMCLAPI/Modules/Storage/ICachedStorage.cs
  39. +14 −9 CSharp-OpenBMCLAPI/Modules/Storage/IStorage.cs
  40. +100 −0 CSharp-OpenBMCLAPI/Modules/Storage/SambaConnection.cs
  41. +5 −4 CSharp-OpenBMCLAPI/Modules/{WebServer/ServeType.cs → Storage/StorageType.cs}
  42. +11 −0 CSharp-OpenBMCLAPI/Modules/Storage/StorageUser.cs
  43. +112 −0 CSharp-OpenBMCLAPI/Modules/Storage/WebDavStorage.cs
  44. +8 −0 CSharp-OpenBMCLAPI/Modules/Tasks.cs
  45. +10 −11 CSharp-OpenBMCLAPI/Modules/TokenManager.cs
  46. +14 −54 CSharp-OpenBMCLAPI/Modules/Utils.cs
  47. +0 −59 CSharp-OpenBMCLAPI/Modules/WebServer/Client.cs
  48. +0 −128 CSharp-OpenBMCLAPI/Modules/WebServer/Header.cs
  49. +0 −16 CSharp-OpenBMCLAPI/Modules/WebServer/HttpContext.cs
  50. +0 −53 CSharp-OpenBMCLAPI/Modules/WebServer/Request.cs
  51. +0 −108 CSharp-OpenBMCLAPI/Modules/WebServer/Response.cs
  52. +0 −38 CSharp-OpenBMCLAPI/Modules/WebServer/Route.cs
  53. +0 −152 CSharp-OpenBMCLAPI/Modules/WebServer/SimpleWebServer.cs
  54. +0 −89 CSharp-OpenBMCLAPI/Modules/WebServer/WebUtils.cs
  55. +12 −67 CSharp-OpenBMCLAPI/Program.cs
  56. +12 −0 CSharp-OpenBMCLAPI/Properties/launchSettings.json
  57. +12 −0 CSharp-OpenBMCLAPI/web.config
  58. +38 −0 Dockerfile
  59. +0 −27 FunctionTest/FunctionTest.csproj
  60. +0 −28 FunctionTest/UnitTest1.cs
  61. +12 −90 README.MD
  62. +8 −0 docker-compose.dev.yml
  63. +9 −0 docker-compose.yml
  64. +7 −0 renovate.json
Binary file added .github/CSharp-OpenBMCLAPI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 0 additions & 41 deletions .github/workflows/dotnet.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/on-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Push image on dev

on:
push:
branches: [dev]
workflow_dispatch:

jobs:
build_and_test:
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration $env:Configuration --no-restore
env:
Configuration: ${{ matrix.configuration }}
- name: Test
run: dotnet test --configuration $env:Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: app-debug
path: |
CSharp-OpenBMCLAPI/bin/Release
push_to_registry:
name: Push Docker image to Docker Hub
if: true
runs-on: ubuntu-latest
needs:
- build_and_test
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set environment
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Log in to Docker Hub
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.6.0
with:
images: saltwood233/csharp-openbmclapi

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6.8.0
with:
context: .
file: ./Dockerfile
push: true
tags: saltwood233/csharp-openbmclapi:dev
cache-from: type=gha
cache-to: type=gha,mode=max
43 changes: 43 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Push image on master

on:
push:
branches: [master]
workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set environment
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Log in to Docker Hub
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.6.0
with:
images: saltwood233/csharp-openbmclapi

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6.8.0
with:
context: .
file: ./Dockerfile
push: true
tags: saltwood233/csharp-openbmclapi
cache-from: type=gha
cache-to: type=gha,mode=max
44 changes: 44 additions & 0 deletions .github/workflows/on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Push image on tag

on:
push:
tags:
- v*
workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set environment
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Log in to Docker Hub
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.6.0
with:
images: saltwood233/csharp-openbmclapi

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6.8.0
with:
context: .
file: ./Dockerfile
push: true
tags: saltwood233/csharp-openbmclapi:${{env.RELEASE_VERSION}}
cache-from: type=gha
cache-to: type=gha,mode=max
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -362,5 +362,12 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd

# .env 之类的文件
.env.*
.lh
.lh

# docker 镜像的文件夹
/working
/cache

working
23 changes: 17 additions & 6 deletions CSharp-OpenBMCLAPI.sln
Original file line number Diff line number Diff line change
@@ -8,11 +8,22 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决方案项", "{09EEA2BF-7069-4835-95CE-2BFAC2F2B8D0}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
Dockerfile = Dockerfile
README.MD = README.MD
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionTest", "FunctionTest\FunctionTest.csproj", "{F6C49E3D-05A7-4E0F-8CDF-DCEC10ADD62B}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{433AB2A0-5CC0-403B-B03C-2CFFB4E3C201}"
ProjectSection(SolutionItems) = preProject
.github\workflows\on-dev.yml = .github\workflows\on-dev.yml
.github\workflows\on-release.yml = .github\workflows\on-release.yml
.github\workflows\on-tag.yml = .github\workflows\on-tag.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docker compose", "Docker compose", "{82765CF6-BDF4-4297-9237-AACA413FA049}"
ProjectSection(SolutionItems) = preProject
docker-compose.dev.yml = docker-compose.dev.yml
docker-compose.yml = docker-compose.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -24,14 +35,14 @@ Global
{F01E0E3F-BF3E-4D0D-BCB7-7DFEF1926310}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F01E0E3F-BF3E-4D0D-BCB7-7DFEF1926310}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F01E0E3F-BF3E-4D0D-BCB7-7DFEF1926310}.Release|Any CPU.Build.0 = Release|Any CPU
{F6C49E3D-05A7-4E0F-8CDF-DCEC10ADD62B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6C49E3D-05A7-4E0F-8CDF-DCEC10ADD62B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6C49E3D-05A7-4E0F-8CDF-DCEC10ADD62B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6C49E3D-05A7-4E0F-8CDF-DCEC10ADD62B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{433AB2A0-5CC0-403B-B03C-2CFFB4E3C201} = {09EEA2BF-7069-4835-95CE-2BFAC2F2B8D0}
{82765CF6-BDF4-4297-9237-AACA413FA049} = {09EEA2BF-7069-4835-95CE-2BFAC2F2B8D0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1A5C6C9-0F70-4622-BC44-2F32090D8A03}
EndGlobalSection
45 changes: 12 additions & 33 deletions CSharp-OpenBMCLAPI/CSharp-OpenBMCLAPI.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
@@ -9,39 +9,18 @@
</PropertyGroup>

<ItemGroup>
<None Remove="Modules\Dashboard\index.html" />
<None Remove="Modules\Dashboard\static\js\echarts.min.js" />
<None Remove="Modules\Dashboard\static\js\index.min.js" />
<None Remove="Modules\Dashboard\static\js\ttb.min.js" />
<None Remove="Modules\Dashboard\关于面板部分的说明.txt" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Modules\Dashboard\index.html">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Modules\Dashboard\static\js\echarts.min.js">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Modules\Dashboard\static\js\index.min.js">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Modules\Dashboard\static\js\ttb.min.js">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Modules\Dashboard\关于面板部分的说明.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.17" />
<PackageReference Include="log4net" Version="3.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2" />
<PackageReference Include="SaltWood.TeraIO" Version="1.0.4" />
<PackageReference Include="SocketIOClient" Version="3.1.1" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0" />
<PackageReference Include="WindowsFirewallHelper" Version="2.2.0.86" />
<PackageReference Include="YamlDotNet" Version="15.1.2" />
<PackageReference Include="ZstdSharp.Port" Version="0.7.6" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.3" />
<PackageReference Include="SaltWood.TeraIO" Version="1.1.0" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
<PackageReference Include="SocketIOClient" Version="3.1.2" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="9.0.1" />
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
<PackageReference Include="System.Text.Json" Version="9.0.1" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="ZstdSharp.Port" Version="0.8.4" />
</ItemGroup>

<ItemGroup>
8 changes: 3 additions & 5 deletions CSharp-OpenBMCLAPI/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
using CSharpOpenBMCLAPI.Modules;

namespace CSharpOpenBMCLAPI
namespace CSharpOpenBMCLAPI
{
public class Logger
{
private static readonly Logger _instance = new Logger();

// 通过单例控制来使得 Logger 类不会被创建多次,进而保证日志写入锁只有一个,保证日志输出不会错位
public static Logger Instance { get => _instance; }
public static Logger Instance { get => _instance; }

private Logger()
{

}

private static void WriteLine(object[] args)
12 changes: 3 additions & 9 deletions CSharp-OpenBMCLAPI/Modules/AvroParser.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using CSharpOpenBMCLAPI.Modules.Storage;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace CSharpOpenBMCLAPI.Modules
{
@@ -42,13 +35,14 @@ public List<ApiFileInfo> Parse()
};
this._files.Add(file);
}
this._stream.ReadByte();
return this._files;
}

public long ReadLong()
{
int b = this._stream.ReadByte();
int n = b & 0x7F;
long b = this._stream.ReadByte();
long n = b & 0x7F;
int shift = 7;
while ((b & 0x80) != 0)
{
Loading