@if (!Server.DisablePublicNetwork)
{
-
+
@if (context!.IpAddress == "0.0.0.0")
diff --git a/Moonlight/Features/Servers/UI/Views/Admin/Images/Index.razor b/Moonlight/Features/Servers/UI/Views/Admin/Images/Index.razor
index 1d475184..6275b273 100644
--- a/Moonlight/Features/Servers/UI/Views/Admin/Images/Index.razor
+++ b/Moonlight/Features/Servers/UI/Views/Admin/Images/Index.razor
@@ -28,43 +28,43 @@
-
-
-
-
-
-
+
+
+ @context.Name
+
+
- @if (!string.IsNullOrEmpty(context.UpdateUrl))
- {
-
-
- Update
-
- }
+
+ @if (!string.IsNullOrEmpty(context.UpdateUrl))
+ {
+
+
+ Update
+
+ }
- @if (!string.IsNullOrEmpty(context.DonateUrl))
- {
-
-
- Donate
+ @if (!string.IsNullOrEmpty(context.DonateUrl))
+ {
+
+
+ Donate
+
+ }
+
+
Export(context)">
+
+ Export
- }
-
-
-
- Export
-
+
@@ -93,16 +93,16 @@
private SmartCustomFileSelect ImageUpload;
private SmartCustomFileSelect EggUpload;
- private ServerImage[] Load(Repository repository)
+ private IEnumerable Load(Repository repository)
{
- return repository.Get().ToArray();
+ return repository.Get();
}
private Task ValidateDelete(ServerImage serverImage)
{
if (ServerRepository.Get().Any(x => x.Image.Id == serverImage.Id))
throw new DisplayException("A server using this image exists. Please delete the servers using this image to continue");
-
+
return Task.CompletedTask;
}
@@ -123,7 +123,7 @@
return Task.CompletedTask;
}
-
+
private Task CustomDelete(ServerImage serverImage)
{
var image = ImageRepository
@@ -168,7 +168,7 @@
/* this should not fail the operation */
}
}
-
+
ImageRepository.Delete(serverImage);
return Task.CompletedTask;
@@ -216,11 +216,11 @@
await ImageUpload.RemoveSelection();
}
}
-
+
private async Task ImportEgg(IBrowserFile file)
{
- var confirm = await AlertService.YesNo("Importing pterodactyl eggs is a experimental feature and may result in unusable images. Are you sure you want to proceed?",
- "Yes, i take the risk",
+ var confirm = await AlertService.YesNo("Importing pterodactyl eggs is a experimental feature and may result in unusable images. Are you sure you want to proceed?",
+ "Yes, i take the risk",
"Cancel");
if (!confirm)
diff --git a/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor b/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor
index b44e94b0..be0030a1 100644
--- a/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor
+++ b/Moonlight/Features/Servers/UI/Views/Admin/Nodes/Index.razor
@@ -26,8 +26,7 @@
@@ -154,11 +153,10 @@
return Task.CompletedTask;
}
- private ServerNode[] LoadData(Repository repository)
+ private IEnumerable LoadData(Repository repository)
{
return repository
- .Get()
- .ToArray();
+ .Get();
}
private Task ValidateDelete(ServerNode node)
diff --git a/Moonlight/Features/Servers/UI/Views/Servers/Networks.razor b/Moonlight/Features/Servers/UI/Views/Servers/Networks.razor
index b2372ef6..2c24bdba 100644
--- a/Moonlight/Features/Servers/UI/Views/Servers/Networks.razor
+++ b/Moonlight/Features/Servers/UI/Views/Servers/Networks.razor
@@ -16,7 +16,7 @@
@@ -28,7 +28,7 @@
@{
- var servers = UsedByCache[context.Id];
+ var servers = UsedByCache.ContainsKey(context.Id) ? UsedByCache[context.Id] : Array.Empty();
}
@@ -51,13 +51,12 @@
{
private readonly Dictionary UsedByCache = new();
- private ServerNetwork[] Load(Repository repository)
+ private IEnumerable Load(Repository repository)
{
var result = repository
.Get()
.Include(x => x.Node)
- .Where(x => x.User.Id == IdentityService.CurrentUser.Id)
- .ToArray();
+ .Where(x => x.User.Id == IdentityService.CurrentUser.Id);
UsedByCache.Clear();