Improving code readability for lists (index.js and db_lists.js) (#1994)

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2021-12-18 09:15:24 -03:00
committed by GitHub
parent b94884ae17
commit 7927ac1815
3 changed files with 48 additions and 77 deletions

View File

@@ -85,17 +85,11 @@ function updateTopClientsChart() {
percentage = (data.top_sources[client] / sum) * 100;
clienttable.append(
"<tr> <td>" +
clientname +
"</td> <td>" +
data.top_sources[client] +
'</td> <td> <div class="progress progress-sm" title="' +
percentage.toFixed(1) +
"% of " +
sum +
'"> <div class="progress-bar progress-bar-blue" style="width: ' +
percentage +
'%"></div> </div> </td> </tr> '
"<tr> " +
utils.addTD(clientname) +
utils.addTD(data.top_sources[client]) +
utils.addTD(utils.colorBar(percentage, sum, "progress-bar-blue")) +
"</tr> "
);
}
}
@@ -132,17 +126,11 @@ function updateTopDomainsChart() {
percentage = (data.top_domains[domain] / sum) * 100;
domaintable.append(
"<tr> <td>" +
domain +
"</td> <td>" +
data.top_domains[domain] +
'</td> <td> <div class="progress progress-sm" title="' +
percentage.toFixed(1) +
"% of " +
sum +
'"> <div class="progress-bar queries-permitted" style="width: ' +
percentage +
'%"></div> </div> </td> </tr> '
"<tr> " +
utils.addTD(domain) +
utils.addTD(data.top_domains[domain]) +
utils.addTD(utils.colorBar(percentage, sum, "queries-permitted")) +
"</tr> "
);
}
}
@@ -179,17 +167,11 @@ function updateTopAdsChart() {
percentage = (data.top_ads[ad] / sum) * 100;
adtable.append(
"<tr> <td>" +
ad +
"</td> <td>" +
data.top_ads[ad] +
'</td> <td> <div class="progress progress-sm" title="' +
percentage.toFixed(1) +
"% of " +
sum +
'"> <div class="progress-bar queries-blocked" style="width: ' +
percentage +
'%"></div> </div> </td> </tr> '
"<tr> " +
utils.addTD(ad) +
utils.addTD(data.top_ads[ad]) +
utils.addTD(utils.colorBar(percentage, sum, "queries-blocked")) +
"</tr> "
);
}
}