{% extends "base.html" %}
{% block js %}
var getters = [];
(function() {
RSgetter = function(shard, plotOptions)
{
this.shard = shard;
this.last_time = {{ timestamp|make_timestamp }} - 60 * 11;
this.first = true;
}
RSgetter.prototype =
{
update_resources_cb: function(response)
{
var table = $("#services_" + this.shard + "_table > tbody");
var msg = utils.standard_response(response);
if (msg != "")
{
table.html('
');
strings.push(s);
if (response['data'][l-1][1]['services'][s]['running'] == false)
strings.push(' | Not running');
else
{
strings.push(' | ');
strings.push(utils.repr_time_ago_short((new Date()).getTime()/1000 - response['data'][l-1][1]['services'][s]['since']));
{% if admin.permission_all %}
if (s.lastIndexOf("LogService,", 0) !== 0 &&
s.lastIndexOf("ResourceService,", 0) !== 0)
strings.push(" [Kill]");
{% endif %}
strings.push(' | ');
strings.push(response['data'][l-1][1]['services'][s]['threads']);
strings.push(' | ');
strings.push(response['data'][l-1][1]['services'][s]['resident']);
strings.push(' | ');
strings.push(response['data'][l-1][1]['services'][s]['virtual']);
strings.push(' | ');
strings.push(response['data'][l-1][1]['services'][s]['user']);
strings.push(' | ');
strings.push(response['data'][l-1][1]['services'][s]['sys']);
}
strings.push(' | ');
if (s.lastIndexOf("LogService,", 0) === 0 ||
s.lastIndexOf("ResourceService,", 0) === 0) {
strings.push('N/A');
} else if (response['data'][l-1][1]['services'][s]['autorestart'] == true) {
strings.push(" ");
} else if (response['data'][l-1][1]['services'][s]['autorestart'] == false) {
strings.push(" ");
} else {
strings.push('N/A');
}
strings.push(' |
');
}
table.html(strings.join(""));
},
update_resources: function()
{
var f = utils.bind_func(this, this.update_resources_cb);
cmsrpc_request("ResourceService", this.shard,
"get_resources",
{"last_time": this.last_time},
f);
},
kill_service: function(s, link)
{
link.parentNode.innerHTML = '