mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-06 16:07:06 +08:00
Added: picgo-setting page
This commit is contained in:
+28
-11
@@ -1,24 +1,41 @@
|
|||||||
|
import weiboUpload from '../main/utils/weiboUpload'
|
||||||
|
import qiniuUpload from '../main/utils/qiniuUpload'
|
||||||
|
import tcYunUpload from '../main/utils/tcYunUpload'
|
||||||
|
import upYunUpload from '../main/utils/upYunUpload'
|
||||||
|
import githubUpload from '../main/utils/githubUpload'
|
||||||
|
|
||||||
const picBed = [
|
const picBed = [
|
||||||
{
|
{
|
||||||
title: '微博图床',
|
type: 'weibo',
|
||||||
value: 'weibo'
|
name: '微博图床'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '七牛云',
|
type: 'qiniu',
|
||||||
value: 'qiniu'
|
name: '七牛图床'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '腾讯COS',
|
type: 'tcyun',
|
||||||
value: 'tcyun'
|
name: '腾讯云COS'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '又拍云',
|
type: 'upyun',
|
||||||
value: 'upyun'
|
name: '又拍云图床'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'GitHub图床',
|
type: 'github',
|
||||||
value: 'github'
|
name: 'GitHub图床'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
export default picBed
|
const picBedHandler = {
|
||||||
|
weibo: weiboUpload,
|
||||||
|
qiniu: qiniuUpload,
|
||||||
|
tcyun: tcYunUpload,
|
||||||
|
upyun: upYunUpload,
|
||||||
|
github: githubUpload
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
picBed,
|
||||||
|
picBedHandler
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
class="picgo-sidebar"
|
class="picgo-sidebar"
|
||||||
:default-active="defaultActive"
|
:default-active="defaultActive"
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
|
:unique-opened="true"
|
||||||
>
|
>
|
||||||
<el-menu-item index="upload">
|
<el-menu-item index="upload">
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
@@ -29,29 +30,21 @@
|
|||||||
<i class="el-icon-menu"></i>
|
<i class="el-icon-menu"></i>
|
||||||
<span>图床设置</span>
|
<span>图床设置</span>
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item index="weibo">
|
<el-menu-item
|
||||||
<i class="el-icon-ui-weibo"></i>
|
v-for="item in picBed"
|
||||||
<span slot="title">微博设置</span>
|
:index="item.type"
|
||||||
</el-menu-item>
|
:key="item.type"
|
||||||
<el-menu-item index="qiniu">
|
>
|
||||||
<i class="el-icon-ui-qiniu"></i>
|
<i :class="`el-icon-ui-${item.type}`"></i>
|
||||||
<span slot="title">七牛云设置</span>
|
<span slot="title">{{ item.name }}</span>
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="tcyun">
|
|
||||||
<i class="el-icon-ui-tcyun"></i>
|
|
||||||
<span slot="title">腾讯COS设置</span>
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="upyun">
|
|
||||||
<i class="el-icon-ui-upyun"></i>
|
|
||||||
<span slot="title">又拍云设置</span>
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="github">
|
|
||||||
<i class="el-icon-ui-github"></i>
|
|
||||||
<span slot="title">GitHub设置</span>
|
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
|
<el-menu-item index="setting">
|
||||||
|
<i class="el-icon-setting"></i>
|
||||||
|
<span slot="title">PicGo设置</span>
|
||||||
|
</el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
<i class="el-icon-setting" @click="openDialog"></i>
|
<i class="el-icon-setting setting-window" @click="openDialog"></i>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="19" :offset="5">
|
<el-col :span="19" :offset="5">
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
@@ -157,6 +150,7 @@ import pkg from '../../../package.json'
|
|||||||
import keyDetect from 'utils/key-binding'
|
import keyDetect from 'utils/key-binding'
|
||||||
import { remote } from 'electron'
|
import { remote } from 'electron'
|
||||||
import db from '../../datastore'
|
import db from '../../datastore'
|
||||||
|
import { picBed } from '../../datastore/pic-bed'
|
||||||
const { Menu, dialog, BrowserWindow } = remote
|
const { Menu, dialog, BrowserWindow } = remote
|
||||||
export default {
|
export default {
|
||||||
name: 'setting-page',
|
name: 'setting-page',
|
||||||
@@ -186,7 +180,8 @@ export default {
|
|||||||
os: '',
|
os: '',
|
||||||
shortKey: {
|
shortKey: {
|
||||||
upload: db.read().get('shortKey.upload').value()
|
upload: db.read().get('shortKey.upload').value()
|
||||||
}
|
},
|
||||||
|
picBed
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@@ -323,7 +318,7 @@ export default {
|
|||||||
overflow-x hidden
|
overflow-x hidden
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
width 170px
|
width 170px
|
||||||
.el-icon-setting
|
.el-icon-setting.setting-window
|
||||||
position fixed
|
position fixed
|
||||||
bottom 4px
|
bottom 4px
|
||||||
left 4px
|
left 4px
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="gallery-list__tool-panel">
|
<div class="gallery-list__tool-panel">
|
||||||
<i class="el-icon-document" @click="copy(item)"></i>
|
<i class="el-icon-document" @click="copy(item.imgUrl)"></i>
|
||||||
<i class="el-icon-edit-outline" @click="openDialog(item)"></i>
|
<i class="el-icon-edit-outline" @click="openDialog(item)"></i>
|
||||||
<i class="el-icon-delete" @click="remove(item.id)"></i>
|
<i class="el-icon-delete" @click="remove(item.id)"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<div id="picgo-setting">
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="6">
|
||||||
|
<div class="view-title">
|
||||||
|
PicGo设置
|
||||||
|
</div>
|
||||||
|
<el-form
|
||||||
|
label-width="120px"
|
||||||
|
label-position="right"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-form-item
|
||||||
|
label="设定快捷键"
|
||||||
|
>
|
||||||
|
<el-button type="primary" round size="mini">点击设置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="自定义链接格式"
|
||||||
|
>
|
||||||
|
<el-button type="primary" round size="mini">点击设置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="打开更新助手"
|
||||||
|
>
|
||||||
|
<el-switch
|
||||||
|
v-model="form.updateHelper"
|
||||||
|
active-text="开"
|
||||||
|
inactive-text="关"
|
||||||
|
></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'picgo-setting',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
updateHelper: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang='stylus'>
|
||||||
|
.el-message
|
||||||
|
left 60%
|
||||||
|
.view-title
|
||||||
|
color #eee
|
||||||
|
font-size 20px
|
||||||
|
text-align center
|
||||||
|
margin 20px auto
|
||||||
|
#picgo-setting
|
||||||
|
.el-form
|
||||||
|
label
|
||||||
|
line-height 32px
|
||||||
|
padding-bottom 0
|
||||||
|
color #eee
|
||||||
|
.el-button-group
|
||||||
|
width 100%
|
||||||
|
.el-button
|
||||||
|
width 50%
|
||||||
|
.el-input__inner
|
||||||
|
border-radius 19px
|
||||||
|
.el-radio-group
|
||||||
|
margin-left 25px
|
||||||
|
.el-switch__label
|
||||||
|
color #eee
|
||||||
|
&.is-active
|
||||||
|
color #409EFF
|
||||||
|
.el-icon-question
|
||||||
|
font-size 20px
|
||||||
|
float right
|
||||||
|
margin-top 9px
|
||||||
|
color #eee
|
||||||
|
cursor pointer
|
||||||
|
transition .2s color ease-in-out
|
||||||
|
&:hover
|
||||||
|
color #409EFF
|
||||||
|
</style>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import mixin from '../mixin'
|
import mixin from '../mixin'
|
||||||
import picBed from '../../../datastore/pic-bed'
|
import { picBed } from '../../../datastore/pic-bed'
|
||||||
export default {
|
export default {
|
||||||
name: 'upload',
|
name: 'upload',
|
||||||
mixins: [mixin],
|
mixins: [mixin],
|
||||||
@@ -133,8 +133,8 @@ export default {
|
|||||||
getDefaultPicBed () {
|
getDefaultPicBed () {
|
||||||
const current = this.$db.read().get('picBed.current').value()
|
const current = this.$db.read().get('picBed.current').value()
|
||||||
picBed.forEach(item => {
|
picBed.forEach(item => {
|
||||||
if (item.value === current) {
|
if (item.type === current) {
|
||||||
this.picBed = item.title
|
this.picBed = item.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ export default new Router({
|
|||||||
path: 'gallery',
|
path: 'gallery',
|
||||||
component: require('@/components/SettingView/Gallery').default,
|
component: require('@/components/SettingView/Gallery').default,
|
||||||
name: 'gallery'
|
name: 'gallery'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'setting',
|
||||||
|
component: require('@/components/SettingView/PicGoSetting').default,
|
||||||
|
name: 'setting'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user