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

@@ -1,5 +1,5 @@
<template>
<div id="setting-page">
<div id="main-page">
<div class="fake-title-bar" :class="{ 'darwin': os === 'darwin' }">
<div class="fake-title-bar__title">
PicGo - {{ version }}
@@ -140,7 +140,7 @@ const customLinkRule = (rule: string, value: string, callback: (arg0?: Error) =>
}
}
@Component({
name: 'setting-page',
name: 'main-page',
mixins: [mixin],
components: {
InputBoxDialog
@@ -282,7 +282,7 @@ $darwinBg = transparentify(#172426, #000, 0.7)
font-size 20px
text-align center
margin 10px auto
#setting-page
#main-page
.fake-title-bar
-webkit-app-region drag
height h = 22px

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('请选择日志记录等级')

View File

@@ -22,9 +22,9 @@ export default new Router({
component: () => import(/* webpackChunkName: "MiniPage" */ '@/pages/MiniPage.vue')
},
{
path: '/setting',
name: 'setting-page',
component: () => import(/* webpackChunkName: "SettingPage" */ '@/layouts/SettingPage.vue'),
path: '/main-page',
name: 'main-page',
component: () => import(/* webpackChunkName: "SettingPage" */ '@/layouts/Main.vue'),
children: [
{
path: 'upload',