Feature: add autoCopy option for users to use or not

This commit is contained in:
Molunerfinn
2020-03-19 21:03:21 +08:00
parent cd70a1a5cc
commit 67e526f163
10 changed files with 51 additions and 17 deletions

View File

@@ -4,10 +4,10 @@
PicGo设置 - <i class="el-icon-document" @click="goConfigPage"></i>
</div>
<el-row class="setting-list">
<el-col :span="15" :offset="4">
<el-col :span="16" :offset="4">
<el-row>
<el-form
label-width="120px"
label-width="160px"
label-position="right"
size="small"
>
@@ -107,6 +107,16 @@
@change="handleMiniWindowOntop"
></el-switch>
</el-form-item>
<el-form-item
label="上传后自动复制URL"
>
<el-switch
v-model="form.autoCopyUrl"
active-text=""
inactive-text=""
@change="handleAutoCopyUrl"
></el-switch>
</el-form-item>
<el-form-item
label="选择显示的图床"
>
@@ -336,7 +346,8 @@ export default class extends Vue {
autoRename: db.get('settings.autoRename') || false,
uploadNotification: db.get('settings.uploadNotification') || false,
miniWindowOntop: db.get('settings.miniWindowOntop') || false,
logLevel
logLevel,
autoCopyUrl: db.get('settings.autoCopy') === undefined ? true : db.get('settings.autoCopy')
}
picBed: IPicBedType[] = []
logFileVisible = false
@@ -513,6 +524,15 @@ export default class extends Vue {
db.set('settings.miniWindowOntop', val)
this.$message.info('需要重启生效')
}
handleAutoCopyUrl (val: boolean) {
db.set('settings.autoCopy', val)
const successNotification = new Notification('设置自动复制链接', {
body: '设置成功'
})
successNotification.onclick = () => {
return true
}
}
confirmLogLevelSetting () {
if (this.form.logLevel.length === 0) {
return this.$message.error('请选择日志记录等级')