Added Repo-URL in repo list.
This commit is contained in:
parent
50784e3e7e
commit
9fdb75720c
2 changed files with 6 additions and 0 deletions
|
|
@ -38,6 +38,10 @@ class BorgRepository(models.Model):
|
||||||
"""Returns the username of the linux user account for this user."""
|
"""Returns the username of the linux user account for this user."""
|
||||||
return f"u-{self.pk}"
|
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):
|
def save(self):
|
||||||
from .tasks import update_user
|
from .tasks import update_user
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Key</th>
|
<th>Key</th>
|
||||||
|
<th>Repo-URL</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -18,6 +19,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ repo.name }}</td>
|
<td>{{ repo.name }}</td>
|
||||||
<td>{{ repo.key }}</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>
|
<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>
|
<a href="{% url 'borg_delete' pk=repo.pk %}" class="btn btn-danger btn-sm">Delete</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue