view service/wifi/index.html @ 1462:2b29f14eb6bd

try new graph+view widget Ignore-this: d5f9c5dc52f04324368716ba2f604fdb darcs-hash:44e85a5c075ef73c34a58deaa3a3c1e8390dae52
author drewp <drewp@bigasterisk.com>
date Sun, 24 Nov 2019 00:01:00 -0800
parents 517cbb905d4c
children 32d134dbfb1e
line wrap: on
line source

<!doctype html>
<html>

<head>
  <title>wifi</title>
  <meta charset="utf-8">
  <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script>
  <script src="/lib/require/require-2.3.3.js"></script>
  <script src="/rdf/common_paths_and_ns.js"></script>

  <link rel="stylesheet" href="/rdf/browse/style.css">

  <link rel="import" href="/rdf/streamed-graph.html">
  <link rel="import" href="/lib/polymer/1.0.9/polymer/polymer.html">
</head>

<body class="rdfBrowsePage">
  <template id="t" is="dom-bind">
    <style>

     #subjectRequest {
         width: 50em;
     }
    </style>

    <streamed-graph url="/sse_collector/graph/network" graph="{{graph}}"></streamed-graph>
    <div id="out">
    </div>

    <script type="module">
      import { render } from '/lib/lit-html/1.0.0/lit-html.js';
      import { graphView } from './wifi.js';
      const sg = document.querySelector('streamed-graph');

      const out = document.querySelector('#out');
      const startPainting = () => {
        if (!sg.graph || !sg.graph.graph) {
          setTimeout(startPainting, 100);
          return;
        }

        let dirty = true;

        const repaint = () => {
          if (!dirty) {
            return;
          }
          render(graphView(sg.graph.graph, /*showGroups=*/false), out);
          dirty = false;
        };

        sg.addEventListener('graph-changed', (ev) => {
          dirty = true;
          requestAnimationFrame(repaint);
        });
        repaint();
      };
      setTimeout(startPainting, 10);
    </script>
  </template>
  <script>

  </script>

  <form method="POST" action="remoteSuspend"><button>Suspend windows/VR machine</button></form>
  <!-- also put wakeonlan actions down here -->

</body>

</html>