Added domain system
This commit is contained in:
parent
8b37514ff6
commit
6fe9a0a1bd
18 changed files with 399 additions and 132 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -444,3 +444,10 @@ Moonlight/obj/project.nuget.cache
|
|||
Moonlight/obj/project.packagespec.json
|
||||
Moonlight/obj/Debug/net6.0/Moonlight.GeneratedMSBuildEditorConfig.editorconfig
|
||||
*.editorconfig
|
||||
Moonlight/obj/Debug/net6.0/Moonlight.GeneratedMSBuildEditorConfig.editorconfig
|
||||
*.cache
|
||||
*.editorconfig
|
||||
Moonlight/obj/Moonlight.csproj.nuget.dgspec.json
|
||||
Moonlight/obj/project.assets.json
|
||||
Moonlight/obj/project.nuget.cache
|
||||
Moonlight/obj/project.packagespec.json
|
||||
|
|
16
Moonlight/App/Exceptions/PaperException.cs
Normal file
16
Moonlight/App/Exceptions/PaperException.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
namespace Moonlight.App.Exceptions;
|
||||
|
||||
public class PaperException : Exception
|
||||
{
|
||||
public PaperException()
|
||||
{
|
||||
}
|
||||
|
||||
public PaperException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public PaperException(string message, Exception inner) : base(message, inner)
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Moonlight.App.Exceptions.Wings;
|
||||
namespace Moonlight.App.Exceptions;
|
||||
|
||||
[Serializable]
|
||||
public class WingsException : Exception
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Newtonsoft.Json;
|
||||
using Moonlight.App.Exceptions;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
namespace Moonlight.App.Helpers;
|
||||
|
@ -33,7 +34,7 @@ public class PaperApiHelper
|
|||
{
|
||||
if (response.StatusCode != 0)
|
||||
{
|
||||
throw new Exception(
|
||||
throw new PaperException(
|
||||
$"An error occured: ({response.StatusCode}) {response.Content}"
|
||||
);
|
||||
}
|
||||
|
@ -43,6 +44,6 @@ public class PaperApiHelper
|
|||
}
|
||||
}
|
||||
|
||||
return JsonConvert.DeserializeObject<T>(response.Content);
|
||||
return JsonConvert.DeserializeObject<T>(response.Content!)!;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Exceptions.Wings;
|
||||
using Moonlight.App.Exceptions;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
using CloudFlare.Client;
|
||||
using CloudFlare.Client.Api.Authentication;
|
||||
using CloudFlare.Client.Api.Parameters.Data;
|
||||
using CloudFlare.Client.Api.Result;
|
||||
using CloudFlare.Client.Api.Zones;
|
||||
using CloudFlare.Client.Api.Zones.DnsRecord;
|
||||
using CloudFlare.Client.Enumerators;
|
||||
using Logging.Net;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Exceptions;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Repositories.Domains;
|
||||
using DnsRecord = Moonlight.App.Models.Misc.DnsRecord;
|
||||
|
||||
namespace Moonlight.App.Services;
|
||||
|
||||
|
@ -107,6 +111,95 @@ public class DomainService
|
|||
return result.ToArray();
|
||||
}
|
||||
|
||||
public async Task AddDnsRecord(Domain d, DnsRecord dnsRecord)
|
||||
{
|
||||
var domain = EnsureData(d);
|
||||
|
||||
var rname = $"{domain.Name}.{domain.SharedDomain.Name}";
|
||||
var dname = $".{rname}";
|
||||
|
||||
if (dnsRecord.Type == DnsRecordType.Srv)
|
||||
{
|
||||
var parts = dnsRecord.Name.Split(".");
|
||||
Enum.TryParse(parts[1], out Protocol protocol);
|
||||
|
||||
var valueParts = dnsRecord.Content.Split(" ");
|
||||
|
||||
var nameWithoutProt = dnsRecord.Name.Replace($"{parts[0]}.{parts[1]}.", "");
|
||||
nameWithoutProt = nameWithoutProt.Replace($"{parts[0]}.{parts[1]}", "");
|
||||
var name = nameWithoutProt == "" ? rname : nameWithoutProt + dname;
|
||||
|
||||
var srv = new NewDnsRecord<Srv>()
|
||||
{
|
||||
Type = dnsRecord.Type,
|
||||
Data = new()
|
||||
{
|
||||
|
||||
Service = parts[0],
|
||||
Protocol = protocol,
|
||||
Name = name,
|
||||
Weight = int.Parse(valueParts[0]),
|
||||
Port = int.Parse(valueParts[1]),
|
||||
Target = valueParts[2],
|
||||
Priority = dnsRecord.Priority
|
||||
},
|
||||
Proxied = dnsRecord.Proxied,
|
||||
Ttl = dnsRecord.Ttl,
|
||||
};
|
||||
|
||||
GetData(await Client.Zones.DnsRecords.AddAsync(d.SharedDomain.CloudflareId, srv));
|
||||
}
|
||||
else
|
||||
{
|
||||
var name = string.IsNullOrEmpty(dnsRecord.Name) ? rname : dnsRecord.Name + dname;
|
||||
|
||||
GetData(await Client.Zones.DnsRecords.AddAsync(d.SharedDomain.CloudflareId, new NewDnsRecord()
|
||||
{
|
||||
Type = dnsRecord.Type,
|
||||
Priority = dnsRecord.Priority,
|
||||
Content = dnsRecord.Content,
|
||||
Proxied = dnsRecord.Proxied,
|
||||
Ttl = dnsRecord.Ttl,
|
||||
Name = name
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdateDnsRecord(Domain d, DnsRecord dnsRecord)
|
||||
{
|
||||
var domain = EnsureData(d);
|
||||
|
||||
var rname = $"{domain.Name}.{domain.SharedDomain.Name}";
|
||||
var dname = $".{rname}";
|
||||
|
||||
if (dnsRecord.Type == DnsRecordType.Srv)
|
||||
{
|
||||
throw new DisplayException("SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one");
|
||||
}
|
||||
else
|
||||
{
|
||||
var name = dnsRecord.Name == "" ? rname : dnsRecord.Name + dname;
|
||||
|
||||
GetData(await Client.Zones.DnsRecords.UpdateAsync(d.SharedDomain.CloudflareId, dnsRecord.Id, new ModifiedDnsRecord()
|
||||
{
|
||||
Content = dnsRecord.Content,
|
||||
Proxied = dnsRecord.Proxied,
|
||||
Ttl = dnsRecord.Ttl,
|
||||
Name = name,
|
||||
Type = dnsRecord.Type
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteDnsRecord(Domain d, DnsRecord dnsRecord)
|
||||
{
|
||||
var domain = EnsureData(d);
|
||||
|
||||
GetData(
|
||||
await Client.Zones.DnsRecords.DeleteAsync(domain.SharedDomain.CloudflareId, dnsRecord.Id)
|
||||
);
|
||||
}
|
||||
|
||||
private Domain EnsureData(Domain domain)
|
||||
{
|
||||
if (domain.SharedDomain != null)
|
||||
|
@ -121,7 +214,16 @@ public class DomainService
|
|||
{
|
||||
if (!result.Success)
|
||||
{
|
||||
var message = result.Errors.First().ErrorChain.First().Message;
|
||||
string message;
|
||||
|
||||
try
|
||||
{
|
||||
message = result.Errors.First().ErrorChain.First().Message;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new CloudflareException("No error message provided");
|
||||
}
|
||||
|
||||
throw new CloudflareException(message);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
@using Moonlight.App.Services.Interop
|
||||
@using Moonlight.App.Exceptions
|
||||
@using Moonlight.App.Services
|
||||
@inherits ErrorBoundaryBase
|
||||
|
||||
@inject AlertService AlertService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
|
||||
@ChildContent
|
||||
|
||||
@code
|
||||
{
|
||||
protected override async Task OnErrorAsync(Exception exception)
|
||||
{
|
||||
if (exception is DisplayException displayException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error"),
|
||||
SmartTranslateService.Translate(displayException.Message)
|
||||
);
|
||||
}
|
||||
else if (exception is CloudflareException cloudflareException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error from cloudflare api"),
|
||||
cloudflareException.Message
|
||||
);
|
||||
}
|
||||
else if (exception is WingsException wingsException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error from daemon"),
|
||||
wingsException.Message
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -112,10 +112,10 @@
|
|||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
MessageService.Subscribe<ServerBackups, ServerBackup>("wings.backups.create", this, async (backup) =>
|
||||
MessageService.Subscribe<ServerBackups, ServerBackup>("wings.backups.create", this, (backup) =>
|
||||
{
|
||||
if (AllBackups == null)
|
||||
return;
|
||||
return Task.CompletedTask;
|
||||
|
||||
if (AllBackups.Any(x => x.Id == backup.Id))
|
||||
{
|
||||
|
@ -126,12 +126,14 @@
|
|||
await LazyLoader.Reload();
|
||||
});
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
MessageService.Subscribe<ServerBackups, ServerBackup>("wings.backups.createfailed", this, async (backup) =>
|
||||
MessageService.Subscribe<ServerBackups, ServerBackup>("wings.backups.createfailed", this, (backup) =>
|
||||
{
|
||||
if (AllBackups == null)
|
||||
return;
|
||||
return Task.CompletedTask;
|
||||
|
||||
if (AllBackups.Any(x => x.Id == backup.Id))
|
||||
{
|
||||
|
@ -141,6 +143,8 @@
|
|||
await LazyLoader.Reload();
|
||||
});
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
MessageService.Subscribe<ServerBackups, ServerBackup>("wings.backups.delete", this, async (backup) =>
|
||||
|
|
|
@ -59,40 +59,42 @@
|
|||
<div id="kt_app_content_container" class="app-container container-fluid">
|
||||
<div class="mt-10">
|
||||
<PageErrorBoundary>
|
||||
@if (uri.LocalPath != "/login" &&
|
||||
uri.LocalPath != "/register")
|
||||
{
|
||||
if (User == null)
|
||||
<SoftErrorBoundary>
|
||||
@if (uri.LocalPath != "/login" &&
|
||||
uri.LocalPath != "/register")
|
||||
{
|
||||
<Login></Login>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (User.Status == UserStatus.Banned)
|
||||
if (User == null)
|
||||
{
|
||||
<BannedAlert></BannedAlert>
|
||||
}
|
||||
else if (User.Status == UserStatus.Disabled)
|
||||
{
|
||||
<DisabledAlert></DisabledAlert>
|
||||
<Login></Login>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Body
|
||||
if (User.Status == UserStatus.Banned)
|
||||
{
|
||||
<BannedAlert></BannedAlert>
|
||||
}
|
||||
else if (User.Status == UserStatus.Disabled)
|
||||
{
|
||||
<DisabledAlert></DisabledAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Body
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (uri.LocalPath == "/login")
|
||||
else
|
||||
{
|
||||
<Login></Login>
|
||||
if (uri.LocalPath == "/login")
|
||||
{
|
||||
<Login></Login>
|
||||
}
|
||||
else if (uri.LocalPath == "/register")
|
||||
{
|
||||
<Register></Register>
|
||||
}
|
||||
}
|
||||
else if (uri.LocalPath == "/register")
|
||||
{
|
||||
<Register></Register>
|
||||
}
|
||||
}
|
||||
</SoftErrorBoundary>
|
||||
</PageErrorBoundary>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -160,7 +162,7 @@
|
|||
await ToastService.Info($"Support: {message.Message}");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
RunDelayedMenu(0);
|
||||
RunDelayedMenu(1);
|
||||
RunDelayedMenu(3);
|
||||
|
@ -204,8 +206,8 @@
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//Logger.Warn("Delayed menu error");
|
||||
//Logger.Warn(e);
|
||||
//Logger.Warn("Delayed menu error");
|
||||
//Logger.Warn(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
{
|
||||
DomainRepository.Add(new()
|
||||
{
|
||||
Name = Name,
|
||||
Name = Name.ToLower(),
|
||||
Owner = User!,
|
||||
SharedDomain = SharedDomain!
|
||||
});
|
||||
|
|
|
@ -5,11 +5,16 @@
|
|||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Models.Misc
|
||||
@using Moonlight.App.Services
|
||||
@using CloudFlare.Client.Enumerators
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Exceptions
|
||||
@using Moonlight.App.Services.Interop
|
||||
|
||||
@inject IdentityService IdentityService
|
||||
@inject DomainRepository DomainRepository
|
||||
@inject DomainService DomainService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject ToastService ToastService
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
@if (Domain == null)
|
||||
|
@ -20,64 +25,148 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
var domainNameBuilt = $"{Domain.Name}.{Domain.SharedDomain.Name}";
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<TL>DNS records for</TL><span class="ms-3">@($"{Domain.Name}.{Domain.SharedDomain.Name}")</span>
|
||||
<TL>DNS records for</TL><span class="ms-3">@(domainNameBuilt)</span>
|
||||
</span>
|
||||
</div>
|
||||
<LazyLoader Load="LoadDnsRecords">
|
||||
<div class="mt-5"></div>
|
||||
<LazyLoader @ref="DnsLazyLoader" Load="LoadDnsRecords">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="w-100 d-flex flex-row justify-content-between align-items-center">
|
||||
<div class="p-2">
|
||||
<select @bind="NewRecord.Type" class="form-select">
|
||||
@foreach (DnsRecordType type in (DnsRecordType[])Enum.GetValues(typeof(DnsRecordType)))
|
||||
{
|
||||
<option value="@(type)">@(type.ToString().ToUpper())</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="text" placeholder="@domainNameBuilt" @bind="NewRecord.Name"/>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="text" placeholder="@(SmartTranslateService.Translate("Content"))" @bind="NewRecord.Content"/>
|
||||
</div>
|
||||
<div class="form-check p-2 ms-10 me-10">
|
||||
<input class="form-check-input" type="checkbox" @bind="NewRecord.Proxied" id="cfCheckbox">
|
||||
<label class="form-check-label" for="cfCheckbox">
|
||||
<TL>CF Proxy</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="number" placeholder="@(SmartTranslateService.Translate("Ttl"))" @bind="NewRecord.Ttl"/>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="number" placeholder="@(SmartTranslateService.Translate("Priority"))" @bind="NewRecord.Priority"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="mt-3 ms-auto">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Add"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Adding"))"
|
||||
CssClasses="btn-success"
|
||||
OnClick="Add">
|
||||
</WButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
@if (DnsRecords.Any())
|
||||
{
|
||||
<div class="row">
|
||||
<div class="">
|
||||
<div class="accordion accordion-flush" id="accordionDomain">
|
||||
@foreach (var record in DnsRecords)
|
||||
{
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="heading@(record.Id)">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse@(record.Id)" aria-expanded="false" aria-controls="collapse@(record.Id)">
|
||||
<div class="w-100 d-flex flex-row justify-content-between align-items-center">
|
||||
<div class="p-2">
|
||||
@(record.Type.ToString().ToUpper())
|
||||
</div>
|
||||
<div class="p-2">
|
||||
@(record.Name == "" ? $"{Domain.Name}.{Domain.SharedDomain.Name}" : record.Name)
|
||||
</div>
|
||||
<div class="p-2">
|
||||
@(record.Content)
|
||||
</div>
|
||||
<div class="p-2">
|
||||
@(record.Proxied)
|
||||
</div>
|
||||
<div class="p-2 pe-6">
|
||||
@(record.Ttl)
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapse@(record.Id)" class="accordion-collapse collapse" aria-labelledby="heading@(record.Id)" data-bs-parent="#accordionDomain">
|
||||
<div class="accordion-body">
|
||||
|
||||
@if (DnsRecords.Any())
|
||||
{
|
||||
<div class="row">
|
||||
<div class="accordion accordion-flush" id="accordionDomain">
|
||||
@foreach (var record in DnsRecords)
|
||||
{
|
||||
<div class="separator"></div>
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="heading@(record.Id)">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse@(record.Id)" aria-expanded="false" aria-controls="collapse@(record.Id)">
|
||||
<div class="row w-100">
|
||||
<div class="ms-5 col">
|
||||
@(record.Type.ToString().ToUpper())
|
||||
</div>
|
||||
<div class="col">
|
||||
@(record.Name == "" ? domainNameBuilt : record.Name)
|
||||
</div>
|
||||
<div class="col">
|
||||
@(record.Content)
|
||||
</div>
|
||||
<div class="col">
|
||||
@(record.Proxied)
|
||||
</div>
|
||||
<div class="col">
|
||||
@(record.Ttl)
|
||||
</div>
|
||||
<div class="col pe-6">
|
||||
@(record.Priority)
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapse@(record.Id)" class="accordion-collapse collapse" aria-labelledby="heading@(record.Id)" data-bs-parent="#accordionDomain">
|
||||
<div class="accordion-body">
|
||||
<div class="w-100 d-flex flex-row justify-content-between align-items-center">
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="text" value="@(record.Type.ToString().ToUpper())" disabled=""/>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="text" placeholder="@domainNameBuilt" @bind="record.Name"/>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="text" placeholder="@(SmartTranslateService.Translate("Content"))" @bind="record.Content"/>
|
||||
</div>
|
||||
<div class="form-check p-2 ms-10 me-10">
|
||||
<input class="form-check-input" type="checkbox" @bind="record.Proxied" id="cfCheckbox">
|
||||
<label class="form-check-label" for="cfCheckbox">
|
||||
<TL>CF Proxy</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="number" placeholder="@(SmartTranslateService.Translate("Ttl"))" @bind="record.Ttl"/>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<input class="form-control" type="number" placeholder="@(SmartTranslateService.Translate("Priority"))" @bind="record.Priority"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="separator mx-5"></div>
|
||||
<div class="accordion-body">
|
||||
<div class="d-flex">
|
||||
<div class="me-auto">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Delete"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Deleting"))"
|
||||
CssClasses="btn-danger"
|
||||
OnClick="() => Delete(record)">
|
||||
</WButton>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-light" data-bs-toggle="collapse" data-bs-target="#collapse@(record.Id)">
|
||||
<TL>Cancle</TL>
|
||||
</button>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Save"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Saving"))"
|
||||
CssClasses="btn-success"
|
||||
OnClick="() => Save(record)">
|
||||
</WButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert alert-primary">
|
||||
<TL>No dns records found</TL>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="separator"></div>
|
||||
<div class="mx-5 mt-5 alert alert-primary">
|
||||
<TL>No dns records found</TL>
|
||||
</div>
|
||||
}
|
||||
</LazyLoader>
|
||||
</div>
|
||||
}
|
||||
|
@ -90,6 +179,13 @@
|
|||
|
||||
private Domain? Domain;
|
||||
private DnsRecord[] DnsRecords;
|
||||
private DnsRecord NewRecord = new()
|
||||
{
|
||||
Ttl = 1,
|
||||
Priority = 0
|
||||
};
|
||||
|
||||
private LazyLoader DnsLazyLoader;
|
||||
|
||||
private async Task Load(LazyLoader arg)
|
||||
{
|
||||
|
@ -122,4 +218,29 @@
|
|||
await lazyLoader.SetText(SmartTranslateService.Translate("Fetching dns records"));
|
||||
DnsRecords = await DomainService.GetDnsRecords(Domain!);
|
||||
}
|
||||
|
||||
private async Task Save(DnsRecord record)
|
||||
{
|
||||
await DomainService.UpdateDnsRecord(Domain!, record);
|
||||
await DnsLazyLoader.Reload();
|
||||
}
|
||||
|
||||
private async Task Add()
|
||||
{
|
||||
await DomainService.AddDnsRecord(Domain!, NewRecord);
|
||||
|
||||
NewRecord = new()
|
||||
{
|
||||
Ttl = 1,
|
||||
Priority = 0
|
||||
};
|
||||
|
||||
await DnsLazyLoader.Reload();
|
||||
}
|
||||
|
||||
private async Task Delete(DnsRecord record)
|
||||
{
|
||||
await DomainService.DeleteDnsRecord(Domain!, record);
|
||||
await DnsLazyLoader.Reload();
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ build_property.UsingMicrosoftNETSdkWeb = true
|
|||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = Moonlight
|
||||
build_property.RootNamespace = Moonlight
|
||||
|
@ -52,6 +51,10 @@ build_metadata.AdditionalFiles.CssScope =
|
|||
build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXENvbXBvbmVudHNcRXJyb3JCb3VuZGFyaWVzXFBhZ2VFcnJvckJvdW5kYXJ5LnJhem9y
|
||||
build_metadata.AdditionalFiles.CssScope =
|
||||
|
||||
[C:/Users/marce/GitHub/Moonlight-Panel/Moonlight/Moonlight/Shared/Components/ErrorBoundaries/SoftErrorBoundary.razor]
|
||||
build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXENvbXBvbmVudHNcRXJyb3JCb3VuZGFyaWVzXFNvZnRFcnJvckJvdW5kYXJ5LnJhem9y
|
||||
build_metadata.AdditionalFiles.CssScope =
|
||||
|
||||
[C:/Users/marce/GitHub/Moonlight-Panel/Moonlight/Moonlight/Shared/Components/FileManagerPartials/FileEditor.razor]
|
||||
build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXENvbXBvbmVudHNcRmlsZU1hbmFnZXJQYXJ0aWFsc1xGaWxlRWRpdG9yLnJhem9y
|
||||
build_metadata.AdditionalFiles.CssScope =
|
||||
|
|
Binary file not shown.
|
@ -154,24 +154,6 @@
|
|||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"downloadDependencies": [
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App.Ref",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Host.win-x64",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Ref",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.WindowsDesktop.App.Ref",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
}
|
||||
],
|
||||
"frameworkReferences": {
|
||||
"Microsoft.AspNetCore.App": {
|
||||
"privateAssets": "none"
|
||||
|
@ -180,7 +162,7 @@
|
|||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Users\\marce\\.dotnet\\sdk\\7.0.200\\RuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.406\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7842,24 +7842,6 @@
|
|||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"downloadDependencies": [
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App.Ref",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Host.win-x64",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Ref",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.WindowsDesktop.App.Ref",
|
||||
"version": "[6.0.14, 6.0.14]"
|
||||
}
|
||||
],
|
||||
"frameworkReferences": {
|
||||
"Microsoft.AspNetCore.App": {
|
||||
"privateAssets": "none"
|
||||
|
@ -7868,7 +7850,7 @@
|
|||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Users\\marce\\.dotnet\\sdk\\7.0.200\\RuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.406\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "h+m+sPm3O7eUNxvWdurMZhK8n+X4XIB2K11iRoLniiWZkh0HpElt3QhjSoP/Rps/4kXgZiTwr+r4hbh4gDxAFA==",
|
||||
"dgSpecHash": "vaAqxQVZgwjBmv9wk4mLw5OLlAnxWHEIocSEveXG2u/Qy6MfU1wC5VzWGYfj+fE6X2bAWVxfQLUtpy9spJL3Mg==",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\marce\\GitHub\\Moonlight-Panel\\Moonlight\\Moonlight\\Moonlight.csproj",
|
||||
"expectedPackageFiles": [
|
||||
|
@ -149,11 +149,7 @@
|
|||
"C:\\Users\\marce\\.nuget\\packages\\system.xml.readerwriter\\4.3.0\\system.xml.readerwriter.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\marce\\.nuget\\packages\\system.xml.xdocument\\4.3.0\\system.xml.xdocument.4.3.0.nupkg.sha512",
|
||||
"C:\\Users\\marce\\.nuget\\packages\\uaparser\\3.1.47\\uaparser.3.1.47.nupkg.sha512",
|
||||
"C:\\Users\\marce\\.nuget\\packages\\xtermblazor\\1.6.1\\xtermblazor.1.6.1.nupkg.sha512",
|
||||
"C:\\Users\\marce\\.nuget\\packages\\microsoft.netcore.app.ref\\6.0.14\\microsoft.netcore.app.ref.6.0.14.nupkg.sha512",
|
||||
"C:\\Users\\marce\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\6.0.14\\microsoft.windowsdesktop.app.ref.6.0.14.nupkg.sha512",
|
||||
"C:\\Users\\marce\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\6.0.14\\microsoft.aspnetcore.app.ref.6.0.14.nupkg.sha512",
|
||||
"C:\\Users\\marce\\.nuget\\packages\\microsoft.netcore.app.host.win-x64\\6.0.14\\microsoft.netcore.app.host.win-x64.6.0.14.nupkg.sha512"
|
||||
"C:\\Users\\marce\\.nuget\\packages\\xtermblazor\\1.6.1\\xtermblazor.1.6.1.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
|
@ -1 +1 @@
|
|||
"restore":{"projectUniqueName":"C:\\Users\\marce\\GitHub\\Moonlight-Panel\\Moonlight\\Moonlight\\Moonlight.csproj","projectName":"Moonlight","projectPath":"C:\\Users\\marce\\GitHub\\Moonlight-Panel\\Moonlight\\Moonlight\\Moonlight.csproj","outputPath":"C:\\Users\\marce\\GitHub\\Moonlight-Panel\\Moonlight\\Moonlight\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net6.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net6.0":{"targetAlias":"net6.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net6.0":{"targetAlias":"net6.0","dependencies":{"BCrypt.Net-Next":{"target":"Package","version":"[4.0.3, )"},"Ben.Demystifier":{"target":"Package","version":"[0.4.1, )"},"Blazor.ContextMenu":{"target":"Package","version":"[1.15.0, )"},"BlazorMonaco":{"target":"Package","version":"[2.1.0, )"},"BlazorTable":{"target":"Package","version":"[1.17.0, )"},"Blazored.Typeahead":{"target":"Package","version":"[4.7.0, )"},"CloudFlare.Client":{"target":"Package","version":"[6.1.4, )"},"CurrieTechnologies.Razor.SweetAlert2":{"target":"Package","version":"[5.4.0, )"},"Discord.Net":{"target":"Package","version":"[3.9.0, )"},"GravatarSharp.Core":{"target":"Package","version":"[1.0.1.2, )"},"JWT":{"target":"Package","version":"[10.0.2, )"},"Logging.Net":{"target":"Package","version":"[1.1.0, )"},"Microsoft.EntityFrameworkCore.Design":{"include":"Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive","suppressParent":"All","target":"Package","version":"[7.0.3, )"},"Microsoft.VisualStudio.Azure.Containers.Tools.Targets":{"target":"Package","version":"[1.15.1, )"},"MimeTypes":{"include":"Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive","suppressParent":"All","target":"Package","version":"[2.4.0, )"},"MineStat":{"target":"Package","version":"[3.1.1, )"},"Newtonsoft.Json":{"target":"Package","version":"[13.0.3-beta1, )"},"Otp.NET":{"target":"Package","version":"[1.3.0, )"},"Pomelo.EntityFrameworkCore.MySql":{"target":"Package","version":"[7.0.0, )"},"PteroConsole.NET":{"target":"Package","version":"[1.0.4, )"},"QRCoder":{"target":"Package","version":"[1.4.3, )"},"RestSharp":{"target":"Package","version":"[109.0.0-preview.1, )"},"UAParser":{"target":"Package","version":"[3.1.47, )"},"XtermBlazor":{"target":"Package","version":"[1.6.1, )"},"aaPanelSharp":{"target":"Package","version":"[1.0.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"downloadDependencies":[{"name":"Microsoft.AspNetCore.App.Ref","version":"[6.0.14, 6.0.14]"},{"name":"Microsoft.NETCore.App.Host.win-x64","version":"[6.0.14, 6.0.14]"},{"name":"Microsoft.NETCore.App.Ref","version":"[6.0.14, 6.0.14]"},{"name":"Microsoft.WindowsDesktop.App.Ref","version":"[6.0.14, 6.0.14]"}],"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\marce\\.dotnet\\sdk\\7.0.200\\RuntimeIdentifierGraph.json"}}
|
||||
"restore":{"projectUniqueName":"C:\\Users\\marce\\GitHub\\Moonlight-Panel\\Moonlight\\Moonlight\\Moonlight.csproj","projectName":"Moonlight","projectPath":"C:\\Users\\marce\\GitHub\\Moonlight-Panel\\Moonlight\\Moonlight\\Moonlight.csproj","outputPath":"C:\\Users\\marce\\GitHub\\Moonlight-Panel\\Moonlight\\Moonlight\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net6.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net6.0":{"targetAlias":"net6.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net6.0":{"targetAlias":"net6.0","dependencies":{"BCrypt.Net-Next":{"target":"Package","version":"[4.0.3, )"},"Ben.Demystifier":{"target":"Package","version":"[0.4.1, )"},"Blazor.ContextMenu":{"target":"Package","version":"[1.15.0, )"},"BlazorMonaco":{"target":"Package","version":"[2.1.0, )"},"BlazorTable":{"target":"Package","version":"[1.17.0, )"},"Blazored.Typeahead":{"target":"Package","version":"[4.7.0, )"},"CloudFlare.Client":{"target":"Package","version":"[6.1.4, )"},"CurrieTechnologies.Razor.SweetAlert2":{"target":"Package","version":"[5.4.0, )"},"Discord.Net":{"target":"Package","version":"[3.9.0, )"},"GravatarSharp.Core":{"target":"Package","version":"[1.0.1.2, )"},"JWT":{"target":"Package","version":"[10.0.2, )"},"Logging.Net":{"target":"Package","version":"[1.1.0, )"},"Microsoft.EntityFrameworkCore.Design":{"include":"Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive","suppressParent":"All","target":"Package","version":"[7.0.3, )"},"Microsoft.VisualStudio.Azure.Containers.Tools.Targets":{"target":"Package","version":"[1.15.1, )"},"MimeTypes":{"include":"Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive","suppressParent":"All","target":"Package","version":"[2.4.0, )"},"MineStat":{"target":"Package","version":"[3.1.1, )"},"Newtonsoft.Json":{"target":"Package","version":"[13.0.3-beta1, )"},"Otp.NET":{"target":"Package","version":"[1.3.0, )"},"Pomelo.EntityFrameworkCore.MySql":{"target":"Package","version":"[7.0.0, )"},"PteroConsole.NET":{"target":"Package","version":"[1.0.4, )"},"QRCoder":{"target":"Package","version":"[1.4.3, )"},"RestSharp":{"target":"Package","version":"[109.0.0-preview.1, )"},"UAParser":{"target":"Package","version":"[3.1.47, )"},"XtermBlazor":{"target":"Package","version":"[1.6.1, )"},"aaPanelSharp":{"target":"Package","version":"[1.0.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\6.0.406\\RuntimeIdentifierGraph.json"}}
|
|
@ -236,3 +236,13 @@ Domain name;Domain name
|
|||
DNS records for;DNS records for
|
||||
Fetching dns records;Fetching dns records
|
||||
No dns records found;No dns records found
|
||||
Content;Content
|
||||
Priority;Priority
|
||||
Ttl;Ttl
|
||||
Enable cloudflare proxy;Enable cloudflare proxy
|
||||
CF Proxy;CF Proxy
|
||||
days ago; days ago
|
||||
Cancle;Cancle
|
||||
An unexpected error occured;An unexpected error occured
|
||||
Testy;Testy
|
||||
Error from cloudflare api;Error from cloudflare api
|
||||
|
|
Loading…
Reference in a new issue