diff --git a/cluster/models.py b/cluster/models.py index 2150901..591904d 100644 --- a/cluster/models.py +++ b/cluster/models.py @@ -57,6 +57,10 @@ class Worker(models.Model): def __str__(self): return self.name + @property + def server_address(self): + return self.hostname or self.ip_address or '' + @property def display_name(self): cluster_settings = ClusterSettings.objects.first() @@ -98,7 +102,6 @@ class Worker(models.Model): return False - class WorkerStatus(models.Model): worker = models.OneToOneField(Worker, on_delete=models.CASCADE) last_seen = models.DateTimeField(auto_now=True) diff --git a/templates/vpn_invite/public_vpn_invite.html b/templates/vpn_invite/public_vpn_invite.html index c1689c5..0ed53b8 100644 --- a/templates/vpn_invite/public_vpn_invite.html +++ b/templates/vpn_invite/public_vpn_invite.html @@ -129,6 +129,16 @@ {{ invite_settings.download_5_label }} {% endif %} + {% if cluster_settings and servers|length > 1 %} +
{% trans 'There are no WireGuard instances configured. You can add a new instance by clicking the button below.' %}
-- {% trans 'Add WireGuard Instance' %} -
- {% endif %} +{% else %} +{% trans 'There are no WireGuard instances configured. You can add a new instance by clicking the button below.' %}
+