Remove calls to /version, use /diagnosis instead

This commit is contained in:
Alexandre Aubin 2019-02-04 23:55:21 +00:00
parent 5beb60d9cb
commit 28c788f38e
5 changed files with 7 additions and 15 deletions

View file

@ -78,6 +78,8 @@
});
c.api("/diagnosis", function(data) {
versions = data.packages;
$('#yunohost-version').html(y18n.t('footer_version', [versions.yunohost.version, versions.yunohost.repo]));
if (data.security["CVE-2017-5754"].vulnerable) {
c.flash('danger', y18n.t('meltdown'));
}

View file

@ -30,8 +30,8 @@
delete monitorData.network.usage.lo;
// Get YunoHost versions too
c.api('/version', function(versions) {
monitorData.versions = versions;
c.api('/diagnosis', function(diagnosis) {
monitorData.versions = diagnosis.packages;
c.view('tools/tools_monitoring', monitorData);
});
});
@ -47,4 +47,4 @@
}, 'GET');
});
})();
})();

View file

@ -223,8 +223,8 @@
// Packages version
app.get('#/tools/versions', function (c) {
c.api('/version', function(versions) {
c.view('tools/tools_versions', {'versions' : versions});
c.api('/diagnosis', function(diagnosis) {
c.view('tools/tools_versions', {'versions' : diagnosis.packages });
});
});

View file

@ -8,9 +8,6 @@
*
*/
app.bind('login', function(e, data) {
this.api('/version', function(versions) {
$('#yunohost-version').html(y18n.t('footer_version', [versions.yunohost.version, versions.yunohost.repo]));
});
});
app.bind('logout', function(e, data) {

View file

@ -149,13 +149,6 @@
// Store url
sam.store.set('url', window.location.hostname + '/yunohost/api');
// Get YunoHost version
if (sam.store.get('connected')) {
this.api('/version', function(versions) {
$('#yunohost-version').html(y18n.t('footer_version', [versions.yunohost.version, versions.yunohost.repo]));
});
}
// Flash messages
var flashMessage = $('#flashMessage');
$('#toggle-btn', flashMessage).click(function(e) {