Skip to content

Commit

Permalink
versao 3.1 cores
Browse files Browse the repository at this point in the history
  • Loading branch information
José René Campanario committed Oct 20, 2019
1 parent 4b533f4 commit 0148286
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 406 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"request": "launch",
"mainClass": "com.timesheet.Main",
"projectName": "server",
"vmArgs": "-DXms512m -DXmx512m -DKEYSTORE_PATH=./arquivos/certs/keystore.jks -DROOT_PATH=. -DDB_URL=jdbc:h2:./timesheet -DDB_USER=sa -DDB_PASS=sa -DSERVICE_PORT=8000 -DSERVICE_BIND=localhost"
"vmArgs": "-DXms512m -DXmx512m -DKEYSTORE_PATH=./arquivos/certs/keystore.jks -DROOT_PATH=. -DDB_URL=jdbc:h2:./timesheet -DDB_USER=sa -DDB_PASS=sa -DSERVICE_PORT=443 -DSERVICE_BIND=localhost"
}
]
}
10 changes: 9 additions & 1 deletion app.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@
border-color: red;
}

.vis-nested-group.toBreak {
.vis-nested-group.toBreak90 {
background-color: lightgreen;
}

.vis-nested-group.toBreak120 {
background-color: lightyellow;
}

.vis-nested-group.toBreak150 {
background-color: lightcoral;
}

.vis-item.blue {
background-color: blue;
border-color: blue;
Expand Down
28 changes: 20 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ var app = new Vue({
removerSheets: function (idSubGroup, event) {
this.items.forEach(function (i) {
if (i.selecionado) {
removerAvisoVisual(idSubGroup);
items.remove(i.id);
removeItem(i, 'I');
}
Expand Down Expand Up @@ -160,8 +161,6 @@ var app = new Vue({

var items = new vis.DataSet([]);
var groups = new vis.DataSet([]);
// items.on('*', itemsOn);
// groups.on('*', groupsOn);

var timeline = null;
var container = document.getElementById("TimeLine");
Expand Down Expand Up @@ -255,13 +254,19 @@ function actionFired(properties) {
item.end = getMoment();
group = getGroupById(item.group);
var diffMinutes = item.end.diff(item.start, 'minutes');
if (group.className != 'toBreak' && item.typeOfWork === 'Work' && diffMinutes >= 90) {
group.className = 'toBreak';
if (group.className != 'toBreak90' && item.typeOfWork === 'Work' && diffMinutes >= 90 && diffMinutes < 120) {
group.className = 'toBreak90';
groups.update(group);
} else if (group.className === 'toBreak' && item.typeOfWork === 'Work' && diffMinutes < 90) {
} else if (group.className != 'toBreak120' && item.typeOfWork === 'Work' && diffMinutes >= 120 && diffMinutes < 150) {
group.className = 'toBreak120';
groups.update(group);
} else if (group.className != 'toBreak150' && item.typeOfWork === 'Work' && diffMinutes >= 150) {
group.className = 'toBreak150';
groups.update(group);
} else if (group.className != 'p' && item.typeOfWork === 'Work' && diffMinutes < 90) {
group.className = 'p';
groups.update(group);
} else if (group.className === 'toBreak' && item.typeOfWork != 'Work') {
} else if (group.className === 'p' && item.typeOfWork != 'Work') {
group.className = 'p';
groups.update(group);
}
Expand Down Expand Up @@ -319,9 +324,16 @@ function checkme(component, idSubGroup) {
var c = montarNome(subGrupo.id, subGrupo.employeeName, component.checked);
groups.update({ id: idSubGroup, content: c, checked: !subGrupo.checked });
}
function removerAvisoVisual(idSubGroup) {
var g = groups.get(idSubGroup);
g.className = 'p';
groups.update(g);
persistItem(g, 'G');
}
function closeLastItem(idSubGroup, hora, minuto) {
if (typeof hora == 'undefined') hora = getHora(hora);
if (typeof minuto == 'undefined') minuto = getMinuto(minuto);
removerAvisoVisual(idSubGroup);
var item = getLastOpenItemBySubGroup(idSubGroup);
if (item) {
item.end = getMoment().hours(hora).minutes(minuto).seconds(0).milliseconds(0);
Expand Down Expand Up @@ -407,7 +419,7 @@ function adicionar(name, sector, horaInicial, minutoInicial, horaFinal, minutoFi
if (typeof name === 'undefined' || name == null || name.length <= 0) {
return;
}
var idSubGroup = groups.add({ employeeName: name, order: 0, checked: false })[0];
var idSubGroup = groups.add({ employeeName: name, order: 0, checked: false, className: 'p' })[0];
var c = montarNome(idSubGroup, name, false);
groups.update({ id: idSubGroup, content: c });
if (!horaInicial) horaInicial = 9;
Expand Down Expand Up @@ -560,7 +572,7 @@ function updateDateItem(item) {

var socket;
if (window.WebSocket) {
var url = "wss://" + location.hostname + ":444/";
var url = "wss://" + location.hostname + "/ws";
socket = new WebSocket(url);
socket.onmessage = function (event) {
var action = JSON.parse(event.data);
Expand Down
98 changes: 0 additions & 98 deletions compare-complete.json

This file was deleted.

98 changes: 0 additions & 98 deletions compare-unity.json

This file was deleted.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h5 class="modal-title">{{employeeName}}'s Timesheet</h5>
<button type="button" v-on:click="adicionar" class="btn btn-primary">Add</button>
</div>
<div class="col">
Versao 3.0 WebSocket
Versao 3.1 Cores
</div>
</div>
<div>
Expand Down
Loading

0 comments on commit 0148286

Please sign in to comment.