Browse Source

Refatroação dos cronometros para o painel

Websocket_painel
AlGouvea 3 years ago
parent
commit
f8e5620c0b
  1. 3
      frontend/src/__apps/painel/main.js
  2. 8
      sapl/templates/painel/index.html
  3. 89
      sapl/templates/sessao/painel.html

3
frontend/src/__apps/painel/main.js

@ -241,7 +241,7 @@ const v = new Vue({ // eslint-disable-line
}
},
start: function startStopWatch (temp_crono) {
if (this.running !== 0) return
if (this.running === temp_crono) return
crono = temp_crono
if (time === null) {
@ -254,7 +254,6 @@ const v = new Vue({ // eslint-disable-line
timeEnd.setMinutes(timeEnd.getMinutes() + time.getMinutes())
timeEnd.setSeconds(timeEnd.getSeconds() + time.getSeconds())
timeEnd.setMilliseconds(timeEnd.getMilliseconds() + time.getMilliseconds())
clearInterval(this.timeStopped)
}
this.running = crono

8
sapl/templates/painel/index.html

@ -122,23 +122,15 @@
<h2 class="text-subtitle">Cronômetros</h2>
<div class="text-value">
Discurso:<span id='discurso' style="margin-right: 20px;">[[ cronometro_discurso ]]</span><span v-if="painel_aberto">
<span v-if='running != 1'><button class="btn btn-success" v-on:click="start (1)">Iniciar</button><button style="margin-left: 10px;" class="btn btn-success" v-on:click="reset">Reiniciar</button></span>
<span v-else><button class="btn btn-danger" v-on:click="stop(1)">Parar</button></span>
</span><br>
Aparte:<span id='discurso' style="margin-right: 20px;">[[ cronometro_aparte ]]</span><span v-if="painel_aberto">
<span v-if='running != 2'><button class="btn btn-success" v-on:click="start (2)">Iniciar</button><button style="margin-left: 10px;" class="btn btn-success" v-on:click="reset">Reiniciar</button></span>
<span v-else><button class="btn btn-danger" v-on:click="stop(2)">Parar</button></span>
</span><br>
Questão de Ordem: <span id='discurso' style="margin-right: 20px;">[[ cronometro_ordem ]]</span><span v-if="painel_aberto">
<span v-if='running != 3'><button class="btn btn-success" v-on:click="start (3)">Iniciar</button><button style="margin-left: 10px;" class="btn btn-success" v-on:click="reset">Reiniciar</button></span>
<span v-else><button class="btn btn-danger" v-on:click="stop(3)">Parar</button></span>
</span><br>
Considerações Finais: <span id='discurso' style="margin-right: 20px;">[[ cronometro_consideracoes ]]</span><span v-if="painel_aberto">
<span v-if='running != 4'><button class="btn btn-success" v-on:click="start (4)">Iniciar</button><button style="margin-left: 10px;" class="btn btn-success" v-on:click="reset">Reiniciar</button></span>
<span v-else><button class="btn btn-danger" v-on:click="stop(4)">Parar</button></span>
</span>
</div>
</div>

89
sapl/templates/sessao/painel.html

@ -35,8 +35,8 @@
<br />
<div class="row">
<div class="col-md-6"><button onclick="switch_cronometro(true, 1)" id="discursoStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-6"><button onclick="switch_cronometro(false, 1)" id="discursoStop" class="btn btn-success">Parar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(true, 1)" id="discursoStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(false, 1)" id="discursoStop" class="btn btn-danger">Parar</button></div>
<div class="col-md-6"><button type="button" id="discursoReset" class="btn btn-success">Reiniciar</button></div>
</div>
@ -51,8 +51,9 @@
<br />
<div class="row">
<div class="col-md-6"><button type="button" id="aparteStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-6"><button type="button" id="aparteReset" class="btn btn-success" class="btn btn-success">Reiniciar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(true, 2)" id="aparteStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(false, 2)" id="aparteStop" class="btn btn-danger">Parar</button></div>
<div class="col-md-6"><button type="button" id="aparteReset" class="btn btn-success">Reiniciar</button></div>
</div>
<br /><br >
@ -66,7 +67,8 @@
<br />
<div class="row">
<div class="col-md-6"><button type="button" id="ordemStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(true, 3)" id="ordemStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(false, 3)" id="ordemStop" class="btn btn-danger">Parar</button></div>
<div class="col-md-6"><button type="button" id="ordemReset" class="btn btn-success">Reiniciar</button></div>
</div>
@ -83,7 +85,8 @@
<br />
<div class="row">
<div class="col-md-6"><button type="button" id="consideracoesStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(true, 3)" id="consideracoesStart" class="btn btn-success">Iniciar</button></div>
<div class="col-md-3"><button onclick="switch_cronometro(false, 3)" id="consideracoesStop" class="btn btn-danger">Parar</button></div>
<div class="col-md-6"><button type="button" id="consideracoesReset" class="btn btn-success">Reiniciar</button></div>
</div>
<br /><br >
@ -151,7 +154,6 @@ $(function() {
$.get('/painel/cronometro', { tipo: 'discurso', action: 'start' } );
$('#discursoReset').hide();
$('#discurso').runner('start');
});
@ -160,7 +162,6 @@ $(function() {
$.get('/painel/cronometro', { tipo: 'discurso', action: 'stop' } );
$('#discursoReset').show();
$('#discurso').runner('stop');
});
@ -197,24 +198,14 @@ $(function() {
});
$('#aparteStart').click(function(){
if ($('#aparteStart').text() == 'Iniciar') {
$.get('/painel/cronometro', { tipo: 'aparte', action: 'start' } );
$('#aparteReset').hide();
$('#aparte').runner('start');
$('#aparteStart').text('Parar');
} else {
$.get('/painel/cronometro', { tipo: 'aparte', action: 'stop' } );
$('#aparteReset').show();
$('#aparte').runner('stop');
$('#aparteStart').text('Iniciar');
$('#aparteStart').click(function(){
$.get('/painel/cronometro', { tipo: 'aparte', action: 'start' } );
$('#aparte').runner('start');
});
}
$('#aparteStop').click(function(){
$.get('/painel/cronometro', { tipo: 'aparte', action: 'stop' } );
$('#aparte').runner('stop');
});
$('#aparteReset').click(function() {
@ -248,26 +239,14 @@ $(function() {
$('#ordemStart').text('Iniciar');
});
$('#ordemStart').click(function(){
$.get('/painel/cronometro', { tipo: 'ordem', action: 'start' } );
$('#ordem').runner('start');
});
$('#ordemStart').click(function() {
if ($('#ordemStart').text() == 'Iniciar') {
$.get('/painel/cronometro', { tipo: 'ordem', action: 'start' } );
$('#ordemReset').hide();
$('#ordem').runner('start');
$('#ordemStart').text('Parar');
} else {
$.get('/painel/cronometro', { tipo: 'ordem', action: 'stop' } );
$('#ordemReset').show();
$('#ordem').runner('stop');
$('#ordemStart').text('Iniciar');
}
$('#ordemStop').click(function(){
$.get('/painel/cronometro', { tipo: 'ordem', action: 'stop' } );
$('#ordem').runner('stop');
});
$('#ordemReset').click(function() {
@ -304,23 +283,13 @@ $(function() {
});
$('#consideracoesStart').click(function(){
if ($('#consideracoesStart').text() == 'Iniciar') {
$.get('/painel/cronometro', { tipo: 'consideracoes', action: 'start' } );
$('#consideracoesReset').hide();
$('#consideracoes').runner('start');
$('#consideracoesStart').text('Parar');
} else {
$.get('/painel/cronometro', { tipo: 'consideracoes', action: 'stop' } );
$('#consideracoesReset').show();
$('#consideracoes').runner('stop');
$('#consideracoesStart').text('Iniciar');
$.get('/painel/cronometro', { tipo: 'consideracoes', action: 'start' } );
$('#consideracoes').runner('start');
});
}
$('#consideracoesStop').click(function(){
$.get('/painel/cronometro', { tipo: 'consideracoes', action: 'stop' } );
$('#consideracoes').runner('stop');
});
$('#consideracoesReset').click(function() {

Loading…
Cancel
Save