Added Repo-URL in repo list.

This commit is contained in:
Johannes Erwerle 2026-04-06 18:59:27 +02:00
parent 50784e3e7e
commit 9fdb75720c
2 changed files with 6 additions and 0 deletions

View file

@ -38,6 +38,10 @@ class BorgRepository(models.Model):
"""Returns the username of the linux user account for this user."""
return f"u-{self.pk}"
@property
def repo_url(self) -> str:
return f"{settings.BACKUP_USER}@{settings.BACKUP_REPO_HOST}:{self.user.pk}/{self.pk}"
def save(self):
from .tasks import update_user

View file

@ -11,6 +11,7 @@
<thead>
<th>Name</th>
<th>Key</th>
<th>Repo-URL</th>
<th></th>
</thead>
<tbody>
@ -18,6 +19,7 @@
<tr>
<td>{{ repo.name }}</td>
<td>{{ repo.key }}</td>
<td><code>{{ repo.repo_url}}</code></td>
<td><a href="{% url 'borg_update' pk=repo.pk %}" class="btn btn-warning btn-sm">Edit</a>
<a href="{% url 'borg_delete' pk=repo.pk %}" class="btn btn-danger btn-sm">Delete</a></td>
</tr>