Implement button to rerun the diagnosis

This commit is contained in:
Alexandre Aubin 2018-09-01 00:12:35 +00:00
parent 75ab8a3d76
commit dbf8c8af85
3 changed files with 20 additions and 2 deletions

View file

@ -31,6 +31,7 @@
issue = true; issue = true;
} }
else if (type_ == "error") { else if (type_ == "error") {
type_ = "danger";
icon = "times"; icon = "times";
issue = true; issue = true;
} }
@ -39,7 +40,21 @@
data.reports[i].reports[j].issue = issue; data.reports[i].reports[j].issue = issue;
}; };
}; };
c.view('diagnosis/diagnosis_show', data); c.view('diagnosis/diagnosis_show', data, function() {
$(".rerun-diagnosis").click(function() {
var category = $(this).attr("category");
c.api('/diagnosis/run', function(data) {
// This is a copy-pasta of some of the
// redirect/refresh code of sammy.js
// because for some reason calling the function did not work >.>
var to = "#/diagnosis";
c.trigger('redirect', {to: to});
c.app.last_location = c.path;
c.app.setLocation(to);
c.app.trigger('location-changed');
}, 'POST', {"categories": [category], "force":true});
});
});
}, 'GET'); }, 'GET');
}); });

View file

@ -110,6 +110,7 @@
"default": "Default", "default": "Default",
"delete": "Delete", "delete": "Delete",
"description": "Description", "description": "Description",
"details": "Details",
"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.", "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": "Diagnosis",
"diagnosis_hide_private": "Show diagnostic information without private data", "diagnosis_hide_private": "Show diagnostic information without private data",
@ -177,6 +178,7 @@
"hook_data_mail_desc": "Raw emails stored on the server", "hook_data_mail_desc": "Raw emails stored on the server",
"hostname": "Hostname", "hostname": "Hostname",
"id": "ID", "id": "ID",
"ignore": "Ignore",
"inactive": "Inactive", "inactive": "Inactive",
"infos": "Info", "infos": "Info",
"install": "Install", "install": "Install",
@ -288,6 +290,7 @@
"read": "Read", "read": "Read",
"read_more": "Read more", "read_more": "Read more",
"reception": "Reception", "reception": "Reception",
"rerun_diagnosis": "Rerun diagnosis",
"refresh_app_list": "Refresh list", "refresh_app_list": "Refresh list",
"remove_access": "Remove access", "remove_access": "Remove access",
"request_adoption": "waiting adoption", "request_adoption": "waiting adoption",

View file

@ -9,7 +9,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h2 class="panel-title" style="display: inline-block">{{ 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> <a role="button" category="{{ id }}" class="btn btn-sm btn-info pull-right rerun-diagnosis"><span class="fa-fw fa-refresh"></span> {{t 'rerun_diagnosis'}}</a>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<ul class="list-group"> <ul class="list-group">