2020-06-28 21:44:35 -05:00
|
|
|
using System;
|
2021-07-27 20:00:33 +02:00
|
|
|
using BTCPayServer.Abstractions.Extensions;
|
2019-07-24 17:59:30 +09:00
|
|
|
using BTCPayServer.Services;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Models.ServerViewModels
|
|
|
|
{
|
|
|
|
public class DynamicDnsViewModel
|
|
|
|
{
|
|
|
|
public class WellKnownService
|
|
|
|
{
|
|
|
|
public WellKnownService(string name, string url)
|
|
|
|
{
|
|
|
|
Name = name;
|
|
|
|
Url = url;
|
|
|
|
}
|
|
|
|
public string Name { get; set; }
|
|
|
|
public string Url { get; set; }
|
|
|
|
}
|
2019-07-25 18:29:18 +09:00
|
|
|
public bool Modify { get; set; }
|
|
|
|
public DynamicDnsService Settings { get; set; }
|
2019-07-24 17:59:30 +09:00
|
|
|
public string LastUpdated
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (Settings?.LastUpdated is DateTimeOffset date)
|
|
|
|
{
|
2021-07-27 20:00:33 +02:00
|
|
|
return ViewsRazor.ToTimeAgo(date);
|
2019-07-24 17:59:30 +09:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
2020-06-28 17:55:27 +09:00
|
|
|
public WellKnownService[] KnownServices { get; set; } = new[]
|
2019-07-24 17:59:30 +09:00
|
|
|
{
|
|
|
|
new WellKnownService("noip", "https://dynupdate.no-ip.com/nic/update"),
|
|
|
|
new WellKnownService("dyndns", "https://members.dyndns.org/v3/update"),
|
|
|
|
new WellKnownService("duckdns", "https://www.duckdns.org/v3/update"),
|
|
|
|
new WellKnownService("google", "https://domains.google.com/nic/update"),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|