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 Apr 28, 2024
2 parents f28f054 + ec92be8 commit 8acbd93
Show file tree
Hide file tree
Showing 33 changed files with 281 additions and 338 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## :tada: 2.8.4 (2024-04-28)


### :sparkles: Features

* **custom:** add feedback entry ([2087d9a](https://github.com/Kuingsmile/piclist/commit/2087d9a))
* **custom:** auto refresh after change custom url ([939c907](https://github.com/Kuingsmile/piclist/commit/939c907)), closes [#191](https://github.com/Kuingsmile/piclist/issues/191)
* **custom:** change timestamp to milliseconds ([25648ea](https://github.com/Kuingsmile/piclist/commit/25648ea)), closes [#194](https://github.com/Kuingsmile/piclist/issues/194)


### :bug: Bug Fixes

* **custom:** fix aws s3 urlprefix bug ([3681681](https://github.com/Kuingsmile/piclist/commit/3681681))


### :pencil: Documentation

* **custom:** prepare for 2.8.4 ([bcb4760](https://github.com/Kuingsmile/piclist/commit/bcb4760))



## :tada: 2.8.3 (2024-04-11)


Expand Down
18 changes: 12 additions & 6 deletions currentVersion.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
✨ Features

- 现在不再对gif图片进行格式转换
### ✨ Features

🐛 Bug Fixes
- 管理功能
- 现在修改自定义域名后会自动强制刷新当前页面
- 现在第一次进入管理页面时默认获取云端最新文件列表
- 现在内置s3图床默认允许自签证书
- 现在高级重命名中的时间戳精确到毫秒

- 修复了重新保存配置后图片水印功能失效的问题
- 修复了同时打开主界面和mini窗口时,重命名窗口定位错误的问题
- 修复了特殊情况下软件界面异常退出并导致后台CPU占用过高的问题
### 🐛 Bug Fixes

- 管理功能
- 修复了强制https对本地图床没有生效的问题
- 修复了不填写区域时,minio无法正常删除图片的问题
- 修复了内置s3图床,配合minio使用时会额外添加桶名的问题
17 changes: 11 additions & 6 deletions currentVersion_en.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
✨ Features
### ✨ Features

- Now no longer convert gif images
- Manage
- Now, after modifying the custom domain name, the current page will be automatically forced to refresh
- Now, the cloud-side latest file list is obtained by default when entering the management page for the first time
- Now the built-in s3 image bed defaults to allowing self-signed certificates
- Now the timestamp in advanced renaming is accurate to milliseconds

🐛 Bug Fixes
### 🐛 Bug Fixes

- Fix the problem that the image watermark function is invalid after re-saving the configuration
- Fix the problem that the rename window is positioned incorrectly when the main interface and mini window are opened at the same time
- Fix the problem that the software interface exits abnormally under special circumstances and causes high CPU usage in the background
- Manage
- Fixed the problem that forcing https does not take effect on the local image bed
- Fixed the problem that Minio cannot delete images normally when the region is not filled in
- Fixed the problem that the built-in s3 image bed will add an additional bucket name when used with Minio
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.8.3",
"version": "2.8.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.8.5",
"piclist": "^1.8.7",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
"proxy-agent": "^5.0.0",
Expand Down
1 change: 1 addition & 0 deletions public/i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CONFIG_THING: Config ${c}
FIND_NEW_VERSION: Find New Version
NO_MORE_NOTICE: No More Notice
SHOW_DEVTOOLS: Show Devtools
FEEDBACK: Feedback
CURRENT_PICBED: Current Picbed
START_WATCH_CLIPBOARD: Start Watch Clipboard
STOP_WATCH_CLIPBOARD: Stop Watch Clipboard
Expand Down
1 change: 1 addition & 0 deletions public/i18n/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CONFIG_THING: 配置${c}
FIND_NEW_VERSION: 发现新版本
NO_MORE_NOTICE: 以后不再提醒
SHOW_DEVTOOLS: 打开开发者工具
FEEDBACK: 反馈问题
CURRENT_PICBED: 当前图床
START_WATCH_CLIPBOARD: 开始监听剪贴板
STOP_WATCH_CLIPBOARD: 停止监听剪贴板
Expand Down
1 change: 1 addition & 0 deletions public/i18n/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CONFIG_THING: 設定${c}
FIND_NEW_VERSION: 發現新版本
NO_MORE_NOTICE: 以後不再提醒
SHOW_DEVTOOLS: 開啟開發者工具
FEEDBACK: 問題反饋
CURRENT_PICBED: 當前圖床
START_WATCH_CLIPBOARD: 開始監聽剪貼簿
STOP_WATCH_CLIPBOARD: 停止監聽剪貼簿
Expand Down
30 changes: 15 additions & 15 deletions src/main/apis/app/window/windowManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ import { BrowserWindow } from 'electron'
import { IWindowList } from '#/types/enum'

class WindowManager implements IWindowManager {
private windowMap: Map<IWindowList | string, BrowserWindow> = new Map()
private windowIdMap: Map<number, IWindowList | string> = new Map()
#windowMap: Map<IWindowList | string, BrowserWindow> = new Map()
#windowIdMap: Map<number, IWindowList | string> = new Map()
create (name: IWindowList) {
const windowConfig: IWindowListItem = windowList.get(name)!
if (windowConfig.isValid) {
if (!windowConfig.multiple) {
if (this.has(name)) return this.windowMap.get(name)!
if (this.has(name)) return this.#windowMap.get(name)!
}
const window = new BrowserWindow(windowConfig.options())
const id = window.id
if (windowConfig.multiple) {
this.windowMap.set(`${name}_${window.id}`, window)
this.windowIdMap.set(window.id, `${name}_${window.id}`)
this.#windowMap.set(`${name}_${window.id}`, window)
this.#windowIdMap.set(window.id, `${name}_${window.id}`)
} else {
this.windowMap.set(name, window)
this.windowIdMap.set(window.id, name)
this.#windowMap.set(name, window)
this.#windowIdMap.set(window.id, name)
}
windowConfig.callback(window, this)
window.on('close', () => {
Expand All @@ -39,32 +39,32 @@ class WindowManager implements IWindowManager {

get (name: IWindowList) {
if (this.has(name)) {
return this.windowMap.get(name)!
return this.#windowMap.get(name)!
} else {
const window = this.create(name)
return window
}
}

has (name: IWindowList) {
return this.windowMap.has(name)
return this.#windowMap.has(name)
}

deleteById = (id: number) => {
const name = this.windowIdMap.get(id)
const name = this.#windowIdMap.get(id)
if (name) {
this.windowMap.delete(name)
this.windowIdMap.delete(id)
this.#windowMap.delete(name)
this.#windowIdMap.delete(id)
}
}

getAvailableWindow (isSkipMiniWindow = false) {
const miniWindow = this.windowMap.get(IWindowList.MINI_WINDOW)
const miniWindow = this.#windowMap.get(IWindowList.MINI_WINDOW)
if (miniWindow && miniWindow.isVisible() && !isSkipMiniWindow) {
return miniWindow
} else {
const settingWindow = this.windowMap.get(IWindowList.SETTING_WINDOW)
const trayWindow = this.windowMap.get(IWindowList.TRAY_WINDOW)
const settingWindow = this.#windowMap.get(IWindowList.SETTING_WINDOW)
const trayWindow = this.#windowMap.get(IWindowList.TRAY_WINDOW)
return settingWindow || trayWindow || this.create(IWindowList.SETTING_WINDOW)!
}
}
Expand Down
38 changes: 19 additions & 19 deletions src/main/apis/core/datastore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const CONFIG_PATH: string = dbPathChecker()
export const DB_PATH: string = getGalleryDBPath().dbPath

class ConfigStore {
private db: JSONStore
#db: JSONStore
constructor () {
this.db = new JSONStore(CONFIG_PATH)
this.#db = new JSONStore(CONFIG_PATH)

if (!this.db.has('picBed')) {
this.db.set('picBed', {
if (!this.#db.has('picBed')) {
this.#db.set('picBed', {
current: 'smms', // deprecated
uploader: 'smms',
smms: {
Expand All @@ -38,8 +38,8 @@ class ConfigStore {
})
}

if (!this.db.has(configPaths.settings.shortKey._path)) {
this.db.set(configPaths.settings.shortKey['picgo:upload'], {
if (!this.#db.has(configPaths.settings.shortKey._path)) {
this.#db.set(configPaths.settings.shortKey['picgo:upload'], {
enable: true,
key: 'CommandOrControl+Shift+P',
name: 'upload',
Expand All @@ -50,31 +50,31 @@ class ConfigStore {
}

flush () {
this.db = new JSONStore(CONFIG_PATH)
this.#db = new JSONStore(CONFIG_PATH)
}

read () {
this.db.read()
return this.db
this.#db.read()
return this.#db
}

get (key = ''): any {
if (key === '') {
return this.db.read()
return this.#db.read()
}
return this.db.get(key)
return this.#db.get(key)
}

set (key: string, value: any): void {
return this.db.set(key, value)
return this.#db.set(key, value)
}

has (key: string) {
return this.db.has(key)
return this.#db.has(key)
}

unset (key: string, value: any): boolean {
return this.db.unset(key, value)
return this.#db.unset(key, value)
}

getConfigPath () {
Expand All @@ -88,16 +88,16 @@ export default db

// v2.3.0 add gallery db
class GalleryDB {
private static instance: DBStore
static #instance: DBStore
private constructor () {
console.log('init gallery db')
}

public static getInstance (): DBStore {
if (!GalleryDB.instance) {
GalleryDB.instance = new DBStore(DB_PATH, 'gallery')
static getInstance (): DBStore {
if (!GalleryDB.#instance) {
GalleryDB.#instance = new DBStore(DB_PATH, 'gallery')
}
return GalleryDB.instance
return GalleryDB.#instance
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/apis/gui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GuiApi implements IGuiApi {
console.log('init guiapi')
}

public static getInstance (): GuiApi {
static getInstance (): GuiApi {
if (!GuiApi.instance) {
GuiApi.instance = new GuiApi()
}
Expand Down
9 changes: 8 additions & 1 deletion src/main/events/remotes/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pkg from 'root/package.json'

// Electron modules
import { Menu, BrowserWindow, app, dialog } from 'electron'
import { Menu, BrowserWindow, app, dialog, shell } from 'electron'

// Custom utilities and modules
import windowManager from 'apis/app/window/windowManager'
Expand Down Expand Up @@ -140,6 +140,13 @@ const buildMainPageMenu = (win: BrowserWindow) => {
click () {
win?.webContents?.openDevTools({ mode: 'detach' })
}
},
{
label: T('FEEDBACK'),
click () {
const url = 'https://github.com/Kuingsmile/PicList/issues'
shell.openExternal(url)
}
}
]
// @ts-ignore
Expand Down
16 changes: 8 additions & 8 deletions src/main/lifeCycle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ autoUpdater.on('error', (err) => {
})

class LifeCycle {
private async beforeReady () {
async #beforeReady () {
protocol.registerSchemesAsPrivileged([{ scheme: 'picgo', privileges: { secure: true, standard: true } }])
// fix the $PATH in macOS & linux
fixPath()
Expand All @@ -148,7 +148,7 @@ class LifeCycle {
busEventList.listen()
}

private onReady () {
#onReady () {
const readyFunction = async () => {
createProtocol('picgo')
windowManager.create(IWindowList.TRAY_WINDOW)
Expand Down Expand Up @@ -228,7 +228,7 @@ class LifeCycle {
app.whenReady().then(readyFunction)
}

private onRunning () {
#onRunning () {
app.on('second-instance', (event, commandLine, workingDirectory) => {
logger.info('detect second instance')
const result = handleStartUpFiles(commandLine, workingDirectory)
Expand Down Expand Up @@ -263,7 +263,7 @@ class LifeCycle {
}
}

private onQuit () {
#onQuit () {
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
Expand Down Expand Up @@ -298,10 +298,10 @@ class LifeCycle {
if (!gotTheLock) {
app.quit()
} else {
await this.beforeReady()
this.onReady()
this.onRunning()
this.onQuit()
await this.#beforeReady()
this.#onReady()
this.#onRunning()
this.#onQuit()
}
}
}
Expand Down
Loading

0 comments on commit 8acbd93

Please sign in to comment.