Started adding node setup page

This commit is contained in:
Marcel Baumgartner 2024-03-22 20:50:11 +01:00
parent 9bf129f1ad
commit f172d765e3
3 changed files with 13 additions and 2 deletions

View file

@ -6,6 +6,9 @@ namespace Moonlight.Core.Configuration;
public class CoreConfiguration
{
[JsonProperty("AppUrl")]
[Description("This defines the public url of moonlight. This will be used by the nodes to communicate with moonlight")]
public string AppUrl { get; set; } = "";
[JsonProperty("Database")] public DatabaseData Database { get; set; } = new();
[JsonProperty("Features")] public FeaturesData Features { get; set; } = new();
[JsonProperty("Authentication")] public AuthenticationData Authentication { get; set; } = new();

View file

@ -1,4 +1,8 @@
@using Moonlight.Features.Servers.Entities
@using MoonCore.Services
@using Moonlight.Core.Configuration
@inject ConfigService<CoreConfiguration> ConfigService
<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.
@ -15,8 +19,12 @@
{
[Parameter] public ServerNode Node { get; set; }
private string Channel = "custom";
private string GenerateSetupCommand()
{
return $"echo Do somthing smart here with {Node.Name}";
var appUrl = ConfigService.Get().AppUrl;
return $"curl https://get-moonlight.app/install.sh | bash; mlcli daemon install {Channel} {appUrl} {Node.Token} {Node.HttpPort} {Node.Fqdn} {Node.Ssl.ToString().ToLower()}";
}
}

View file

@ -34,7 +34,7 @@
<CrudColumn TItem="ServerNode" Field="@(x => x.Fqdn)" Title="Fqdn"/>
<CrudColumn TItem="ServerNode" Field="@(x => x.Id)" Title="Status">
<Template>
<span class="text-success">Online</span>
<span class="text-muted">N/A</span>
</Template>
</CrudColumn>
</View>