2 <html xmlns:ng="http://angularjs.org">
5 <script src="angular.js" ng:autobind></script>
8 Printers.$inject = ['$xhr'];
10 function Printers(xhr){
14 , "/json/monitor/printers?callback=JSON_CALLBACK"
15 , function(code, response){
16 console.log('xhr JSON', code, response);
25 <title>Printer overview</title>
30 font-family: monospace;
50 <div ng:controller="Printers">
53 <input type=checkbox name=show_message>
58 <input type=checkbox name=show_consumable>
63 <input type=checkbox name=show_trays>
68 <input type=checkbox name=show_pages>
73 <input type=checkbox name=show_info>
78 <tr ng:repeat="printer in data">
79 <td><a href="http://{{printer._key}}" target="{{printer._key}}"><tt>{{printer._key}}</tt></a></td>
80 <td>{{printer.hostname}}</td>
82 <td><div class=message ng:show="show_message" ng:repeat="m in printer.message">{{m}}</div></td>
84 <td ng:show="show_consumable">
86 <tr ng:repeat="c in printer.consumable">
87 <td align="right" ng:class="'p'+((c.curr * 10 + 0.0001)/ c.max).toFixed(0)">{{ ((c.curr * 100 + 0.0001)/ c.max).toFixed(1) }}%</td>
93 <td ng:show="show_trays">
95 <tr ng:repeat="t in printer.tray">
96 <td align="right" ng:class="'p'+((t.capacity * 10 + 0.0001)/ t.max).toFixed(0)">{{t.capacity}}/{{t.max}}</td>
98 <td>{{t.dim_x}}*{{t.dim_y}}</td>
103 <td ng:show="show_pages">{{printer.pages}}</td>
105 <td ng:show="show_info">{{printer.info}}</td>
109 <input name=debug type=checkbox>
110 <pre ng:show="debug">