mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-08 17:08:49 +08:00
Added: upload notification swtich
This commit is contained in:
@@ -12,11 +12,13 @@ const checkUploader = (type) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const uploader = (img, type, webContents) => {
|
const uploader = (img, type, webContents) => {
|
||||||
const notification = new Notification({
|
if (db.read().get('picBed.uploadNotification').value()) {
|
||||||
title: '上传进度',
|
const notification = new Notification({
|
||||||
body: '正在上传'
|
title: '上传进度',
|
||||||
})
|
body: '正在上传'
|
||||||
notification.show()
|
})
|
||||||
|
notification.show()
|
||||||
|
}
|
||||||
const uploadType = db.read().get('picBed.current').value()
|
const uploadType = db.read().get('picBed.current').value()
|
||||||
if (checkUploader(uploadType)) {
|
if (checkUploader(uploadType)) {
|
||||||
return picBeds[uploadType](img, type, webContents)
|
return picBeds[uploadType](img, type, webContents)
|
||||||
|
|||||||
@@ -66,6 +66,16 @@
|
|||||||
@change="handleAutoRename"
|
@change="handleAutoRename"
|
||||||
></el-switch>
|
></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="开启上传提示"
|
||||||
|
>
|
||||||
|
<el-switch
|
||||||
|
v-model="form.uploadNotification"
|
||||||
|
active-text="开"
|
||||||
|
inactive-text="关"
|
||||||
|
@change="handleUploadNotification"
|
||||||
|
></el-switch>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="选择显示的图床"
|
label="选择显示的图床"
|
||||||
>
|
>
|
||||||
@@ -190,7 +200,8 @@ export default {
|
|||||||
showPicBedList: [],
|
showPicBedList: [],
|
||||||
autoStart: this.$db.get('picBed.autoStart').value() || false,
|
autoStart: this.$db.get('picBed.autoStart').value() || false,
|
||||||
rename: this.$db.get('picBed.rename').value() || false,
|
rename: this.$db.get('picBed.rename').value() || false,
|
||||||
autoRename: this.$db.get('picBed.autoRename').value() || false
|
autoRename: this.$db.get('picBed.autoRename').value() || false,
|
||||||
|
uploadNotification: this.$db.get('picBed.uploadNotification').value() || false
|
||||||
},
|
},
|
||||||
picBed: this.$picBed,
|
picBed: this.$picBed,
|
||||||
keyBindingVisible: false,
|
keyBindingVisible: false,
|
||||||
@@ -302,6 +313,9 @@ export default {
|
|||||||
},
|
},
|
||||||
cancelCheckVersion () {
|
cancelCheckVersion () {
|
||||||
this.checkUpdateVisible = false
|
this.checkUpdateVisible = false
|
||||||
|
},
|
||||||
|
handleUploadNotification (val) {
|
||||||
|
this.$db.read().set('picBed.uploadNotification', val).write()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
|
|||||||
Reference in New Issue
Block a user