Skip to content

Commit

Permalink
✨ Feature: add config sync module
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed May 1, 2023
1 parent 6f19cb0 commit ab4e31f
Show file tree
Hide file tree
Showing 14 changed files with 665 additions and 100 deletions.
26 changes: 26 additions & 0 deletions public/i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,32 @@ SETTINGS_ENCODE_OUTPUT_URL: Encode Output(or Copyed) URL
SETTINGS_WATCH_CLIPBOARD: Watch clipboard when software start
SETTINGS_SHORT_URL: Use short url
SETTINGS_DELETE_LOCAL_FILE_AFTER_UPLOAD: Delete local file after upload
SETTINGS_SYNC_CONFIG: Settings Sync Configuration
SETTINGS_SYNC_CONFIG_TITLE: Sync Settings
SETTINGS_SYNC_CONFIG_NOTE: The files to be synchronized include both configuration files and gallery files.
SETTINGS_SYNC_CONFIG_SELECT_TYPE: Select sync method
SETTINGS_SYNC_CONFIG_SELECT_FILE: Select files to sync
SETTINGS_SYNC_CONFIG_SELECT_CONFIG: Configuration files only
SETTINGS_SYNC_CONFIG_SELECT_GALLERY: Gallery files only
SETTINGS_SYNC_CONFIG_SELECT_BOTH: Both configuration and gallery files
SETTINGS_SYNC_CONFIG_GITHUB_USERNAME: username
SETTINGS_SYNC_CONFIG_GITEE_USERNAME: username
SETTINGS_SYNC_CONFIG_GITHUB_REPO: repository (private)
SETTINGS_SYNC_CONFIG_GITEE_REPO: repository (private)
SETTINGS_SYNC_CONFIG_GITHUB_BRANCH: branch
SETTINGS_SYNC_CONFIG_GITEE_BRANCH: branch
SETTINGS_SYNC_CONFIG_GITHUB_TOKEN: Token
SETTINGS_SYNC_CONFIG_GITEE_TOKEN: Token
SETTINGS_SYNC_CONFIG_PROXY: Proxy
SETTINGS_SYNC_CONFIG_GITHUB_USERNAME_PLACEHOLDER: Please enter GitHub username
SETTINGS_SYNC_CONFIG_GITEE_USERNAME_PLACEHOLDER: Please enter Gitee username
SETTINGS_SYNC_CONFIG_GITHUB_REPO_PLACEHOLDER: Please enter GitHub repository name
SETTINGS_SYNC_CONFIG_GITEE_REPO_PLACEHOLDER: Please enter Gitee repository name
SETTINGS_SYNC_CONFIG_GITHUB_BRANCH_PLACEHOLDER: Please enter GitHub branch name
SETTINGS_SYNC_CONFIG_GITEE_BRANCH_PLACEHOLDER: Please enter Gitee branch name
SETTINGS_SYNC_CONFIG_GITHUB_TOKEN_PLACEHOLDER: Please enter GitHub Token
SETTINGS_SYNC_CONFIG_GITEE_TOKEN_PLACEHOLDER: Please enter Gitee Token
SETTINGS_SYNC_CONFIG_PROXY_PLACEHOLDER: Please enter proxy
# shortcut-page

BUILTIN_CLIPBOARD_TIPS: Use builtin clipboard function to upload instead of using scripts
Expand Down
26 changes: 26 additions & 0 deletions public/i18n/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,32 @@ SETTINGS_ENCODE_OUTPUT_URL: 输出(复制) URL 时进行转义
SETTINGS_WATCH_CLIPBOARD: 软件启动时自动监听剪贴板上传
SETTINGS_SHORT_URL: 使用短链接
SETTINGS_DELETE_LOCAL_FILE_AFTER_UPLOAD: 上传后删除本地文件
SETTINGS_SYNC_CONFIG: 设置配置同步
SETTINGS_SYNC_CONFIG_TITLE: 同步设置
SETTINGS_SYNC_CONFIG_NOTE: 同步的文件包括配置文件和相册文件
SETTINGS_SYNC_CONFIG_SELECT_TYPE: 选择同步方式
SETTINGS_SYNC_CONFIG_SELECT_FILE: 选择同步文件
SETTINGS_SYNC_CONFIG_SELECT_CONFIG: 仅配置文件
SETTINGS_SYNC_CONFIG_SELECT_GALLERY: 仅相册文件
SETTINGS_SYNC_CONFIG_SELECT_BOTH: 配置文件和相册文件
SETTINGS_SYNC_CONFIG_GITHUB_USERNAME: GitHub用户名
SETTINGS_SYNC_CONFIG_GITEE_USERNAME: Gitee用户名
SETTINGS_SYNC_CONFIG_GITHUB_REPO: 仓库(私有)
SETTINGS_SYNC_CONFIG_GITEE_REPO: 仓库(私有)
SETTINGS_SYNC_CONFIG_GITHUB_BRANCH: GitHub分支
SETTINGS_SYNC_CONFIG_GITEE_BRANCH: Gitee分支
SETTINGS_SYNC_CONFIG_GITHUB_TOKEN: GitHub Token
SETTINGS_SYNC_CONFIG_GITEE_TOKEN: Gitee Token
SETTINGS_SYNC_CONFIG_PROXY: 代理
SETTINGS_SYNC_CONFIG_GITHUB_USERNAME_PLACEHOLDER: 请输入GitHub用户名
SETTINGS_SYNC_CONFIG_GITEE_USERNAME_PLACEHOLDER: 请输入Gitee用户名
SETTINGS_SYNC_CONFIG_GITHUB_REPO_PLACEHOLDER: 请输入GitHub仓库名
SETTINGS_SYNC_CONFIG_GITEE_REPO_PLACEHOLDER: 请输入Gitee仓库名
SETTINGS_SYNC_CONFIG_GITHUB_BRANCH_PLACEHOLDER: 请输入GitHub分支名
SETTINGS_SYNC_CONFIG_GITEE_BRANCH_PLACEHOLDER: 请输入Gitee分支名
SETTINGS_SYNC_CONFIG_GITHUB_TOKEN_PLACEHOLDER: 请输入GitHub Token
SETTINGS_SYNC_CONFIG_GITEE_TOKEN_PLACEHOLDER: 请输入Gitee Token
SETTINGS_SYNC_CONFIG_PROXY_PLACEHOLDER: 请输入代理地址
# shortcut-page

SHORTCUT_NAME: 快捷键名称
Expand Down
27 changes: 27 additions & 0 deletions public/i18n/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,33 @@ SETTINGS_ENCODE_OUTPUT_URL: 輸出(複製) URL 時進行轉義
SETTINGS_WATCH_CLIPBOARD: 軟體啟動時自動監聽剪貼簿上傳
SETTINGS_SHORT_URL: 使用短網址
SETTINGS_DELETE_LOCAL_FILE_AFTER_UPLOAD: 上傳後刪除本地檔案
SETTINGS_SYNC_CONFIG: 設置同步配置
SETTINGS_SYNC_CONFIG_TITLE: 同步設置
SETTINGS_SYNC_CONFIG_NOTE: 同步的檔案包括配置檔案和相簿檔案
SETTINGS_SYNC_CONFIG_SELECT_TYPE: 選擇同步方式
SETTINGS_SYNC_CONFIG_SELECT_FILE: 選擇同步檔案
SETTINGS_SYNC_CONFIG_SELECT_CONFIG: 僅配置檔案
SETTINGS_SYNC_CONFIG_SELECT_GALLERY: 僅相簿檔案
SETTINGS_SYNC_CONFIG_SELECT_BOTH: 配置檔案和相簿檔案
SETTINGS_SYNC_CONFIG_GITHUB_USERNAME: 用戶名
SETTINGS_SYNC_CONFIG_GITEE_USERNAME: 用戶名
SETTINGS_SYNC_CONFIG_GITHUB_REPO: 儲存庫(私有)
SETTINGS_SYNC_CONFIG_GITEE_REPO: 儲存庫(私有)
SETTINGS_SYNC_CONFIG_GITHUB_BRANCH: GitHub 分支
SETTINGS_SYNC_CONFIG_GITEE_BRANCH: Gitee 分支
SETTINGS_SYNC_CONFIG_GITHUB_TOKEN: GitHub Token
SETTINGS_SYNC_CONFIG_GITEE_TOKEN: Gitee Token
SETTINGS_SYNC_CONFIG_PROXY: 代理
SETTINGS_SYNC_CONFIG_GITHUB_USERNAME_PLACEHOLDER: 請輸入 GitHub 用戶名
SETTINGS_SYNC_CONFIG_GITEE_USERNAME_PLACEHOLDER: 請輸入 Gitee 用戶名
SETTINGS_SYNC_CONFIG_GITHUB_REPO_PLACEHOLDER: 請輸入 GitHub 儲存庫名稱
SETTINGS_SYNC_CONFIG_GITEE_REPO_PLACEHOLDER: 請輸入 Gitee 儲存庫名稱
SETTINGS_SYNC_CONFIG_GITHUB_BRANCH_PLACEHOLDER: 請輸入 GitHub 分支名稱
SETTINGS_SYNC_CONFIG_GITEE_BRANCH_PLACEHOLDER: 請輸入 Gitee 分支名稱
SETTINGS_SYNC_CONFIG_GITHUB_TOKEN_PLACEHOLDER: 請輸入 GitHub Token
SETTINGS_SYNC_CONFIG_GITEE_TOKEN_PLACEHOLDER: 請輸入 Gitee Token
SETTINGS_SYNC_CONFIG_PROXY_PLACEHOLDER: 請輸入代理地址

# shortcut-page

SHORTCUT_NAME: 快捷鍵名稱
Expand Down
3 changes: 0 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ import 'video.js/dist/video-js.css'

webFrame.setVisualZoomLevelLimits(1, 1)

// do here before vue init
// handleURLParams()

const app = createApp(App)

app.config.globalProperties.$builtInPicBed = [
Expand Down
2 changes: 2 additions & 0 deletions src/main/lifeCycle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import clipboardPoll from '../utils/clipboardPoll'
import path from 'path'
import { CLIPBOARD_IMAGE_FOLDER } from '~/universal/utils/static'
import fs from 'fs-extra'
import { syncInterval } from '../utils/syncSettings'
const isDevelopment = process.env.NODE_ENV !== 'production'

const handleStartUpFiles = (argv: string[], cwd: string) => {
Expand Down Expand Up @@ -201,6 +202,7 @@ class LifeCycle {
}
const clipboardDir = path.join(picgo.baseDir, CLIPBOARD_IMAGE_FOLDER)
fs.ensureDir(clipboardDir)
syncInterval()
}
app.whenReady().then(readyFunction)
}
Expand Down
Loading

0 comments on commit ab4e31f

Please sign in to comment.