[enh] Warn about delayed upgrades #52.

This commit is contained in:
opi 2014-07-03 14:54:58 +02:00
parent b8395c4b99
commit f3c3607558
4 changed files with 16 additions and 0 deletions

View file

@ -1411,7 +1411,14 @@ app = Sammy('#main', function (sam) {
c.api('/update', function(data) { c.api('/update', function(data) {
packagesLength = data.packages.length; packagesLength = data.packages.length;
for(var i = 0; i < packagesLength; i++) { for(var i = 0; i < packagesLength; i++) {
data.packages[i].delayed = false;
data.packages[i].changelog = data.packages[i].changelog.replace(/\n/g, '<br />'); data.packages[i].changelog = data.packages[i].changelog.replace(/\n/g, '<br />');
// Check for special packages that need delayed upgrade.
if (["moulinette", "moulinette-yunohost", "yunohost-admin", "yunohost-config-nginx", "ssowat", "python"].indexOf(data.packages[i].name) != -1) {
c.flash('warning', y18n.t('system_delayed_upgrade_warning', [data.packages[i].name]));
data.packages[i].delayed = true;
}
} }
c.view('tools/tools_update', data); c.view('tools/tools_update', data);
}, 'PUT'); }, 'PUT');

View file

@ -207,6 +207,8 @@
"system_packages_nothing" : "There is no packages to upgrade.", "system_packages_nothing" : "There is no packages to upgrade.",
"system_apps_nothing" : "There is no apps to upgrade.", "system_apps_nothing" : "There is no apps to upgrade.",
"no_log" : "No log.", "no_log" : "No log.",
"system_delayed_upgrade_warning" : "<b>%s</b> will be upgraded automatically within the next hour.",
"system_delayed_upgrade" : "Delayed upgrade",
"users" : "Users", "users" : "Users",
"users_new" : "New user", "users_new" : "New user",

View file

@ -209,6 +209,8 @@
"system_packages_nothing" : "Il n'y a aucun paquet à mettre à jour.", "system_packages_nothing" : "Il n'y a aucun paquet à mettre à jour.",
"system_apps_nothing" : "Il n'y a aucune application à mettre à jour.", "system_apps_nothing" : "Il n'y a aucune application à mettre à jour.",
"no_log" : "Aucun journal.", "no_log" : "Aucun journal.",
"system_delayed_upgrade_warning" : "<b>%s</b> sera mis-à-jour automatiquement durant l'heure suivante.",
"system_delayed_upgrade" : "Mise à jour en attente",
"users" : "Utilisateurs", "users" : "Utilisateurs",
"users_new" : "Nouvel utilisateur", "users_new" : "Nouvel utilisateur",

View file

@ -15,6 +15,11 @@
{{#if packages}} {{#if packages}}
{{#packages}} {{#packages}}
<div class="list-group-item"> <div class="list-group-item">
{{#if delayed}}
<span class="text-warning pull-right">
<span class="fa-warning"></span> {{t 'system_delayed_upgrade'}}
</span>
{{/if}}
<h3 class="list-group-item-heading">{{name}} <small>{{fullname}}</small></h3> <h3 class="list-group-item-heading">{{name}} <small>{{fullname}}</small></h3>
<p class="list-group-item-text">{{{changelog}}}</p> <p class="list-group-item-text">{{{changelog}}}</p>
</div> </div>