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_consumable>
58 <input type=checkbox name=show_trays>
63 <li ng:repeat="printer in data">
64 <tt>{{printer._key}}</tt>
67 <div class=message ng:repeat="m in printer.message">{{m}}</div>
69 <ul ng:show="show_consumable">
71 <li ng:repeat="c in printer.consumable">
73 <tt ng:class="'p'+((c.curr * 10 + 0.0001)/ c.max).toFixed(0)">
74 {{ ((c.curr * 100 + 0.0001)/ c.max).toFixed(1) }}%
79 <ul ng:show="show_trays">
81 <li ng:repeat="t in printer.tray">
82 {{t.dim_x}}*{{t.dim_y}}
83 <tt ng:class="'p'+((t.capacity * 10 + 0.0001)/ t.max).toFixed(0)">
84 {{t.capacity}}/{{t.max}}
92 <input name=debug type=checkbox>