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 <li ng:repeat="printer in data">
79 <a href="http://{{printer._key}}" target="{{printer._key}}"><tt>{{printer._key}}</tt></a>
83 <tt ng:show="show_pages">{{printer.pages}}</tt>
85 <span ng:show="show_info">{{printer.info}}</span>
87 <div class=message ng:show="show_message" ng:repeat="m in printer.message">{{m}}</div>
89 <ul ng:show="show_consumable">
91 <li ng:repeat="c in printer.consumable">
93 <tt ng:class="'p'+((c.curr * 10 + 0.0001)/ c.max).toFixed(0)">
94 {{ ((c.curr * 100 + 0.0001)/ c.max).toFixed(1) }}%
99 <ul ng:show="show_trays">
101 <li ng:repeat="t in printer.tray">
102 {{t.dim_x}}*{{t.dim_y}}
103 <tt ng:class="'p'+((t.capacity * 10 + 0.0001)/ t.max).toFixed(0)">
104 {{t.capacity}}/{{t.max}}
112 <input name=debug type=checkbox>
113 <pre ng:show="debug">