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,$location) {
9 this.status_update = function() {
10 $xhr('JSON', '/_g/status?callback=JSON_CALLBACK', function(code,response) {
16 var a = $location.hashPath.split('/');
17 self.function_name = a[0];
20 this.fetch = function() {
22 $location.hashPath = self.function_name + '/' + self.args;
23 self.url = '/g/' + $location.hashPath + '?callback=JSON_CALLBACK';
24 $xhr('JSON', self.url, function(code, response) {
26 self.response = response;
30 this.clear = function() {
35 GearmanCntl.$inject = ['$xhr','$location'];
37 <div ng:controller="GearmanCntl">
38 <select name="function_name">
39 <option ng:repeat="f in g.status" ng:show="f.available" value="{{f.function}}">{{f.function}}</option>
40 <input type="text" name="args" value="127.0.0.1" size="40"/>
41 <button ng:click="fetch()">fetch</button>
42 <button ng:click="clear()">clear</button>
51 <tr><th>function</th><th>total</th><th>running</th><th>available</th></tr>
52 <tr ng:repeat="f in g.status">
53 <td>{{f.function}}</td>
55 <td>{{f.running}}</td>
56 <td>{{f.available}}</td>
59 <button ng:click="status_update()">update</button>