mirror of
https://github.com/Molunerfinn/PicGo.git
synced 2024-04-21 10:31:33 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8978166328 | ||
|
|
7f1769733b | ||
|
|
e5fbe750ae | ||
|
|
ed539cf206 | ||
|
|
74c7016d2c | ||
|
|
407b821aca | ||
|
|
6db86ec359 | ||
|
|
c64959a139 | ||
|
|
6122e17d75 | ||
|
|
37f1d34abc | ||
|
|
3dd20857aa | ||
|
|
4a11d9830b | ||
|
|
0165879f2d | ||
|
|
17302fe3e4 | ||
|
|
f65d2d2df4 | ||
|
|
af19de7168 | ||
|
|
9ab9e1973c | ||
|
|
a4056cbe58 | ||
|
|
69d660fe7e | ||
|
|
058e903789 | ||
|
|
53cdddf44a | ||
|
|
2315aad732 | ||
|
|
7f8c6fd60e | ||
|
|
10959f3c54 | ||
|
|
1f4f40848e | ||
|
|
7ef76b0a9b | ||
|
|
f87311760a | ||
|
|
d597477a79 | ||
|
|
2bcbf749d1 | ||
|
|
59dd2c0b55 | ||
|
|
43bace3212 | ||
|
|
649e9f0695 | ||
|
|
e8f2185bbb |
@@ -0,0 +1,28 @@
|
|||||||
|
# :tada: 2.1.0 (2019-04-15)
|
||||||
|
|
||||||
|
|
||||||
|
### :sparkles: Features
|
||||||
|
|
||||||
|
* add commandline argvs support for picgo app ([6db86ec](https://github.com/Molunerfinn/PicGo/commit/6db86ec))
|
||||||
|
* add gui-api for remove event ([407b821](https://github.com/Molunerfinn/PicGo/commit/407b821)), closes [#201](https://github.com/Molunerfinn/PicGo/issues/201)
|
||||||
|
* add windows context menu ([e5fbe75](https://github.com/Molunerfinn/PicGo/commit/e5fbe75))
|
||||||
|
* add workflow for mac ([7f17697](https://github.com/Molunerfinn/PicGo/commit/7f17697))
|
||||||
|
* support commandline -> upload images in clipboard ([74c7016](https://github.com/Molunerfinn/PicGo/commit/74c7016))
|
||||||
|
|
||||||
|
|
||||||
|
### :bug: Bug Fixes
|
||||||
|
|
||||||
|
* qiniu area option from select group -> input ([c64959a](https://github.com/Molunerfinn/PicGo/commit/c64959a)), closes [#230](https://github.com/Molunerfinn/PicGo/issues/230)
|
||||||
|
|
||||||
|
|
||||||
|
### :pencil: Documentation
|
||||||
|
|
||||||
|
* add brew cask source ([6122e17](https://github.com/Molunerfinn/PicGo/commit/6122e17))
|
||||||
|
|
||||||
|
|
||||||
|
### :package: Chore
|
||||||
|
|
||||||
|
* add picgo bump-version ([37f1d34](https://github.com/Molunerfinn/PicGo/commit/37f1d34))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
MIT License
|
The 996ICU License (996ICU)
|
||||||
Copyright (c) <year> <copyright holders>
|
Version 0.1, March 2019
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
PACKAGE is distributed under LICENSE with the following restriction:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above license is only granted to entities that act in concordance
|
||||||
|
with local labor laws. In addition, the following requirements must be
|
||||||
|
observed:
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* The licencee must not, explicitly or implicitly, request or schedule
|
||||||
|
their employees to work more than 45 hours in any single week.
|
||||||
|
* The licencee must not, explicitly or implicitly, request or schedule
|
||||||
|
their employees to be at work consecutively for 10 hours.
|
||||||
@@ -18,6 +18,9 @@
|
|||||||
<a href="https://github.com/Molunerfinn/PicGo/releases/latest">
|
<a href="https://github.com/Molunerfinn/PicGo/releases/latest">
|
||||||
<img src="https://img.shields.io/github/release/Molunerfinn/PicGo.svg?style=flat-square" alt="">
|
<img src="https://img.shields.io/github/release/Molunerfinn/PicGo.svg?style=flat-square" alt="">
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/PicGo/bump-version">
|
||||||
|
<img src="https://img.shields.io/badge/picgo-convention-blue.svg?style=flat-square" alt="">
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## 应用说明
|
## 应用说明
|
||||||
@@ -50,11 +53,13 @@ PicGo支持自定义快捷键,使用方法见[配置手册](https://picgo.gith
|
|||||||
|
|
||||||
## 下载安装
|
## 下载安装
|
||||||
|
|
||||||
macOS用户请下载最新版本的`dmg`文件,windows用户请下载最新版本的`exe`文件,linux用户请下载`AppImage`文件。
|
|
||||||
|
|
||||||
点击此处下载[应用](https://github.com/Molunerfinn/PicGo/releases)。
|
点击此处下载[应用](https://github.com/Molunerfinn/PicGo/releases)。
|
||||||
|
|
||||||
**如果你是Arch类的Linux用户,可以直接通过`aurman -S picgo-appimage`来安装PicGo。感谢@houbaron的贡献!**
|
macOS用户请下载最新版本的`dmg`文件,windows用户请下载最新版本的`exe`文件,linux用户请下载`AppImage`文件。
|
||||||
|
|
||||||
|
**如果你是Arch类的Linux用户,可以直接通过`aurman -S picgo-appimage`来安装PicGo。感谢 @houbaron 的贡献!**
|
||||||
|
|
||||||
|
**如果你是macOS用户,可以使用brew cask来安装PicGo: `brew cask install picgo`。感谢 @womeimingzi11 的贡献!**
|
||||||
|
|
||||||
## 应用截图
|
## 应用截图
|
||||||
|
|
||||||
@@ -117,4 +122,4 @@ npm run build
|
|||||||
|
|
||||||
[MIT](http://opensource.org/licenses/MIT)
|
[MIT](http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
Copyright (c) 2017 Molunerfinn
|
Copyright (c) 2017 - 2019 Molunerfinn
|
||||||
|
|||||||
+13
-8
@@ -1,8 +1,13 @@
|
|||||||
!macro preInit
|
!macro customInstall
|
||||||
SetRegView 64
|
SetRegView 64
|
||||||
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\PicGo"
|
WriteRegStr HKCR "*\shell\PicGo" "" "Upload pictures w&ith PicGo"
|
||||||
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\PicGo"
|
WriteRegStr HKCR "*\shell\PicGo" "Icon" "$INSTDIR\PicGo.exe"
|
||||||
SetRegView 32
|
WriteRegStr HKCR "*\shell\PicGo\command" "" '"$INSTDIR\PicGo.exe" "upload" "%1"'
|
||||||
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\PicGo"
|
SetRegView 32
|
||||||
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\PicGo"
|
WriteRegStr HKCR "*\shell\PicGo" "" "Upload pictures w&ith PicGo"
|
||||||
!macroend
|
WriteRegStr HKCR "*\shell\PicGo" "Icon" "$INSTDIR\PicGo.exe"
|
||||||
|
WriteRegStr HKCR "*\shell\PicGo\command" "" '"$INSTDIR\PicGo.exe" "upload" "%1"'
|
||||||
|
!macroend
|
||||||
|
!macro customUninstall
|
||||||
|
DeleteRegKey HKCR "*\shell\PicGo"
|
||||||
|
!macroend
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
small(v-if="version") {{ version }}
|
small(v-if="version") {{ version }}
|
||||||
h2.desc 图片上传+管理新体验
|
h2.desc 图片上传+管理新体验
|
||||||
button.download(@click="goLink('https://github.com/Molunerfinn/picgo/releases')") 免费下载
|
button.download(@click="goLink('https://github.com/Molunerfinn/picgo/releases')") 免费下载
|
||||||
button.download(@click="goLink('https://github.com/Molunerfinn/picgo')") 在github上查看
|
button.download(@click="goLink('https://picgo.github.io/PicGo-Doc/zh/guide/')") 查看文档
|
||||||
h3.desc
|
h3.desc
|
||||||
| 基于#[a(href="https://github.com/SimulatedGREG/electron-vue" target="_blank") electron-vue]开发
|
| 基于#[a(href="https://github.com/SimulatedGREG/electron-vue" target="_blank") electron-vue]开发
|
||||||
h3.desc
|
h3.desc
|
||||||
|
|||||||
+30
-4
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "picgo",
|
"name": "picgo",
|
||||||
"version": "2.0.2",
|
"version": "2.1.0",
|
||||||
"author": "Molunerfinn <marksz@teamsz.xyz>",
|
"author": "Molunerfinn <marksz@teamsz.xyz>",
|
||||||
"description": "Easy to upload your pic & copy to write",
|
"description": "Easy to upload your pic & copy to write",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -26,7 +26,27 @@
|
|||||||
"docs": "webpack-dev-server --content-base docs/dist --config .electron-vue/webpack.docs.config.js --hot --inline",
|
"docs": "webpack-dev-server --content-base docs/dist --config .electron-vue/webpack.docs.config.js --hot --inline",
|
||||||
"patch": "npm version patch && git push origin master && git push origin --tags",
|
"patch": "npm version patch && git push origin master && git push origin --tags",
|
||||||
"minor": "npm version minor && git push origin master && git push origin --tags",
|
"minor": "npm version minor && git push origin master && git push origin --tags",
|
||||||
"major": "npm version major && git push origin master && git push origin --tags"
|
"major": "npm version major && git push origin master && git push origin --tags",
|
||||||
|
"cz": "git-cz",
|
||||||
|
"bump": "bump-version"
|
||||||
|
},
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"commitizen": {
|
||||||
|
"path": "./node_modules/cz-customizable"
|
||||||
|
},
|
||||||
|
"cz-customizable": {
|
||||||
|
"config": "./node_modules/@picgo/bump-version/.cz-config.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commitlint": {
|
||||||
|
"extends": [
|
||||||
|
"./node_modules/@picgo/bump-version/commitlint-picgo"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"productName": "PicGo",
|
"productName": "PicGo",
|
||||||
@@ -82,7 +102,7 @@
|
|||||||
"lowdb": "^1.0.0",
|
"lowdb": "^1.0.0",
|
||||||
"md5": "^2.2.1",
|
"md5": "^2.2.1",
|
||||||
"melody.css": "^1.0.2",
|
"melody.css": "^1.0.2",
|
||||||
"picgo": "^1.2.4",
|
"picgo": "^1.3.5",
|
||||||
"qiniu": "^7.1.1",
|
"qiniu": "^7.1.1",
|
||||||
"vue": "^2.3.3",
|
"vue": "^2.3.3",
|
||||||
"vue-electron": "^1.0.6",
|
"vue-electron": "^1.0.6",
|
||||||
@@ -92,6 +112,8 @@
|
|||||||
"vuex": "^2.3.1"
|
"vuex": "^2.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@commitlint/cli": "^7.5.2",
|
||||||
|
"@picgo/bump-version": "^1.0.2",
|
||||||
"babel-core": "^6.25.0",
|
"babel-core": "^6.25.0",
|
||||||
"babel-eslint": "^7.2.3",
|
"babel-eslint": "^7.2.3",
|
||||||
"babel-loader": "^7.1.1",
|
"babel-loader": "^7.1.1",
|
||||||
@@ -104,12 +126,15 @@
|
|||||||
"cfonts": "^1.1.3",
|
"cfonts": "^1.1.3",
|
||||||
"chai": "^4.0.0",
|
"chai": "^4.0.0",
|
||||||
"chalk": "^2.1.0",
|
"chalk": "^2.1.0",
|
||||||
|
"commitizen": "^3.0.7",
|
||||||
|
"conventional-changelog": "^3.0.6",
|
||||||
"copy-webpack-plugin": "^4.0.1",
|
"copy-webpack-plugin": "^4.0.1",
|
||||||
"cross-env": "^5.0.5",
|
"cross-env": "^5.0.5",
|
||||||
"css-loader": "^0.28.4",
|
"css-loader": "^0.28.4",
|
||||||
|
"cz-customizable": "^5.10.0",
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"devtron": "^1.4.0",
|
"devtron": "^1.4.0",
|
||||||
"electron": "4.0.0",
|
"electron": "4.0.2",
|
||||||
"electron-builder": "^20.38.4",
|
"electron-builder": "^20.38.4",
|
||||||
"electron-debug": "^1.4.0",
|
"electron-debug": "^1.4.0",
|
||||||
"electron-devtools-installer": "^2.2.0",
|
"electron-devtools-installer": "^2.2.0",
|
||||||
@@ -124,6 +149,7 @@
|
|||||||
"eslint-plugin-standard": "^3.0.1",
|
"eslint-plugin-standard": "^3.0.1",
|
||||||
"file-loader": "^3.0.1",
|
"file-loader": "^3.0.1",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
|
"husky": "^1.3.1",
|
||||||
"inject-loader": "^3.0.0",
|
"inject-loader": "^3.0.0",
|
||||||
"karma": "^1.3.0",
|
"karma": "^1.3.0",
|
||||||
"karma-chai": "^0.1.0",
|
"karma-chai": "^0.1.0",
|
||||||
|
|||||||
+32
-3
@@ -43,10 +43,39 @@ if (!db.has('settings.shortKey').value()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// init generate clipboard image files
|
// init generate clipboard image files
|
||||||
|
let clipboardFiles = getClipboardFiles()
|
||||||
if (!fs.pathExistsSync(path.join(STORE_PATH, 'windows.ps1'))) {
|
if (!fs.pathExistsSync(path.join(STORE_PATH, 'windows.ps1'))) {
|
||||||
fs.copySync(path.join(__static, '/linux.sh'), path.join(STORE_PATH, '/linux.sh'))
|
clipboardFiles.forEach(item => {
|
||||||
fs.copySync(path.join(__static, '/mac.applescript'), path.join(STORE_PATH, '/mac.applescript'))
|
fs.copyFileSync(item.origin, item.dest)
|
||||||
fs.copySync(path.join(__static, '/windows.ps1'), path.join(STORE_PATH, '/windows.ps1'))
|
})
|
||||||
|
} else {
|
||||||
|
clipboardFiles.forEach(item => {
|
||||||
|
diffFilesAndUpdate(item.origin, item.dest)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function diffFilesAndUpdate (filePath1, filePath2) {
|
||||||
|
let file1 = fs.readFileSync(filePath1)
|
||||||
|
let file2 = fs.readFileSync(filePath2)
|
||||||
|
|
||||||
|
if (!file1.equals(file2)) {
|
||||||
|
fs.copyFileSync(filePath1, filePath2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getClipboardFiles () {
|
||||||
|
let files = [
|
||||||
|
'/linux.sh',
|
||||||
|
'/mac.applescript',
|
||||||
|
'/windows.ps1'
|
||||||
|
]
|
||||||
|
|
||||||
|
return files.map(item => {
|
||||||
|
return {
|
||||||
|
origin: path.join(__static, item),
|
||||||
|
dest: path.join(STORE_PATH, item)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default db
|
export default db
|
||||||
|
|||||||
+83
-38
@@ -3,12 +3,17 @@
|
|||||||
import Uploader from './utils/uploader.js'
|
import Uploader from './utils/uploader.js'
|
||||||
import { app, BrowserWindow, Tray, Menu, Notification, clipboard, ipcMain, globalShortcut, dialog } from 'electron'
|
import { app, BrowserWindow, Tray, Menu, Notification, clipboard, ipcMain, globalShortcut, dialog } from 'electron'
|
||||||
import db from '../datastore'
|
import db from '../datastore'
|
||||||
|
import beforeOpen from './utils/beforeOpen'
|
||||||
import pasteTemplate from './utils/pasteTemplate'
|
import pasteTemplate from './utils/pasteTemplate'
|
||||||
import updateChecker from './utils/updateChecker'
|
import updateChecker from './utils/updateChecker'
|
||||||
import { getPicBeds } from './utils/getPicBeds'
|
import { getPicBeds } from './utils/getPicBeds'
|
||||||
import pkg from '../../package.json'
|
import pkg from '../../package.json'
|
||||||
import picgoCoreIPC from './utils/picgoCoreIPC'
|
import picgoCoreIPC from './utils/picgoCoreIPC'
|
||||||
import fixPath from 'fix-path'
|
import fixPath from 'fix-path'
|
||||||
|
import { getUploadFiles } from './utils/handleArgv'
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
beforeOpen()
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Set `__static` path to static files in production
|
* Set `__static` path to static files in production
|
||||||
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
|
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
|
||||||
@@ -210,6 +215,7 @@ const createWindow = () => {
|
|||||||
window.on('blur', () => {
|
window.on('blur', () => {
|
||||||
window.hide()
|
window.hide()
|
||||||
})
|
})
|
||||||
|
return window
|
||||||
}
|
}
|
||||||
|
|
||||||
const createMiniWidow = () => {
|
const createMiniWidow = () => {
|
||||||
@@ -219,7 +225,7 @@ const createMiniWidow = () => {
|
|||||||
let obj = {
|
let obj = {
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
show: true,
|
show: false,
|
||||||
frame: false,
|
frame: false,
|
||||||
fullscreenable: false,
|
fullscreenable: false,
|
||||||
skipTaskbar: true,
|
skipTaskbar: true,
|
||||||
@@ -250,6 +256,7 @@ const createMiniWidow = () => {
|
|||||||
miniWindow.on('closed', () => {
|
miniWindow.on('closed', () => {
|
||||||
miniWindow = null
|
miniWindow = null
|
||||||
})
|
})
|
||||||
|
return miniWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
const createSettingWindow = () => {
|
const createSettingWindow = () => {
|
||||||
@@ -289,6 +296,7 @@ const createSettingWindow = () => {
|
|||||||
})
|
})
|
||||||
createMenu()
|
createMenu()
|
||||||
createMiniWidow()
|
createMiniWidow()
|
||||||
|
return settingWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
const createMenu = () => {
|
const createMenu = () => {
|
||||||
@@ -337,7 +345,7 @@ const uploadClipboardFiles = async () => {
|
|||||||
if (miniWindow.isVisible()) {
|
if (miniWindow.isVisible()) {
|
||||||
win = miniWindow
|
win = miniWindow
|
||||||
} else {
|
} else {
|
||||||
win = settingWindow || window
|
win = settingWindow || window || createSettingWindow()
|
||||||
}
|
}
|
||||||
let img = await new Uploader(undefined, win.webContents).upload()
|
let img = await new Uploader(undefined, win.webContents).upload()
|
||||||
if (img !== false) {
|
if (img !== false) {
|
||||||
@@ -367,38 +375,9 @@ const uploadClipboardFiles = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
picgoCoreIPC(app, ipcMain)
|
const uploadChoosedFiles = async (webContents, files) => {
|
||||||
|
|
||||||
// from macOS tray
|
|
||||||
ipcMain.on('uploadClipboardFiles', async (evt, file) => {
|
|
||||||
const img = await new Uploader(file, window.webContents).upload()
|
|
||||||
if (img !== false) {
|
|
||||||
const pasteStyle = db.read().get('settings.pasteStyle').value() || 'markdown'
|
|
||||||
const url = img[0].url || img[0].imgUrl
|
|
||||||
clipboard.writeText(pasteTemplate(pasteStyle, url))
|
|
||||||
const notification = new Notification({
|
|
||||||
title: '上传成功',
|
|
||||||
body: img[0].imgUrl,
|
|
||||||
// icon: file[0]
|
|
||||||
icon: img[0].imgUrl
|
|
||||||
})
|
|
||||||
notification.show()
|
|
||||||
db.read().get('uploaded').insert(img[0]).write()
|
|
||||||
window.webContents.send('clipboardFiles', [])
|
|
||||||
window.webContents.send('uploadFiles')
|
|
||||||
if (settingWindow) {
|
|
||||||
settingWindow.webContents.send('updateGallery')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
ipcMain.on('uploadClipboardFilesFromUploadPage', () => {
|
|
||||||
uploadClipboardFiles()
|
|
||||||
})
|
|
||||||
|
|
||||||
ipcMain.on('uploadChoosedFiles', async (evt, files) => {
|
|
||||||
const input = files.map(item => item.path)
|
const input = files.map(item => item.path)
|
||||||
const imgs = await new Uploader(input, evt.sender).upload()
|
const imgs = await new Uploader(input, webContents).upload()
|
||||||
if (imgs !== false) {
|
if (imgs !== false) {
|
||||||
const pasteStyle = db.read().get('settings.pasteStyle').value() || 'markdown'
|
const pasteStyle = db.read().get('settings.pasteStyle').value() || 'markdown'
|
||||||
let pasteText = ''
|
let pasteText = ''
|
||||||
@@ -421,6 +400,39 @@ ipcMain.on('uploadChoosedFiles', async (evt, files) => {
|
|||||||
settingWindow.webContents.send('updateGallery')
|
settingWindow.webContents.send('updateGallery')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
picgoCoreIPC(app, ipcMain)
|
||||||
|
|
||||||
|
// from macOS tray
|
||||||
|
ipcMain.on('uploadClipboardFiles', async (evt, file) => {
|
||||||
|
const img = await new Uploader(undefined, window.webContents).upload()
|
||||||
|
if (img !== false) {
|
||||||
|
const pasteStyle = db.read().get('settings.pasteStyle').value() || 'markdown'
|
||||||
|
const url = img[0].url || img[0].imgUrl
|
||||||
|
clipboard.writeText(pasteTemplate(pasteStyle, url))
|
||||||
|
const notification = new Notification({
|
||||||
|
title: '上传成功',
|
||||||
|
body: img[0].imgUrl,
|
||||||
|
// icon: file[0]
|
||||||
|
icon: img[0].imgUrl
|
||||||
|
})
|
||||||
|
notification.show()
|
||||||
|
db.read().get('uploaded').insert(img[0]).write()
|
||||||
|
window.webContents.send('clipboardFiles', [])
|
||||||
|
if (settingWindow) {
|
||||||
|
settingWindow.webContents.send('updateGallery')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.webContents.send('uploadFiles')
|
||||||
|
})
|
||||||
|
|
||||||
|
ipcMain.on('uploadClipboardFilesFromUploadPage', () => {
|
||||||
|
uploadClipboardFiles()
|
||||||
|
})
|
||||||
|
|
||||||
|
ipcMain.on('uploadChoosedFiles', async (evt, files) => {
|
||||||
|
return uploadChoosedFiles(evt, files)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('updateShortKey', (evt, oldKey) => {
|
ipcMain.on('updateShortKey', (evt, oldKey) => {
|
||||||
@@ -491,12 +503,29 @@ const gotTheLock = app.requestSingleInstanceLock()
|
|||||||
if (!gotTheLock) {
|
if (!gotTheLock) {
|
||||||
app.quit()
|
app.quit()
|
||||||
} else {
|
} else {
|
||||||
if (settingWindow) {
|
app.on('second-instance', (event, commandLine, workingDirectory) => {
|
||||||
if (settingWindow.isMinimized()) {
|
let files = getUploadFiles(commandLine, workingDirectory)
|
||||||
settingWindow.restore()
|
if (files === null || files.length > 0) { // 如果有文件列表作为参数,说明是命令行启动
|
||||||
|
if (files === null) {
|
||||||
|
uploadClipboardFiles()
|
||||||
|
} else {
|
||||||
|
let win
|
||||||
|
if (miniWindow && miniWindow.isVisible()) {
|
||||||
|
win = miniWindow
|
||||||
|
} else {
|
||||||
|
win = settingWindow || window || createSettingWindow()
|
||||||
|
}
|
||||||
|
uploadChoosedFiles(win.webContents, files)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (settingWindow) {
|
||||||
|
if (settingWindow.isMinimized()) {
|
||||||
|
settingWindow.restore()
|
||||||
|
}
|
||||||
|
settingWindow.focus()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settingWindow.focus()
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
@@ -519,6 +548,22 @@ app.on('ready', () => {
|
|||||||
globalShortcut.register(db.read().get('settings.shortKey.upload').value(), () => {
|
globalShortcut.register(db.read().get('settings.shortKey.upload').value(), () => {
|
||||||
uploadClipboardFiles()
|
uploadClipboardFiles()
|
||||||
})
|
})
|
||||||
|
if (process.env.NODE_ENV !== 'development') {
|
||||||
|
let files = getUploadFiles()
|
||||||
|
if (files === null || files.length > 0) { // 如果有文件列表作为参数,说明是命令行启动
|
||||||
|
if (files === null) {
|
||||||
|
uploadClipboardFiles()
|
||||||
|
} else {
|
||||||
|
let win
|
||||||
|
if (miniWindow && miniWindow.isVisible()) {
|
||||||
|
win = miniWindow
|
||||||
|
} else {
|
||||||
|
win = settingWindow || window || createSettingWindow()
|
||||||
|
}
|
||||||
|
uploadChoosedFiles(win.webContents, files)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import fs from 'fs-extra'
|
||||||
|
import path from 'path'
|
||||||
|
import os from 'os'
|
||||||
|
if (process.env.NODE_ENV !== 'development') {
|
||||||
|
global.__static = path.join(__dirname, '/static').replace(/\\/g, '\\\\')
|
||||||
|
}
|
||||||
|
if (process.env.DEBUG_ENV === 'debug') {
|
||||||
|
global.__static = path.join(__dirname, '../../../static').replace(/\\/g, '\\\\')
|
||||||
|
}
|
||||||
|
function beforeOpen () {
|
||||||
|
const dest = `${os.homedir}/Library/Services/Upload pictures with PicGo.workflow`
|
||||||
|
if (fs.existsSync(dest)) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
fs.copySync(path.join(__static, 'Upload pictures with PicGo.workflow'), dest)
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default beforeOpen
|
||||||
@@ -87,19 +87,39 @@ class GuiApi {
|
|||||||
* For notification
|
* For notification
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
*/
|
*/
|
||||||
showNotification (options) {
|
showNotification (options = {
|
||||||
if (options === undefined) {
|
title: '',
|
||||||
options = {
|
body: ''
|
||||||
title: '',
|
}) {
|
||||||
body: ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const notification = new Notification({
|
const notification = new Notification({
|
||||||
title: options.title,
|
title: options.title,
|
||||||
body: options.body
|
body: options.body
|
||||||
})
|
})
|
||||||
notification.show()
|
notification.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {Object} options
|
||||||
|
*/
|
||||||
|
showMessageBox (options = {
|
||||||
|
title: '',
|
||||||
|
message: '',
|
||||||
|
type: 'info',
|
||||||
|
buttons: ['Yes', 'No']
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
dialog.showMessageBox(
|
||||||
|
BrowserWindow.fromWebContents(this[WEBCONTENTS]),
|
||||||
|
options,
|
||||||
|
(result, checkboxChecked) => {
|
||||||
|
resolve({
|
||||||
|
result,
|
||||||
|
checkboxChecked
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default GuiApi
|
export default GuiApi
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import path from 'path'
|
||||||
|
import fs from 'fs-extra'
|
||||||
|
const getUploadFiles = (argv = process.argv, cwd = process.cwd()) => {
|
||||||
|
let files = argv.slice(1)
|
||||||
|
if (files.length > 0 && files[0] === 'upload') {
|
||||||
|
if (files.length === 1) {
|
||||||
|
return null // for uploading images in clipboard
|
||||||
|
} else if (files.length > 1) {
|
||||||
|
files = argv.slice(1)
|
||||||
|
let result = []
|
||||||
|
if (files.length > 0) {
|
||||||
|
result = files.map(item => {
|
||||||
|
if (path.isAbsolute(item)) {
|
||||||
|
return {
|
||||||
|
path: item
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let tempPath = path.join(cwd, item)
|
||||||
|
if (fs.existsSync(tempPath)) {
|
||||||
|
return {
|
||||||
|
path: tempPath
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).filter(item => item !== null)
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
getUploadFiles
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import GuiApi from './guiApi'
|
import GuiApi from './guiApi'
|
||||||
|
import { dialog, shell } from 'electron'
|
||||||
|
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
const requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require
|
const requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require
|
||||||
@@ -89,41 +90,63 @@ const handleGetPluginList = (ipcMain, STORE_PATH, CONFIG_PATH) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handlePluginInstall = (ipcMain, CONFIG_PATH) => {
|
const handlePluginInstall = (ipcMain, CONFIG_PATH) => {
|
||||||
ipcMain.on('installPlugin', (event, msg) => {
|
ipcMain.on('installPlugin', async (event, msg) => {
|
||||||
const picgo = new PicGo(CONFIG_PATH)
|
const picgo = new PicGo(CONFIG_PATH)
|
||||||
const pluginHandler = new PluginHandler(picgo)
|
const pluginHandler = new PluginHandler(picgo)
|
||||||
picgo.on('installSuccess', notice => {
|
picgo.on('installSuccess', notice => {
|
||||||
event.sender.send('installSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
|
event.sender.send('installSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
|
||||||
})
|
})
|
||||||
|
picgo.on('failed', () => {
|
||||||
|
handleNPMError()
|
||||||
|
})
|
||||||
|
await pluginHandler.uninstall([msg])
|
||||||
pluginHandler.install([msg])
|
pluginHandler.install([msg])
|
||||||
picgo.cmd.program.removeAllListeners()
|
picgo.cmd.program.removeAllListeners()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePluginUninstall = (ipcMain, CONFIG_PATH) => {
|
const handlePluginUninstall = (ipcMain, CONFIG_PATH) => {
|
||||||
ipcMain.on('uninstallPlugin', (event, msg) => {
|
ipcMain.on('uninstallPlugin', async (event, msg) => {
|
||||||
const picgo = new PicGo(CONFIG_PATH)
|
const picgo = new PicGo(CONFIG_PATH)
|
||||||
const pluginHandler = new PluginHandler(picgo)
|
const pluginHandler = new PluginHandler(picgo)
|
||||||
picgo.on('uninstallSuccess', notice => {
|
picgo.on('uninstallSuccess', notice => {
|
||||||
event.sender.send('uninstallSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
|
event.sender.send('uninstallSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
|
||||||
})
|
})
|
||||||
pluginHandler.uninstall([msg])
|
picgo.on('failed', () => {
|
||||||
|
handleNPMError()
|
||||||
|
})
|
||||||
|
await pluginHandler.uninstall([msg])
|
||||||
picgo.cmd.program.removeAllListeners()
|
picgo.cmd.program.removeAllListeners()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePluginUpdate = (ipcMain, CONFIG_PATH) => {
|
const handlePluginUpdate = (ipcMain, CONFIG_PATH) => {
|
||||||
ipcMain.on('updatePlugin', (event, msg) => {
|
ipcMain.on('updatePlugin', async (event, msg) => {
|
||||||
const picgo = new PicGo(CONFIG_PATH)
|
const picgo = new PicGo(CONFIG_PATH)
|
||||||
const pluginHandler = new PluginHandler(picgo)
|
const pluginHandler = new PluginHandler(picgo)
|
||||||
picgo.on('updateSuccess', notice => {
|
picgo.on('updateSuccess', notice => {
|
||||||
event.sender.send('updateSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
|
event.sender.send('updateSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
|
||||||
})
|
})
|
||||||
pluginHandler.update([msg])
|
picgo.on('failed', () => {
|
||||||
|
handleNPMError()
|
||||||
|
})
|
||||||
|
await pluginHandler.update([msg])
|
||||||
picgo.cmd.program.removeAllListeners()
|
picgo.cmd.program.removeAllListeners()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleNPMError = () => {
|
||||||
|
dialog.showMessageBox({
|
||||||
|
title: '发生错误',
|
||||||
|
message: '请安装Node.js并重启PicGo再继续操作',
|
||||||
|
buttons: ['Yes']
|
||||||
|
}, (res) => {
|
||||||
|
if (res === 0) {
|
||||||
|
shell.openExternal('https://nodejs.org/')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
||||||
@@ -157,7 +180,10 @@ const handlePluginActions = (ipcMain, CONFIG_PATH) => {
|
|||||||
const handleRemoveFiles = (ipcMain, CONFIG_PATH) => {
|
const handleRemoveFiles = (ipcMain, CONFIG_PATH) => {
|
||||||
ipcMain.on('removeFiles', (event, files) => {
|
ipcMain.on('removeFiles', (event, files) => {
|
||||||
const picgo = new PicGo(CONFIG_PATH)
|
const picgo = new PicGo(CONFIG_PATH)
|
||||||
picgo.emit('remove', files)
|
const guiApi = new GuiApi(ipcMain, event.sender, picgo)
|
||||||
|
setTimeout(() => {
|
||||||
|
picgo.emit('remove', files, guiApi)
|
||||||
|
}, 500)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,12 @@
|
|||||||
class="main-wrapper"
|
class="main-wrapper"
|
||||||
:class="{ 'darwin': os === 'darwin' }">
|
:class="{ 'darwin': os === 'darwin' }">
|
||||||
<transition name="picgo-fade" mode="out-in">
|
<transition name="picgo-fade" mode="out-in">
|
||||||
<router-view :key="$route.params ? $route.params.type : $route.path"></router-view>
|
<keep-alive>
|
||||||
|
<router-view v-if="$route.meta.keepAlive"></router-view>
|
||||||
|
</keep-alive>
|
||||||
|
</transition>
|
||||||
|
<transition name="picgo-fade" mode="out-in">
|
||||||
|
<router-view :key="$route.path" v-if="!$route.meta.keepAlive"></router-view>
|
||||||
</transition>
|
</transition>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -138,6 +143,20 @@
|
|||||||
<el-button type="primary" @click="confirmCustomLink">确定</el-button>
|
<el-button type="primary" @click="confirmCustomLink">确定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
:title="inputBoxOptions.title || '输入框'"
|
||||||
|
:visible.sync="showInputBoxVisible"
|
||||||
|
:modal-append-to-body="false"
|
||||||
|
@close="handleInputBoxClose"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="inputBoxValue"
|
||||||
|
:placeholder="inputBoxOptions.placeholder"></el-input>
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button @click="showInputBoxVisible = false" round>取消</el-button>
|
||||||
|
<el-button type="primary" @click="showInputBoxVisible = false" round>确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -177,7 +196,14 @@ export default {
|
|||||||
shortKey: {
|
shortKey: {
|
||||||
upload: db.read().get('shortKey.upload').value()
|
upload: db.read().get('shortKey.upload').value()
|
||||||
},
|
},
|
||||||
picBed: []
|
picBed: [],
|
||||||
|
// for showInputBox
|
||||||
|
showInputBoxVisible: false,
|
||||||
|
inputBoxValue: '',
|
||||||
|
inputBoxOptions: {
|
||||||
|
title: '',
|
||||||
|
placeholder: ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@@ -185,6 +211,12 @@ export default {
|
|||||||
this.buildMenu()
|
this.buildMenu()
|
||||||
this.$electron.ipcRenderer.send('getPicBeds')
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||||
|
this.$electron.ipcRenderer.on('showInputBox', (evt, options) => {
|
||||||
|
this.inputBoxValue = ''
|
||||||
|
this.inputBoxOptions.title = options.title || ''
|
||||||
|
this.inputBoxOptions.placeholder = options.placeholder || ''
|
||||||
|
this.showInputBoxVisible = true
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelect (index) {
|
handleSelect (index) {
|
||||||
@@ -275,6 +307,9 @@ export default {
|
|||||||
},
|
},
|
||||||
getPicBeds (event, picBeds) {
|
getPicBeds (event, picBeds) {
|
||||||
this.picBed = picBeds
|
this.picBed = picBeds
|
||||||
|
},
|
||||||
|
handleInputBoxClose () {
|
||||||
|
this.$electron.ipcRenderer.send('showInputBox', this.inputBoxValue)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeRouteEnter: (to, from, next) => {
|
beforeRouteEnter: (to, from, next) => {
|
||||||
@@ -284,6 +319,7 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.$electron.ipcRenderer.removeListener('getPicBeds', this.getPicBeds)
|
this.$electron.ipcRenderer.removeListener('getPicBeds', this.getPicBeds)
|
||||||
|
this.$electron.ipcRenderer.removeAllListeners('showInputBox')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -296,7 +332,7 @@ $darwinBg = transparentify(#172426, #000, 0.7)
|
|||||||
opacity 0
|
opacity 0
|
||||||
&-enter-active,
|
&-enter-active,
|
||||||
&-leave-active
|
&-leave-active
|
||||||
transition opacity 100ms linear
|
transition all 100ms linear
|
||||||
.view-title
|
.view-title
|
||||||
color #eee
|
color #eee
|
||||||
font-size 20px
|
font-size 20px
|
||||||
|
|||||||
@@ -74,9 +74,9 @@
|
|||||||
<el-col :span="6" v-for="(item, index) in images" :key="item.id" class="gallery-list__img">
|
<el-col :span="6" v-for="(item, index) in images" :key="item.id" class="gallery-list__img">
|
||||||
<div
|
<div
|
||||||
class="gallery-list__item"
|
class="gallery-list__item"
|
||||||
v-lazy:background-image="item.imgUrl"
|
|
||||||
@click="zoomImage(index)"
|
@click="zoomImage(index)"
|
||||||
>
|
>
|
||||||
|
<img v-lazy="item.imgUrl" class="gallery-list__item-img">
|
||||||
</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)"></i>
|
||||||
@@ -139,8 +139,14 @@ export default {
|
|||||||
picBed: []
|
picBed: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeRouteEnter (to, from, next) {
|
||||||
|
next(vm => {
|
||||||
|
vm.getGallery()
|
||||||
|
vm.getPasteStyle()
|
||||||
|
vm.getPicBeds()
|
||||||
|
})
|
||||||
|
},
|
||||||
created () {
|
created () {
|
||||||
this.getGallery()
|
|
||||||
this.$electron.ipcRenderer.on('updateGallery', (event) => {
|
this.$electron.ipcRenderer.on('updateGallery', (event) => {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.filterList = this.getGallery()
|
this.filterList = this.getGallery()
|
||||||
@@ -148,8 +154,6 @@ export default {
|
|||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.send('getPicBeds')
|
this.$electron.ipcRenderer.send('getPicBeds')
|
||||||
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||||
this.getPasteStyle()
|
|
||||||
this.getPicBeds()
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filterList: {
|
filterList: {
|
||||||
@@ -368,6 +372,8 @@ export default {
|
|||||||
transition all .2s ease-in-out
|
transition all .2s ease-in-out
|
||||||
&.active
|
&.active
|
||||||
transform: rotate(180deg)
|
transform: rotate(180deg)
|
||||||
|
#gallery-view
|
||||||
|
height 100%
|
||||||
.item-base
|
.item-base
|
||||||
background #2E2E2E
|
background #2E2E2E
|
||||||
text-align center
|
text-align center
|
||||||
@@ -417,12 +423,11 @@ export default {
|
|||||||
&__item
|
&__item
|
||||||
width 100%
|
width 100%
|
||||||
height 120px
|
height 120px
|
||||||
background-size cover
|
|
||||||
background-position 50% 50%
|
|
||||||
background-repeat no-repeat
|
|
||||||
transition all .2s ease-in-out
|
transition all .2s ease-in-out
|
||||||
cursor pointer
|
cursor pointer
|
||||||
margin-bottom 8px
|
margin-bottom 8px
|
||||||
|
overflow hidden
|
||||||
|
display flex
|
||||||
&-fake
|
&-fake
|
||||||
position absolute
|
position absolute
|
||||||
top 0
|
top 0
|
||||||
@@ -431,8 +436,10 @@ export default {
|
|||||||
width 100%
|
width 100%
|
||||||
z-index -1
|
z-index -1
|
||||||
&:hover
|
&:hover
|
||||||
background-color #49B1F5
|
|
||||||
transform scale(1.1)
|
transform scale(1.1)
|
||||||
|
&-img
|
||||||
|
width 100%
|
||||||
|
object-fit fill
|
||||||
&__tool-panel
|
&__tool-panel
|
||||||
color #ddd
|
color #ddd
|
||||||
i
|
i
|
||||||
|
|||||||
@@ -14,7 +14,12 @@
|
|||||||
<el-form-item
|
<el-form-item
|
||||||
label="打开配置文件"
|
label="打开配置文件"
|
||||||
>
|
>
|
||||||
<el-button type="primary" round size="mini" @click="openConfigFile">点击打开</el-button>
|
<el-button type="primary" round size="mini" @click="openFile('data.json')">点击打开</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="设置日志文件"
|
||||||
|
>
|
||||||
|
<el-button type="primary" round size="mini" @click="openLogSetting">点击设置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="修改上传快捷键"
|
label="修改上传快捷键"
|
||||||
@@ -215,6 +220,44 @@
|
|||||||
<el-button type="primary" @click="confirmCheckVersion" round>确定</el-button>
|
<el-button type="primary" @click="confirmCheckVersion" round>确定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
title="设置日志文件"
|
||||||
|
:visible.sync="logFileVisible"
|
||||||
|
:modal-append-to-body="false"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
label-position="right"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item
|
||||||
|
label="日志文件"
|
||||||
|
>
|
||||||
|
<el-button type="primary" round size="mini" @click="openFile('picgo.log')">点击打开</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="日志记录等级"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
v-model="form.logLevel"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
@change="handleLogLevelChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(value, key) of logLevel"
|
||||||
|
:key="key"
|
||||||
|
:label="value"
|
||||||
|
:value="key"
|
||||||
|
:disabled="handleLevelDisabled(key)"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button @click="cancelLogLevelSetting" round>取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirmLogLevelSetting" round>确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -250,9 +293,11 @@ export default {
|
|||||||
rename: this.$db.read().get('settings.rename').value() || false,
|
rename: this.$db.read().get('settings.rename').value() || false,
|
||||||
autoRename: this.$db.read().get('settings.autoRename').value() || false,
|
autoRename: this.$db.read().get('settings.autoRename').value() || false,
|
||||||
uploadNotification: this.$db.read().get('settings.uploadNotification').value() || false,
|
uploadNotification: this.$db.read().get('settings.uploadNotification').value() || false,
|
||||||
miniWindowOntop: this.$db.read().get('settings.miniWindowOntop').value() || false
|
miniWindowOntop: this.$db.read().get('settings.miniWindowOntop').value() || false,
|
||||||
|
logLevel: this.$db.read().get('settings.logLevel').value() || ['all']
|
||||||
},
|
},
|
||||||
picBed: [],
|
picBed: [],
|
||||||
|
logFileVisible: false,
|
||||||
keyBindingVisible: false,
|
keyBindingVisible: false,
|
||||||
customLinkVisible: false,
|
customLinkVisible: false,
|
||||||
checkUpdateVisible: false,
|
checkUpdateVisible: false,
|
||||||
@@ -269,6 +314,14 @@ export default {
|
|||||||
{ validator: customLinkRule, trigger: 'blur' }
|
{ validator: customLinkRule, trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
logLevel: {
|
||||||
|
all: '全部-All',
|
||||||
|
success: '成功-Success',
|
||||||
|
error: '错误-Error',
|
||||||
|
info: '普通-Info',
|
||||||
|
warn: '提醒-Warn',
|
||||||
|
none: '不记录日志-None'
|
||||||
|
},
|
||||||
version: pkg.version,
|
version: pkg.version,
|
||||||
latestVersion: '',
|
latestVersion: '',
|
||||||
os: ''
|
os: ''
|
||||||
@@ -288,11 +341,14 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
openConfigFile () {
|
openFile (file) {
|
||||||
const { app, shell } = this.$electron.remote
|
const { app, shell } = this.$electron.remote
|
||||||
const STORE_PATH = app.getPath('userData')
|
const STORE_PATH = app.getPath('userData')
|
||||||
const CONFIG_FILE = path.join(STORE_PATH, '/data.json')
|
const FILE = path.join(STORE_PATH, `/${file}`)
|
||||||
shell.openItem(CONFIG_FILE)
|
shell.openItem(FILE)
|
||||||
|
},
|
||||||
|
openLogSetting () {
|
||||||
|
this.logFileVisible = true
|
||||||
},
|
},
|
||||||
keyDetect (type, event) {
|
keyDetect (type, event) {
|
||||||
this.shortKey[type] = keyDetect(event).join('+')
|
this.shortKey[type] = keyDetect(event).join('+')
|
||||||
@@ -399,6 +455,43 @@ export default {
|
|||||||
handleMiniWindowOntop (val) {
|
handleMiniWindowOntop (val) {
|
||||||
this.$db.read().set('settings.miniWindowOntop', val).write()
|
this.$db.read().set('settings.miniWindowOntop', val).write()
|
||||||
this.$message('需要重启生效')
|
this.$message('需要重启生效')
|
||||||
|
},
|
||||||
|
confirmLogLevelSetting () {
|
||||||
|
if (this.form.logLevel.length === 0) {
|
||||||
|
return this.$message.error('请选择日志记录等级')
|
||||||
|
}
|
||||||
|
this.$db.read().set('settings.logLevel', this.form.logLevel).write()
|
||||||
|
const successNotification = new window.Notification('设置日志', {
|
||||||
|
body: '设置成功'
|
||||||
|
})
|
||||||
|
successNotification.onclick = () => {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
this.logFileVisible = false
|
||||||
|
},
|
||||||
|
cancelLogLevelSetting () {
|
||||||
|
this.logFileVisible = false
|
||||||
|
this.form.logLevel = this.$db.read().get('settings.logLevel').value() || 'all'
|
||||||
|
},
|
||||||
|
handleLevelDisabled (val) {
|
||||||
|
let currentLevel = val
|
||||||
|
let flagLevel
|
||||||
|
let result = this.form.logLevel.some(item => {
|
||||||
|
if (item === 'all' || item === 'none') {
|
||||||
|
flagLevel = item
|
||||||
|
}
|
||||||
|
return (item === 'all' || item === 'none')
|
||||||
|
})
|
||||||
|
if (result) {
|
||||||
|
if (currentLevel !== flagLevel) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
} else if (this.form.logLevel.length > 0) {
|
||||||
|
if (val === 'all' || val === 'none') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="plugin-view">
|
<div id="plugin-view">
|
||||||
<div class="view-title">
|
<div class="view-title">
|
||||||
插件设置
|
插件设置 - <i class="el-icon-goods" @click="goAwesomeList"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-row class="handle-bar" :class="{ 'cut-width': pluginList.length > 6 }">
|
<el-row class="handle-bar" :class="{ 'cut-width': pluginList.length > 6 }">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchText"
|
v-model="searchText"
|
||||||
placeholder="搜索npm上的PicGo插件"
|
placeholder="搜索npm上的PicGo插件,或者点击上方按钮查看优秀插件列表"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<i slot="suffix" class="el-input__icon el-icon-close" v-if="searchText" @click="cleanSearch" style="cursor: pointer"></i>
|
<i slot="suffix" class="el-input__icon el-icon-close" v-if="searchText" @click="cleanSearch" style="cursor: pointer"></i>
|
||||||
@@ -91,20 +91,6 @@
|
|||||||
<el-button type="primary" @click="handleConfirmConfig" round>确定</el-button>
|
<el-button type="primary" @click="handleConfirmConfig" round>确定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog
|
|
||||||
:title="inputBoxOptions.title || '输入框'"
|
|
||||||
:visible.sync="showInputBoxVisible"
|
|
||||||
:modal-append-to-body="false"
|
|
||||||
@close="handleInputBoxClose"
|
|
||||||
>
|
|
||||||
<el-input
|
|
||||||
v-model="inputBoxValue"
|
|
||||||
:placeholder="inputBoxOptions.placeholder"></el-input>
|
|
||||||
<span slot="footer">
|
|
||||||
<el-button @click="showInputBoxVisible = false" round>取消</el-button>
|
|
||||||
<el-button type="primary" @click="showInputBoxVisible = false" round>确定</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -128,14 +114,7 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
needReload: false,
|
needReload: false,
|
||||||
id: '',
|
id: '',
|
||||||
os: '',
|
os: ''
|
||||||
// for showInputBox
|
|
||||||
showInputBoxVisible: false,
|
|
||||||
inputBoxValue: '',
|
|
||||||
inputBoxOptions: {
|
|
||||||
title: '',
|
|
||||||
placeholder: ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -205,12 +184,6 @@ 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()
|
this.needReload = this.$db.read().get('needReload').value()
|
||||||
this.$electron.ipcRenderer.on('showInputBox', (evt, options) => {
|
|
||||||
this.inputBoxValue = ''
|
|
||||||
this.inputBoxOptions.title = options.title || ''
|
|
||||||
this.inputBoxOptions.placeholder = options.placeholder || ''
|
|
||||||
this.showInputBoxVisible = true
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buildContextMenu (plugin) {
|
buildContextMenu (plugin) {
|
||||||
@@ -437,8 +410,8 @@ export default {
|
|||||||
this.$electron.remote.shell.openExternal(url)
|
this.$electron.remote.shell.openExternal(url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleInputBoxClose () {
|
goAwesomeList () {
|
||||||
this.$electron.ipcRenderer.send('showInputBox', this.inputBoxValue)
|
this.$electron.remote.shell.openExternal('https://github.com/PicGo/Awesome-PicGo')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
@@ -446,7 +419,6 @@ export default {
|
|||||||
this.$electron.ipcRenderer.removeAllListeners('installSuccess')
|
this.$electron.ipcRenderer.removeAllListeners('installSuccess')
|
||||||
this.$electron.ipcRenderer.removeAllListeners('uninstallSuccess')
|
this.$electron.ipcRenderer.removeAllListeners('uninstallSuccess')
|
||||||
this.$electron.ipcRenderer.removeAllListeners('updateSuccess')
|
this.$electron.ipcRenderer.removeAllListeners('updateSuccess')
|
||||||
this.$electron.ipcRenderer.removeAllListeners('showInputBox')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -476,6 +448,10 @@ $darwinBg = #172426
|
|||||||
font-size 20px
|
font-size 20px
|
||||||
text-align center
|
text-align center
|
||||||
margin 10px auto
|
margin 10px auto
|
||||||
|
i.el-icon-goods
|
||||||
|
font-size 20px
|
||||||
|
vertical-align middle
|
||||||
|
cursor pointer
|
||||||
.handle-bar
|
.handle-bar
|
||||||
margin-bottom 20px
|
margin-bottom 20px
|
||||||
&.cut-width
|
&.cut-width
|
||||||
|
|||||||
@@ -4,15 +4,18 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="wait-upload-img" v-if="clipboardFiles.length > 0">
|
<div class="wait-upload-img" v-if="clipboardFiles.length > 0">
|
||||||
<div class="list-title">等待上传</div>
|
<div class="list-title">等待上传</div>
|
||||||
<div v-for="(item, index) in clipboardFiles" :key="index" class="img-list" :style="{height: calcHeight(item.width, item.height) + 'px'}">
|
<div v-for="(item, index) in clipboardFiles" :key="index" class="img-list">
|
||||||
<div class="upload-img__container" @click="uploadClipboardFiles">
|
<div
|
||||||
|
class="upload-img__container"
|
||||||
|
:class="{ upload: uploadFlag }"
|
||||||
|
@click="uploadClipboardFiles">
|
||||||
<img :src="item.imgUrl" class="upload-img">
|
<img :src="item.imgUrl" class="upload-img">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uploaded-img">
|
<div class="uploaded-img">
|
||||||
<div class="list-title">已上传</div>
|
<div class="list-title">已上传</div>
|
||||||
<div v-for="(item, index) in files" :key="index" class="img-list" :style="{height: calcHeight(item.width, item.height) + 'px'}">
|
<div v-for="item in files" :key="item.imgUrl" class="img-list">
|
||||||
<div class="upload-img__container" @click="copyTheLink(item)">
|
<div class="upload-img__container" @click="copyTheLink(item)">
|
||||||
<img :src="item.imgUrl" class="upload-img">
|
<img :src="item.imgUrl" class="upload-img">
|
||||||
</div>
|
</div>
|
||||||
@@ -36,7 +39,8 @@
|
|||||||
body: '',
|
body: '',
|
||||||
icon: ''
|
icon: ''
|
||||||
},
|
},
|
||||||
clipboardFiles: []
|
clipboardFiles: [],
|
||||||
|
uploadFlag: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -58,6 +62,8 @@
|
|||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.on('uploadFiles', (event) => {
|
this.$electron.ipcRenderer.on('uploadFiles', (event) => {
|
||||||
this.files = this.$db.read().get('uploaded').slice().reverse().slice(0, 5).value()
|
this.files = this.$db.read().get('uploaded').slice().reverse().slice(0, 5).value()
|
||||||
|
console.log(this.files)
|
||||||
|
this.uploadFlag = false
|
||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.on('updateFiles', (event) => {
|
this.$electron.ipcRenderer.on('updateFiles', (event) => {
|
||||||
this.getData()
|
this.getData()
|
||||||
@@ -97,7 +103,11 @@
|
|||||||
}, false)
|
}, false)
|
||||||
},
|
},
|
||||||
uploadClipboardFiles () {
|
uploadClipboardFiles () {
|
||||||
this.$electron.ipcRenderer.send('uploadClipboardFiles', this.clipboardFiles[0])
|
if (this.uploadFlag) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.uploadFlag = true
|
||||||
|
this.$electron.ipcRenderer.send('uploadClipboardFiles')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,11 +147,11 @@ body::-webkit-scrollbar
|
|||||||
top 0px
|
top 0px
|
||||||
width 100%
|
width 100%
|
||||||
.img-list
|
.img-list
|
||||||
padding 16px 8px
|
padding 8px 8px
|
||||||
display flex
|
display flex
|
||||||
justify-content space-between
|
justify-content space-between
|
||||||
align-items center
|
align-items center
|
||||||
height 45px
|
// height 45px
|
||||||
cursor pointer
|
cursor pointer
|
||||||
transition all .2s ease-in-out
|
transition all .2s ease-in-out
|
||||||
&:hover
|
&:hover
|
||||||
@@ -149,11 +159,13 @@ body::-webkit-scrollbar
|
|||||||
.upload-img__index
|
.upload-img__index
|
||||||
color #fff
|
color #fff
|
||||||
.upload-img
|
.upload-img
|
||||||
height 100%
|
|
||||||
width 100%
|
width 100%
|
||||||
|
object-fit scale-down
|
||||||
margin 0 auto
|
margin 0 auto
|
||||||
&__container
|
&__container
|
||||||
width 100%
|
width 100%
|
||||||
padding 8px 10px
|
padding 8px 10px
|
||||||
height 100%
|
height 100%
|
||||||
|
&.upload
|
||||||
|
cursor not-allowed
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="20" :offset="2">
|
<el-col :span="20" :offset="2">
|
||||||
<div class="view-title">
|
<div class="view-title">
|
||||||
图片上传 - {{ picBedName }}
|
图片上传 - {{ picBedName }} <i class="el-icon-caret-bottom" @click="handleChangePicBed"></i>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
id="upload-area"
|
id="upload-area"
|
||||||
@@ -66,7 +66,8 @@ export default {
|
|||||||
showError: false,
|
showError: false,
|
||||||
pasteStyle: '',
|
pasteStyle: '',
|
||||||
picBed: [],
|
picBed: [],
|
||||||
picBedName: ''
|
picBedName: '',
|
||||||
|
menu: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@@ -149,6 +150,25 @@ export default {
|
|||||||
getPicBeds (event, picBeds) {
|
getPicBeds (event, picBeds) {
|
||||||
this.picBed = picBeds
|
this.picBed = picBeds
|
||||||
this.getDefaultPicBed()
|
this.getDefaultPicBed()
|
||||||
|
},
|
||||||
|
handleChangePicBed () {
|
||||||
|
this.buildMenu()
|
||||||
|
this.menu.popup(this.$electron.remote.getCurrentWindow())
|
||||||
|
},
|
||||||
|
buildMenu () {
|
||||||
|
const _this = this
|
||||||
|
const submenu = this.picBed.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
type: 'radio',
|
||||||
|
checked: this.$db.read().get('picBed.current').value() === item.type,
|
||||||
|
click () {
|
||||||
|
_this.$db.read().set('picBed.current', item.type).write()
|
||||||
|
_this.$electron.ipcRenderer.send('syncPicBed')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.menu = this.$electron.remote.Menu.buildFromTemplate(submenu)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
:rules="{
|
:rules="{
|
||||||
required: true, message: 'Token不能为空', trigger: 'blur'
|
required: true, message: 'Token不能为空', trigger: 'blur'
|
||||||
}">
|
}">
|
||||||
<el-input v-model="form.token" @keyup.native.enter="confirm" placeholder="token"></el-input>
|
<el-input v-model="form.token" @keyup.native.enter="confirm" placeholder="token" type="password"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="指定存储路径"
|
label="指定存储路径"
|
||||||
|
|||||||
@@ -45,13 +45,10 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="确认存储区域"
|
label="确认存储区域"
|
||||||
>
|
:rules="{
|
||||||
<el-radio-group v-model="form.area" size="mini">
|
required: true, message: '区域代码不能为空', trigger: 'blur'
|
||||||
<el-radio-button label="z0">华东</el-radio-button>
|
}">
|
||||||
<el-radio-button label="z1">华北</el-radio-button>
|
<el-input v-model="form.area" placeholder="例如z0"></el-input>
|
||||||
<el-radio-button label="z2">华南</el-radio-button>
|
|
||||||
<el-radio-button label="na0">北美</el-radio-button>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="设定网址后缀"
|
label="设定网址后缀"
|
||||||
@@ -86,7 +83,7 @@ export default {
|
|||||||
secretKey: '',
|
secretKey: '',
|
||||||
bucket: '',
|
bucket: '',
|
||||||
url: '',
|
url: '',
|
||||||
area: 'z0',
|
area: '',
|
||||||
options: '',
|
options: '',
|
||||||
path: ''
|
path: ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export default {
|
|||||||
this.$refs['weiboForm'].resetFields()
|
this.$refs['weiboForm'].resetFields()
|
||||||
},
|
},
|
||||||
openWiki () {
|
openWiki () {
|
||||||
this.$electron.remote.shell.openExternal('https://github.com/Molunerfinn/PicGo/wiki/%E8%AF%A6%E7%BB%86%E7%AA%97%E5%8F%A3%E7%9A%84%E4%BD%BF%E7%94%A8#%E5%BE%AE%E5%8D%9A%E5%9B%BE%E5%BA%8A')
|
this.$electron.remote.shell.openExternal('https://picgo.github.io/PicGo-Doc/zh/guide/config.html#微博图床')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,10 @@ export default new Router({
|
|||||||
{
|
{
|
||||||
path: 'gallery',
|
path: 'gallery',
|
||||||
component: require('@/pages/Gallery').default,
|
component: require('@/pages/Gallery').default,
|
||||||
name: 'gallery'
|
name: 'gallery',
|
||||||
|
meta: {
|
||||||
|
keepAlive: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'setting',
|
path: 'setting',
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>NSServices</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>NSBackgroundColorName</key>
|
||||||
|
<string>background</string>
|
||||||
|
<key>NSBackgroundSystemColorName</key>
|
||||||
|
<string>systemBlueColor</string>
|
||||||
|
<key>NSIconName</key>
|
||||||
|
<string>NSTouchBarShare</string>
|
||||||
|
<key>NSMenuItem</key>
|
||||||
|
<dict>
|
||||||
|
<key>default</key>
|
||||||
|
<string>Upload pictures with PicGo</string>
|
||||||
|
</dict>
|
||||||
|
<key>NSMessage</key>
|
||||||
|
<string>runWorkflowAsService</string>
|
||||||
|
<key>NSRequiredContext</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSApplicationIdentifier</key>
|
||||||
|
<string>com.apple.finder</string>
|
||||||
|
</dict>
|
||||||
|
<key>NSSendFileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>public.image</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
@@ -0,0 +1,314 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>AMApplicationBuild</key>
|
||||||
|
<string>444.42</string>
|
||||||
|
<key>AMApplicationVersion</key>
|
||||||
|
<string>2.9</string>
|
||||||
|
<key>AMDocumentVersion</key>
|
||||||
|
<string>2</string>
|
||||||
|
<key>actions</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>action</key>
|
||||||
|
<dict>
|
||||||
|
<key>AMAccepts</key>
|
||||||
|
<dict>
|
||||||
|
<key>Container</key>
|
||||||
|
<string>List</string>
|
||||||
|
<key>Optional</key>
|
||||||
|
<true/>
|
||||||
|
<key>Types</key>
|
||||||
|
<array>
|
||||||
|
<string>com.apple.cocoa.string</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>AMActionVersion</key>
|
||||||
|
<string>2.0.3</string>
|
||||||
|
<key>AMApplication</key>
|
||||||
|
<array>
|
||||||
|
<string>自动操作</string>
|
||||||
|
</array>
|
||||||
|
<key>AMParameterProperties</key>
|
||||||
|
<dict>
|
||||||
|
<key>COMMAND_STRING</key>
|
||||||
|
<dict/>
|
||||||
|
<key>CheckedForUserDefaultShell</key>
|
||||||
|
<dict/>
|
||||||
|
<key>inputMethod</key>
|
||||||
|
<dict/>
|
||||||
|
<key>shell</key>
|
||||||
|
<dict/>
|
||||||
|
<key>source</key>
|
||||||
|
<dict/>
|
||||||
|
</dict>
|
||||||
|
<key>AMProvides</key>
|
||||||
|
<dict>
|
||||||
|
<key>Container</key>
|
||||||
|
<string>List</string>
|
||||||
|
<key>Types</key>
|
||||||
|
<array>
|
||||||
|
<string>com.apple.cocoa.string</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>ActionBundlePath</key>
|
||||||
|
<string>/System/Library/Automator/Run Shell Script.action</string>
|
||||||
|
<key>ActionName</key>
|
||||||
|
<string>运行 Shell 脚本</string>
|
||||||
|
<key>ActionParameters</key>
|
||||||
|
<dict>
|
||||||
|
<key>COMMAND_STRING</key>
|
||||||
|
<string>/Applications/PicGo.app/Contents/MacOS/PicGo upload "$@" > /dev/null 2>&1 &</string>
|
||||||
|
<key>CheckedForUserDefaultShell</key>
|
||||||
|
<true/>
|
||||||
|
<key>inputMethod</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>shell</key>
|
||||||
|
<string>/bin/bash</string>
|
||||||
|
<key>source</key>
|
||||||
|
<string></string>
|
||||||
|
</dict>
|
||||||
|
<key>BundleIdentifier</key>
|
||||||
|
<string>com.apple.RunShellScript</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>2.0.3</string>
|
||||||
|
<key>CanShowSelectedItemsWhenRun</key>
|
||||||
|
<false/>
|
||||||
|
<key>CanShowWhenRun</key>
|
||||||
|
<true/>
|
||||||
|
<key>Category</key>
|
||||||
|
<array>
|
||||||
|
<string>AMCategoryUtilities</string>
|
||||||
|
</array>
|
||||||
|
<key>Class Name</key>
|
||||||
|
<string>RunShellScriptAction</string>
|
||||||
|
<key>InputUUID</key>
|
||||||
|
<string>79609224-28DD-4ADE-AA8F-5A6C68C18C18</string>
|
||||||
|
<key>Keywords</key>
|
||||||
|
<array>
|
||||||
|
<string>Shell</string>
|
||||||
|
<string>脚本</string>
|
||||||
|
<string>命令</string>
|
||||||
|
<string>运行</string>
|
||||||
|
<string>Unix</string>
|
||||||
|
</array>
|
||||||
|
<key>OutputUUID</key>
|
||||||
|
<string>35CD6B4C-A616-4F89-8D76-DCD3249C5B4E</string>
|
||||||
|
<key>UUID</key>
|
||||||
|
<string>4350A83B-E7E6-4D2B-9768-B1D676CF58F3</string>
|
||||||
|
<key>UnlocalizedApplications</key>
|
||||||
|
<array>
|
||||||
|
<string>Automator</string>
|
||||||
|
</array>
|
||||||
|
<key>arguments</key>
|
||||||
|
<dict>
|
||||||
|
<key>0</key>
|
||||||
|
<dict>
|
||||||
|
<key>default value</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
<key>name</key>
|
||||||
|
<string>inputMethod</string>
|
||||||
|
<key>required</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>type</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>0</string>
|
||||||
|
</dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>default value</key>
|
||||||
|
<string></string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>source</string>
|
||||||
|
<key>required</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>type</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>1</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>default value</key>
|
||||||
|
<false/>
|
||||||
|
<key>name</key>
|
||||||
|
<string>CheckedForUserDefaultShell</string>
|
||||||
|
<key>required</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>type</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>2</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>default value</key>
|
||||||
|
<string></string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>COMMAND_STRING</string>
|
||||||
|
<key>required</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>type</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>3</string>
|
||||||
|
</dict>
|
||||||
|
<key>4</key>
|
||||||
|
<dict>
|
||||||
|
<key>default value</key>
|
||||||
|
<string>/bin/sh</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>shell</string>
|
||||||
|
<key>required</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>type</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>4</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>isViewVisible</key>
|
||||||
|
<true/>
|
||||||
|
<key>location</key>
|
||||||
|
<string>449.000000:305.000000</string>
|
||||||
|
<key>nibPath</key>
|
||||||
|
<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/Base.lproj/main.nib</string>
|
||||||
|
</dict>
|
||||||
|
<key>isViewVisible</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>connectors</key>
|
||||||
|
<dict/>
|
||||||
|
<key>workflowMetaData</key>
|
||||||
|
<dict>
|
||||||
|
<key>applicationBundleID</key>
|
||||||
|
<string>com.apple.finder</string>
|
||||||
|
<key>applicationBundleIDsByPath</key>
|
||||||
|
<dict>
|
||||||
|
<key>/System/Library/CoreServices/Finder.app</key>
|
||||||
|
<string>com.apple.finder</string>
|
||||||
|
</dict>
|
||||||
|
<key>applicationPath</key>
|
||||||
|
<string>/System/Library/CoreServices/Finder.app</string>
|
||||||
|
<key>applicationPaths</key>
|
||||||
|
<array>
|
||||||
|
<string>/System/Library/CoreServices/Finder.app</string>
|
||||||
|
</array>
|
||||||
|
<key>backgroundColor</key>
|
||||||
|
<data>
|
||||||
|
YnBsaXN0MDDUAQIDBAUGNjdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVy
|
||||||
|
VCR0b3ASAAGGoKoHCBMUFR4kKC8zVSRudWxs1QkKCwwNDg8QERJWJGNsYXNz
|
||||||
|
W05TQ29sb3JOYW1lXE5TQ29sb3JTcGFjZV1OU0NhdGFsb2dOYW1lV05TQ29s
|
||||||
|
b3KACYADEAaAAoAEVlN5c3RlbV8QD3N5c3RlbUJsdWVDb2xvctUWFwsYCRka
|
||||||
|
GxwOXE5TQ29tcG9uZW50c1VOU1JHQl8QEk5TQ3VzdG9tQ29sb3JTcGFjZUcw
|
||||||
|
IDAgMSAxTxARMCAwIDAuOTk4MTg4OTcyNQAQAYAFgA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AAAAAIBAAAAAAAAADoAAAAAAAAAAAAAAAAAAA39
|
||||||
|
</data>
|
||||||
|
<key>backgroundColorName</key>
|
||||||
|
<string>systemBlueColor</string>
|
||||||
|
<key>inputTypeIdentifier</key>
|
||||||
|
<string>com.apple.Automator.fileSystemObject.image</string>
|
||||||
|
<key>outputTypeIdentifier</key>
|
||||||
|
<string>com.apple.Automator.nothing</string>
|
||||||
|
<key>presentationMode</key>
|
||||||
|
<integer>15</integer>
|
||||||
|
<key>processesInput</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
<key>serviceApplicationBundleID</key>
|
||||||
|
<string>com.apple.finder</string>
|
||||||
|
<key>serviceApplicationPath</key>
|
||||||
|
<string>/System/Library/CoreServices/Finder.app</string>
|
||||||
|
<key>serviceInputTypeIdentifier</key>
|
||||||
|
<string>com.apple.Automator.fileSystemObject.image</string>
|
||||||
|
<key>serviceOutputTypeIdentifier</key>
|
||||||
|
<string>com.apple.Automator.nothing</string>
|
||||||
|
<key>serviceProcessesInput</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
<key>systemImageName</key>
|
||||||
|
<string>NSTouchBarShare</string>
|
||||||
|
<key>useAutomaticInputType</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
<key>workflowTypeIdentifier</key>
|
||||||
|
<string>com.apple.Automator.servicesMenu</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
+12
-10
@@ -1,16 +1,18 @@
|
|||||||
# from https://github.com/favers/vscode-qiniu-upload-image/blob/master/lib/linux.sh
|
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# require xclip(see http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212)
|
# require xclip(see http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212)
|
||||||
command -v xclip >/dev/null 2>&1 || { echo >&1 "no xclip"; exit 1; }
|
command -v xclip >/dev/null 2>&1 || { echo >&1 "no xclip"; exit 1; }
|
||||||
|
|
||||||
# write image in clipboard to file (see http://unix.stackexchange.com/questions/145131/copy-image-from-clipboard-to-file)
|
# write image in clipboard to file (see http://unix.stackexchange.com/questions/145131/copy-image-from-clipboard-to-file)
|
||||||
if
|
filePath=`xclip -selection clipboard -o 2>/dev/null | grep ^file:// | cut -c8-`
|
||||||
xclip -selection clipboard -target image/png -o >/dev/null 2>&1
|
if [ ! -n "$filePath" ] ;then
|
||||||
then
|
if
|
||||||
xclip -selection clipboard -target image/png -o >$1 2>/dev/null
|
xclip -selection clipboard -target image/png -o >/dev/null 2>&1
|
||||||
echo $1
|
then
|
||||||
|
xclip -selection clipboard -target image/png -o >$1 2>/dev/null
|
||||||
|
echo $1
|
||||||
|
else
|
||||||
|
echo "no image"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "no image"
|
echo $filePath
|
||||||
fi
|
fi
|
||||||
|
|||||||
Binary file not shown.
+35
-17
@@ -1,26 +1,44 @@
|
|||||||
|
# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1
|
||||||
param($imagePath)
|
param($imagePath)
|
||||||
|
|
||||||
# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1
|
# https://github.com/PowerShell/PowerShell/issues/7233
|
||||||
|
# fix the output encoding bug
|
||||||
|
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||||
|
|
||||||
Add-Type -Assembly PresentationCore
|
Add-Type -Assembly PresentationCore
|
||||||
$img = [Windows.Clipboard]::GetImage()
|
function main {
|
||||||
|
$img = [Windows.Clipboard]::GetImage()
|
||||||
|
|
||||||
if ($img -eq $null) {
|
if ($img -eq $null) {
|
||||||
"no image"
|
"no image"
|
||||||
Exit 1
|
Exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not $imagePath) {
|
||||||
|
"no image"
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
|
||||||
|
$stream = [IO.File]::Open($imagePath, "OpenOrCreate")
|
||||||
|
$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
|
||||||
|
$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null
|
||||||
|
$encoder.Save($stream) | out-null
|
||||||
|
$stream.Dispose() | out-null
|
||||||
|
|
||||||
|
$imagePath
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $imagePath) {
|
try {
|
||||||
"no image"
|
# For WIN10
|
||||||
Exit 1
|
$file = Get-Clipboard -Format FileDropList
|
||||||
|
if ($file -ne $null) {
|
||||||
|
Convert-Path $file
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
# For WIN7 WIN8 WIN10
|
||||||
|
main
|
||||||
}
|
}
|
||||||
|
|
||||||
$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
|
main
|
||||||
$stream = [IO.File]::Open($imagePath, "OpenOrCreate")
|
|
||||||
$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
|
|
||||||
$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null
|
|
||||||
$encoder.Save($stream) | out-null
|
|
||||||
$stream.Dispose() | out-null
|
|
||||||
|
|
||||||
$imagePath
|
|
||||||
Reference in New Issue
Block a user