diff --git a/client/public/stylesheets/layout.css b/client/public/stylesheets/layout.css index faf6ebcf..96d82624 100644 --- a/client/public/stylesheets/layout.css +++ b/client/public/stylesheets/layout.css @@ -63,6 +63,7 @@ body.feature-forceShowUnitControlPanel #unit-control-panel { } dl.data-grid { + align-items: center; display:flex; flex-direction: row; flex-wrap: wrap; @@ -71,11 +72,11 @@ dl.data-grid { } dl.data-grid dt { - width:40%; + width:60%; } dl.data-grid dd { - width:60%; + width:40%; } @@ -138,13 +139,35 @@ dl.data-grid dd { #connection-status-panel { bottom: 20px; - height: 30px; + font-size:12px; position: absolute; right: 10px; width: 160px; z-index: 1000; } +#connection-status-panel dt::before { + content: "No connection"; +} + +#connection-status-panel dd::after { + border-radius: 50%; + background: red; + content: " "; + height:12px; + width:12px; +} + + +#connection-status-panel[data-is-connected] dt::before { + content: "Connected"; +} + +#connection-status-panel[data-is-connected] dd::after { + background:var( --accent-green ); +} + + #mouse-info-panel { bottom: 60px; height: fit-content; diff --git a/client/src/panels/connectionstatuspanel.ts b/client/src/panels/connectionstatuspanel.ts index ccde1ba2..54a3f7f6 100644 --- a/client/src/panels/connectionstatuspanel.ts +++ b/client/src/panels/connectionstatuspanel.ts @@ -6,18 +6,6 @@ export class ConnectionStatusPanel extends Panel { } update(connected: boolean) { - var div = this.getElement().querySelector("#status-string"); - if (div != null) { - if (connected) { - div.innerHTML = "Connected"; - div.classList.add("ol-status-connected"); - div.classList.remove("ol-status-disconnected"); - } - else { - div.innerHTML = "Disconnected"; - div.classList.add("ol-status-disconnected"); - div.classList.remove("ol-status-connected"); - } - } + this.getElement().toggleAttribute( "data-is-connected", connected ); } } \ No newline at end of file diff --git a/client/views/connectionstatuspanel.ejs b/client/views/connectionstatuspanel.ejs index 82e47961..81b7f8ba 100644 --- a/client/views/connectionstatuspanel.ejs +++ b/client/views/connectionstatuspanel.ejs @@ -1,3 +1,6 @@
-

Connected

+
+
+
+
\ No newline at end of file