diff --git a/src/js/yunohost/controllers/diagnosis.js b/src/js/yunohost/controllers/diagnosis.js index 6fb48f7b..78416697 100644 --- a/src/js/yunohost/controllers/diagnosis.js +++ b/src/js/yunohost/controllers/diagnosis.js @@ -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) { diff --git a/src/locales/en.json b/src/locales/en.json index 9e5f6fd8..e9d6272b 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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", diff --git a/src/views/diagnosis/diagnosis_show.ms b/src/views/diagnosis/diagnosis_show.ms index 1b7382f8..c5f3759c 100644 --- a/src/views/diagnosis/diagnosis_show.ms +++ b/src/views/diagnosis/diagnosis_show.ms @@ -11,7 +11,15 @@
-
{{t 'diagnosis_experimental_disclaimer'}}
+{{#unless reports}} +
+

{{t 'diagnosis_first_run'}}

+
+ +
+{{/unless}} + +
{{t 'diagnosis_experimental_disclaimer'}}
{{#reports}}