Merge pull request #380 from Moonlight-Panel/v2_EarlyAccessFixes
Fixed bugs reported by early access people
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
@using Moonlight.Features.Servers.Entities
|
||||
@using MoonCore.Services
|
||||
@using Moonlight.Core.Configuration
|
||||
@using Moonlight.Core.Services
|
||||
|
||||
@inject ConfigService<CoreConfiguration> ConfigService
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
<div class="card card-body p-8 fs-5">
|
||||
In order to setup this node, make sure you have a clean linux (tested with ubuntu 22.04) server with the capabilities to run docker.
|
||||
@@ -25,6 +27,15 @@
|
||||
{
|
||||
var appUrl = ConfigService.Get().AppUrl;
|
||||
|
||||
return $"bash <(curl https://get-moonlight.app) --use-software daemon --use-action Install --use-channel {Channel} --use-remote-url {appUrl} --use-remote-token {Node.Token} --use-http-port {Node.HttpPort} --use-ftp-port {Node.FtpPort} --use-fqdn {Node.Fqdn} --use-ssl {Node.Ssl.ToString().ToLower()} --use-email letsencrypt@moonlightpanel.xyz";
|
||||
return $"bash <(curl https://get-moonlight.app) --use-software daemon " +
|
||||
$"--use-action Install " +
|
||||
$"--use-channel {Channel} " +
|
||||
$"--use-remote-url {appUrl} " +
|
||||
$"--use-remote-token {Node.Token} " +
|
||||
$"--use-http-port {Node.HttpPort} " +
|
||||
$"--use-ftp-port {Node.FtpPort} " +
|
||||
$"--use-fqdn {Node.Fqdn} " +
|
||||
$"--use-ssl {Node.Ssl.ToString().ToLower()} " +
|
||||
$"--use-email {IdentityService.CurrentUser.Email}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
Load="Load"
|
||||
ValidateDelete="ValidateDelete"
|
||||
ValidateAdd="ValidateAdd"
|
||||
CustomDelete="CustomDelete"
|
||||
@ref="Crud">
|
||||
<Actions>
|
||||
<a href="/admin/servers/images/view/@(context.Id)" class="btn btn-icon btn-info">
|
||||
@@ -102,6 +103,29 @@
|
||||
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;
|
||||
}
|
||||
|
||||
private Task ValidateAdd(ServerImage image)
|
||||
{
|
||||
// Set defaults
|
||||
|
||||
image.StopCommand = "^C";
|
||||
image.StartupCommand = "echo Startup command here";
|
||||
image.AllocationsNeeded = 1;
|
||||
image.InstallScript = "#! /bin/bash\necho Done";
|
||||
image.InstallShell = "/bin/bash";
|
||||
image.InstallDockerImage = "debian:latest";
|
||||
image.OnlineDetection = "Running";
|
||||
image.AllowDockerImageChange = false;
|
||||
image.DefaultDockerImage = 0;
|
||||
image.ParseConfiguration = "[]";
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Task CustomDelete(ServerImage serverImage)
|
||||
{
|
||||
var image = ImageRepository
|
||||
.Get()
|
||||
.Include(x => x.Variables)
|
||||
@@ -148,28 +172,11 @@
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Task ValidateAdd(ServerImage image)
|
||||
{
|
||||
// Set defaults
|
||||
|
||||
image.StopCommand = "^C";
|
||||
image.StartupCommand = "echo Startup command here";
|
||||
image.AllocationsNeeded = 1;
|
||||
image.InstallScript = "#! /bin/bash\necho Done";
|
||||
image.InstallShell = "/bin/bash";
|
||||
image.InstallDockerImage = "debian:latest";
|
||||
image.OnlineDetection = "Running";
|
||||
image.AllowDockerImageChange = false;
|
||||
image.DefaultDockerImage = 0;
|
||||
image.ParseConfiguration = "[]";
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task Export(ServerImage image)
|
||||
{
|
||||
var json = await ImageConversionHelper.ExportAsJson(image);
|
||||
await FileDownloadService.DownloadString($"{image.Name}.json", json);
|
||||
var imageName = image.Name.Replace(" ", "");
|
||||
await FileDownloadService.DownloadString($"{imageName}.json", json);
|
||||
|
||||
await ToastService.Success($"Successfully exported '{image.Name}'");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user