mirror of
https://github.com/cupcakearmy/ora.git
synced 2026-04-03 04:25:24 +00:00
progress
This commit is contained in:
@@ -2,6 +2,7 @@ import { groupBy, orderBy, sum } from 'lodash'
|
||||
import dj from 'dayjs'
|
||||
|
||||
import { DB } from './db.js'
|
||||
import { SettingsValidator } from './validation.js'
|
||||
|
||||
export async function data({ start, end }) {
|
||||
const logs = await getLogsBetweenDates({ start, end })
|
||||
@@ -60,3 +61,9 @@ export function percentagesToBool(percentages) {
|
||||
const blocked = percentages.map((p) => p >= 100).includes(true)
|
||||
return blocked
|
||||
}
|
||||
|
||||
export async function getSettingsWithDefaults() {
|
||||
const values = await DB.settings.toArray()
|
||||
const fromDB = Object.fromEntries(values.map((v) => [v.key, v.value]))
|
||||
return SettingsValidator.validate(fromDB).value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user