[enh] Add diagnosis. #39

This commit is contained in:
opi 2016-03-14 11:19:02 +01:00
parent fb26b86c22
commit a23cad09ab
4 changed files with 50 additions and 2 deletions

View file

@ -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
});
});
});
})();

View file

@ -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"
}

View file

@ -0,0 +1,24 @@
<div class="btn-breadcrumb">
<a href="#/" ><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
<a href="#/tools">{{t 'tools'}}</a>
<a href="#/tools/diagnosis">{{t 'diagnosis'}}</a>
{{#private}}
<a href="#/tools/diagnosis/private">{{t 'diagnosis_with_private'}}</a>
{{/private}}
</div>
<div class="separator"></div>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title"><span class="fa-fw fa-stethoscope"></span> {{t 'diagnosis'}}</h2>
</div>
<div class="panel-body">
<pre>{{ diagnosis }}</pre>
{{#if private}}
<a class="btn btn-primary" href="#/tools/diagnosis">{{t 'diagnosis_hide_private'}}</a>
{{else}}
<a class="btn btn-primary" href="#/tools/diagnosis/private">{{t 'diagnosis_view_private'}}</a>
{{/if}}
</div>
</div>

View file

@ -7,6 +7,10 @@
<div class="list-group">
<a href="#/tools/diagnosis" class="list-group-item slide clearfix">
<span class="pull-right fa-chevron-right"></span>
<h2 class="list-group-item-heading">{{t 'diagnosis'}}</h2>
</a>
<a href="#/tools/monitor" class="list-group-item slide clearfix">
<span class="pull-right fa-chevron-right"></span>
<h2 class="list-group-item-heading">{{t 'monitoring'}}</h2>