www: change background when connection in closed in topics view

This commit is contained in:
Oleg Kalachev
2021-11-25 23:27:01 +03:00
parent f1783bdd0b
commit 6909ba5819
2 changed files with 3 additions and 0 deletions

View File

@@ -3,11 +3,13 @@ const ros = new ROSLIB.Ros({ url: url });
ros.on('connection', function () {
document.body.classList.add('connected');
document.body.classList.remove('closed');
init();
});
ros.on('close', function () {
document.body.classList.remove('connected');
document.body.classList.add('closed');
setTimeout(function() {
// reconnect
ros.connect(url);

View File

@@ -17,6 +17,7 @@
}
#topic-type { font-family: monospace; font-size: 0.5em; vertical-align: super; font-weight: normal; }
.topic { font-family: monospace; }
body.closed { background-color: rgb(207, 207, 207); }
</style>
</head>
<body>