Skip to content

Commit 0f2e0fd

Browse files
Merge pull request #92 from JSON-ms/dev
Enable File Manager integration with Local File Sync
2 parents 6bc092e + 76e7d02 commit 0f2e0fd

16 files changed

Lines changed: 802 additions & 630 deletions

.github/workflows/deploy-pages.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@json.ms/www",
33
"private": true,
44
"type": "module",
5-
"version": "1.2.18",
5+
"version": "1.2.19",
66
"scripts": {
77
"dev": "vite --host",
88
"build": "run-p type-check \"build-only {@}\" --",

src/components/ActionBar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {useStructure} from '@/composables/structure';
44
import {useLayout} from '@/composables/layout';
55
import {useGlobalStore} from '@/stores/global';
66
import {computed} from "vue";
7-
import {useTypings} from "@/composables/typings";
7+
import {useSyncing} from "@/composables/syncing";
88
import {useModelStore} from "@/stores/model";
99
import TriggerMenu from "@/components/TriggerMenu.vue";
1010
import type {IStructure, IStructureData} from "@/interfaces";
@@ -45,7 +45,7 @@ const onSetAsDefaultValues = () => {
4545
}
4646
4747
const onSyncWithLocalOnly = () => {
48-
useTypings().syncToFolder(modelStore.structure, 'typescript', ['data']);
48+
useSyncing().syncToFolder(modelStore.structure, ['data']);
4949
userDataSaved.value = true;
5050
setTimeout(() => userDataSaved.value = false, 1000);
5151
}

src/components/FileFieldItem.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {useDisplay} from "vuetify";
66
import {useGlobalStore} from "@/stores/global";
77
import ImgTag from "@/components/ImgTag.vue";
88
import VideoPlayer from "@/components/VideoPlayer.vue";
9+
import {blobFileList} from "@/composables/syncing";
910
1011
const value = defineModel<any>({ required: true });
1112
const {
@@ -40,12 +41,15 @@ const thumbnailSize = (file: IFile): { width: number, height: number } => {
4041
};
4142
}
4243
const isImage = (file: IFile): boolean => {
43-
return file.meta.type.startsWith('image/');
44+
return file.meta.type?.startsWith('image/') || false;
4445
}
4546
const isVideo = (file: IFile): boolean => {
46-
return file.meta.type.startsWith('video/');
47+
return file.meta.type?.startsWith('video/') || false;
4748
}
4849
const src = computed((): string => {
50+
if (file.path && blobFileList[file.path]) {
51+
return blobFileList[file.path];
52+
}
4953
if (file.path && (file.path.startsWith('http://') || file.path.startsWith('https://'))) {
5054
return file.path;
5155
}
@@ -60,7 +64,7 @@ const onDownloadFile = (file: IFile) => {
6064
.then(blob => {
6165
const link = document.createElement('a');
6266
link.href = URL.createObjectURL(blob);
63-
link.download = file.meta.originalFileName;
67+
link.download = file.meta.originalFileName || 'unknown';
6468
document.body.appendChild(link);
6569
link.click();
6670
document.body.removeChild(link);
@@ -155,12 +159,11 @@ const onRemoveFile = (file: IFile) => {
155159
v-bind="props"
156160
:disabled="disabled"
157161
:size="smAndDown ? 'small' : 'default'"
158-
color="error"
159162
variant="text"
160163
icon
161164
@click="() => onRemoveFile(file)"
162165
>
163-
<v-icon icon="mdi-trash-can-outline" />
166+
<v-icon icon="mdi-close" />
164167
</v-btn>
165168
</template>
166169
</v-tooltip>

0 commit comments

Comments
 (0)