Skip to content

Commit

Permalink
feat: #319 PicGO图形化配置界面-事件监听
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 12, 2023
1 parent 1ab10c7 commit ad3ca12
Show file tree
Hide file tree
Showing 19 changed files with 367 additions and 65 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -40,4 +40,6 @@ coverage
out
.pnpm-store
public/lib/picgo/picgo.cfg.json
public/lib/picgo/picgo.cfg.dev.json
public/lib/picgo/picgo.cfg.dev.json

__pycache__
6 changes: 6 additions & 0 deletions components/picgo/PicgoSetting.vue
Expand Up @@ -57,8 +57,13 @@
<picbed-setting :is-reload="isReload" />
</el-tab-pane>
<el-tab-pane :label="$t('setting.picgo.picgo')">
<!-- PicGO配置 -->
<picgo-config-setting />
</el-tab-pane>
<el-tab-pane :label="$t('setting.picgo.plugin')">
<!-- PicGO插件配置 -->
<picgo-plugin-setting />
</el-tab-pane>
</el-tabs>
</div>
<div v-else>
Expand All @@ -74,6 +79,7 @@ import PicbedSetting from "~/components/picgo/setting/PicbedSetting.vue"
import PicgoConfigSetting from "~/components/picgo/setting/PicgoConfigSetting.vue"
import { ref } from "vue"
import picgoUtil from "~/utils/otherlib/picgoUtil"
import PicgoPluginSetting from "~/components/picgo/setting/PicgoPluginSetting.vue"
const isReload = ref(false)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/picgo/setting/PicbedSetting.vue
Expand Up @@ -139,7 +139,7 @@ import { LogFactory } from "~/utils/logUtil"
import dateUtil from "../../../utils/dateUtil"
import { usePicbedStore } from "~/stores/picbedStore"
import { useI18n } from "vue-i18n"
import ConfigForm from "~/components/picgo/setting/ConfigForm.vue"
import ConfigForm from "~/components/picgo/common/ConfigForm.vue"
const logger = LogFactory.getLogger(
"components/picgo/setting/PicbedSetting.vue"
Expand Down
258 changes: 258 additions & 0 deletions components/picgo/setting/PicgoPluginSetting.vue
@@ -0,0 +1,258 @@
<!--
- Copyright (c) 2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Terwer designates this
- particular file as subject to the "Classpath" exception as provided
- by Terwer in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
- or visit www.terwer.space if you need additional information or have any
- questions.
-->

<template>
<div id="plugin-view">
<div class="view-title">
{{ $t("setting.picgo.plugin") }} -
<el-tooltip :content="$t('setting.picgo.plugin.list')" placement="right">
<el-button class="el-icon-goods" @click="goAwesomeList">
<font-awesome-icon icon="fa-solid fa-cart-shopping" />
</el-button>
</el-tooltip>
<el-tooltip
:content="$t('setting.picgo.plugin.import.local')"
placement="left"
>
<el-button class="el-icon-download" @click="handleImportLocalPlugin">
<font-awesome-icon icon="fa-solid fa-download" />
</el-button>
</el-tooltip>
</div>
</div>
</template>

<script lang="ts" setup>
import picgoUtil from "~/utils/otherlib/picgoUtil"
function goAwesomeList() {
window.open("https://github.com/PicGo/Awesome-PicGo")
}
function handleImportLocalPlugin() {
picgoUtil.ipcHandleImportLocalPlugin()
}
</script>

<style lang="stylus">
$darwinBg = #172426
#plugin-view
position relative
padding 0 20px 0
.el-loading-mask
background-color rgba(0, 0, 0, 0.8)
.plugin-list
align-content flex-start
height: 339px;
box-sizing: border-box;
padding: 8px 15px;
overflow-y: auto;
overflow-x: hidden;
position: absolute;
top: 70px;
left: 5px;
transition: all 0.2s ease-in-out 0.1s;
width: 100%
.el-loading-mask
left: 20px
width: calc(100% - 40px)
.view-title
color var(--custom-app-color)
font-size 20px
text-align center
margin 10px auto
position relative
button
height 24px
margin-top -4px
border none
padding-left 12px
width 24px
button:hover, button:focus
background transparent
button.el-icon-goods
margin-left 4px
font-size 20px
vertical-align middle
cursor pointer
transition color .2s ease-in-out
&:hover
color #49B1F5
button.el-icon-download
position absolute
right 0
top 8px
font-size 20px
vertical-align middle
cursor pointer
transition color .2s ease-in-out
&:hover
color #49B1F5
.handle-bar
margin-bottom 20px
&.cut-width
padding-right: 8px
.el-input__inner
border-radius 0
.plugin-item
box-sizing border-box
height 80px
background #444
padding 8px
user-select text
transition all .2s ease-in-out
position relative
&__container
height 80px
margin-bottom 10px
.cli-only-badge
position absolute
right 0px
top 0
font-size 12px
padding 3px 8px
background #49B1F5
color #eee
&.darwin
background transparentify($darwinBg, #000, 0.75)
&:hover
background transparentify($darwinBg, #000, 0.85)
&:hover
background #333
&__logo
width 64px
height 64px
float left
&__content
float left
width calc(100% - 72px)
height 64px
color #ddd
margin-left 8px
display flex
flex-direction column
justify-content space-between
&.disabled
color #aaa
&__name
font-size 16px
height 22px
line-height 22px
// font-weight 600
font-weight 600
cursor pointer
transition all .2s ease-in-out
&:hover
color: #1B9EF3
&__desc
font-size 14px
height 21px
line-height 21px
overflow hidden
text-overflow ellipsis
white-space nowrap
&__info-bar
font-size 14px
height 21px
line-height 28px
position relative
&__author
overflow hidden
text-overflow ellipsis
white-space nowrap
&__config
float right
font-size 16px
cursor pointer
transition all .2s ease-in-out
&:hover
color: #1B9EF3
.config-button
font-size 12px
color #ddd
background #222
padding 1px 8px
height 18px
line-height 18px
text-align center
position absolute
top 4px
right 20px
transition all .2s ease-in-out
&.reload
right 0px
&.ing
right 0px
&.install
right 0px
&:hover
background: #1B9EF3
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>
4 changes: 4 additions & 0 deletions components/publish/PublishService.vue
Expand Up @@ -51,6 +51,9 @@
<el-tab-pane name="dynamic-platform" :label="$t('dynamic.platform.new')">
<dynamic-platform />
</el-tab-pane>
<el-tab-pane name="picgo-setting" :label="$t('picgo.pic.setting')">
<picgo-setting />
</el-tab-pane>
</el-tabs>
</template>

Expand All @@ -61,6 +64,7 @@ import DynamicPlatform from "~/components/publish/tab/DynamicPlatform.vue"
import ServiceSwitch from "~/components/publish/tab/ServiceSwitch.vue"
import PlatformSetting from "~/components/publish/tab/PlatformSetting.vue"
import PlatformMain from "~/components/publish/tab/PlatformMain.vue"
import PicgoSetting from "~/components/picgo/PicgoSetting.vue"
const logger = LogFactory.getLogger("components/publish/PublishService.vue")
Expand Down
3 changes: 3 additions & 0 deletions locales/en_US.ts
Expand Up @@ -453,4 +453,7 @@ export default {
"setting.picgo.setting.close": "Close",
"setting.picgo.setting.open": "Open",
"setting.picgo.setting.log.file": "Log file",
"setting.picgo.plugin": "Plugin setting",
"setting.picgo.plugin.list": "Plugin list",
"setting.picgo.plugin.import.local": "Import local plugin",
}
3 changes: 3 additions & 0 deletions locales/zh_CN.ts
Expand Up @@ -452,4 +452,7 @@ export default {
"setting.picgo.setting.close": "关",
"setting.picgo.setting.open": "开",
"setting.picgo.setting.log.file": "日志文件",
"setting.picgo.plugin": "插件设置",
"setting.picgo.plugin.list": "插件列表",
"setting.picgo.plugin.import.local": "导入本地插件",
}
7 changes: 4 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "sy-post-publisher",
"private": true,
"version": "0.7.0-beta5",
"version": "0.7.0-beta6",
"scripts": {
"serve": "python scripts/serve.py",
"dev": "python scripts/dev.py",
Expand All @@ -11,13 +11,13 @@
"docs": "jsdoc -c jsdoc.json utils/api.ts",
"prettier": "prettier --write .",
"prepare": "husky install",
"new": "python scripts/version.py 0.7.0-beta5",
"new": "python scripts/version.py 0.7.0-beta6",
"widget": "python scripts/widget.py",
"ext": "python scripts/ext.py",
"package": "pnpm widget && pnpm ext"
},
"dependencies": {
"@element-plus/icons-vue": "^2.0.9",
"@element-plus/icons-vue": "^2.0.10",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-regular-svg-icons": "^6.2.1",
Expand Down Expand Up @@ -73,6 +73,7 @@
"node-localstorage": "^2.2.1",
"prettier": "2.8.3",
"sass": "^1.56.1",
"stylus": "^0.59.0",
"typescript": "^4.9.3",
"unplugin-vue-components": "^0.22.11",
"vercel": "^28.7.0",
Expand Down
5 changes: 4 additions & 1 deletion plugins/font-awesome/font-awesome.ts
Expand Up @@ -31,6 +31,7 @@ import {
faArrowRotateRight,
faBolt,
faBookOpenReader,
faCartShopping,
faCircleXmark,
faCreditCard,
faDownload,
Expand All @@ -48,7 +49,7 @@ import {
faUpload,
faXmark,
} from "@fortawesome/free-solid-svg-icons"
import { faChrome } from "@fortawesome/free-brands-svg-icons"
import { faChrome, faShopify } from "@fortawesome/free-brands-svg-icons"

const logger = LogFactory.getLogger("plugins/font-awesome/font-awesome.ts")

Expand All @@ -74,6 +75,8 @@ const FontAwesome: PluginObject<any> = {
library.add(faArrowRotateRight)
library.add(faTrashCan)
library.add(faPenToSquare)
library.add(faShopify)
library.add(faCartShopping)

Vue.component("font-awesome-icon", FontAwesomeIcon)
logger.debug("FontAwesome inited")
Expand Down

0 comments on commit ad3ca12

Please sign in to comment.