mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Propagate tools_update and tools_upgrade api changes
This commit is contained in:
parent
34f22ee7de
commit
27a07d0956
3 changed files with 8 additions and 32 deletions
|
@ -49,23 +49,13 @@
|
||||||
// System update & upgrade
|
// System update & upgrade
|
||||||
app.get('#/update', function (c) {
|
app.get('#/update', function (c) {
|
||||||
c.api('/update', function(data) {
|
c.api('/update', function(data) {
|
||||||
var packagesLength = data.packages.length;
|
|
||||||
for(var i = 0; i < packagesLength; i++) {
|
|
||||||
data.packages[i].delayed = false;
|
|
||||||
|
|
||||||
// Check for special packages that need delayed upgrade.
|
|
||||||
if (["moulinette", "yunohost", "yunohost-admin", "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('update/update', data);
|
c.view('update/update', data);
|
||||||
}, 'PUT');
|
}, 'PUT');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Upgrade apps or packages
|
// Upgrade apps or packages
|
||||||
app.get('#/upgrade/:type', function (c) {
|
app.get('#/upgrade/:type', function (c) {
|
||||||
if (c.params['type'] !== 'apps' && c.params['type'] !== 'packages') {
|
if (c.params['type'] !== 'apps' && c.params['type'] !== 'system') {
|
||||||
c.flash('fail', y18n.t('unknown_argument', [c.params['type']]));
|
c.flash('fail', y18n.t('unknown_argument', [c.params['type']]));
|
||||||
store.clear('slide');
|
store.clear('slide');
|
||||||
c.redirect('#/update');
|
c.redirect('#/update');
|
||||||
|
@ -76,16 +66,9 @@
|
||||||
// confirm_update_apps and confirm_update_packages
|
// confirm_update_apps and confirm_update_packages
|
||||||
y18n.t('confirm_update_' + c.params['type'].toLowerCase()),
|
y18n.t('confirm_update_' + c.params['type'].toLowerCase()),
|
||||||
function(){
|
function(){
|
||||||
var endurl = '';
|
c.api('/upgrade?'+c.params["type"], function(data) {
|
||||||
if (c.params['type'] == 'packages') {endurl = 'ignore_apps';}
|
c.view('home', data);
|
||||||
else if (c.params['type'] == 'apps') {endurl = 'ignore_packages';}
|
|
||||||
|
|
||||||
c.api('/upgrade?'+endurl, function(data) {
|
|
||||||
// 'log' is a reserved name, maybe in handlebars
|
|
||||||
data.logs = data.log;
|
|
||||||
c.view('upgrade/upgrade', data);
|
|
||||||
}, 'PUT');
|
}, 'PUT');
|
||||||
|
|
||||||
},
|
},
|
||||||
function(){
|
function(){
|
||||||
store.clear('slide');
|
store.clear('slide');
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
"confirm_service_disable": "Are you sure you want to disable %s?",
|
"confirm_service_disable": "Are you sure you want to disable %s?",
|
||||||
"confirm_uninstall": "Are you sure you want to uninstall %s?",
|
"confirm_uninstall": "Are you sure you want to uninstall %s?",
|
||||||
"confirm_update_apps": "Are you sure you want to update all applications?",
|
"confirm_update_apps": "Are you sure you want to update all applications?",
|
||||||
"confirm_update_packages": "Are you sure you want to update all packages?",
|
"confirm_update_system": "Are you sure you want to update all system packages?",
|
||||||
"confirm_update_specific_app": "Are you sure you want to update %s?",
|
"confirm_update_specific_app": "Are you sure you want to update %s?",
|
||||||
"confirm_upnp_enable": "Are you sure you want to enable UPnP?",
|
"confirm_upnp_enable": "Are you sure you want to enable UPnP?",
|
||||||
"confirm_upnp_disable": "Are you sure you want to disable UPnP?",
|
"confirm_upnp_disable": "Are you sure you want to disable UPnP?",
|
||||||
|
@ -306,8 +306,6 @@
|
||||||
"system": "System",
|
"system": "System",
|
||||||
"system_apps": "Apps",
|
"system_apps": "Apps",
|
||||||
"system_apps_nothing": "There are no apps to upgrade.",
|
"system_apps_nothing": "There are no apps to upgrade.",
|
||||||
"system_delayed_upgrade": "Delayed upgrade",
|
|
||||||
"system_delayed_upgrade_warning": "<b>%s</b> will be upgraded automatically within the next hour.",
|
|
||||||
"system_packages": "Packages",
|
"system_packages": "Packages",
|
||||||
"system_packages_nothing": "There are no packages to upgrade.",
|
"system_packages_nothing": "There are no packages to upgrade.",
|
||||||
"system_update": "System update",
|
"system_update": "System update",
|
||||||
|
|
|
@ -9,23 +9,18 @@
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h2 class="panel-title"><span class="fa-fw fa-cube"></span> {{t 'system'}}</h2>
|
<h2 class="panel-title"><span class="fa-fw fa-cube"></span> {{t 'system'}}</h2>
|
||||||
</div>
|
</div>
|
||||||
{{#if packages}}
|
{{#if system}}
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
{{#packages}}
|
{{#system}}
|
||||||
<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">
|
<h3 class="list-group-item-heading">
|
||||||
{{name}} <small>{{fullname}}</small>
|
{{name}} <small>{{fullname}}</small>
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
{{/packages}}
|
{{/system}}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
<a href="#/upgrade/packages" role="button" class="btn btn-success">{{t 'system_upgrade_all_packages_btn'}}</a>
|
<a href="#/upgrade/system" role="button" class="btn btn-success">{{t 'system_upgrade_all_packages_btn'}}</a>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
Loading…
Add table
Reference in a new issue