Use the new diagnosis system to display the version number

This commit is contained in:
Alexandre Aubin 2019-11-06 23:47:23 +01:00
parent 3c9c3fc926
commit e39d00956b
3 changed files with 8 additions and 11 deletions

View file

@ -54,7 +54,6 @@
// We want filter_args to be something like "dnsrecords,domain=yolo.test,category=xmpp"
data.reports[i].items[j].filter_args = data.reports[i].id;
for (prop in data.reports[i].items[j].meta) {
console.log(prop)
data.reports[i].items[j].filter_args = data.reports[i].items[j].filter_args + ","+prop+"="+data.reports[i].items[j].meta[prop];
}
};

View file

@ -69,13 +69,10 @@
c.flash('fail', y18n.t('error_retrieve_feed', [securityFeed]));
});
c.api("GET", "/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'));
}
c.hideLoader();
c.api("GET", "/diagnosis/show?full", {}, function(data) {
basesystem = data.reports.filter(function(r) { return r.id == "basesystem"; })[0];
version_info = basesystem.items.filter(function(i) { return (i.meta && i.meta.test && i.meta.test == "ynh_versions"); })[0];
$('#yunohost-version').html(y18n.t('footer_version', [version_info.data.main_version, version_info.data.repo]));
});
});
});

View file

@ -181,9 +181,10 @@
sam.store.set('url', window.location.hostname + '/yunohost/api');
if (sam.store.get('connected')) {
this.api('GET', '/diagnosis', {}, function(diagnosis) {
versions = diagnosis.packages;
$('#yunohost-version').html(y18n.t('footer_version', [versions.yunohost.version, versions.yunohost.repo]));
this.api('GET', '/diagnosis/show?full', {}, function(data) {
basesystem = data.reports.filter(function(r) { return r.id == "basesystem"; })[0];
version_info = basesystem.items.filter(function(i) { return (i.meta && i.meta.test && i.meta.test == "ynh_versions"); })[0];
$('#yunohost-version').html(y18n.t('footer_version', [version_info.data.main_version, version_info.data.repo]));
});
}