mkws.registerWidgetType('Stat', function() {
var that = this;
- var M = mkws.M;
-
this.team.queue("stat").subscribe(function(data) {
- that.node.html(' -- ' +
- '<span class="mkwsClientCount">' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '</span>' +
- ' -- ' +
- M('Retrieved records') + ': ' + data.records + '/' + data.hits);
+ var template = that.team.loadTemplate(that.config.template || "Stat");
+ that.node.html(template(data));
});
});
--- /dev/null
+{{!
+Search statistics
+
+activeclients - number of targets currently searching
+clients - total targets for this search
+records - number of records returned and available
+hits - number of hits across all targets
+}}
+ -- <span class="mkwsClientCount">{{mkws-translate "Active clients"}} : {{activeclients}}/{{clients}}</span> -- {{mkws-translate "Retrieved records"}} : {{records}}/{{hits}}