Add support for more limits

This commit is contained in:
Jonas Lochmann
2020-05-18 02:00:00 +02:00
parent d021497e52
commit ef1b19a01c
79 changed files with 2785 additions and 136 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 Jonas Lochmann
* Copyright (C) 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -20,6 +20,7 @@ export interface ClientDataStatus {
apps: {[key: string]: string} // installedAppsVersionsByDeviceId
categories: {[key: string]: CategoryDataStatus}
users: string // userListVersion
clientLevel?: number
}
export interface CategoryDataStatus {
+36
View File
@@ -121,12 +121,44 @@ export interface ServerUpdatedCategoryAssignedApps {
export interface ServerUpdatedCategoryUsedTimes {
categoryId: string
times: Array<ServerUsedTimeItem>
sessionDurations: Array<ServerSessionDurationItem>
version: string
}
export interface ServerUsedTimeItem {
day: number // day of epoch
time: number // in milliseconds
start: number
end: number
}
export interface ServerSessionDurationItem {
/**
* the maximum duration of a session (maxSessionDuration)
*/
md: number
/**
* the pause duration after a session (sessionPauseDuration)
*/
spd: number
/**
* the start minute of the day of the session/ the rule
* which created this session (startMinuteOfDay)
*/
sm: number
/**
* the end minute of the day of the session/ the rule
* which created this session (endMinuteOfDay)
*/
em: number
/**
* the timestamp of the last usage of this session (lastUsage)
*/
l: number
/**
* the duration of the last/ current session (lastSessionDuration)
*/
d: number
}
export interface ServerUpdatedTimeLimitRules {
@@ -140,6 +172,10 @@ export interface ServerTimeLimitRule {
extraTime: boolean // applyToExtraTimeUsage
dayMask: number // as binary bitmask
maxTime: number // maximumTimeInMillis
start: number // startMinuteOfDay
end: number // endMinuteOfDay
session: number // maximum session duration
pause: number // session pause duration
}
export interface ServerInstalledAppsData {