diff --git a/app/src/components/v-upload/v-upload.vue b/app/src/components/v-upload/v-upload.vue
index 4c1901d4d3..132bad47b2 100644
--- a/app/src/components/v-upload/v-upload.vue
+++ b/app/src/components/v-upload/v-upload.vue
@@ -29,15 +29,66 @@
{{ $t('drag_file_here') }}
{{ $t('click_to_browse') }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('choose_from_library') }}
+
+
+
+
+
+
+ {{ $t('import_from_url') }}
+
+
+
+
+
+
+
+
+
+ {{ $t('import_from_url') }}
+
+
+
+
+
+ {{ $t('cancel') }}
+
+
+ {{ $t('import') }}
+
+
+
+
+
@@ -214,4 +343,17 @@ export default defineComponent({
width: calc(100% - 64px);
}
}
+
+.options {
+ position: absolute;
+ top: 12px;
+ right: 12px;
+ color: var(--foreground-subdued);
+ cursor: pointer;
+ transition: color var(--medium) var(--transition);
+}
+
+.v-upload:hover .options {
+ color: var(--primary);
+}
diff --git a/app/src/interfaces/file/file.vue b/app/src/interfaces/file/file.vue
index 76d1e31f64..7d0f1ac39d 100644
--- a/app/src/interfaces/file/file.vue
+++ b/app/src/interfaces/file/file.vue
@@ -71,7 +71,7 @@
{{ $t('upload_from_device') }}
-
+
{{ $t('cancel') }}
diff --git a/app/src/interfaces/files/files.vue b/app/src/interfaces/files/files.vue
index 85529fa975..4126f8f936 100644
--- a/app/src/interfaces/files/files.vue
+++ b/app/src/interfaces/files/files.vue
@@ -59,7 +59,7 @@
{{ $t('upload_file') }}
-
+
{{ $t('done') }}
diff --git a/app/src/interfaces/image/image.vue b/app/src/interfaces/image/image.vue
index 8221eaf97c..54134e385b 100644
--- a/app/src/interfaces/image/image.vue
+++ b/app/src/interfaces/image/image.vue
@@ -45,53 +45,7 @@
/>
-
-
-
-
-
-
-
-
-
-
- {{ $t('choose_from_library') }}
-
-
-
-
-
-
- {{ $t('import_from_url') }}
-
-
-
-
-
-
-
-
-
- {{ $t('import_from_url') }}
-
-
-
-
-
- {{ $t('cancel') }}
-
-
- {{ $t('import') }}
-
-
-
-
-
+
@@ -102,7 +56,7 @@ import formatFilesize from '@/utils/format-filesize';
import i18n from '@/lang';
import FileLightbox from '@/views/private/components/file-lightbox';
import ImageEditor from '@/views/private/components/image-editor';
-import ModalBrowse from '@/views/private/components/modal-browse';
+
import { nanoid } from 'nanoid';
import getRootPath from '@/utils/get-root-path';
@@ -116,7 +70,7 @@ type Image = {
};
export default defineComponent({
- components: { FileLightbox, ImageEditor, ModalBrowse },
+ components: { FileLightbox, ImageEditor },
props: {
value: {
type: String,
@@ -128,7 +82,6 @@ export default defineComponent({
},
},
setup(props, { emit }) {
- const activeDialog = ref<'choose' | 'url' | null>(null);
const loading = ref(false);
const image = ref(null);
const error = ref(null);
@@ -180,8 +133,6 @@ export default defineComponent({
}
);
- const { url, isValidURL, loading: urlLoading, error: urlError, importFromURL } = useURLImport();
-
return {
loading,
image,
@@ -194,12 +145,6 @@ export default defineComponent({
setImage,
deselect,
downloadSrc,
- activeDialog,
- setSelection,
- url,
- isValidURL,
- urlLoading,
- importFromURL,
};
async function fetchImage() {
@@ -238,51 +183,6 @@ export default defineComponent({
lightboxActive.value = false;
editorActive.value = false;
}
-
- function setSelection(selection: number[]) {
- if (selection[0]) {
- emit('input', selection[0]);
- } else {
- emit('input', null);
- }
- }
-
- function useURLImport() {
- const url = ref('');
- const loading = ref(false);
- const error = ref(null);
-
- const isValidURL = computed(() => {
- try {
- new URL(url.value);
- return true;
- } catch {
- return false;
- }
- });
-
- return { url, loading, error, isValidURL, importFromURL };
-
- async function importFromURL() {
- loading.value = true;
-
- try {
- const response = await api.post(`/files/import`, {
- url: url.value,
- });
-
- image.value = response.data.data;
-
- activeDialog.value = null;
- url.value = '';
- emit('input', image.value?.id);
- } catch (err) {
- error.value = err;
- } finally {
- loading.value = false;
- }
- }
- }
},
});
@@ -402,17 +302,4 @@ img {
.disabled-placeholder {
height: var(--input-height-tall);
}
-
-.options {
- position: absolute;
- top: 13px;
- right: 13px;
- color: var(--foreground-subdued);
- cursor: pointer;
- transition: color var(--medium) var(--transition);
-}
-
-.image:hover .options {
- color: var(--primary);
-}
diff --git a/app/src/modules/files/routes/add-new.vue b/app/src/modules/files/routes/add-new.vue
index 863cbc11ed..72aefb2bf7 100644
--- a/app/src/modules/files/routes/add-new.vue
+++ b/app/src/modules/files/routes/add-new.vue
@@ -3,7 +3,7 @@
{{ $t('add_file') }}
-
+
{{ $t('done') }}