[Web] More custom_params

This commit is contained in:
andryyy
2020-11-06 14:26:48 +01:00
parent 8dce12dbfa
commit b9a8b8a3e7
25 changed files with 158 additions and 123 deletions

View File

@@ -16,10 +16,11 @@ jQuery(function($){
$('#qid_detail_subj').text(data.subject);
$('#qid_detail_hfrom').text(data.header_from);
$('#qid_detail_efrom').text(data.env_from);
$('#qid_detail_score').text(data.score);
$('#qid_detail_score').html('');
$('#qid_detail_symbols').html('');
$('#qid_detail_recipients').html('');
$('#qid_detail_fuzzy').html('');
if (data.fuzzy_hashes !== null) {
if (typeof data.fuzzy_hashes === 'object' && data.fuzzy_hashes !== null && data.fuzzy_hashes.length !== 0) {
$.each(data.fuzzy_hashes, function (index, value) {
$('#qid_detail_fuzzy').append('<p style="font-family:monospace">' + value + '</p>');
});
@@ -47,7 +48,13 @@ jQuery(function($){
});
$('[data-toggle="tooltip"]').tooltip()
}
$('#qid_detail_recipients').html('');
if (typeof data.score !== 'undefined' && typeof data.action !== 'undefined') {
if (data.action === "add header") {
$('#qid_detail_score').append('<span class="label-rspamd-action label label-warning"><b>' + data.score + '</b> - ' + lang.junk_folder + '</span>');
} else {
$('#qid_detail_score').append('<span class="label-rspamd-action label label-danger"><b>' + data.score + '</b> - ' + lang.rejected + '</span>');
}
}
if (typeof data.recipients !== 'undefined') {
$.each(data.recipients, function(index, value) {
var elem = $('<span class="mail-address-item"></span>');

View File

@@ -52,6 +52,7 @@ jQuery(function($){
{"name":"qid","breakpoints":"all","type":"text","title":lang.qid,"style":{"width":"125px"}},
{"name":"sender","title":lang.sender},
{"name":"subject","title":lang.subj, "type": "text"},
{"name":"rspamdaction","title":lang.rspamd_result, "type": "html"},
{"name":"rcpt","title":lang.rcpt, "breakpoints":"xs sm md", "type": "text"},
{"name":"virus","title":lang.danger, "type": "text"},
{"name":"score","title": lang.spam_score, "type": "text"},
@@ -77,9 +78,14 @@ jQuery(function($){
item.score = '-';
}
if (item.virus_flag > 0) {
item.virus = '<span class="dot-danger"></span>';
item.virus = '<span class="label label-danger">' + lang.high_danger + '</span>';
} else {
item.virus = '<span class="dot-neutral"></span>';
item.virus = '<span class="label label-default">' + lang.neutral_danger + '</span>';
}
if (item.action === "reject") {
item.rspamdaction = '<span class="label label-danger">' + lang.rejected + '</span>';
} else if (item.action === "add header") {
item.rspamdaction = '<span class="label label-warning">' + lang.junk_folder + '</span>';
}
if(item.notified > 0) {
item.notified = '&#10004;';
@@ -142,11 +148,10 @@ jQuery(function($){
});
$('#qid_detail_subj').text(data.subject);
$('#qid_detail_text').text(data.text_plain);
$('#qid_detail_text_from_html').text(data.text_html);
$('#qid_detail_hfrom').text(data.header_from);
$('#qid_detail_efrom').text(data.env_from);
$('#qid_detail_score').text(data.score);
$('#qid_detail_score').html('');
$('#qid_detail_recipients').html('');
$('#qid_detail_symbols').html('');
$('#qid_detail_fuzzy').html('');
if (typeof data.symbols !== 'undefined') {
@@ -170,14 +175,20 @@ jQuery(function($){
});
$('[data-toggle="tooltip"]').tooltip()
}
if (data.fuzzy_hashes !== null) {
if (typeof data.fuzzy_hashes === 'object' && data.fuzzy_hashes !== null && data.fuzzy_hashes.length !== 0) {
$.each(data.fuzzy_hashes, function (index, value) {
$('#qid_detail_fuzzy').append('<p style="font-family:monospace">' + value + '</p>');
});
} else {
$('#qid_detail_fuzzy').append('-');
}
$('#qid_detail_recipients').html('');
if (typeof data.score !== 'undefined' && typeof data.action !== 'undefined') {
if (data.action == "add header") {
$('#qid_detail_score').append('<span class="label-rspamd-action label label-warning"><b>' + data.score + '</b> - ' + lang.junk_folder + '</span>');
} else {
$('#qid_detail_score').append('<span class="label-rspamd-action label label-danger"><b>' + data.score + '</b> - ' + lang.rejected + '</span>');
}
}
if (typeof data.recipients !== 'undefined') {
$.each(data.recipients, function(index, value) {
var elem = $('<span class="mail-address-item"></span>');
@@ -185,7 +196,8 @@ jQuery(function($){
$('#qid_detail_recipients').append(elem);
});
}
$('#qid_detail_text').text(data.text_plain);
$('#qid_detail_text_from_html').text(data.text_html);
var qAtts = $("#qid_detail_atts");
if (typeof data.attachments !== 'undefined') {
qAtts.text('');