mirror of
https://github.com/cupcakearmy/ora.git
synced 2026-04-02 12:05:23 +00:00
move to dexie es nedb does not support multiple isntances
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import day from 'dayjs'
|
||||
import { range, random } from 'lodash'
|
||||
|
||||
import { insertLog, normalizeTimestamp, clear as clearDB } from '../../shared/db'
|
||||
import { insertLog, normalizeTimestamp, DB } from '../../shared/db'
|
||||
|
||||
let loading = false
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
async function clear() {
|
||||
try {
|
||||
loading = true
|
||||
await clearDB()
|
||||
await DB.limits.clear()
|
||||
await DB.logs.clear()
|
||||
} finally {
|
||||
loading = false
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { cloneDeep } from 'lodash'
|
||||
|
||||
import { Limits } from '../../shared/db'
|
||||
import { DB } from '../../shared/db'
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
const init = { limit: ['1', 'h'], every: [1, 'd'] }
|
||||
@@ -23,8 +23,7 @@
|
||||
}
|
||||
|
||||
async function save() {
|
||||
const { _id, ...rest } = limit
|
||||
await Limits.update({ _id }, rest, { upsert: true })
|
||||
await DB.limits.put(limit)
|
||||
dispatch('update')
|
||||
close()
|
||||
}
|
||||
@@ -41,7 +40,8 @@
|
||||
<div class="content">
|
||||
{#if limit}
|
||||
<label class="form-label">
|
||||
Host <input type="text" class="form-input" placeholder="google.com" bind:value={limit.host} />
|
||||
Host
|
||||
<input type="text" class="form-input" placeholder="google.com" bind:value={limit.host} />
|
||||
</label>
|
||||
|
||||
<div class="form-label">Rules</div>
|
||||
|
||||
Reference in New Issue
Block a user