Skip to content

Commit

Permalink
chore: 🔨 npm update
Browse files Browse the repository at this point in the history
  • Loading branch information
tk authored and nsnail committed Jan 14, 2025
1 parent f50dfc8 commit 72cc3c4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ private static Dictionary<string, object> IncludeToDictionary(TEntity entity, Li
{
var ret = includeFields!.ToDictionary(
x => x, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity));

// ReSharper disable once ConvertIfStatementToSwitchStatement
if (entity is IFieldModifiedUser) {
var userInfo = App.GetService<ContextUserInfo>();
if (userInfo == null) {
Expand All @@ -148,6 +150,7 @@ private static Dictionary<string, object> IncludeToDictionary(TEntity entity, Li
ret.Add(nameof(IFieldModifiedUser.ModifiedUserName), userInfo.UserName);
}

// ReSharper disable once SuspiciousTypeConversion.Global
if (entity is IFieldModifiedClientIp) {
ret.Add(nameof(IFieldModifiedClientIp.ModifiedClientIp), App.HttpContext?.GetRealIpAddress()?.MapToIPv4().ToString().IpV4ToInt32());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace NetAdmin.Host.Middlewares;

/// <summary>
/// 输出环境信息到 http header
/// </summary>
public sealed class EnvironmentInfoMiddleware(RequestDelegate next)
{
/// <summary>
/// 主函数
/// </summary>
public Task InvokeAsync(HttpContext context)
{
context.Response.Headers.Append("X-Node", Environment.MachineName);
return next(context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public static class CaptchaImageHelper
await using var tranStream = resAsm.GetManifestResourceStream($"{tempPath}._{templateIndex}.transparent.png");

// 底图
using var backgroundImage = await Image.LoadAsync<Rgba32>(bgStream).ConfigureAwait(false);
using var backgroundImage = await Image.LoadAsync<Rgba32>(bgStream!).ConfigureAwait(false);

using var darkTemplateImage = await Image.LoadAsync<Rgba32>(darkStream).ConfigureAwait(false);
using var darkTemplateImage = await Image.LoadAsync<Rgba32>(darkStream!).ConfigureAwait(false);

// 透明模板图
using var transparentTemplateImage = await Image.LoadAsync<Rgba32>(tranStream).ConfigureAwait(false);
using var transparentTemplateImage = await Image.LoadAsync<Rgba32>(tranStream!).ConfigureAwait(false);

// 调整模板图大小
darkTemplateImage.Mutate(x => x.Resize(sliderSize));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public static async Task<RedisLocker> GetLockerAsync(IDatabase redisDatabase, st
return new RedisLocker(redisDatabase, lockerName);
}

await Task.Delay(retryDelay).ConfigureAwait(false);
if (retryCount > 1) {
await Task.Delay(retryDelay).ConfigureAwait(false);
}
}

throw new NetAdminGetLockerException(lockerName);
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@element-plus/icons-vue": "2.3.1",
"ace-builds": "1.37.1",
"aieditor": "1.3.3",
"ace-builds": "1.37.4",
"aieditor": "1.3.4",
"axios": "1.7.9",
"crypto-js": "4.2.0",
"echarts": "5.6.0",
"element-plus": "2.9.1",
"element-plus": "2.9.3",
"json-bigint": "1.0.0",
"markdown-it": "14.1.0",
"markdown-it-emoji": "3.0.0",
Expand All @@ -34,9 +34,9 @@
"@vitejs/plugin-vue": "5.2.1",
"prettier": "3.4.2",
"prettier-plugin-organize-attributes": "1.0.0",
"sass": "1.83.0",
"sass": "1.83.1",
"terser": "5.37.0",
"vite": "6.0.6"
"vite": "6.0.7"
},
"browserslist": [
"> 1%",
Expand Down

0 comments on commit 72cc3c4

Please sign in to comment.