UNPKG

iobroker.tinker

Version:

Tinker Board-Monitor for ioBroker Installations

140 lines (125 loc) 5.96 kB
<html> <head> <link rel="stylesheet" type="text/css" href="../../css/adapter.css" /> <link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css"> <script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="../../socket.io/socket.io.js"></script> <script type="text/javascript" src="../../js/translate.js"></script> <script type="text/javascript" src="../../lib/js/materialize.js"></script> <script type="text/javascript" src="../../js/adapter-settings.js"></script> <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="words.js"></script> <script type="text/javascript"> changed = false; function setValue(id, value, onChange) { // example: select elements with id=key and class=value and insert value if ($('#' + id + '.value').attr('type') === 'checkbox') { $('#' + id + '.value').prop('checked', value).change(function () { onChange(); }); } else { $('#' + id + '.value').val(value).change(function () { onChange(); }).keyup(function () { // Check that only numbers entered if ($(this).hasClass('number')) { var val = $(this).val(); if (val) { var newVal = ''; for (var i = 0; i < val.length; i++) { if (val[i] >= '0' && val[i] <= '9') { newVal += val[i]; } } if (val != newVal) $(this).val(newVal); } } onChange(); }); } } // the function loadSettings has to exist ... function load(settings, onChange) { if (!settings) return; for (var key in settings) { if (settings === 'gpios') continue; setValue(key, settings[key], onChange); } onChange(false); } function save(callback) { var obj = {}; $('.value').each(function () { var $this = $(this); if ($this.attr('type') === 'checkbox') { obj[$this.attr('id')] = $this.prop('checked'); } else { obj[$this.attr('id')] = $this.val(); } }); callback(obj); } </script> </head> <body> <div class="m adapter-container"> <div class="row"> <div class="col s12 m4 l6"> <img src="tinker.png" class="logo"> </div> </div> <div class="row"> <div class="input-field col s6 l1"> <input class="value" id="c_cpu" type="checkbox" /> <label for="c_cpu" class="translate">CPU</label> </div> <div class="input-field col s6 l1"> <input class="value" id="c_memory" type="checkbox" /> <label for="c_memory" class="translate">Memory</label> </div> <div class="input-field col s6 l1"> <input class="value" id="c_network" type="checkbox" /> <label for="c_network" class="translate">Network</label> </div> <div class="input-field col s6 l1"> <input class="value" id="c_sdcard" type="checkbox" /> <label for="c_sdcard" class="translate">sdcard</label> </div> </div> <div class="row"> <div class="input-field col s6 l1"> <input class="value" id="c_swap" type="checkbox" /> <label for="c_swap" class="translate">Swap</label> </div> <div class="input-field col s6 l1"> <input class="value" id="c_temperature" type="checkbox" /> <label for="c_temperature" class="translate">Temperature</label> </div> <div class="input-field col s6 l1"> <input class="value" id="c_uptime" type="checkbox" /> <label for="c_uptime" class="translate">Uptime</label> </div> <div class="input-field col s6 l1"> <input class="value" id="c_wlan" type="checkbox" /> <label for="c_wlan" class="translate">WLAN</label> </div> </div> <!-- Donate --> <div class="row"> <div class="col s6 l12"> <span class="translate">If you like this project and would like to support its development, you are welcome to leave a donation.</span> </div> </div> <div class="row"> <div class="col s6 l12"> <a class="donateButton" title="GitHub Sponsors" href="https://github.com/sponsors/simatec" target="_blank"> <img class="material-icons" src="https://camo.githubusercontent.com/365a269ff418d24bdf194ab15958a7545e2d9cc794be9e42933e57519e315b51/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d53706f6e736f72266d6573736167653d254532253944254134266c6f676f3d47697448756226636f6c6f723d253233666538653836"> </a> <a class="donateButton" title="PayPal.Me" href="https://paypal.me/mk1676" target="_blank"> <img class="material-icons" src="https://camo.githubusercontent.com/bf0ea06ef4d9aa4dcb2f2990d99371e7a68e543ec49b788e481568a88c745502/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617970616c2d646f6e6174652532302537432532307370656e64656e2d626c75652e737667"> </a> </div> </div> </div> </body> </html>