| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>sksysmon</title> |
| |
| {{template "header.html" .}} |
| |
| <style is="custom-style" type="text/css" media="screen"> |
| :root { |
| --default-primary-color: #AA4499; |
| } |
| </style> |
| |
| <style type="text/css" media="screen"> |
| body { |
| font-family: Arial, sans-serif; |
| font-size: 15px; |
| } |
| |
| paper-toast { |
| margin: 2em; |
| } |
| |
| unit-list-sk { |
| margin: 2em; |
| display: block; |
| } |
| |
| html, body { |
| height: 100%; |
| margin: 0; |
| } |
| |
| paper-header-panel { |
| height: 100%; |
| } |
| </style> |
| </head> |
| <body> |
| <body class="fullbleed layout vertical"> |
| <paper-header-panel mode=scroll> |
| {{template "titlebar.html" .}} |
| <unit-list-sk header=true></unit-list-sk> |
| <paper-toast></paper-toast> |
| </paper-header-panel> |
| </body> |
| |
| <script type="text/javascript" charset="utf-8"> |
| (function() { |
| function loadData() { |
| sk.get("/_/list").then(JSON.parse).then(function(json) { |
| $$$('unit-list-sk').units = json; |
| }).catch(function(e){ |
| $$$('paper-toast').text = e; |
| $$$('paper-toast').show(); |
| }); |
| } |
| |
| loadData(); |
| $$$('unit-list-sk').addEventListener('unit-action', function(e) { |
| var params = { |
| name: e.detail.name, |
| action: e.detail.action, |
| } |
| sk.post('/_/change?'+sk.query.fromObject(params)).then(JSON.parse).then(function(json) { |
| $$$('paper-toast').text = e.detail.name + ": " + json.result; |
| $$$('paper-toast').show(); |
| loadData(); |
| }).catch(function(e) { |
| $$$('paper-toast').text = e; |
| $$$('paper-toast').show(); |
| }); |
| }); |
| })(); |
| </script> |
| </body> |
| </html> |