Small & large fixes to various server bits

This commit is contained in:
Hugvey Central Command 2019-05-14 17:56:43 +02:00
parent a93a6055cf
commit 4efd8c2e09
10 changed files with 43 additions and 46 deletions

View File

@ -10,6 +10,6 @@ voice:
input_mixer: 'Mic'
output_mixer: 'PCM'
input_volume: 100
output_volume: 30
output_volume: 60
file_address: "http://hugveycmd.local:8888"
output_driver: pulseaudio

View File

@ -28,7 +28,7 @@ web_dir = os.path.join(os.path.split(__file__)[0], '..', 'www')
def getWebSocketHandler(central_command):
class WebSocketHandler(tornado.websocket.WebSocketHandler):
CORS_ORIGINS = ['localhost']
CORS_ORIGINS = ['localhost', 'hugveycmd.local']
connections = set()
def check_origin(self, origin):

View File

@ -1,6 +1,6 @@
apt-get update
#apt-get update
apt-get install -y munin-node bc supervisor
#apt-get install -y munin-node bc supervisor
cp installation/rpi-internal-temp /usr/share/munin/plugins
ln -sf /usr/share/munin/plugins/rpi-internal-temp /etc/munin/plugins/rpi-internal-temp
rm /etc/munin/plugins/irqstats
@ -25,6 +25,9 @@ systemctl --system enable pulseaudio.service
systemctl --system start pulseaudio.service
usermod -a -G pulse-access pi
# install wifi networks
cp installation/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
# Added chown=pi:pi
cp installation/supervisord.conf /etc/supervisor/supervisord.conf
ln -s /home/pi/hugvey/supervisor.conf /etc/supervisor/conf.d/hugvey.conf

View File

@ -1,28 +1,12 @@
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=NL
country=BE
network={
ssid="r3"
psk="5qoWGZ0z"
}
network={
ssid="Digibox-8892"
psk="ODMZ7?423V63ODRG"
}
network={
ssid="PACT"
psk="zollverein"
}
network={
ssid="Hugvey"
ssid="Hugvey_5G"
psk="YouAreNotVeryTalkativeToday"
}
network={
ssid="Nanterre-Amandiers"
key_mgmt=NONE
ssid="Hugvey2_5G"
psk="YouAreNotVeryTalkativeToday"
}

View File

@ -1,4 +1,4 @@
#N canvas 976 211 660 592 10;
#N canvas 307 277 660 592 10;
#X obj 131 277 dac~;
#X obj 131 227 readsf~;
#X obj 209 209 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
@ -26,13 +26,13 @@
#X msg 330 117 0;
#X obj 208 345 oscformat /loop;
#X msg 356 434 connect 192.168.1.174 7400;
#X msg 132 170 open /mnt/stash/hugvey/score38_loop_40s_extra.wav \,
1;
#X msg 132 170 open /mnt/stash/hugvey/sound/score40_loop_plus40s.wav
\, 1;
#X connect 1 0 0 0;
#X connect 1 0 0 1;
#X connect 1 1 2 0;
#X connect 2 0 22 0;
#X connect 2 0 12 0;
#X connect 2 0 22 0;
#X connect 4 0 5 0;
#X connect 6 0 4 0;
#X connect 7 0 8 0;

View File

@ -27,7 +27,7 @@
@click="loadNarrative(lang.code, lang.file)"><span
:class="['flag-icon', lang.code]"></span> {{lang.code}}</li>
</ul>
</div>
<div class='hugvey' v-for="hv in hugveys"
:class="[{'hugvey--on': hv.status != 'off'},'hugvey--' + hv.status]"
@ -64,13 +64,13 @@
</div>
<div class='btn' v-if="hv.status == 'blocked'" @click.stop="unblock(hv)">Unblock</div>
<div class='btn' v-if="hv.status == 'available'" @click.stop="block(hv)">Block</div>
<div class='btn' v-if="hv.status == 'available'" @click.stop="restart(hv)">Start</div>
<div class='btn' v-if="hv.status == 'available' || hv.status =='blocked'" @click.stop="restart(hv)">Start</div>
<div class='btn' v-if="hv.status == 'running'" @click.stop="finish(hv)">Finish</div> <!-- to available state -->
<div class='btn' v-if="hv.status == 'running'" @click.stop="pause(hv)">Pause</div>
<div class='btn' v-if="hv.status == 'paused'" @click.stop="resume(hv)">Resume</div>
<div class='btn' v-if="(hv.status == 'available' || hv.status == 'blocked') && hv.has_state" @click.stop="resume(hv)">Resume from save</div>
</div>
</div>
</div>
</div>
<div id='story'>
@ -109,4 +109,4 @@
</div>
<script type='application/javascript' src="/js/hugvey_console.js"></script>
</body>
</html>
</html>

View File

@ -1068,7 +1068,7 @@ class Graph {
}, 'Volume factor' ),
crel( 'input', {
'name': msg['@id'] + '-params.vol',
'value': params.hasOwnProperty('vol') ? params['vol'] : 1,
'value': params.hasOwnProperty('vol') ? params['vol'] : .8,
'step': "0.1",
'type': 'number',
'on': {

View File

@ -1,4 +1,4 @@
var ws = new ReconnectingWebSocket( "ws://localhost:8888/ws", null, { debug: false, reconnectInterval: 3000 } );
var ws = new ReconnectingWebSocket( window.location.origin.replace('http', 'ws') +'/ws', null, { debug: false, reconnectInterval: 3000 } );
//request close before unloading
window.addEventListener('beforeunload', function(){

View File

@ -20,7 +20,7 @@
<dt>Uptime</dt>
<dd>{{uptime}}</dd>
</dl>
</div>
<div class='hugvey' v-for="hv in hugveys"
:class="[{'hugvey--on': hv.status != 'off'},'hugvey--' + hv.status]"
@ -39,9 +39,9 @@
</option>
</select>
{{ hv.language }}
<!-- <div v-if="hv.awaiting != false"><img class='icon' :src="'/images/icon-finished.svg'" title="Finished"> {{timer(hv,
'finished')}}</div> -->
<div class='stats'>
@ -60,17 +60,17 @@
</div>
<div class='btn' v-if="hv.status == 'blocked'" @click.stop="unblock(hv)">Unblock</div>
<div class='btn' v-if="hv.status == 'available'" @click.stop="block(hv)">Block</div>
<div class='btn' v-if="hv.status == 'available'" @click.stop="restart(hv)">Start</div>
<div class='btn' v-if="hv.status == 'available' || hv.status =='blocked'" @click.stop="restart(hv)">Start</div>
<div class='btn' v-if="hv.status == 'running'" @click.stop="finish(hv)">Finish</div> <!-- to available state -->
<div class='btn' v-if="hv.status == 'running'" @click.stop="pause(hv)">Pause</div>
<div class='btn' v-if="hv.status == 'paused'" @click.stop="resume(hv)">Resume</div>
<div class='btn' v-if="(hv.status == 'available' || hv.status == 'blocked') && hv.has_state" @click.stop="resume(hv)">Resume from save</div>
<!-- <div class='light'>
{{ hv.light }}
</div> -->
<div class='light'>Light: <input type="number" step="1" :value="hv.light_id" @change="change_light" :data-hvid="hv.id" v-on:click.stop></div>
</div>
</div>
</div>
</div>
<div id='logbook'>
@ -85,9 +85,9 @@
</div>
</div>
</div>
</div>
</div>
<script type='application/javascript' src="/js/hugvey_console.js"></script>
</body>
</html>
</html>

View File

@ -26,10 +26,12 @@
.vis-item.message.vis-range{
background-color: darkgray;
border-color: black;
border:none 0px;
}
.vis-item.speech {
background-color: greenyellow;
border-color: green;
border:none 0px;
}
.vis-text,.vis-labelset .vis-label {
@ -67,11 +69,19 @@ font-size: 4.5pt;
border-color:darkred;
border-radius:15px;
}
#follow_button{
background: #669;
border-radius: 2px;
position: absolute;
left:10px;
top: 10px;
z-index: 99999;
padding: 5px;
}
</style>
</head>
<body id='timeline'>
<input id="follow_checkbox" type="checkbox" name="follow" value="follow" checked> Follow timeline<br>
<label id='follow_button'><input id="follow_checkbox" type="checkbox" name="follow" value="follow" checked> Follow timeline</label>
<div id='line'></div>
<script type='application/javascript' src="/js/hugvey_timeline.js"></script>