mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-07 00:17:03 +08:00
Partly finished: plugin system
This commit is contained in:
@@ -522,6 +522,7 @@ app.on('ready', () => {
|
|||||||
if (process.platform === 'darwin' || process.platform === 'win32') {
|
if (process.platform === 'darwin' || process.platform === 'win32') {
|
||||||
createTray()
|
createTray()
|
||||||
}
|
}
|
||||||
|
db.read().set('needReload', false).write()
|
||||||
updateChecker()
|
updateChecker()
|
||||||
|
|
||||||
globalShortcut.register(db.read().get('settings.shortKey.upload').value(), () => {
|
globalShortcut.register(db.read().get('settings.shortKey.upload').value(), () => {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const getPicBeds = (app) => {
|
|||||||
visible: visible ? visible.visible : true
|
visible: visible ? visible.visible : true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
picgo.cmd.program.removeAllListeners()
|
||||||
return picBeds
|
return picBeds
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,9 +114,14 @@ const handlePluginUpdate = (ipcMain, CONFIG_PATH) => {
|
|||||||
const handleGetPicBedConfig = (ipcMain, CONFIG_PATH) => {
|
const handleGetPicBedConfig = (ipcMain, CONFIG_PATH) => {
|
||||||
ipcMain.on('getPicBedConfig', (event, type) => {
|
ipcMain.on('getPicBedConfig', (event, type) => {
|
||||||
const picgo = new PicGo(CONFIG_PATH)
|
const picgo = new PicGo(CONFIG_PATH)
|
||||||
const config = handleConfigWithFunction(picgo.helper.uploader.get(type).config(picgo))
|
|
||||||
const name = picgo.helper.uploader.get(type).name || type
|
const name = picgo.helper.uploader.get(type).name || type
|
||||||
event.sender.send('getPicBedConfig', config, name)
|
if (picgo.helper.uploader.get(type).config) {
|
||||||
|
const config = handleConfigWithFunction(picgo.helper.uploader.get(type).config(picgo))
|
||||||
|
event.sender.send('getPicBedConfig', config, name)
|
||||||
|
} else {
|
||||||
|
event.sender.send('getPicBedConfig', [], name)
|
||||||
|
}
|
||||||
|
picgo.cmd.program.removeAllListeners()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,9 @@
|
|||||||
<i class="el-icon-info setting-window" @click="openDialog"></i>
|
<i class="el-icon-info setting-window" @click="openDialog"></i>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="19" :offset="5" style="height: 428px">
|
<el-col :span="19" :offset="5" style="height: 428px">
|
||||||
<router-view></router-view>
|
<transition name="picgo-fade" mode="out-in">
|
||||||
|
<router-view :key="$route.params ? $route.params.type : $route.path"></router-view>
|
||||||
|
</transition>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
@@ -174,10 +176,8 @@ export default {
|
|||||||
created () {
|
created () {
|
||||||
this.os = process.platform
|
this.os = process.platform
|
||||||
this.buildMenu()
|
this.buildMenu()
|
||||||
this.getPicBeds()
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
this.$electron.ipcRenderer.on('getPicBeds', (event, picBeds) => {
|
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||||
this.picBed = picBeds
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelect (index) {
|
handleSelect (index) {
|
||||||
@@ -195,7 +195,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'others',
|
name: 'others',
|
||||||
query: {
|
params: {
|
||||||
type: picBed
|
type: picBed
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -266,8 +266,8 @@ export default {
|
|||||||
openMiniWindow () {
|
openMiniWindow () {
|
||||||
this.$electron.ipcRenderer.send('openMiniWindow')
|
this.$electron.ipcRenderer.send('openMiniWindow')
|
||||||
},
|
},
|
||||||
getPicBeds () {
|
getPicBeds (event, picBeds) {
|
||||||
this.$electron.ipcRenderer.send('getPicBeds')
|
this.picBed = picBeds
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeRouteEnter: (to, from, next) => {
|
beforeRouteEnter: (to, from, next) => {
|
||||||
@@ -276,11 +276,19 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$electron.ipcRenderer.removeAllListeners('getPicBeds')
|
this.$electron.ipcRenderer.removeListener('getPicBeds', this.getPicBeds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='stylus'>
|
<style lang='stylus'>
|
||||||
|
.picgo-fade
|
||||||
|
&-enter,
|
||||||
|
&-leave,
|
||||||
|
&-leave-active
|
||||||
|
opacity 0
|
||||||
|
&-enter-active,
|
||||||
|
&-leave-active
|
||||||
|
transition opacity 100ms linear
|
||||||
.view-title
|
.view-title
|
||||||
color #eee
|
color #eee
|
||||||
font-size 20px
|
font-size 20px
|
||||||
|
|||||||
@@ -146,9 +146,8 @@ export default {
|
|||||||
this.filterList = this.getGallery()
|
this.filterList = this.getGallery()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.on('getPicBeds', (event, picBeds) => {
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
this.picBed = picBeds
|
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||||
})
|
|
||||||
this.getPasteStyle()
|
this.getPasteStyle()
|
||||||
this.getPicBeds()
|
this.getPicBeds()
|
||||||
},
|
},
|
||||||
@@ -163,8 +162,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getPicBeds () {
|
getPicBeds (event, picBeds) {
|
||||||
this.$electron.ipcRenderer.send('getPicBeds')
|
this.picBed = picBeds
|
||||||
},
|
},
|
||||||
getGallery () {
|
getGallery () {
|
||||||
if (this.choosedPicBed.length > 0) {
|
if (this.choosedPicBed.length > 0) {
|
||||||
@@ -343,7 +342,7 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$electron.ipcRenderer.removeAllListeners('updateGallery')
|
this.$electron.ipcRenderer.removeAllListeners('updateGallery')
|
||||||
this.$electron.ipcRenderer.removeAllListeners('getPicBeds')
|
this.$electron.ipcRenderer.removeListener('getPicBeds', this.getPicBeds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ export default {
|
|||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.os = process.platform
|
this.os = process.platform
|
||||||
this.getPicBeds()
|
|
||||||
this.$electron.ipcRenderer.on('uploadProgress', (event, progress) => {
|
this.$electron.ipcRenderer.on('uploadProgress', (event, progress) => {
|
||||||
if (progress !== -1) {
|
if (progress !== -1) {
|
||||||
this.showProgress = true
|
this.showProgress = true
|
||||||
@@ -49,10 +48,8 @@ export default {
|
|||||||
this.showError = true
|
this.showError = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.on('getPicBeds', (event, picBeds) => {
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
this.picBed = picBeds
|
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||||
this.buildMenu()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
window.addEventListener('mousedown', this.handleMouseDown, false)
|
window.addEventListener('mousedown', this.handleMouseDown, false)
|
||||||
@@ -73,8 +70,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getPicBeds () {
|
getPicBeds (event, picBeds) {
|
||||||
this.$electron.ipcRenderer.send('getPicBeds')
|
this.picBed = picBeds
|
||||||
|
this.buildMenu()
|
||||||
},
|
},
|
||||||
onDrop (e) {
|
onDrop (e) {
|
||||||
this.dragover = false
|
this.dragover = false
|
||||||
@@ -183,7 +181,7 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$electron.ipcRenderer.removeAllListeners('uploadProgress')
|
this.$electron.ipcRenderer.removeAllListeners('uploadProgress')
|
||||||
this.$electron.ipcRenderer.removeAllListeners('getPicBeds')
|
this.$electron.ipcRenderer.removeListener('getPicBeds', this.getPicBeds)
|
||||||
window.removeEventListener('mousedown', this.handleMouseDown, false)
|
window.removeEventListener('mousedown', this.handleMouseDown, false)
|
||||||
window.removeEventListener('mousemove', this.handleMouseMove, false)
|
window.removeEventListener('mousemove', this.handleMouseMove, false)
|
||||||
window.removeEventListener('mouseup', this.handleMouseUp, false)
|
window.removeEventListener('mouseup', this.handleMouseUp, false)
|
||||||
|
|||||||
@@ -273,19 +273,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.getPicBeds()
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
this.$electron.ipcRenderer.on('getPicBeds', (event, picBeds) => {
|
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPicBeds (event, picBeds) {
|
||||||
this.picBed = picBeds
|
this.picBed = picBeds
|
||||||
this.form.showPicBedList = this.picBed.map(item => {
|
this.form.showPicBedList = this.picBed.map(item => {
|
||||||
if (item.visible) {
|
if (item.visible) {
|
||||||
return item.name
|
return item.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getPicBeds () {
|
|
||||||
this.$electron.ipcRenderer.send('getPicBeds')
|
|
||||||
},
|
},
|
||||||
openConfigFile () {
|
openConfigFile () {
|
||||||
const { app, shell } = this.$electron.remote
|
const { app, shell } = this.$electron.remote
|
||||||
@@ -348,6 +346,7 @@ export default {
|
|||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
this.$db.read().set('picBed.list', list).write()
|
this.$db.read().set('picBed.list', list).write()
|
||||||
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
},
|
},
|
||||||
handleAutoStartChange (val) {
|
handleAutoStartChange (val) {
|
||||||
this.$db.read().set('settings.autoStart', val).write()
|
this.$db.read().set('settings.autoStart', val).write()
|
||||||
@@ -400,7 +399,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$electron.ipcRenderer.removeAllListeners('getPicBeds')
|
this.$electron.ipcRenderer.removeListener('getPicBeds', this.getPicBeds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -69,6 +69,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row v-show="needReload" class="reload-mask" :class="{ 'cut-width': pluginList.length > 6 }">
|
||||||
|
<el-button type="primary" @click="reloadApp" size="mini" round>重启以生效</el-button>
|
||||||
|
</el-row>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
:modal-append-to-body="false"
|
:modal-append-to-body="false"
|
||||||
@@ -107,7 +110,8 @@ export default {
|
|||||||
configName: '',
|
configName: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
pluginNameList: [],
|
pluginNameList: [],
|
||||||
loading: true
|
loading: true,
|
||||||
|
needReload: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -152,7 +156,9 @@ export default {
|
|||||||
item.ing = false
|
item.ing = false
|
||||||
item.hasInstall = true
|
item.hasInstall = true
|
||||||
}
|
}
|
||||||
|
this.getPicBeds()
|
||||||
})
|
})
|
||||||
|
this.handleReload()
|
||||||
this.getPluginList()
|
this.getPluginList()
|
||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.on('uninstallSuccess', (evt, plugin) => {
|
this.$electron.ipcRenderer.on('uninstallSuccess', (evt, plugin) => {
|
||||||
@@ -160,11 +166,12 @@ export default {
|
|||||||
this.pluginList = this.pluginList.filter(item => {
|
this.pluginList = this.pluginList.filter(item => {
|
||||||
if (item.name === plugin) { // restore Uploader & Transformer after uninstalling
|
if (item.name === plugin) { // restore Uploader & Transformer after uninstalling
|
||||||
if (item.config.transformer.name) {
|
if (item.config.transformer.name) {
|
||||||
this.handleRestoreState('transformer')
|
this.handleRestoreState('transformer', item.config.transformer.name)
|
||||||
}
|
}
|
||||||
if (item.config.uploader.name) {
|
if (item.config.uploader.name) {
|
||||||
this.handleRestoreState('uploader')
|
this.handleRestoreState('uploader', item.config.uploader.name)
|
||||||
}
|
}
|
||||||
|
this.getPicBeds()
|
||||||
}
|
}
|
||||||
return item.name !== plugin
|
return item.name !== plugin
|
||||||
})
|
})
|
||||||
@@ -172,6 +179,7 @@ export default {
|
|||||||
})
|
})
|
||||||
this.getPluginList()
|
this.getPluginList()
|
||||||
this.getSearchResult = debounce(this.getSearchResult, 50)
|
this.getSearchResult = debounce(this.getSearchResult, 50)
|
||||||
|
this.needReload = this.$db.read().get('needReload').value()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buildContextMenu (plugin) {
|
buildContextMenu (plugin) {
|
||||||
@@ -182,6 +190,7 @@ export default {
|
|||||||
click () {
|
click () {
|
||||||
_this.$db.read().set(`plugins.picgo-plugin-${plugin.name}`, true).write()
|
_this.$db.read().set(`plugins.picgo-plugin-${plugin.name}`, true).write()
|
||||||
plugin.enabled = true
|
plugin.enabled = true
|
||||||
|
_this.getPicBeds()
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
label: '禁用插件',
|
label: '禁用插件',
|
||||||
@@ -189,6 +198,13 @@ export default {
|
|||||||
click () {
|
click () {
|
||||||
_this.$db.read().set(`plugins.picgo-plugin-${plugin.name}`, false).write()
|
_this.$db.read().set(`plugins.picgo-plugin-${plugin.name}`, false).write()
|
||||||
plugin.enabled = false
|
plugin.enabled = false
|
||||||
|
_this.getPicBeds()
|
||||||
|
if (plugin.config.transformer.name) {
|
||||||
|
_this.handleRestoreState('transformer', plugin.config.transformer.name)
|
||||||
|
}
|
||||||
|
if (plugin.config.uploader.name) {
|
||||||
|
_this.handleRestoreState('uploader', plugin.config.uploader.name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
label: '卸载插件',
|
label: '卸载插件',
|
||||||
@@ -221,6 +237,9 @@ export default {
|
|||||||
getPluginList () {
|
getPluginList () {
|
||||||
this.$electron.ipcRenderer.send('getPluginList')
|
this.$electron.ipcRenderer.send('getPluginList')
|
||||||
},
|
},
|
||||||
|
getPicBeds () {
|
||||||
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
|
},
|
||||||
installPlugin (item) {
|
installPlugin (item) {
|
||||||
item.ing = true
|
item.ing = true
|
||||||
this.$electron.ipcRenderer.send('installPlugin', item.name)
|
this.$electron.ipcRenderer.send('installPlugin', item.name)
|
||||||
@@ -245,6 +264,16 @@ export default {
|
|||||||
this.$electron.remote.app.relaunch()
|
this.$electron.remote.app.relaunch()
|
||||||
this.$electron.remote.app.exit(0)
|
this.$electron.remote.app.exit(0)
|
||||||
},
|
},
|
||||||
|
handleReload () {
|
||||||
|
this.$db.read().set('needReload', true).write()
|
||||||
|
this.needReload = true
|
||||||
|
const successNotification = new window.Notification('更新成功', {
|
||||||
|
body: '请点击此通知重启应用以生效'
|
||||||
|
})
|
||||||
|
successNotification.onclick = () => {
|
||||||
|
this.reloadApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
cleanSearch () {
|
cleanSearch () {
|
||||||
this.searchText = ''
|
this.searchText = ''
|
||||||
},
|
},
|
||||||
@@ -301,12 +330,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// restore Uploader & Transformer
|
// restore Uploader & Transformer
|
||||||
handleRestoreState (item) {
|
handleRestoreState (item, name) {
|
||||||
if (item === 'uploader') {
|
if (item === 'uploader') {
|
||||||
this.$db.set('picBed.current', 'smms')
|
const current = this.$db.read().get('picBed.current').value()
|
||||||
|
console.log(name)
|
||||||
|
if (current === name) {
|
||||||
|
this.$db.read().set('picBed.current', 'smms').write()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item === 'transformer') {
|
if (item === 'transformer') {
|
||||||
this.$db.set('picBed.transformer', 'path')
|
const current = this.$db.read().get('picBed.transformer').value()
|
||||||
|
if (current === name) {
|
||||||
|
this.$db.read().set('picBed.transformer', 'path').write()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openHomepage (url) {
|
openHomepage (url) {
|
||||||
@@ -433,4 +469,13 @@ export default {
|
|||||||
&:hover
|
&:hover
|
||||||
background: #1B9EF3
|
background: #1B9EF3
|
||||||
color #fff
|
color #fff
|
||||||
|
.reload-mask
|
||||||
|
position absolute
|
||||||
|
width calc(100% - 40px)
|
||||||
|
bottom -320px
|
||||||
|
text-align center
|
||||||
|
background rgba(0,0,0,0.4)
|
||||||
|
padding 10px 0
|
||||||
|
&.cut-width
|
||||||
|
width calc(100% - 48px)
|
||||||
</style>
|
</style>
|
||||||
@@ -84,11 +84,8 @@ export default {
|
|||||||
this.$electron.ipcRenderer.on('syncPicBed', () => {
|
this.$electron.ipcRenderer.on('syncPicBed', () => {
|
||||||
this.getDefaultPicBed()
|
this.getDefaultPicBed()
|
||||||
})
|
})
|
||||||
this.getPicBeds()
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
this.$electron.ipcRenderer.on('getPicBeds', (event, picBeds) => {
|
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||||
this.picBed = picBeds
|
|
||||||
this.getDefaultPicBed()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
progress (val) {
|
progress (val) {
|
||||||
@@ -106,7 +103,7 @@ export default {
|
|||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$electron.ipcRenderer.removeAllListeners('uploadProgress')
|
this.$electron.ipcRenderer.removeAllListeners('uploadProgress')
|
||||||
this.$electron.ipcRenderer.removeAllListeners('syncPicBed')
|
this.$electron.ipcRenderer.removeAllListeners('syncPicBed')
|
||||||
this.$electron.ipcRenderer.removeAllListeners('getPicBeds')
|
this.$electron.ipcRenderer.removeListener('getPicBeds', this.getPicBeds)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onDrop (e) {
|
onDrop (e) {
|
||||||
@@ -149,8 +146,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPicBeds () {
|
getPicBeds (event, picBeds) {
|
||||||
this.$electron.ipcRenderer.send('getPicBeds')
|
this.picBed = picBeds
|
||||||
|
this.getDefaultPicBed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
{{ picBedName }}设置
|
{{ picBedName }}设置
|
||||||
</div>
|
</div>
|
||||||
<config-form
|
<config-form
|
||||||
|
v-if="config.length > 0"
|
||||||
:config="config"
|
:config="config"
|
||||||
type="uploader"
|
type="uploader"
|
||||||
ref="configForm"
|
ref="configForm"
|
||||||
@@ -17,7 +18,10 @@
|
|||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</config-form>
|
</config-form>
|
||||||
|
<div v-else class="single">
|
||||||
|
<div class="notice">暂无配置项</div>
|
||||||
|
<el-button type="success" @click="setDefaultPicBed(type)" round :disabled="defaultPicBed === type" size="mini">设为默认图床</el-button>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,15 +42,10 @@ export default {
|
|||||||
picBedName: ''
|
picBedName: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeRouteEnter (to, from, next) {
|
created () {
|
||||||
next(vm => {
|
this.type = this.$route.params.type
|
||||||
vm.type = to.query.type
|
this.$electron.ipcRenderer.send('getPicBedConfig', this.$route.params.type)
|
||||||
vm.$electron.ipcRenderer.send('getPicBedConfig', to.query.type)
|
this.$electron.ipcRenderer.on('getPicBedConfig', this.getPicBeds)
|
||||||
vm.$electron.ipcRenderer.on('getPicBedConfig', (event, config, name) => {
|
|
||||||
vm.config = config
|
|
||||||
vm.picBedName = name
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async handleConfirm () {
|
async handleConfirm () {
|
||||||
@@ -71,10 +70,14 @@ export default {
|
|||||||
successNotification.onclick = () => {
|
successNotification.onclick = () => {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
getPicBeds (event, config, name) {
|
||||||
|
this.config = config
|
||||||
|
this.picBedName = name
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$electron.ipcRenderer.removeAllListeners('getPicBedConfig')
|
this.$electron.ipcRenderer.removeListener('getPicBedConfig', this.getPicBeds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -97,4 +100,10 @@ export default {
|
|||||||
color #eee
|
color #eee
|
||||||
&.is-active
|
&.is-active
|
||||||
color #409EFF
|
color #409EFF
|
||||||
|
.notice
|
||||||
|
color #eee
|
||||||
|
text-align center
|
||||||
|
margin-bottom 10px
|
||||||
|
.single
|
||||||
|
text-align center
|
||||||
</style>
|
</style>
|
||||||
@@ -71,7 +71,7 @@ export default new Router({
|
|||||||
name: 'imgur'
|
name: 'imgur'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'others',
|
path: 'others/:type',
|
||||||
component: require('@/pages/picbeds/Others').default,
|
component: require('@/pages/picbeds/Others').default,
|
||||||
name: 'others'
|
name: 'others'
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user