Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Feb 25, 2024
2 parents af6777e + 28d1d88 commit 4c3d0e0
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 56 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## :tada: 2.7.4 (2024-02-25)


### :sparkles: Features

* **custom:** add new set item to open config file path ([4be82e0](https://github.com/Kuingsmile/piclist/commit/4be82e0))


### :bug: Bug Fixes

* **custom:** fix buildin s3 config item bug ([914ec15](https://github.com/Kuingsmile/piclist/commit/914ec15))
* **custom:** fix config import name error ([4c70946](https://github.com/Kuingsmile/piclist/commit/4c70946))
* **custom:** fix typo ([d3fdfca](https://github.com/Kuingsmile/piclist/commit/d3fdfca))
* **custom:** optimize github remote delete ([0767fbc](https://github.com/Kuingsmile/piclist/commit/0767fbc)), closes [#158](https://github.com/Kuingsmile/piclist/issues/158)


### :pencil: Documentation

* **custom:** update chagelog ([3fc3f92](https://github.com/Kuingsmile/piclist/commit/3fc3f92))
* **custom:** update docs for docker usage ([21cc115](https://github.com/Kuingsmile/piclist/commit/21cc115))
* **custom:** update wechat group info ([faeeed7](https://github.com/Kuingsmile/piclist/commit/faeeed7))



## :tada: 2.7.3 (2024-01-30)


Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ In the community plugins, search for and install the Image auto upload Plugin. N

#### docker run

Change the `./piclist` to your own path, and change the `piclist123456` to your own secret key.
Change the `./piclist` to your own path, this is the path where you put your `config.json` file, and change the `piclist123456` to your own secret key.

```bash
docker run -d \
Expand Down Expand Up @@ -123,7 +123,7 @@ services:
command: node /usr/local/bin/picgo-server -k piclist123456
```

You can change the `volumes` to your own path and change the `command` to your own secret key.
You can change the `./piclist` to your own path, this is the path where you put your `config.json` file, and change the `command` to your own secret key.

Then run:

Expand Down Expand Up @@ -231,9 +231,7 @@ If you need to build it yourself, you can start building with `yarn run build`.

## Communication group

If you have any questions, you can join the WeChat group for communication.

![image](https://pichoro.msq.pub/wechat.png)
If you have any questions, you can join the WeChat group for communication. The group is currently full, please add WeChat `pku_sq_ma` and note `PicList`, and I will add you to the group.

## License

Expand Down
8 changes: 3 additions & 5 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ MacOS:

#### docker run

修改`./piclist`为你自己的路径,修改`piclist123456`为你自己的密钥。
修改`./piclist`为你自己的配置文件`config.json`所在的路径,修改`piclist123456`为你自己的密钥。

```bash
docker run -d \
Expand Down Expand Up @@ -123,7 +123,7 @@ services:
command: node /usr/local/bin/picgo-server -k piclist123456
```

你可以修改`volumes`为你自己的路径,修改`command`为你自己的密钥。
你可以修改`./piclist`为你自己的配置文件`config.json`所在的路径,修改`command`为你自己的密钥。

然后运行

Expand Down Expand Up @@ -221,9 +221,7 @@ brew uninstall piclist

## 交流群

如果有任何问题,可以加入微信群进行交流。

![image](https://pichoro.msq.pub/wechat.png)
如果有任何问题,可以加入微信群进行交流,目前群已满,请添加微信号`pku_sq_ma`,备注`PicList`,我会拉你入群。

## License

Expand Down
8 changes: 5 additions & 3 deletions currentVersion.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
✨ Features

- 现在配置页点击图床名会跳转至手册说明页
- 设置界面添加了新的选项以快速进入配置文件和日志目录
- 优化了github图床云端删除对特殊路径的处理

🐛 Bug Fixes

- 修复了设置精细转换格式时,配置没有起作用的问题
- 修复了界面翻译错误
- 修复了导入配置时,默认图床名没有跟随当前时间变化的问题
- 修复了内置s3图床的禁用存储桶前缀设置项没有正确生效的问题
- 修复了部分繁体中文翻译错误
8 changes: 5 additions & 3 deletions currentVersion_en.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
✨ Features

- Now clicking the image bed name on the configuration page will jump to the manual explanation page
- Add new options in the settings interface to quickly enter the configuration file and log directory
- Optimized the processing of special paths for cloud deletion of github image bed

🐛 Bug Fixes

- Fixed the problem that the configuration did not take effect when setting the fine conversion format
- Fixed interface translation error
- Fix the problem that the default image bed name does not change with the current time when importing the configuration
- Fix the problem that the disable storage bucket prefix setting of the built-in s3 image bed does not take effect correctly
- Fix some translation errors in traditional Chinese
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "piclist",
"version": "2.7.3",
"version": "2.7.4",
"author": {
"name": "Kuingsmile",
"email": "pkukuing@gmail.com"
Expand Down Expand Up @@ -68,7 +68,7 @@
"multer": "^1.4.5-lts.1",
"node-ssh-no-cpu-features": "^1.0.1",
"nodejs-file-downloader": "^4.12.1",
"piclist": "^1.7.9",
"piclist": "^1.7.11",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
"proxy-agent": "^5.0.0",
Expand Down
2 changes: 2 additions & 0 deletions public/i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ SETTINGS_CURRENT_VERSION: Current Version
SETTINGS_NEWEST_VERSION: Newest Version
SETTINGS_GETING: Getting...
SETTINGS_TIPS_HAS_NEW_VERSION: PicList has a new version, please click confirm to open download page
SETTINGS_LOG_FILE_PATH: Log File Path
SETTINGS_CONFIG_FILE_PATH: Config File Path
SETTINGS_LOG_FILE: Log File
SETTINGS_GUI_LOG_FILE: GUI Log File
SETTINGS_MANAGE_LOG_FILE: Manage Log File
Expand Down
2 changes: 2 additions & 0 deletions public/i18n/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ SETTINGS_CURRENT_VERSION: 当前版本
SETTINGS_NEWEST_VERSION: 最新版本
SETTINGS_GETING: 正在获取中
SETTINGS_TIPS_HAS_NEW_VERSION: PicList更新啦,请点击确定打开下载页面
SETTINGS_LOG_FILE_PATH: 日志文件路径
SETTINGS_CONFIG_FILE_PATH: 配置文件路径
SETTINGS_LOG_FILE: 常规日志文件
SETTINGS_GUI_LOG_FILE: GUI日志文件
SETTINGS_MANAGE_LOG_FILE: 管理日志文件
Expand Down
16 changes: 9 additions & 7 deletions public/i18n/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ UPLOAD_PAGE_IMAGE_PROCESS_ISRESIZEBYPERCENT: 是否按比例調整尺寸,優
UPLOAD_PAGE_IMAGE_PROCESS_RESIZEPERCENT: 調整尺寸比例,輸入50表示50%
UPLOAD_PAGE_IMAGE_PROCESS_ISROTATE: 是否旋轉
UPLOAD_PAGE_IMAGE_PROCESS_ROTATEDEGREE: 旋轉角度
UPLOAD_PAGE_IMAGE_PROCESS_CONFIRM: 保存
UPLOAD_PAGE_IMAGE_PROCESS_CONFIRM: 儲存
UPLOAD_PAGE_IMAGE_PROCESS_CANCEL: 取消
UPLOAD_PAGE_IMAGE_PROCESS_POSITION_TOP:
UPLOAD_PAGE_IMAGE_PROCESS_POSITION_BOTTOM:
Expand All @@ -143,8 +143,8 @@ UPLOAD_PAGE_IMAGE_PROCESS_POSITION_TOP_RIGHT: 右上
UPLOAD_PAGE_IMAGE_PROCESS_POSITION_BOTTOM_LEFT: 左下
UPLOAD_PAGE_IMAGE_PROCESS_POSITION_BOTTOM_RIGHT: 右下
UPLOAD_PAGE_IMAGE_PROCESS_POSITION_CENTER:
UPLOAD_SHORT_URL: 短链接
UPLOAD_NORMAL_URL: 长链接
UPLOAD_SHORT_URL: 短連結
UPLOAD_NORMAL_URL: 长連結
# settings

SETTINGS: 設定
Expand All @@ -155,8 +155,8 @@ SETTINGS_MIGRATE_FROM_PICGO_CONTENT: 即將導入PicGo的設定文件和相冊,
SETTINGS_MIGRATE_FROM_PICGO_SUCCESS: 導入成功, 請重啟應用
SETTINGS_MIGRATE_FROM_PICGO_FAILED: 導入失敗
SETTINGS_START_MODE: 啟動模式
SETTINGS_START_MODE_MINI: mini窗口
SETTINGS_START_MODE_MAIN: 主窗口
SETTINGS_START_MODE_MINI: mini視窗
SETTINGS_START_MODE_MAIN: 主視窗
SETTINGS_START_MODE_QUIET: 靜默啟動
SETTINGS_START_MODE_NO_TRAY: 隐藏托盘
SETTINGS_CLICK_TO_OPEN: 點擊打開
Expand All @@ -175,7 +175,7 @@ SETTINGS_CLOSE_MINI_WINDOW_SYNC: 開主窗口同步關閉mini窗口
SETTINGS_CLOSE_MAIN_WINDOW_SYNC: 關mini窗口同步關閉主窗口
SETTINGS_ACCEPT_BETA_UPDATE: 接受Beta版本更新
SETTINGS_LAUNCH_ON_BOOT: 開機時啟動
SETTINGS_RENAME_BEFORE_UPLOAD: 手动重新命名
SETTINGS_RENAME_BEFORE_UPLOAD: 手動重新命名
SETTINGS_TIMESTAMP_RENAME: 以時間戳命名
SETTINGS_ADVANCED_RENAME: 高級命名
SETTINGS_ADVANCED_RENAME_ENABLE: 啟用高級命名
Expand All @@ -195,6 +195,8 @@ SETTINGS_CURRENT_VERSION: 當前版本
SETTINGS_NEWEST_VERSION: 最新版本
SETTINGS_GETING: 正在取得中
SETTINGS_TIPS_HAS_NEW_VERSION: PicList更新啦,請點擊確定開啟下載頁面
SETTINGS_LOG_FILE_PATH: 記錄檔案路徑
SETTINGS_CONFIG_FILE_PATH: 設定檔案路徑
SETTINGS_LOG_FILE: 記錄檔案
SETTINGS_GUI_LOG_FILE: GUI記錄檔案
SETTINGS_MANAGE_LOG_FILE: 管理記錄檔案
Expand Down Expand Up @@ -232,7 +234,7 @@ SETTINGS_MAIN_WINDOW_WIDTH_HINT: '默認: 1200'
SETTINGS_MAIN_WINDOW_WIDTH_RULE: 窗口寬度必須大於100
SETTINGS_MAIN_WINDOW_SIZE_HEIGHT: 默認主視窗高度
SETTINGS_MAIN_WINDOW_HEIGHT_HINT: '默認: 800'
SETTINGS_MAIN_WINDOW_HEIGHT_RULE: 窗口高度必須大於100
SETTINGS_MAIN_WINDOW_HEIGHT_RULE: 視窗高度必須大於100
SETTINGS_RAW_PICGO_SIZE: 原PicGo大小
SETTINGS_CUSTOM_MINI_ICON_PATH: 自訂Mini視窗圖示路徑
SETTINGS_CUSTOM_MINI_ICON: 自訂Mini視窗圖示
Expand Down
14 changes: 14 additions & 0 deletions src/main/events/picgoCoreIPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
PICGO_GET_BY_ID_DB,
PICGO_REMOVE_BY_ID_DB,
PICGO_OPEN_FILE,
PICGO_OPEN_DIRECTORY,
PASTE_TEXT,
OPEN_WINDOW,
GET_LANGUAGE_LIST,
Expand Down Expand Up @@ -379,6 +380,18 @@ const handleOpenFile = () => {
})
}

const handleOpenDirectory = () => {
ipcMain.on(PICGO_OPEN_DIRECTORY, (event: IpcMainEvent, dirPath?: string, inStorePath: boolean = true) => {
if (inStorePath) {
dirPath = path.join(STORE_PATH, dirPath || '')
}
if (!dirPath || !fs.existsSync(dirPath)) {
return
}
shell.openPath(dirPath)
})
}

const handleOpenWindow = () => {
ipcMain.on(OPEN_WINDOW, (event: IpcMainEvent, windowName: IWindowList) => {
const window = windowManager.get(windowName)
Expand Down Expand Up @@ -431,6 +444,7 @@ export default {
handleImportLocalPlugin()
handleUpdateAllPlugin()
handleOpenFile()
handleOpenDirectory()
handleOpenWindow()
handleI18n()
handleRPCActions()
Expand Down
2 changes: 2 additions & 0 deletions src/main/utils/sshClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ class SSHClient {
const promise = new Promise((resolve, reject) => {
client.on('ready', () => {
client.sftp((err, sftp) => {
// eslint-disable-next-line prefer-promise-reject-errors
if (err) reject(false)
sftp.unlink(remote, (err) => {
// eslint-disable-next-line prefer-promise-reject-errors
if (err) reject(false)
client.end()
resolve(true)
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/apis/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export default class GithubApi {
}

private static createKey (path: string | undefined, fileName: string): string {
const formatedFileName = fileName.replace(/%2F/g, '/')
return path && path !== '/'
? `${path.replace(/^\/+|\/+$/, '')}/${fileName}`
: fileName
? `${path.replace(/^\/+|\/+$/, '')}/${formatedFileName}`
: formatedFileName
}

static async delete (configMap: IConfigMap): Promise<boolean> {
Expand Down
34 changes: 31 additions & 3 deletions src/renderer/pages/PicGoSetting.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div id="picgo-setting">
<div id="piclist-setting">
<el-row
class="view-title"
align="middle"
Expand Down Expand Up @@ -283,6 +283,18 @@
{{ $T('SETTINGS_CLICK_TO_OPEN') }}
</el-button>
</el-form-item>
<el-form-item
:label="$T('SETTINGS_CONFIG_FILE_PATH')"
>
<el-button
type="primary"
round
size="small"
@click="openDirectory()"
>
{{ $T('SETTINGS_CLICK_TO_OPEN') }}
</el-button>
</el-form-item>
</el-form>
</el-row>
</el-col>
Expand Down Expand Up @@ -582,6 +594,18 @@
label-width="50%"
size="small"
>
<el-form-item
:label="$T('SETTINGS_LOG_FILE_PATH')"
>
<el-button
type="primary"
round
size="small"
@click="openDirectory()"
>
{{ $T('SETTINGS_CLICK_TO_OPEN') }}
</el-button>
</el-form-item>
<el-form-item
:label="$T('SETTINGS_SET_LOG_FILE')"
>
Expand Down Expand Up @@ -1603,7 +1627,7 @@ import { Reading, Close, Edit, InfoFilled } from '@element-plus/icons-vue'
import pkg from 'root/package.json'
// 事件常量
import { PICGO_OPEN_FILE, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
import { PICGO_OPEN_FILE, PICGO_OPEN_DIRECTORY, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
import { IRPCActionType } from '~/universal/types/enum'
// Electron 相关
Expand Down Expand Up @@ -2046,6 +2070,10 @@ function openFile (file: string) {
sendToMain(PICGO_OPEN_FILE, file)
}
function openDirectory (directory?: string, inStorePath = true) {
sendToMain(PICGO_OPEN_DIRECTORY, directory, inStorePath)
}
function openLogSetting () {
logFileVisible.value = true
}
Expand Down Expand Up @@ -2535,7 +2563,7 @@ export default {
color #49B1F5
.el-tabs__item
color:white
#picgo-setting
#piclist-setting
height 100%
position absolute
left 142px
Expand Down
18 changes: 4 additions & 14 deletions src/renderer/pages/picbeds/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ async function handleConfigImport (configItem: IUploaderConfigListItem) {
$configForm.value?.updateRuleForm(key, value)
}
}
$configForm.value?.updateRuleForm('_configName', dayjs(_updatedAt).format('YYYYMMDDHHmmss'))
$configForm.value?.updateRuleForm('_configName', dayjs().format('YYYYMMDDHHmmss'))
}
const handleReset = async () => {
Expand Down Expand Up @@ -227,14 +227,7 @@ function handleNameClick () {
async function handleCopyApi () {
try {
const serverConfig = await getConfig<IStringKeyMap>('settings.server') || {
port: 36677,
host: '127.0.0.1'
}
let { port, host } = serverConfig
if (host === '0.0.0.0') {
host = '127.0.0.1'
}
const { port = 36677, host = '127.0.0.1' } = await getConfig<IStringKeyMap>('settings.server') || {}
const serverKey = await getConfig('settings.serverKey') || ''
const uploader = await getConfig('uploader') as IStringKeyMap || {}
const picBedConfigList = uploader[$route.params.type as string].configList || []
Expand All @@ -243,12 +236,9 @@ async function handleCopyApi () {
ElMessage.error('No config found')
return
}
let apiUrl = `http://${host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig?._configName}`
if (serverKey) {
apiUrl += `&key=${serverKey}`
}
const apiUrl = `http://${host === '0.0.0.0' ? '127.0.0.1' : host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig._configName}${serverKey ? `&key=${serverKey}` : ''}`
clipboard.writeText(apiUrl)
ElMessage.success($T('MANAGE_BUCKET_COPY_SUCCESS') + ' ' + apiUrl)
ElMessage.success(`${$T('MANAGE_BUCKET_COPY_SUCCESS')} ${apiUrl}`)
} catch (error) {
console.log(error)
ElMessage.error('Copy failed')
Expand Down
1 change: 1 addition & 0 deletions src/universal/events/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const PICGO_UPDATE_BY_ID_DB = 'PICGO_UPDATE_BY_ID_DB'
export const PICGO_GET_BY_ID_DB = 'PICGO_GET_BY_ID_DB'
export const PICGO_REMOVE_BY_ID_DB = 'PICGO_REMOVE_BY_ID_DB'
export const PICGO_OPEN_FILE = 'PICGO_OPEN_FILE'
export const PICGO_OPEN_DIRECTORY = 'PICGO_OPEN_DIRECTORY'
export const OPEN_DEVTOOLS = 'OPEN_DEVTOOLS'
export const SHOW_MINI_PAGE_MENU = 'SHOW_MINI_PAGE_MENU'
export const SHOW_MAIN_PAGE_MENU = 'SHOW_MAIN_PAGE_MENU'
Expand Down
2 changes: 2 additions & 0 deletions src/universal/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ interface ILocales {
SETTINGS_NEWEST_VERSION: string
SETTINGS_GETING: string
SETTINGS_TIPS_HAS_NEW_VERSION: string
SETTINGS_LOG_FILE_PATH: string
SETTINGS_CONFIG_FILE_PATH: string
SETTINGS_LOG_FILE: string
SETTINGS_GUI_LOG_FILE: string
SETTINGS_MANAGE_LOG_FILE: string
Expand Down

0 comments on commit 4c3d0e0

Please sign in to comment.