A touch more abstraction.
This commit is contained in:
parent
ed43a27e46
commit
b9ba87e7d3
|
|
@ -442,6 +442,11 @@ function fmt_resource_bar(used_label, limit_label, ratio, colour, help) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fmt_resource_bar_count(used, total, thresholds) {
|
||||||
|
return fmt_resource_bar(used, total + ' available', used / total,
|
||||||
|
fmt_color(used / total, thresholds));
|
||||||
|
}
|
||||||
|
|
||||||
function fmt_shortened_uri(uri0) {
|
function fmt_shortened_uri(uri0) {
|
||||||
var uri = fmt_escape_html(uri0);
|
var uri = fmt_escape_html(uri0);
|
||||||
if (uri.indexOf('?') == -1) {
|
if (uri.indexOf('?') == -1) {
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,7 @@
|
||||||
File descriptors <span class="help" id="file-descriptors"></span>
|
File descriptors <span class="help" id="file-descriptors"></span>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<%= fmt_resource_bar(node.fd_used,
|
<%= fmt_resource_bar_count(node.fd_used, node.fd_total, FD_THRESHOLDS) %>
|
||||||
node.fd_total + ' available',
|
|
||||||
node.fd_used / node.fd_total,
|
|
||||||
fmt_color(node.fd_used / node.fd_total, FD_THRESHOLDS)) %>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -25,11 +22,7 @@
|
||||||
Socket descriptors <span class="help" id="socket-descriptors"></span>
|
Socket descriptors <span class="help" id="socket-descriptors"></span>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<%= fmt_resource_bar(node.sockets_used,
|
<%= fmt_resource_bar_count(node.sockets_used, node.sockets_total, FD_THRESHOLDS) %>
|
||||||
node.sockets_total + ' available',
|
|
||||||
node.sockets_used / node.sockets_total,
|
|
||||||
fmt_color(node.sockets_used / node.sockets_total,
|
|
||||||
FD_THRESHOLDS)) %>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -37,11 +30,7 @@
|
||||||
Erlang processes
|
Erlang processes
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<%= fmt_resource_bar(node.proc_used,
|
<%= fmt_resource_bar_count(node.proc_used, node.proc_total, PROCESS_THRESHOLDS) %>
|
||||||
node.proc_total + ' available',
|
|
||||||
node.proc_used / node.proc_total,
|
|
||||||
fmt_color(node.proc_used / node.proc_total,
|
|
||||||
PROCESS_THRESHOLDS)) %>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue