mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Add recheck / details and ignore button to the view
This commit is contained in:
parent
948872b727
commit
75ab8a3d76
2 changed files with 20 additions and 7 deletions
|
@ -12,28 +12,34 @@
|
||||||
|
|
||||||
// Why this method ?
|
// Why this method ?
|
||||||
c.api('/diagnosis/show', function(data) {
|
c.api('/diagnosis/show', function(data) {
|
||||||
console.log(data);
|
|
||||||
c.view('diagnosis/diagnosis_show', data);
|
|
||||||
for (var i = 0 ; i < data.reports.length ; i++)
|
for (var i = 0 ; i < data.reports.length ; i++)
|
||||||
{
|
{
|
||||||
|
// Convert timestamp to datetime
|
||||||
|
data.reports[i].time = new Date(data.reports[i].timestamp*1000);
|
||||||
for (var j = 0 ; j < data.reports[i].reports.length ; j++)
|
for (var j = 0 ; j < data.reports[i].reports.length ; j++)
|
||||||
{
|
{
|
||||||
var type_ = data.reports[i].reports[j].report[0];
|
var type_ = data.reports[i].reports[j].report[0];
|
||||||
type_ = type_.toLowerCase();
|
type_ = type_.toLowerCase();
|
||||||
var icon = "";
|
var icon = "";
|
||||||
|
var issue = false;
|
||||||
|
|
||||||
if (type_ == "success") {
|
if (type_ == "success") {
|
||||||
icon = "check-circle";
|
icon = "check-circle";
|
||||||
}
|
}
|
||||||
else if (type_ == "warning") {
|
else if (type_ == "warning") {
|
||||||
icon = "warning";
|
icon = "warning";
|
||||||
|
issue = true;
|
||||||
}
|
}
|
||||||
else if (type_ == "error") {
|
else if (type_ == "error") {
|
||||||
icon = "times";
|
icon = "times";
|
||||||
|
issue = true;
|
||||||
}
|
}
|
||||||
data.reports[i].reports[j].report[0] = type_;
|
data.reports[i].reports[j].report[0] = type_;
|
||||||
data.reports[i].reports[j].report.push(icon);
|
data.reports[i].reports[j].icon = icon;
|
||||||
|
data.reports[i].reports[j].issue = issue;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
c.view('diagnosis/diagnosis_show', data);
|
||||||
}, 'GET');
|
}, 'GET');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,16 +8,23 @@
|
||||||
{{#reports}}
|
{{#reports}}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h2 class="panel-title">{{ description }}</h2>
|
<h2 class="panel-title" style="display: inline-block">{{ description }}</h2>
|
||||||
|
<a href="#" role="button" class="btn btn-sm btn-info pull-right"><span class="fa-fw fa-refresh"></span> {{t 'recheck'}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
|
<p>Last time ran : {{formatRelative time}}</p>
|
||||||
{{#reports}}
|
{{#reports}}
|
||||||
<li class="list-group-item alert alert-{{report.[0]}} alert-{{report.[0]}}-yo">
|
<li class="list-group-item alert alert-{{report.[0]}} alert-{{report.[0]}}-yo clearfix">
|
||||||
{{#if report.[2]}}
|
{{#if icon}}
|
||||||
<span class="fa-fw fa-{{report.[2]}}"></span>
|
<span class="fa-fw fa-{{icon}}"></span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{report.[1]}}
|
{{report.[1]}}
|
||||||
|
{{#if issue}}
|
||||||
|
<a href="#" role="button" class="btn btn-sm btn-warning pull-right" style="margin: -5px 5px"><span class="fa-fw fa-times"></span> {{t 'ignore'}}</a>
|
||||||
|
<a href="#" role="button" class="btn btn-sm btn-default pull-right" style="margin: -5px 5px"><span class="fa-fw fa-level-down"></span>{{t 'details'}}</a>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
{{/reports}}
|
{{/reports}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Add table
Reference in a new issue