2
0

status.js 519 B

12345678910111213141516
  1. var ref_tmr = 0;
  2. function ref_status(seti) {
  3. clearTimeout(ref_tmr);
  4. var rt = document.getElementById('refresh_time');
  5. const setintv = (seti && rt.checkValidity()) ? '?'+rt.value : '';
  6. fetchconfig('sys/getstatus' + setintv)
  7. .then((map) => initform('getstatus',map,true))
  8. .catch(err => {})
  9. .finally (() => {
  10. const when = parseInt(valval(rt)) * 1000;
  11. ref_tmr = setTimeout(ref_status, when);
  12. });
  13. fetchconfig('version')
  14. .then((map) => initform('getstatus',map,true))
  15. .catch(err => {});
  16. }