Redone syncshell admin ui, fixed some bugs on edit profile.

This commit is contained in:
cake
2025-12-09 05:45:19 +01:00
parent 25f0d41581
commit 675918624d
12 changed files with 684 additions and 344 deletions

View File

@@ -151,6 +151,20 @@ public partial class ApiController
.ConfigureAwait(false);
}
public async Task<GroupPruneSettingsDto> GroupGetPruneSettings(GroupDto dto)
{
CheckConnection();
return await _lightlessHub!.InvokeAsync<GroupPruneSettingsDto>(nameof(GroupGetPruneSettings), dto)
.ConfigureAwait(false);
}
public async Task GroupSetPruneSettings(GroupPruneSettingsDto dto)
{
CheckConnection();
await _lightlessHub!.SendAsync(nameof(GroupSetPruneSettings), dto)
.ConfigureAwait(false);
}
private void CheckConnection()
{
if (ServerState is not (ServerState.Connected or ServerState.Connecting or ServerState.Reconnecting)) throw new InvalidDataException("Not connected");

View File

@@ -71,6 +71,7 @@ public class HubFactory : MediatorSubscriberBase
};
Logger.LogDebug("Building new HubConnection using transport {transport}", transportType);
var msgpackOptions = MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4Block).WithResolver(ContractlessStandardResolver.Instance);
_instance = new HubConnectionBuilder()
.WithUrl(_serverConfigurationManager.CurrentApiUrl + ILightlessHub.Path, options =>
@@ -80,22 +81,7 @@ public class HubFactory : MediatorSubscriberBase
})
.AddMessagePackProtocol(opt =>
{
var resolver = CompositeResolver.Create(StandardResolverAllowPrivate.Instance,
BuiltinResolver.Instance,
AttributeFormatterResolver.Instance,
// replace enum resolver
DynamicEnumAsStringResolver.Instance,
DynamicGenericResolver.Instance,
DynamicUnionResolver.Instance,
DynamicObjectResolver.Instance,
PrimitiveObjectResolver.Instance,
// final fallback(last priority)
StandardResolver.Instance);
opt.SerializerOptions =
MessagePackSerializerOptions.Standard
.WithCompression(MessagePackCompression.Lz4Block)
.WithResolver(resolver);
opt.SerializerOptions = msgpackOptions;
})
.WithAutomaticReconnect(new ForeverRetryPolicy(Mediator))
.ConfigureLogging(a =>