feat: add migrations, mantenance tasks, database cache, blocks cache

This commit is contained in:
2025-11-13 02:24:00 +03:00
parent ab5c2f42b9
commit c0a6cb17b3
32 changed files with 948 additions and 213 deletions

View File

@@ -19,6 +19,7 @@
<script setup>
import {computed, onMounted, ref, useId} from "vue";
import {getThumb} from "@/utils/helpers.js";
const id = useId();
const model = defineModel();
@@ -26,13 +27,7 @@ const emit = defineEmits(['update:modelValue']);
const inputRef = ref(null);
const isLoaded = ref(false);
const thumb = computed(() => {
if (!model.value) return '/image/cache/no_image-100x100.png';
const extIndex = model.value.lastIndexOf('.');
const ext = model.value.substring(extIndex);
const filename = model.value.substring(0, extIndex);
return `/image/cache/${filename}-100x100${ext}`;
});
const thumb = computed(() => getThumb(model.value));
onMounted(() => {
const input = inputRef.value;

View File

@@ -1,11 +1,10 @@
<template>
<SettingsItem :label="label">
<template #default>
<OcImagePicker v-model="model"/>
<OcImagePicker v-model="model" class="tw:w-30"/>
</template>
<template #help><slot></slot></template>
</SettingsItem>
</template>
<script setup>

View File

@@ -1,5 +1,5 @@
export function getThumb(imageUrl) {
if (!imageUrl) return '/image/cache/no_image-100x100.png';
if (!imageUrl) return '/image/no_image.png';
const extIndex = imageUrl.lastIndexOf('.');
const ext = imageUrl.substring(extIndex);
const filename = imageUrl.substring(0, extIndex);