feat: add migrations, mantenance tasks, database cache, blocks cache
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user