-
-
+
diff --git a/src/renderer/pages/TrayPage.vue b/src/renderer/pages/TrayPage.vue
index fde3b85..8a181d6 100644
--- a/src/renderer/pages/TrayPage.vue
+++ b/src/renderer/pages/TrayPage.vue
@@ -1,24 +1,59 @@
-
{{ $T('OPEN_MAIN_WINDOW') }}
+
+ {{ $T('OPEN_MAIN_WINDOW') }}
+
-
-
{{ $T('WAIT_TO_UPLOAD') }}
-
+
+
+ {{ $T('WAIT_TO_UPLOAD') }}
+
+
-
+ @click="uploadClipboardFiles"
+ >
+
-
{{ $T('ALREADY_UPLOAD') }}
-
-
-
-
{{ item.fileName }}
+
+ {{ $T('ALREADY_UPLOAD') }}
+
+
+
+
+
+ {{ item.fileName }}
+
@@ -26,99 +61,100 @@
-
- disableDragFile () {
- window.addEventListener('dragover', (e) => {
- e = e || event
- e.preventDefault()
- }, false)
- window.addEventListener('drop', (e) => {
- e = e || event
- e.preventDefault()
- }, false)
- }
-
- uploadClipboardFiles () {
- if (this.uploadFlag) {
- return
- }
- this.uploadFlag = true
- ipcRenderer.send('uploadClipboardFiles')
- }
-
- mounted () {
- this.disableDragFile()
- this.getData()
- ipcRenderer.on('dragFiles', async (event: Event, files: string[]) => {
- for (let i = 0; i < files.length; i++) {
- const item = files[i]
- await this.$$db.insert(item)
- }
- this.files = (await this.$$db.get
({ orderBy: 'desc', limit: 5 })).data
- })
- ipcRenderer.on('clipboardFiles', (event: Event, files: ImgInfo[]) => {
- this.clipboardFiles = files
- })
- ipcRenderer.on('uploadFiles', async () => {
- this.files = (await this.$$db.get({ orderBy: 'desc', limit: 5 })).data
- this.uploadFlag = false
- })
- ipcRenderer.on('updateFiles', () => {
- this.getData()
- })
- }
-
- beforeDestroy () {
- ipcRenderer.removeAllListeners('dragFiles')
- ipcRenderer.removeAllListeners('clipboardFiles')
- ipcRenderer.removeAllListeners('uploadClipboardFiles')
- ipcRenderer.removeAllListeners('updateFiles')
- }
+
@@ -179,11 +215,20 @@ body::-webkit-scrollbar
background #49B1F5
.upload-img__index
color #fff
+ .upload-img__container
+ display flex
+ flex-direction column
+ justify-content center
+ align-items center
.upload-img
- width 100%
+ max-width 100%
object-fit scale-down
margin 0 auto
&__container
+ display flex
+ flex-direction column
+ justify-content center
+ align-items center
width 100%
padding 8px 8px 4px
height 100%
diff --git a/src/renderer/pages/Upload.vue b/src/renderer/pages/Upload.vue
index 1fb2140..2f66fe4 100644
--- a/src/renderer/pages/Upload.vue
+++ b/src/renderer/pages/Upload.vue
@@ -1,9 +1,18 @@
-
+
- {{ $T('PICTURE_UPLOAD') }} - {{ picBedName }}
+ {{ $T('PICTURE_UPLOAD') }} - {{ picBedName }}
+
+
+
-
+ />
{{ $T('LINK_FORMAT') }}
-
Markdown
-
-
-
-
+
+
+
+
{{ $T('QUICK_UPLOAD') }}
-
{{ $T('CLIPBOARD_PICTURE') }}
-
URL
+
+ {{ $T('CLIPBOARD_PICTURE') }}
+
+
+ URL
+
-
+