Handle the didn't-run-diagnosis-ever-yet case

This commit is contained in:
Alexandre Aubin 2020-03-18 01:31:29 +01:00
parent 7cd3b19017
commit 9e0f2f746a
3 changed files with 23 additions and 1 deletions

View file

@ -10,6 +10,11 @@
app.get('#/diagnosis', function (c) {
c.api('GET', '/diagnosis/show?full', {}, function(data) {
if (typeof(data.reports) === "undefined")
{
data.reports = [];
}
// Prepare data to be displayed ...
for (var i = 0 ; i < data.reports.length ; i++)
{
@ -63,6 +68,13 @@
// Render and display the view
c.view('diagnosis/diagnosis_show', data, function() {
// Button for first diagnosis
$("button[data-action='run-full-diagnosis']").click(function() {
c.api('POST', '/diagnosis/run', {}, function(data) {
c.refresh();
});
});
// Configure share with yunopaste button
$("button[data-action='share']").click(function() {
c.api('GET', '/diagnosis/show?share', {}, function(data) {

View file

@ -96,6 +96,8 @@
"domain_dns_conf_is_just_a_recommendation": "This page shows you the *recommended* configuration. It does *not* configure the DNS for you. It is your responsability to configure your DNS zone in your DNS registrar according to this recommendation.",
"diagnosis": "Diagnosis",
"diagnosis_experimental_disclaimer": "Be aware that the diagnosis feature is still experimental and being polished, and it may not be fully reliable.",
"diagnosis_first_run": "The diagnosis feature will attempt to identify common issues on the different aspects of your server to help you make sure that everything works as smoothly as possible.",
"run_first_diagnosis": "Run initial diagnosis",
"disable": "Disable",
"disabled": "Disabled",
"dns": "DNS",

View file

@ -11,7 +11,15 @@
<div class="separator"></div>
<div class="alert alert-warning">{{t 'diagnosis_experimental_disclaimer'}}</div>
{{#unless reports}}
<div class="alert alert-info text-center">
<p>{{t 'diagnosis_first_run'}}</p>
<br>
<button class="btn btn-info" data-action="run-full-diagnosis"><span class="fa-fw fa-stethoscope"></span> {{t 'run_first_diagnosis'}}</button>
</div>
{{/unless}}
<div class="alert alert-warning text-center">{{t 'diagnosis_experimental_disclaimer'}}</div>
{{#reports}}
<div class="panel panel-default">