diff --git a/.vscode/launch.json b/.vscode/launch.json index 2f15ef6..e3066b1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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" } ] } \ No newline at end of file diff --git a/app.css b/app.css index bc0be23..2994a0c 100644 --- a/app.css +++ b/app.css @@ -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; diff --git a/app.js b/app.js index f264ca0..42f8ccd 100644 --- a/app.js +++ b/app.js @@ -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'); } @@ -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"); @@ -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); } @@ -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); @@ -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; @@ -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); diff --git a/compare-complete.json b/compare-complete.json deleted file mode 100644 index cbf2e3f..0000000 --- a/compare-complete.json +++ /dev/null @@ -1,98 +0,0 @@ -[ - { - "id": "Detail", - "content": "Detail", - "nestedGroups": [ - "1b0bcc37-0c30-46f0-a1f5-890bb08155d8", - "6e508516-3175-410a-a5a8-6242a94527de" - ] - }, - { - "id": "Wipedown", - "content": "Wipedown", - "nestedGroups": [ - "cbc0f40a-d5eb-4ed7-975f-6c647d843186", - "297c02ae-8421-42e1-8c52-3da8f702f004" - ] - }, - { - "id": "Prep", - "content": "Prep", - "nestedGroups": [ - "d881f26a-3a51-45d0-98d5-02e162714027", - "771a30a6-323f-49f6-a9a9-354d5253b9eb" - ] - }, - { - "id": "Cash and Sale", - "content": "Cash and Sale", - "nestedGroups": [ - "4b0747a3-be8a-4a9c-81a2-dd8ff561d4f5", - "06f4d22b-85d6-45c2-b02b-cfb52c5ad7b1" - ] - }, - { - "employeeName": "employee 01", - "order": 0, - "checked": false, - "id": "4b0747a3-be8a-4a9c-81a2-dd8ff561d4f5", - "content": "employee 01", - "nestedInGroup": "Cash and Sale" - }, - { - "employeeName": "employee 02", - "order": 0, - "checked": false, - "id": "d881f26a-3a51-45d0-98d5-02e162714027", - "content": "employee 02", - "nestedInGroup": "Prep" - }, - { - "employeeName": "employee 03", - "order": 0, - "checked": false, - "id": "1b0bcc37-0c30-46f0-a1f5-890bb08155d8", - "content": "employee 03", - "nestedInGroup": "Detail" - }, - { - "employeeName": "employee 04", - "order": 0, - "checked": false, - "id": "cbc0f40a-d5eb-4ed7-975f-6c647d843186", - "content": "employee 04", - "nestedInGroup": "Wipedown" - }, - { - "employeeName": "employee 05", - "order": 0, - "checked": false, - "id": "297c02ae-8421-42e1-8c52-3da8f702f004", - "content": "employee 05", - "nestedInGroup": "Wipedown" - }, - { - "employeeName": "employee 06", - "order": 0, - "checked": false, - "id": "6e508516-3175-410a-a5a8-6242a94527de", - "content": "employee 06", - "nestedInGroup": "Detail" - }, - { - "employeeName": "employee 07", - "order": 0, - "checked": false, - "id": "771a30a6-323f-49f6-a9a9-354d5253b9eb", - "content": "employee 07", - "nestedInGroup": "Prep" - }, - { - "employeeName": "employee 08", - "order": 0, - "checked": false, - "id": "06f4d22b-85d6-45c2-b02b-cfb52c5ad7b1", - "content": "employee 08", - "nestedInGroup": "Cash and Sale" - } -] \ No newline at end of file diff --git a/compare-unity.json b/compare-unity.json deleted file mode 100644 index cbf2e3f..0000000 --- a/compare-unity.json +++ /dev/null @@ -1,98 +0,0 @@ -[ - { - "id": "Detail", - "content": "Detail", - "nestedGroups": [ - "1b0bcc37-0c30-46f0-a1f5-890bb08155d8", - "6e508516-3175-410a-a5a8-6242a94527de" - ] - }, - { - "id": "Wipedown", - "content": "Wipedown", - "nestedGroups": [ - "cbc0f40a-d5eb-4ed7-975f-6c647d843186", - "297c02ae-8421-42e1-8c52-3da8f702f004" - ] - }, - { - "id": "Prep", - "content": "Prep", - "nestedGroups": [ - "d881f26a-3a51-45d0-98d5-02e162714027", - "771a30a6-323f-49f6-a9a9-354d5253b9eb" - ] - }, - { - "id": "Cash and Sale", - "content": "Cash and Sale", - "nestedGroups": [ - "4b0747a3-be8a-4a9c-81a2-dd8ff561d4f5", - "06f4d22b-85d6-45c2-b02b-cfb52c5ad7b1" - ] - }, - { - "employeeName": "employee 01", - "order": 0, - "checked": false, - "id": "4b0747a3-be8a-4a9c-81a2-dd8ff561d4f5", - "content": "employee 01", - "nestedInGroup": "Cash and Sale" - }, - { - "employeeName": "employee 02", - "order": 0, - "checked": false, - "id": "d881f26a-3a51-45d0-98d5-02e162714027", - "content": "employee 02", - "nestedInGroup": "Prep" - }, - { - "employeeName": "employee 03", - "order": 0, - "checked": false, - "id": "1b0bcc37-0c30-46f0-a1f5-890bb08155d8", - "content": "employee 03", - "nestedInGroup": "Detail" - }, - { - "employeeName": "employee 04", - "order": 0, - "checked": false, - "id": "cbc0f40a-d5eb-4ed7-975f-6c647d843186", - "content": "employee 04", - "nestedInGroup": "Wipedown" - }, - { - "employeeName": "employee 05", - "order": 0, - "checked": false, - "id": "297c02ae-8421-42e1-8c52-3da8f702f004", - "content": "employee 05", - "nestedInGroup": "Wipedown" - }, - { - "employeeName": "employee 06", - "order": 0, - "checked": false, - "id": "6e508516-3175-410a-a5a8-6242a94527de", - "content": "employee 06", - "nestedInGroup": "Detail" - }, - { - "employeeName": "employee 07", - "order": 0, - "checked": false, - "id": "771a30a6-323f-49f6-a9a9-354d5253b9eb", - "content": "employee 07", - "nestedInGroup": "Prep" - }, - { - "employeeName": "employee 08", - "order": 0, - "checked": false, - "id": "06f4d22b-85d6-45c2-b02b-cfb52c5ad7b1", - "content": "employee 08", - "nestedInGroup": "Cash and Sale" - } -] \ No newline at end of file diff --git a/index.html b/index.html index 81312e2..68348fc 100644 --- a/index.html +++ b/index.html @@ -79,7 +79,7 @@