iobroker.time-tracker 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/build/lib/web/api.js +5 -2
- package/build/lib/web/api.js.map +2 -2
- package/io-package.json +14 -14
- package/package.json +1 -1
- package/www/assets/index-BOdNralo.js +119 -0
- package/www/assets/index-BOdNralo.js.map +1 -0
- package/www/index.html +1 -1
- package/www/sw.js +1 -1
- package/www/sw.js.map +1 -1
- package/www/assets/index-BW4HvYbk.js +0 -119
- package/www/assets/index-BW4HvYbk.js.map +0 -1
package/README.md
CHANGED
|
@@ -353,6 +353,15 @@ local SQLite file, access is role-based, and every correction is written to an a
|
|
|
353
353
|
|
|
354
354
|
### **WORK IN PROGRESS**
|
|
355
355
|
|
|
356
|
+
### 0.3.1 (2026-09-22)
|
|
357
|
+
|
|
358
|
+
- (Alex) fix: the presence board shows the **real running** time of the day now. Two things kept it frozen:
|
|
359
|
+
`/terminal/users` answered with the stored day aggregate, which only changes on a punch (it counts finished
|
|
360
|
+
pairs), and the tile “ticker” measured the seconds since the last server answer — a refresh every 60 s never let
|
|
361
|
+
it grow beyond 0. The API adds the minutes of an open punch to its answer now, the tile shows that value directly,
|
|
362
|
+
and the board refreshes every 20 s (was 60 s). The API test moves the clock ten minutes and expects the open punch
|
|
363
|
+
in the answer
|
|
364
|
+
|
|
356
365
|
### 0.3.0 (2026-09-22)
|
|
357
366
|
|
|
358
367
|
- (Alex) new: the presence board can show the working time of today on the employee tiles — `1:23` next to
|
|
@@ -386,14 +395,6 @@ local SQLite file, access is role-based, and every correction is written to an a
|
|
|
386
395
|
automatically. Building from a checkout is only the developer path, and the chapter explains why a Git install
|
|
387
396
|
reports `cannot find start file!` (`build/` and `www/` are not part of the repository)
|
|
388
397
|
|
|
389
|
-
### 0.2.4 (2026-09-21)
|
|
390
|
-
|
|
391
|
-
- (Alex) `commands.punchUserId` does what it promises now: writing an employee id selects the employee the punch
|
|
392
|
-
buttons apply to (`0` = the only employee again), and the adapter mirrors the current choice back into the state.
|
|
393
|
-
For the user the README has a new *Commands (states)* section and `docs/erste-schritte.md` explains all six command
|
|
394
|
-
states — both with copy-ready examples and the two traps (buttons act on `true` only, a wrong period answers in the
|
|
395
|
-
log)
|
|
396
|
-
|
|
397
398
|
Older entries are kept in [`CHANGELOG_OLD.md`](CHANGELOG_OLD.md).
|
|
398
399
|
|
|
399
400
|
## Provenance
|
package/build/lib/web/api.js
CHANGED
|
@@ -1961,13 +1961,16 @@ function createApi(deps) {
|
|
|
1961
1961
|
return (0, import_router.json)(200, {
|
|
1962
1962
|
users: visible.map((user) => {
|
|
1963
1963
|
var _a3, _b2;
|
|
1964
|
-
const
|
|
1964
|
+
const date = (0, import_time.localDate)(timestamp, user.timezone);
|
|
1965
|
+
const day = aggregation.recalculateDay(user.id, date, { now: timestamp });
|
|
1966
|
+
const open = (day == null ? void 0 : day.hasOpenEntry) ? entries.listByDate(user.id, date).at(-1) : void 0;
|
|
1967
|
+
const runningMin = open ? Math.max(0, Math.floor((timestamp - open.tsUtc) / 60)) : 0;
|
|
1965
1968
|
const showWorkedTime = ((_a3 = users.getWorkProfile(user.id)) == null ? void 0 : _a3.showWorkedTime) === true;
|
|
1966
1969
|
return {
|
|
1967
1970
|
id: user.id,
|
|
1968
1971
|
displayName: user.displayName,
|
|
1969
1972
|
present: (day == null ? void 0 : day.hasOpenEntry) === true,
|
|
1970
|
-
workedMin: showWorkedTime ? (_b2 = day == null ? void 0 : day.workedMin) != null ? _b2 : 0 : void 0,
|
|
1973
|
+
workedMin: showWorkedTime ? ((_b2 = day == null ? void 0 : day.workedMin) != null ? _b2 : 0) + runningMin : void 0,
|
|
1971
1974
|
// the picture is fetched by the browser from its own route; the session of this device travels
|
|
1972
1975
|
// in the query, so a plain `<img>` can load it
|
|
1973
1976
|
avatarUrl: user.avatar ? `/api/users/${user.id}/avatar?terminalSession=${encodeURIComponent(terminalSession)}&v=${user.updatedAt}` : null
|