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 <li ng:repeat="printer in data">
69 <a href="http://{{printer._key}}" target="{{printer._key}}"><tt>{{printer._key}}</tt></a>
72 <div class=message ng:show="show_message" ng:repeat="m in printer.message">{{m}}</div>
74 <ul ng:show="show_consumable">
76 <li ng:repeat="c in printer.consumable">
78 <tt ng:class="'p'+((c.curr * 10 + 0.0001)/ c.max).toFixed(0)">
79 {{ ((c.curr * 100 + 0.0001)/ c.max).toFixed(1) }}%
84 <ul ng:show="show_trays">
86 <li ng:repeat="t in printer.tray">
87 {{t.dim_x}}*{{t.dim_y}}
88 <tt ng:class="'p'+((t.capacity * 10 + 0.0001)/ t.max).toFixed(0)">
89 {{t.capacity}}/{{t.max}}
97 <input name=debug type=checkbox>