Changes some calls
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -47,6 +47,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
private Task<int>? _pruneTestTask;
|
private Task<int>? _pruneTestTask;
|
||||||
private Task<int>? _pruneTask;
|
private Task<int>? _pruneTask;
|
||||||
private int _pruneDays = 14;
|
private int _pruneDays = 14;
|
||||||
|
private bool renewProfile;
|
||||||
|
|
||||||
public SyncshellAdminUI(ILogger<SyncshellAdminUI> logger, LightlessMediator mediator, ApiController apiController,
|
public SyncshellAdminUI(ILogger<SyncshellAdminUI> logger, LightlessMediator mediator, ApiController apiController,
|
||||||
UiSharedService uiSharedService, PairManager pairManager, GroupFullInfoDto groupFullInfo, PerformanceCollectorService performanceCollectorService, LightlessProfileManager lightlessProfileManager, FileDialogManager fileDialogManager)
|
UiSharedService uiSharedService, PairManager pairManager, GroupFullInfoDto groupFullInfo, PerformanceCollectorService performanceCollectorService, LightlessProfileManager lightlessProfileManager, FileDialogManager fileDialogManager)
|
||||||
@@ -87,6 +88,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
if (!_isModerator && !_isOwner) return;
|
if (!_isModerator && !_isOwner) return;
|
||||||
|
|
||||||
GroupFullInfo = _pairManager.Groups[GroupFullInfo.Group];
|
GroupFullInfo = _pairManager.Groups[GroupFullInfo.Group];
|
||||||
|
_profileData = _lightlessProfileManager.GetLightlessGroupProfile(GroupFullInfo.Group);
|
||||||
|
|
||||||
using var id = ImRaii.PushId("syncshell_admin_" + GroupFullInfo.GID);
|
using var id = ImRaii.PushId("syncshell_admin_" + GroupFullInfo.GID);
|
||||||
using (_uiSharedService.UidFont.Push())
|
using (_uiSharedService.UidFont.Push())
|
||||||
@@ -212,10 +214,6 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
if (profileTab)
|
if (profileTab)
|
||||||
{
|
{
|
||||||
if (_uiSharedService.MediumTreeNode("Current Profile", UIColors.Get("LightlessPurple")))
|
if (_uiSharedService.MediumTreeNode("Current Profile", UIColors.Get("LightlessPurple")))
|
||||||
{
|
|
||||||
_logger.LogInformation(GroupFullInfo.Group.GID);
|
|
||||||
_profileData = _lightlessProfileManager.GetLightlessGroupProfile(GroupFullInfo.Group);
|
|
||||||
if (_profileData != null)
|
|
||||||
{
|
{
|
||||||
ImGui.Dummy(new Vector2(5));
|
ImGui.Dummy(new Vector2(5));
|
||||||
|
|
||||||
@@ -263,7 +261,6 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
ImGui.TreePop();
|
ImGui.TreePop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
@@ -278,8 +275,10 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
if (!success) return;
|
if (!success) return;
|
||||||
_ = Task.Run(async () =>
|
_ = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var fileContent = File.ReadAllBytes(file);
|
var fileContent = await File.ReadAllBytesAsync(file).ConfigureAwait(false);
|
||||||
using MemoryStream ms = new(fileContent);
|
MemoryStream ms = new(fileContent);
|
||||||
|
await using (ms.ConfigureAwait(false))
|
||||||
|
{
|
||||||
var format = await Image.DetectFormatAsync(ms).ConfigureAwait(false);
|
var format = await Image.DetectFormatAsync(ms).ConfigureAwait(false);
|
||||||
if (!format.FileExtensions.Contains("png", StringComparer.OrdinalIgnoreCase))
|
if (!format.FileExtensions.Contains("png", StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
@@ -297,6 +296,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
_showFileDialogError = false;
|
_showFileDialogError = false;
|
||||||
await _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.GID), Description: null, Tags: null, Convert.ToBase64String(fileContent)))
|
await _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.GID), Description: null, Tags: null, Convert.ToBase64String(fileContent)))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -711,5 +711,6 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
public override void OnClose()
|
public override void OnClose()
|
||||||
{
|
{
|
||||||
Mediator.Publish(new RemoveWindowMessage(this));
|
Mediator.Publish(new RemoveWindowMessage(this));
|
||||||
|
_pfpTextureWrap?.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user