@@ -45,6 +45,10 @@ const getFilesByType = (type: string): IFile[] => {
4545 return acceptedFiles .value .filter ((file : IFile ) => file .meta .type ?.startsWith (' video' ));
4646 } else if (type === ' document' ) {
4747 return acceptedFiles .value .filter ((file : IFile ) => ! file .meta .type ?.startsWith (' image' ) && ! file .meta .type ?.startsWith (' video' ));
48+ } else if (type === ' local' ) {
49+ return acceptedFiles .value .filter ((file : IFile ) => file .origin === ' local' );
50+ } else if (type === ' remote' ) {
51+ return acceptedFiles .value .filter ((file : IFile ) => file .origin === ' remote' );
4852 }
4953 return [];
5054}
@@ -123,6 +127,7 @@ const load = () => {
123127 if (! [' data.json' , ' structure.json' , ' structure.yml' , ' default.ts' , ' index.ts' , ' typings.ts' , ' settings.json' ].includes (item .path )) {
124128 files .value .push ({
125129 path: item .path ,
130+ origin: ' local' ,
126131 meta: {
127132 type: item .file .type ,
128133 width: item .width ,
@@ -136,7 +141,7 @@ const load = () => {
136141 });
137142
138143 endpointResponse .forEach ((item : IFile ) => {
139- files .value .push (item );
144+ files .value .push (({ ... item , origin: ' remote ' }) );
140145 });
141146
142147 selectedFiles .value = [];
@@ -348,6 +353,15 @@ watch(() => globalStore.fileManager.visible, () => {
348353 <v-tab v-if =" getFilesByType('document').length > 0" value =" document" >
349354 Document ({{ getFilesByType('document').length }})
350355 </v-tab >
356+ <template v-if =" getFilesByType (' remote' ).length > 0 && getFilesByType (' local' ).length > 0 " >
357+ <v-divider inset vertical class =" mx-2" />
358+ <v-tab v-if =" getFilesByType('remote').length > 0" value =" remote" >
359+ Cloud ({{ getFilesByType('remote').length }})
360+ </v-tab >
361+ <v-tab v-if =" getFilesByType('local').length > 0" value =" local" >
362+ Local ({{ getFilesByType('local').length }})
363+ </v-tab >
364+ </template >
351365 </v-tabs >
352366 </template >
353367 <v-card-actions >
@@ -457,7 +471,24 @@ watch(() => globalStore.fileManager.visible, () => {
457471 @click =" onFileClick(item)"
458472 >
459473 <div v-if =" !canSelect || globalStore.fileManager.multiple" class =" position-absolute" style =" top : 0 ; left : 0 ; z-index : 10 " >
460- <v-checkbox :model-value =" fileIsSelected(item)" color =" primary" base-color =" surface" hide-details @click.stop.prevent =" onFileClick(item)" />
474+ <v-checkbox :model-value =" fileIsSelected(item)" color =" primary" hide-details @click.stop.prevent =" onFileClick(item)" />
475+ </div >
476+ <div class =" position-absolute" style =" top : 0 ; right : 0 ; z-index : 10 " >
477+ <v-chip
478+ v-if =" ['local', 'remote'].includes(item.origin || 'unknown')"
479+ :color =" fileIsSelected(item) ? 'primary' : undefined"
480+ size =" x-small"
481+ variant =" flat"
482+ class =" px-1 ma-2"
483+ label
484+ >
485+ <template v-if =" item .origin === ' local' " >
486+ Local
487+ </template >
488+ <template v-else >
489+ Cloud
490+ </template >
491+ </v-chip >
461492 </div >
462493 <div class =" bg-blue-grey-lighten-4" >
463494 <ImgTag
0 commit comments