08 plugin.js (4/5)

  // Warn when the firmware lacks features device.json relies on.
  try {
    const status = await (await fetch('/api/status')).json();
    const have = String(status.pluginCapabilities || '').split(',');
    const missing = REQUIRED_CAPS.filter((c) => !have.includes(c));
    if (missing.length) {
      $('[data-warn]').hidden = false;
      $('[data-warn]').textContent = 'This firmware lacks ' + missing.join(', ') + '. Update CrossPoint for this catalog to work.';
    }
  } catch (e) { /* status is informational only */ }

  const cfg = await read('config.json');
  const tok = await read('token.json');
  for (const el of inputs) el.value = cfg[el.dataset.k] || '';
  if (tok.token) out('Signed in.');
‹ PreviousReader file (.txt)Next ›