display the instance version on the checkup page

pull/1/head
ansuz 4 years ago
parent eb32651c67
commit fe41ca36bc

@ -72,6 +72,9 @@ html, body {
color: @cryptpad_color_link; color: @cryptpad_color_link;
} }
} }
.cp-app-checkup-version {
text-decoration: underline;
}
iframe { iframe {
display: none; display: none;

@ -12,13 +12,14 @@ define([
'/common/common-util.js', '/common/common-util.js',
'/common/pinpad.js', '/common/pinpad.js',
'/common/outer/network-config.js', '/common/outer/network-config.js',
'/customize/pages.js',
'/bower_components/tweetnacl/nacl-fast.min.js', '/bower_components/tweetnacl/nacl-fast.min.js',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
'less!/checkup/app-checkup.less', 'less!/checkup/app-checkup.less',
], function ($, ApiConfig, Assertions, h, Messages, DomReady, ], function ($, ApiConfig, Assertions, h, Messages, DomReady,
nThen, SFCommonO, Login, Hash, Util, Pinpad, nThen, SFCommonO, Login, Hash, Util, Pinpad,
NetConfig) { NetConfig, Pages) {
var Assert = Assertions(); var Assert = Assertions();
var trimSlashes = function (s) { var trimSlashes = function (s) {
if (typeof(s) !== 'string') { return s; } if (typeof(s) !== 'string') { return s; }
@ -516,6 +517,13 @@ define([
cb(false); cb(false);
}); });
if (false) {
assert(function (cb, msg) {
msg.innerText = 'fake test to simulate failure';
cb(false);
});
}
var row = function (cells) { var row = function (cells) {
return h('tr', cells.map(function (cell) { return h('tr', cells.map(function (cell) {
return h('td', cell); return h('td', cell);
@ -534,6 +542,19 @@ define([
var completed = 0; var completed = 0;
var $progress = $('#cp-progress'); var $progress = $('#cp-progress');
var versionStatement = function () {
return h('p', [
"This instance is running ",
h('span.cp-app-checkup-version',[
"CryptPad",
' ',
Pages.versionString,
]),
'.',
]);
};
Assert.run(function (state) { Assert.run(function (state) {
var errors = state.errors; var errors = state.errors;
var failed = errors.length; var failed = errors.length;
@ -543,10 +564,11 @@ define([
var statusClass = failed? 'failure': 'success'; var statusClass = failed? 'failure': 'success';
var failedDetails = "Details found below"; var failedDetails = "Details found below";
var successDetails = "This checkup only tests the most common configuration issues. You may still experience errors."; var successDetails = "This checkup only tests the most common configuration issues. You may still experience errors or incorrect behaviour.";
var details = h('p', failed? failedDetails: successDetails); var details = h('p', failed? failedDetails: successDetails);
var summary = h('div.summary.' + statusClass, [ var summary = h('div.summary.' + statusClass, [
versionStatement(),
h('p', Messages._getKey('assert_numberOfTestsPassed', [ h('p', Messages._getKey('assert_numberOfTestsPassed', [
state.passed, state.passed,
state.total state.total
@ -566,6 +588,7 @@ define([
completed++; completed++;
Messages.assert_numberOfTestsCompleted = "{0} / {1} tests completed."; Messages.assert_numberOfTestsCompleted = "{0} / {1} tests completed.";
$progress.html('').append(h('div.report.pending.summary', [ $progress.html('').append(h('div.report.pending.summary', [
versionStatement(),
h('p', [ h('p', [
h('i.fa.fa-spinner.fa-pulse'), h('i.fa.fa-spinner.fa-pulse'),
h('span', Messages._getKey('assert_numberOfTestsCompleted', [completed, total])) h('span', Messages._getKey('assert_numberOfTestsCompleted', [completed, total]))

Loading…
Cancel
Save