2 <html xmlns:ng="http://angularjs.org">
3 <script src="http://code.angularjs.org/angular-0.9.12.min.js" ng:autobind></script>
6 function GearmanCntl($xhr) {
9 this.status_update = function() {
10 $xhr('JSON', '/_g/status?callback=JSON_CALLBACK', function(code,response) {
16 this.fetch = function() {
18 self.url = '/g/' + self.function + '/' + self.args + '?callback=JSON_CALLBACK';
19 $xhr('JSON', self.url, function(code, response) {
21 self.response = response;
25 this.clear = function() {
30 GearmanCntl.$inject = ['$xhr'];
32 <div ng:controller="GearmanCntl">
33 <select name="function">
34 <option ng:repeat="f in g.status" ng:show="f.available" value="{{f.function}}">{{f.function}}</option>
35 <input type="text" name="args" value="127.0.0.1" size="40"/>
36 <button ng:click="fetch()">fetch</button>
37 <button ng:click="clear()">clear</button>
46 <tr><th>function</th><th>total</th><th>running</th><th>available</th></tr>
47 <tr ng:repeat="f in g.status">
48 <td>{{f.function}}</td>
50 <td>{{f.running}}</td>
51 <td>{{f.available}}</td>
54 <button ng:click="status_update()">update</button>