admin: outposts show should-be version
This commit is contained in:
parent
a02fcb0a7a
commit
b04f92c8b4
|
@ -71,8 +71,12 @@
|
||||||
<td role="cell">
|
<td role="cell">
|
||||||
<span>
|
<span>
|
||||||
{% with ver=outpost.deployment_version %}
|
{% with ver=outpost.deployment_version %}
|
||||||
{% if ver.outdated or ver.version == "" %}
|
{% if ver.outdated %}
|
||||||
<i class="fas fa-times pf-m-danger"></i> {{ ver.version|default:"-" }}
|
{% if ver.version == "" %}
|
||||||
|
<i class="fas fa-times pf-m-danger"></i> -
|
||||||
|
{% else %}
|
||||||
|
<i class="fas fa-times pf-m-danger"></i> {% blocktrans with is=ver.version should=ver.should %}{{ is }}, should be {{ should }}{% endblocktrans %}
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<i class="fas fa-check pf-m-success"></i> {{ ver.version }}
|
<i class="fas fa-check pf-m-success"></i> {{ ver.version }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -63,7 +63,7 @@ class OutpostUpdateView(
|
||||||
|
|
||||||
template_name = "generic/update.html"
|
template_name = "generic/update.html"
|
||||||
success_url = reverse_lazy("passbook_admin:outposts")
|
success_url = reverse_lazy("passbook_admin:outposts")
|
||||||
success_message = _("Successfully updated Certificate-Key Pair")
|
success_message = _("Successfully updated Outpost")
|
||||||
|
|
||||||
|
|
||||||
class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView):
|
class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView):
|
||||||
|
@ -74,4 +74,4 @@ class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessa
|
||||||
|
|
||||||
template_name = "generic/delete.html"
|
template_name = "generic/delete.html"
|
||||||
success_url = reverse_lazy("passbook_admin:outposts")
|
success_url = reverse_lazy("passbook_admin:outposts")
|
||||||
success_message = _("Successfully deleted Certificate-Key Pair")
|
success_message = _("Successfully deleted Outpost")
|
||||||
|
|
|
@ -118,12 +118,12 @@ class Outpost(models.Model):
|
||||||
key = self.state_cache_prefix("version")
|
key = self.state_cache_prefix("version")
|
||||||
value = cache.get(key, None)
|
value = cache.get(key, None)
|
||||||
if not value:
|
if not value:
|
||||||
return {"version": "", "outdated": False}
|
return {"version": "", "outdated": False, "should": OUR_VERSION}
|
||||||
try:
|
try:
|
||||||
outpost_version = parse(value)
|
outpost_version = parse(value)
|
||||||
return {"version": value, "outdated": outpost_version < OUR_VERSION}
|
return {"version": value, "outdated": outpost_version < OUR_VERSION, "should": OUR_VERSION}
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
return {"version": version, "outdated": False}
|
return {"version": version, "outdated": False, "should": OUR_VERSION}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user(self) -> User:
|
def user(self) -> User:
|
||||||
|
|
Reference in New Issue