diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 1021a52..ed67c80 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,5 +1,5 @@ { - "name": "geotime", + "name": "Geo_Timetracking", "version": "0.1.0", "lockfileVersion": 1, "requires": true, @@ -5167,554 +5167,14 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, "optional": true, "requires": { "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "3.2.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.9.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.1", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.13", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "optional": true - } + "nan": "^2.12.1" } }, "fstream": { diff --git a/frontend/package.json b/frontend/package.json index a05c748..cc8f7b7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,5 +1,5 @@ { - "name": "geotime", + "name": "Geo_Timetracking", "version": "0.1.0", "private": true, "scripts": { diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico index df36fcf..c514a79 100644 Binary files a/frontend/public/favicon.ico and b/frontend/public/favicon.ico differ diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 7f4d377..22f9dfb 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -18,58 +18,91 @@ const routes = [ { path: "/", name: "Home", - component: Home + component: Home, + meta: { + title: "Geo Timetracking - Home", + } }, { path: "/timerecords", name: "TimeRecords", - component: TimeRecords + component: TimeRecords, + meta: { + title: 'Geo Timetracking - Time Records', + } }, { path: "/about", name: "About", - component: About + component: About, + meta: { + title: 'Geo Timetracking - About', + } }, { path: "/statistics", name: "Statistics", - component: StatisticOverview + component: StatisticOverview, + meta: { + title: 'Geo Timetracking - Statistics', + } }, { path: "/users", name: "Users", - component: Users + component: Users, + meta: { + title: 'Geo Timetracking - Users', + } }, { path: "/edituser", name: "EditUser", - component: EditUser + component: EditUser, + meta: { + title: 'Geo Timetracking - Edit User', + } }, { path: "/timetrackaccounts", name: "TimeTrack Accounts", - component: TimeTrackAccounts + component: TimeTrackAccounts, + meta: { + title: 'Geo Timetracking - TimeTrack Accounts', + } }, { path: "/edittimetrackaccount", name: "Edit TimeTrack Account", - component: EditTimeTrackAccount + component: EditTimeTrackAccount, + meta: { + title: 'Geo Timetracking - Edit TimeTrack Account', + } }, { path: "/createtimetrackaccount", name: "Create TimeTrack Account", - component: CreateTimeTrackAccount + component: CreateTimeTrackAccount, + meta: { + title: 'Geo Timetracking - Create TimeTrack Accounts', + } }, { path: "/edittimerecord", name: "EditTimerecord", - component: EditTimerecord + component: EditTimerecord, + meta: { + title: 'Geo Timetracking - Edit Time Record', + } }, { path: "/createtimerecord", name: "CreateTimerecord", - component: CreateTimerecord + component: CreateTimerecord, + meta: { + title: 'Geo Timetracking - Create Time Record', + } }, { path: '*', diff --git a/frontend/src/views/About.vue b/frontend/src/views/About.vue index 0b74727..95bc85c 100644 --- a/frontend/src/views/About.vue +++ b/frontend/src/views/About.vue @@ -1,26 +1,47 @@ diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index 6acc371..4c0e18b 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -66,7 +66,7 @@ -

Welcome to geotime

+

Welcome to Geo Timetracking

diff --git a/frontend/src/views/StatisticOverview.vue b/frontend/src/views/StatisticOverview.vue index d067f67..f001517 100644 --- a/frontend/src/views/StatisticOverview.vue +++ b/frontend/src/views/StatisticOverview.vue @@ -1,22 +1,26 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/charts/WeekSummary.vue b/frontend/src/views/charts/WeekSummary.vue index 57e712b..852d908 100644 --- a/frontend/src/views/charts/WeekSummary.vue +++ b/frontend/src/views/charts/WeekSummary.vue @@ -112,6 +112,30 @@ export default { type: "datetime", categories: [] }, + yaxis: { + labels: { + formatter: function(value) { + var decimalTimeString = value; + var decimalTime = parseFloat(decimalTimeString); + decimalTime = decimalTime * 60; + var hours = Math.floor(decimalTime / (60 * 60)); + decimalTime = decimalTime - hours * 60 * 60; + var minutes = Math.floor(decimalTime / 60); + decimalTime = decimalTime - minutes * 60; + var seconds = Math.round(decimalTime); + if (hours < 10) { + hours = "0" + hours; + } + if (minutes < 10) { + minutes = "0" + minutes; + } + if (seconds < 10) { + seconds = "0" + seconds; + } + return hours + ":" + minutes + ":" + seconds; + } + } + }, legend: { show: false, position: "left", @@ -126,7 +150,10 @@ export default { created() { var daysToDisplay = 8; var xhttp = new XMLHttpRequest(); - var records; + var records = new Array(0); + var hasNext = true; + var page = 0; + this.chartOptions.xaxis.categories = new Array(daysToDisplay); this.series[0].data = new Array(daysToDisplay); this.series[1].data = new Array(daysToDisplay); @@ -150,11 +177,18 @@ export default { } today = yyyy + "-" + mm + "-" + dd; - xhttp.onreadystatechange = function() { + + while (hasNext) { + xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var recordsDB = JSON.parse(xhttp.responseText); - - records = recordsDB._embedded.records; + recordsDB._embedded.records.forEach(tmpRecord => { + records.push(tmpRecord); + }); + page++; + if (recordsDB.page.number == recordsDB.page.totalPages - 1) { + hasNext = false; + } } }; xhttp.open( @@ -168,6 +202,8 @@ export default { "T00:00:01" + "&username=" + sessionStorage.getItem("username") + + "&page=" + + page + "&size=50", false ); @@ -175,6 +211,8 @@ export default { xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); xhttp.send(null); + } + for (let index = 0; index < records.length; index++) { var record = records[index]; diff --git a/frontend/src/views/charts/WorkPausePie.vue b/frontend/src/views/charts/WorkPausePie.vue index 1d1f75a..2d7c068 100644 --- a/frontend/src/views/charts/WorkPausePie.vue +++ b/frontend/src/views/charts/WorkPausePie.vue @@ -102,34 +102,46 @@ export default { }), created() { var xhttp = new XMLHttpRequest(); - var records; - xhttp.onreadystatechange = function() { - if (this.readyState == 4 && this.status == 200) { - var recordsDB = JSON.parse(xhttp.responseText); + var records = new Array(0); + var hasNext = true; + var page = 0; - records = recordsDB._embedded.records; - } - }; - xhttp.open( - "GET", - baseUri + - "/records/search/allForUser?username=" + - sessionStorage.getItem("username") + - "&projection=overview", - false - ); + while (hasNext) { + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + var recordsDB = JSON.parse(xhttp.responseText); + recordsDB._embedded.records.forEach(tmpRecord => { + records.push(tmpRecord) + }); + page++; + if (recordsDB.page.number == recordsDB.page.totalPages - 1) { + hasNext = false; + } + } + }; + xhttp.open( + "GET", + baseUri + + "/records/search/allForUser?username=" + + sessionStorage.getItem("username") + + "&page=" + + page + + "&projection=overview" + + "&size=50", + false + ); - xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); + xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); - xhttp.send(null); + xhttp.send(null); + } var paidTime = 0; - var breakTime = 0; - + var breakTime = 0; + for (let index = 0; index < records.length; index++) { var record = records[index]; var type = record.type + ""; - if (type == "PAID") { paidTime += record.duration;