Fix ts errors
This commit is contained in:
parent
70707fbd0e
commit
df9d199044
@ -29,7 +29,7 @@ const route = useRoute();
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
base: string;
|
base: string;
|
||||||
noLink: boolean;
|
noLink?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const items = computed(() => {
|
const items = computed(() => {
|
||||||
@ -72,7 +72,7 @@ const items = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const element = computed(() => {
|
const element = computed(() => {
|
||||||
if (props.noLink !== undefined) {
|
if (props.noLink) {
|
||||||
return "span";
|
return "span";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<img
|
<img
|
||||||
v-if="readOnly == undefined && type === 'image' && isThumbsEnabled"
|
v-if="!readOnly && type === 'image' && isThumbsEnabled"
|
||||||
v-lazy="thumbnailUrl"
|
v-lazy="thumbnailUrl"
|
||||||
/>
|
/>
|
||||||
<i v-else class="material-icons"></i>
|
<i v-else class="material-icons"></i>
|
||||||
@ -60,8 +60,8 @@ const props = defineProps<{
|
|||||||
size: number;
|
size: number;
|
||||||
modified: string;
|
modified: string;
|
||||||
index: number;
|
index: number;
|
||||||
readOnly: boolean;
|
readOnly?: boolean;
|
||||||
path: string;
|
path?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
@ -69,17 +69,17 @@ const fileStore = useFileStore();
|
|||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
|
|
||||||
const singleClick = computed(
|
const singleClick = computed(
|
||||||
() => props.readOnly == undefined && authStore.user?.singleClick
|
() => !props.readOnly && authStore.user?.singleClick
|
||||||
);
|
);
|
||||||
const isSelected = computed(
|
const isSelected = computed(
|
||||||
() => fileStore.selected.indexOf(props.index) !== -1
|
() => fileStore.selected.indexOf(props.index) !== -1
|
||||||
);
|
);
|
||||||
const isDraggable = computed(
|
const isDraggable = computed(
|
||||||
() => props.readOnly == undefined && authStore.user?.perm.rename
|
() => !props.readOnly && authStore.user?.perm.rename
|
||||||
);
|
);
|
||||||
|
|
||||||
const canDrop = computed(() => {
|
const canDrop = computed(() => {
|
||||||
if (!props.isDir || props.readOnly !== undefined) return false;
|
if (!props.isDir || props.readOnly) return false;
|
||||||
|
|
||||||
for (let i of fileStore.selected) {
|
for (let i of fileStore.selected) {
|
||||||
if (fileStore.req?.items[i].url === props.url) {
|
if (fileStore.req?.items[i].url === props.url) {
|
||||||
@ -111,7 +111,7 @@ const humanSize = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const humanTime = () => {
|
const humanTime = () => {
|
||||||
if (props.readOnly == undefined && authStore.user?.dateFormat) {
|
if (!props.readOnly && authStore.user?.dateFormat) {
|
||||||
return dayjs(props.modified).format("L LT");
|
return dayjs(props.modified).format("L LT");
|
||||||
}
|
}
|
||||||
return dayjs(props.modified).fromNow();
|
return dayjs(props.modified).fromNow();
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<header>
|
<header>
|
||||||
<img v-if="showLogo !== undefined" :src="logoURL" />
|
<img v-if="showLogo" :src="logoURL" />
|
||||||
<Action
|
<Action
|
||||||
v-if="showMenu !== undefined"
|
v-if="showMenu"
|
||||||
class="menu-button"
|
class="menu-button"
|
||||||
icon="menu"
|
icon="menu"
|
||||||
:label="t('buttons.toggleSidebar')"
|
:label="t('buttons.toggleSidebar')"
|
||||||
@ -41,8 +41,8 @@ import { computed, useSlots } from "vue";
|
|||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
showLogo: boolean;
|
showLogo?: boolean;
|
||||||
showMenu: boolean;
|
showMenu?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
|
|||||||
4
frontend/src/types/file.d.ts
vendored
4
frontend/src/types/file.d.ts
vendored
@ -18,13 +18,13 @@ interface Resource extends ResourceBase {
|
|||||||
sorting: Sorting;
|
sorting: Sorting;
|
||||||
hash?: string;
|
hash?: string;
|
||||||
token?: string;
|
token?: string;
|
||||||
index?: number;
|
index: number;
|
||||||
subtitles?: string[];
|
subtitles?: string[];
|
||||||
content?: string;
|
content?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ResourceItem extends ResourceBase {
|
interface ResourceItem extends ResourceBase {
|
||||||
index?: number;
|
index: number;
|
||||||
subtitles?: string[];
|
subtitles?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user