mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
upgrades: Run as background task (Closes: #285).
This commit is contained in:
1 parent
e69189c99c
commit
24cd095c6e
3 files changed
+121
-96
No files matched your search
@@ -20,23 +20,87 @@
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_head %}
|
||||
|
||||
{% if running %}
|
||||
<meta http-equiv="refresh" content="3"/>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>{{ title }}</h2>
|
||||
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
This will run unattended-upgrades, which will attempt to upgrade
|
||||
your system with the latest Debian packages. It may take a few
|
||||
minutes to complete.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% if result %}
|
||||
|
||||
<form class="form" method="post" action="{% url 'upgrades:run' %}">
|
||||
{% csrf_token %}
|
||||
{% if result.error %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{% trans "There was an error while upgrading." %}
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary"
|
||||
value="{% trans "Upgrade now »" %}"/>
|
||||
</form>
|
||||
<h5>{% trans "Output from unattended-upgrades:" %}</h5>
|
||||
|
||||
<pre>{{ result.error }}</pre>
|
||||
{% endif %}
|
||||
|
||||
{% if result.output %}
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="alert alert-success" role="alert">
|
||||
{% trans "The operating system is up to date now. " %}
|
||||
<button type="button" class="btn btn-default show-details"
|
||||
style='display:none'>
|
||||
{% trans "Show Details" %}
|
||||
<div class="caret"></div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
<h5>{% trans "Output from unattended-upgrades:" %}</h5>
|
||||
<pre>{{ result.output }}</pre>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if not result and not running %}
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
This will run unattended-upgrades, which will attempt to upgrade
|
||||
your system with the latest Debian packages. It may take a few
|
||||
minutes to complete.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<form class="form" method="post" action="{% url 'upgrades:run' %}">
|
||||
{% csrf_token %}
|
||||
|
||||
<input type="submit" class="btn btn-primary"
|
||||
value="{% trans "Upgrade now »" %}"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% if running %}
|
||||
<p class="running-status-parent">
|
||||
<span class="running-status active"></span>
|
||||
{% trans "Upgrade is running" %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block page_js %}
|
||||
<script>
|
||||
$('.show-details').show();
|
||||
$('.details').hide();
|
||||
$('.show-details').click(function() {
|
||||
$('.details').toggle("slow");
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,68 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
{% comment %}
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
{% endcomment %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>{{title}}</h2>
|
||||
|
||||
{% if upgrades_error %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{% trans "There was an error while upgrading." %}
|
||||
</div>
|
||||
|
||||
<h5>{% trans "Output from unattended-upgrades:" %}</h5>
|
||||
|
||||
<pre>{{ upgrades_error }}</pre>
|
||||
{% endif %}
|
||||
|
||||
{% if upgrades_output %}
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="alert alert-success" role="alert">
|
||||
{% trans "The operating system is up to date now. " %}
|
||||
<button type="button" class="btn btn-default show-details"
|
||||
style='display:none'>
|
||||
{% trans "Show Details" %}
|
||||
<div class="caret"></div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
<h5>{% trans "Output from unattended-upgrades:" %}</h5>
|
||||
<pre>{{ upgrades_output }}</pre>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block page_js %}
|
||||
<script>
|
||||
$('.show-details').show();
|
||||
$('.details').hide();
|
||||
$('.show-details').click(function() {
|
||||
$('.details').toggle("slow");
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user