diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index bcf7a408..b6bf64c3 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -148,11 +148,26 @@ }); - // Security feed + // Packages version app.get('#/tools/versions', function (c) { c.api('/version', function(versions) { c.view('tools/tools_versions', {'versions' : versions}); }); }); + // Diagnosis + app.get('#/tools/diagnosis(/:private)?', function (c) { + // See http://sammyjs.org/docs/routes for splat documentation + private = (c.params.splat[0] == 'private'); + + endurl = (private) ? '?private' : ''; + c.api('/diagnosis'+endurl, function(diagnosis) { + c.view('tools/tools_diagnosis', { + 'diagnosis' : JSON.stringify(diagnosis, undefined, 4), + 'raw' : diagnosis, + 'private' : private + }); + }); + }); + })(); \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index ed975821..122f5bc6 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -302,5 +302,10 @@ "storage_create": "Add a remote storage", "confirm_restore": "Are you sure you want to restore %s ?", "backup_type": "Type", - "path": "Path" + "path": "Path", + + "diagnosis" : "Diagnosis", + "diagnosis_with_private" : "Diagnosis with private data", + "diagnosis_view_private" : "Show diagnosis with private data", + "diagnosis_hide_private" : "Show diagnosis without private data" } diff --git a/src/views/tools/tools_diagnosis.ms b/src/views/tools/tools_diagnosis.ms new file mode 100644 index 00000000..6a2db2da --- /dev/null +++ b/src/views/tools/tools_diagnosis.ms @@ -0,0 +1,24 @@ +
+ {{t 'home'}} + {{t 'tools'}} + {{t 'diagnosis'}} + {{#private}} + {{t 'diagnosis_with_private'}} + {{/private}} +
+ +
+ +
+
+

{{t 'diagnosis'}}

+
+
+
{{ diagnosis }}
+ {{#if private}} + {{t 'diagnosis_hide_private'}} + {{else}} + {{t 'diagnosis_view_private'}} + {{/if}} +
+
diff --git a/src/views/tools/tools_list.ms b/src/views/tools/tools_list.ms index 7a7b5d42..add62158 100644 --- a/src/views/tools/tools_list.ms +++ b/src/views/tools/tools_list.ms @@ -7,6 +7,10 @@
+ + +

{{t 'diagnosis'}}

+

{{t 'monitoring'}}