Skip to content
Permalink
Browse files

server: hide controls on websocket disconnect

Signed-off-by: Florian Scherf <f.scherf@pengutronix.de>
  • Loading branch information...
fscherf committed Aug 4, 2019
1 parent e9b98fa commit 88f998692eb73505023e011ae43fbbc4260837a1
Showing with 32 additions and 24 deletions.
  1. +28 −24 flamingo/server/static/index.html
  2. +3 −0 flamingo/server/static/main.js
  3. +1 −0 flamingo/server/static/style.css
@@ -69,35 +69,39 @@
<iframe src="{{iframe_initial_pathname}}" onLoad="iframe_onload(this);"></iframe>
<div id="overlay">
<div id="controls">
<button on-click="reload">Reload Page</button>
<button on-click="clear_log">Clear Log</button>
<button on-click="start_shell">Start Shell</button>
{{#if connected }}
<button on-click="reload">Reload Page</button>
<button on-click="clear_log">Clear Log</button>
<button on-click="start_shell">Start Shell</button>
{{/if}}
</div>
<h1>{{overlay_heading}}</h1>
<p>{{overlay_content}}</p>
<div class="tabs">
<div class="left">
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'meta-data'}} active{{/if}}" on-click="@.set('overlay_tab', 'meta-data')">Meta Data</div>
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'template-context'}} active{{/if}}" on-click="@.set('overlay_tab', 'template-context')">Template Context</div>
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'project-settings'}} active{{/if}}" on-click="@.set('overlay_tab', 'project-settings')">Settings</div>
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'log'}} active{{/if}}" on-click="@.set('overlay_tab', 'log')">Log</div>
<div class="clearfix"></div>
{{#if connected }}
<div class="tabs">
<div class="left">
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'meta-data'}} active{{/if}}" on-click="@.set('overlay_tab', 'meta-data')">Meta Data</div>
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'template-context'}} active{{/if}}" on-click="@.set('overlay_tab', 'template-context')">Template Context</div>
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'project-settings'}} active{{/if}}" on-click="@.set('overlay_tab', 'project-settings')">Settings</div>
<div class="spacer"></div>
<div class="tab{{#if overlay_tab == 'log'}} active{{/if}}" on-click="@.set('overlay_tab', 'log')">Log</div>
<div class="clearfix"></div>
</div>
<div class="middle">
<div class="spacer"></div>
</div>
<div class="right">
<div class="tab{{#if overlay_tab == 'settings'}} active{{/if}}" on-click="@.set('overlay_tab', 'settings')">Settings</div>
<div class="spacer"></div>
</div>
</div>
<div class="middle">
<div class="spacer"></div>
<div id="current-tab">
{{>overlay_tab}}
</div>
<div class="right">
<div class="tab{{#if overlay_tab == 'settings'}} active{{/if}}" on-click="@.set('overlay_tab', 'settings')">Settings</div>
<div class="spacer"></div>
</div>
</div>
<div id="current-tab">
{{>overlay_tab}}
</div>
{{/if}}
</div>
<div id="messages">
{{#messages}}
@@ -142,6 +142,7 @@ var ractive = Ractive({
target: '#ractive',
template: '#main',
data: {
connected: false,
iframe_pathname: get_hash(),
iframe_initial_pathname: get_hash(),
iframe_set_offset: false,
@@ -231,6 +232,7 @@ ractive.on({

rpc.on('open', function(rpc) {
ractive.set({
connected: true,
overlay_heading: 'Connected',
overlay_content: '',
overlay_tab: 'meta-data',
@@ -338,6 +340,7 @@ function reconnect() {

rpc.on('close', function(rpc) {
ractive.set({
connected: false,
overlay_heading: 'Connection lost',
overlay_tab: '',
log: {
@@ -73,6 +73,7 @@ body {

#overlay #controls {
text-align: right;
height: 1.5em;
}

#overlay h1 {

0 comments on commit 88f9986

Please sign in to comment.
You can’t perform that action at this time.