UNPKG

twins

Version:

Digital twin PoC demo

53 lines (50 loc) 1.35 kB
<!DOCTYPE html> <!-- SPDX-License-Identifier: MPL-2.0 --> <!-- Copyright 2018-present Samsung Electronics France SAS, and other contributors This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/ --> <html lang="en"> <head> <meta charset="utf-8"/> </head> <body> <div id="main" class="page"> <div class="contents"> <h1>Twins</h1> <form name="settings" id="settings"> <p> <input type="button" id="start" value="Start"/> </p> <p> <input type="text" id="url" placeholder="http://gateway.local:8080"><br/> <input type="password" id="bearer" placeholder="Bearer Token (to be pasted here)"><br/> <input type="text" id="wsUrl" placeholder="ws://gateway.local:8080"><br/> </p> </form> </div> </div> </body> <script> const app = {}; app.start = function() { var list = document.querySelectorAll("#settings input") for (var el of list) { localStorage[el.id] = el.value; } window.location.href = 'index.html'; } console.log(localStorage); for (var key of Object.keys(localStorage)) { var el = document.getElementById(key); if (el) { el.value = localStorage[key]; } } document.getElementById('start').addEventListener('click', function() { app.start(); }); </script> </html>