mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a929376cb2 | ||
|
|
478049e23e | ||
|
|
631dee95a7 | ||
|
|
bcd350584e | ||
|
|
050045f644 | ||
|
|
7e9440b45e | ||
|
|
cd9c0ac742 | ||
|
|
2d018c4967 | ||
|
|
f4d3cc6c8e | ||
|
|
cd6cece45e | ||
|
|
54b5b63f0e | ||
|
|
680f1b01ad | ||
|
|
078b0296f5 | ||
|
|
c956758a4a | ||
|
|
477120ef3b | ||
|
|
0ee95630ef | ||
|
|
fb0319a977 | ||
|
|
ea1a78abf5 |
34
.github/workflows/release.yml
vendored
34
.github/workflows/release.yml
vendored
@@ -8,7 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
|
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
|
||||||
|
|
||||||
@@ -36,34 +36,32 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [macos-latest, ubuntu-latest, windows-latest]
|
platform: [macos-latest, ubuntu-20.04, windows-latest]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
- name: setup node
|
||||||
- name: Setup node
|
uses: actions/setup-node@v3
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 16
|
||||||
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
|
|
||||||
# Rust cache
|
|
||||||
- uses: Swatinem/rust-cache@v1
|
|
||||||
|
|
||||||
|
- name: install Rust stable
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (ubuntu only)
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
if: matrix.platform == 'ubuntu-20.04'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
|
||||||
|
|
||||||
- name: Install app dependencies and build it
|
- name: Install app dependencies and build it
|
||||||
run: yarn && yarn build:fe
|
run: yarn && yarn build:fe
|
||||||
|
|
||||||
|
- name: fix tray icon
|
||||||
|
if: matrix.platform != 'macos-latest'
|
||||||
|
run: |
|
||||||
|
yarn fix:tray
|
||||||
|
|
||||||
- uses: tauri-apps/tauri-action@v0.3
|
- uses: tauri-apps/tauri-action@v0.3
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -74,7 +72,7 @@ jobs:
|
|||||||
releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
|
releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
|
||||||
|
|
||||||
updater:
|
updater:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
needs: [create-release, build-tauri]
|
needs: [create-release, build-tauri]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
72
.github/workflows/win.yml
vendored
Normal file
72
.github/workflows/win.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
# name: Release CI
|
||||||
|
|
||||||
|
# on:
|
||||||
|
# push:
|
||||||
|
# # Sequence of patterns matched against refs/tags
|
||||||
|
# tags:
|
||||||
|
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||||
|
|
||||||
|
# jobs:
|
||||||
|
# create-release:
|
||||||
|
# runs-on: ubuntu-20.04
|
||||||
|
# outputs:
|
||||||
|
# RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
|
||||||
|
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v2
|
||||||
|
# - name: Query version number
|
||||||
|
# id: get_version
|
||||||
|
# shell: bash
|
||||||
|
# run: |
|
||||||
|
# echo "using version tag ${GITHUB_REF:10}"
|
||||||
|
# echo "version=${GITHUB_REF:10}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# - name: Create Release
|
||||||
|
# id: create_release
|
||||||
|
# uses: actions/create-release@v1
|
||||||
|
# env:
|
||||||
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# with:
|
||||||
|
# tag_name: '${{ env.version }}'
|
||||||
|
# release_name: 'ChatGPT ${{ env.version }}'
|
||||||
|
# body: 'See the assets to download this version and install.'
|
||||||
|
|
||||||
|
# build-tauri:
|
||||||
|
# needs: create-release
|
||||||
|
# strategy:
|
||||||
|
# fail-fast: false
|
||||||
|
# matrix:
|
||||||
|
# platform: [windows-latest]
|
||||||
|
|
||||||
|
# runs-on: ${{ matrix.platform }}
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v3
|
||||||
|
# - name: setup node
|
||||||
|
# uses: actions/setup-node@v3
|
||||||
|
# with:
|
||||||
|
# node-version: 16
|
||||||
|
|
||||||
|
# - name: install Rust stable
|
||||||
|
# uses: dtolnay/rust-toolchain@stable
|
||||||
|
# - name: install dependencies (ubuntu only)
|
||||||
|
# if: matrix.platform == 'ubuntu-20.04'
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get update
|
||||||
|
# sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
|
||||||
|
|
||||||
|
# - name: Install app dependencies and build it
|
||||||
|
# run: yarn && yarn build:fe
|
||||||
|
|
||||||
|
# - name: fix tray icon
|
||||||
|
# if: matrix.platform != 'macos-latest'
|
||||||
|
# run: |
|
||||||
|
# yarn fix:tray
|
||||||
|
|
||||||
|
# - uses: tauri-apps/tauri-action@v0.3
|
||||||
|
# env:
|
||||||
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# # 📝: https://tauri.app/v1/guides/distribution/updater#signing-updates
|
||||||
|
# TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
||||||
|
# TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||||
|
# with:
|
||||||
|
# releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
**最新版:**
|
**最新版:**
|
||||||
|
|
||||||
- `Mac`: [ChatGPT_0.7.0_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.0/ChatGPT_0.7.0_x64.dmg)
|
- `Mac`: [ChatGPT_0.7.2_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64.dmg)
|
||||||
- `Linux`: [chat-gpt_0.7.0_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.0/chat-gpt_0.7.0_amd64.deb)
|
- `Linux`: [chat-gpt_0.7.2_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/chat-gpt_0.7.2_amd64.deb)
|
||||||
- `Windows`: [ChatGPT_0.7.0_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.0/ChatGPT_0.7.0_x64_en-US.msi)
|
- `Windows`: [ChatGPT_0.7.2_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64_en-US.msi)
|
||||||
|
|
||||||
[其他版本...](https://github.com/lencx/ChatGPT/releases)
|
[其他版本...](https://github.com/lencx/ChatGPT/releases)
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ cask "popcorn-time", args: { "no-quarantine": true }
|
|||||||
- 系统托盘悬浮窗
|
- 系统托盘悬浮窗
|
||||||
- 应用菜单功能强大
|
- 应用菜单功能强大
|
||||||
- 支持斜杠命令及其配置(可手动配置或从文件同步 [#55](https://github.com/lencx/ChatGPT/issues/55))
|
- 支持斜杠命令及其配置(可手动配置或从文件同步 [#55](https://github.com/lencx/ChatGPT/issues/55))
|
||||||
- 进入应用的全局快捷键 (mac: `command+shift+o`, windows: `ctrl+shift+o`)
|
<!-- - 进入应用的全局快捷键 (mac: `command+shift+o`, windows: `ctrl+shift+o`) -->
|
||||||
|
|
||||||
### 菜单项
|
### 菜单项
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
|
|
||||||
**Latest:**
|
**Latest:**
|
||||||
|
|
||||||
- `Mac`: [ChatGPT_0.7.0_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.0/ChatGPT_0.7.0_x64.dmg)
|
- `Mac`: [ChatGPT_0.7.2_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64.dmg)
|
||||||
- `Linux`: [chat-gpt_0.7.0_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.0/chat-gpt_0.7.0_amd64.deb)
|
- `Linux`: [chat-gpt_0.7.2_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/chat-gpt_0.7.2_amd64.deb)
|
||||||
- `Windows`: [ChatGPT_0.7.0_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.0/ChatGPT_0.7.0_x64_en-US.msi)
|
- `Windows`: [ChatGPT_0.7.2_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64_en-US.msi)
|
||||||
|
|
||||||
[Other version...](https://github.com/lencx/ChatGPT/releases)
|
[Other version...](https://github.com/lencx/ChatGPT/releases)
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ In the chatgpt text input area, type a character starting with `/` to bring up t
|
|||||||
- System tray hover window
|
- System tray hover window
|
||||||
- Powerful menu items
|
- Powerful menu items
|
||||||
- Support for slash commands and their configuration (can be configured manually or synchronized from a file [#55](https://github.com/lencx/ChatGPT/issues/55))
|
- Support for slash commands and their configuration (can be configured manually or synchronized from a file [#55](https://github.com/lencx/ChatGPT/issues/55))
|
||||||
- Global shortcuts to the chatgpt app (mac: `command+shift+o`, windows: `ctrl+shift+o`)
|
<!-- - Global shortcuts to the chatgpt app (mac: `command+shift+o`, windows: `ctrl+shift+o`) -->
|
||||||
|
|
||||||
### MenuItem
|
### MenuItem
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
# UPDATE LOG
|
# UPDATE LOG
|
||||||
|
|
||||||
|
## v0.7.2
|
||||||
|
|
||||||
|
fix: some windows systems cannot start the application
|
||||||
|
|
||||||
|
## v0.7.1
|
||||||
|
|
||||||
|
fix:
|
||||||
|
- some windows systems cannot start the application
|
||||||
|
- windows and linux add about menu (show version information)
|
||||||
|
- the tray icon is indistinguishable from the background in dark mode on window and linux
|
||||||
|
|
||||||
## v0.7.0
|
## v0.7.0
|
||||||
|
|
||||||
fix:
|
fix:
|
||||||
@@ -8,7 +19,7 @@ fix:
|
|||||||
|
|
||||||
feat:
|
feat:
|
||||||
- use the keyboard `⇧` (arrow up) and `⇩` (arrow down) keys to select the slash command
|
- use the keyboard `⇧` (arrow up) and `⇩` (arrow down) keys to select the slash command
|
||||||
- global shortcuts to the chatgpt app (mac: command+shift+o, windows: ctrl+shift+o)
|
<!-- - global shortcuts to the chatgpt app (mac: command+shift+o, windows: ctrl+shift+o) -->
|
||||||
|
|
||||||
## v0.6.10
|
## v0.6.10
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
"build": "yarn tauri build",
|
"build": "yarn tauri build",
|
||||||
"updater": "tr updater",
|
"updater": "tr updater",
|
||||||
"release": "tr release --git",
|
"release": "tr release --git",
|
||||||
|
"fix:tray": "tr override --json.tauri_systemTray_iconPath=\"icons/tray-icon-light.png\" --json.tauri_systemTray_iconAsTemplate=false",
|
||||||
|
"fix:tray:mac": "tr override --json.tauri_systemTray_iconPath=\"icons/tray-icon.png\" --json.tauri_systemTray_iconAsTemplate=true",
|
||||||
"download": "node ./scripts/download.js",
|
"download": "node ./scripts/download.js",
|
||||||
"tr": "tr",
|
"tr": "tr",
|
||||||
"tauri": "tauri"
|
"tauri": "tauri"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ tauri-build = {version = "1.2.1", features = [] }
|
|||||||
anyhow = "1.0.66"
|
anyhow = "1.0.66"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tauri = { version = "1.2.2", features = ["api-all", "devtools", "system-tray", "updater"] }
|
tauri = { version = "1.2.3", features = ["api-all", "devtools", "system-tray", "updater"] }
|
||||||
tauri-plugin-positioner = { version = "1.0.4", features = ["system-tray"] }
|
tauri-plugin-positioner = { version = "1.0.4", features = ["system-tray"] }
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
csv = "1.1.6"
|
csv = "1.1.6"
|
||||||
|
|||||||
BIN
src-tauri/icons/tray-icon-light.png
Normal file
BIN
src-tauri/icons/tray-icon-light.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
@@ -3,11 +3,14 @@ use crate::{
|
|||||||
utils,
|
utils,
|
||||||
};
|
};
|
||||||
use tauri::{
|
use tauri::{
|
||||||
AboutMetadata, AppHandle, CustomMenuItem, Manager, Menu, MenuItem, Submenu, SystemTray,
|
AppHandle, CustomMenuItem, Manager, Menu, MenuItem, Submenu, SystemTray, SystemTrayEvent,
|
||||||
SystemTrayEvent, SystemTrayMenu, SystemTrayMenuItem, WindowMenuEvent,
|
SystemTrayMenu, SystemTrayMenuItem, WindowMenuEvent,
|
||||||
};
|
};
|
||||||
use tauri_plugin_positioner::{on_tray_event, Position, WindowExt};
|
use tauri_plugin_positioner::{on_tray_event, Position, WindowExt};
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
use tauri::AboutMetadata;
|
||||||
|
|
||||||
use super::window;
|
use super::window;
|
||||||
|
|
||||||
// --- Menu
|
// --- Menu
|
||||||
@@ -16,19 +19,23 @@ pub fn init() -> Menu {
|
|||||||
let name = "ChatGPT";
|
let name = "ChatGPT";
|
||||||
let app_menu = Submenu::new(
|
let app_menu = Submenu::new(
|
||||||
name,
|
name,
|
||||||
Menu::new()
|
Menu::with_items([
|
||||||
.add_native_item(MenuItem::About(name.into(), AboutMetadata::default()))
|
#[cfg(target_os = "macos")]
|
||||||
.add_native_item(MenuItem::Services)
|
MenuItem::About(name.into(), AboutMetadata::default()).into(),
|
||||||
.add_native_item(MenuItem::Separator)
|
#[cfg(not(target_os = "macos"))]
|
||||||
.add_native_item(MenuItem::Hide)
|
CustomMenuItem::new("about".to_string(), "About ChatGPT").into(),
|
||||||
.add_native_item(MenuItem::HideOthers)
|
MenuItem::Services.into(),
|
||||||
.add_native_item(MenuItem::ShowAll)
|
MenuItem::Hide.into(),
|
||||||
.add_native_item(MenuItem::Separator)
|
MenuItem::HideOthers.into(),
|
||||||
.add_native_item(MenuItem::Quit),
|
MenuItem::ShowAll.into(),
|
||||||
|
MenuItem::Separator.into(),
|
||||||
|
MenuItem::Quit.into(),
|
||||||
|
]),
|
||||||
);
|
);
|
||||||
|
|
||||||
let stay_on_top =
|
let stay_on_top =
|
||||||
CustomMenuItem::new("stay_on_top".to_string(), "Stay On Top").accelerator("CmdOrCtrl+T");
|
CustomMenuItem::new("stay_on_top".to_string(), "Stay On Top").accelerator("CmdOrCtrl+T");
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
let titlebar =
|
let titlebar =
|
||||||
CustomMenuItem::new("titlebar".to_string(), "Titlebar").accelerator("CmdOrCtrl+B");
|
CustomMenuItem::new("titlebar".to_string(), "Titlebar").accelerator("CmdOrCtrl+B");
|
||||||
let theme_light = CustomMenuItem::new("theme_light".to_string(), "Light");
|
let theme_light = CustomMenuItem::new("theme_light".to_string(), "Light");
|
||||||
@@ -40,6 +47,7 @@ pub fn init() -> Menu {
|
|||||||
} else {
|
} else {
|
||||||
stay_on_top
|
stay_on_top
|
||||||
};
|
};
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
let titlebar_menu = if chat_conf.titlebar {
|
let titlebar_menu = if chat_conf.titlebar {
|
||||||
titlebar.selected()
|
titlebar.selected()
|
||||||
} else {
|
} else {
|
||||||
@@ -175,6 +183,15 @@ pub fn menu_handler(event: WindowMenuEvent<tauri::Wry>) {
|
|||||||
let menu_handle = core_window.menu_handle();
|
let menu_handle = core_window.menu_handle();
|
||||||
|
|
||||||
match menu_id {
|
match menu_id {
|
||||||
|
// App
|
||||||
|
"about" => {
|
||||||
|
let tauri_conf = utils::get_tauri_conf().unwrap();
|
||||||
|
tauri::api::dialog::message(
|
||||||
|
app.get_window("core").as_ref(),
|
||||||
|
"ChatGPT",
|
||||||
|
format!("Version {}", tauri_conf.package.version.unwrap()),
|
||||||
|
);
|
||||||
|
}
|
||||||
// Preferences
|
// Preferences
|
||||||
"control_center" => window::control_window(&app),
|
"control_center" => window::control_window(&app),
|
||||||
"restart" => tauri::api::process::restart(&app.env()),
|
"restart" => tauri::api::process::restart(&app.env()),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use crate::{app::window, conf::ChatConfJson, utils};
|
use crate::{app::window, conf::ChatConfJson, utils};
|
||||||
use tauri::{utils::config::WindowUrl, window::WindowBuilder, App, GlobalShortcutManager, Manager};
|
use log::info;
|
||||||
|
use tauri::{utils::config::WindowUrl, window::WindowBuilder, App, Manager};
|
||||||
|
|
||||||
pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>> {
|
pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>> {
|
||||||
let chat_conf = ChatConfJson::get_chat_conf();
|
let chat_conf = ChatConfJson::get_chat_conf();
|
||||||
@@ -11,26 +12,31 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
|
|||||||
window::tray_window(&handle);
|
window::tray_window(&handle);
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
info!("stepup");
|
||||||
let handle = app.app_handle();
|
|
||||||
let mut shortcut = app.global_shortcut_manager();
|
|
||||||
let is_mini_key = shortcut.is_registered("CmdOrCtrl+Shift+O");
|
|
||||||
|
|
||||||
if !is_mini_key.unwrap() {
|
// fix: Global shortcuts can cause programs to exit under windows
|
||||||
shortcut
|
// {
|
||||||
.register("CmdOrCtrl+Shift+O", move || {
|
// info!("global_shortcut_start");
|
||||||
if let Some(w) = handle.get_window("core") {
|
// let handle = app.app_handle();
|
||||||
if w.is_visible().unwrap() {
|
// let mut shortcut = app.global_shortcut_manager();
|
||||||
w.hide().unwrap();
|
// let is_mini_key = shortcut.is_registered("CmdOrCtrl+Shift+O");
|
||||||
} else {
|
|
||||||
w.show().unwrap();
|
// if is_mini_key.is_ok() {
|
||||||
w.set_focus().unwrap();
|
// shortcut
|
||||||
}
|
// .register("CmdOrCtrl+Shift+O", move || {
|
||||||
}
|
// if let Some(w) = handle.get_window("core") {
|
||||||
})
|
// if w.is_visible().unwrap() {
|
||||||
.unwrap();
|
// w.hide().unwrap();
|
||||||
};
|
// } else {
|
||||||
}
|
// w.show().unwrap();
|
||||||
|
// w.set_focus().unwrap();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .unwrap();
|
||||||
|
// };
|
||||||
|
// info!("global_shortcut_end");
|
||||||
|
// }
|
||||||
|
|
||||||
if chat_conf.hide_dock_icon {
|
if chat_conf.hide_dock_icon {
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|||||||
@@ -8,19 +8,18 @@ use std::{
|
|||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process::Command,
|
process::Command,
|
||||||
};
|
};
|
||||||
use tauri::Manager;
|
use tauri::{utils::config::Config, Manager};
|
||||||
// use tauri::utils::config::Config;
|
|
||||||
|
|
||||||
pub fn chat_root() -> PathBuf {
|
pub fn chat_root() -> PathBuf {
|
||||||
tauri::api::path::home_dir().unwrap().join(".chatgpt")
|
tauri::api::path::home_dir().unwrap().join(".chatgpt")
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub fn get_tauri_conf() -> Option<Config> {
|
pub fn get_tauri_conf() -> Option<Config> {
|
||||||
// let config_file = include_str!("../tauri.conf.json");
|
let config_file = include_str!("../tauri.conf.json");
|
||||||
// let config: Config =
|
let config: Config =
|
||||||
// serde_json::from_str(config_file).expect("failed to parse tauri.conf.json");
|
serde_json::from_str(config_file).expect("failed to parse tauri.conf.json");
|
||||||
// Some(config)
|
Some(config)
|
||||||
// }
|
}
|
||||||
|
|
||||||
pub fn exists(path: &Path) -> bool {
|
pub fn exists(path: &Path) -> bool {
|
||||||
Path::new(path).exists()
|
Path::new(path).exists()
|
||||||
|
|||||||
@@ -7,11 +7,14 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "ChatGPT",
|
"productName": "ChatGPT",
|
||||||
"version": "0.7.0"
|
"version": "0.7.2"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
"all": true,
|
"all": true,
|
||||||
|
"globalShortcut": {
|
||||||
|
"all": true
|
||||||
|
},
|
||||||
"http": {
|
"http": {
|
||||||
"all": true,
|
"all": true,
|
||||||
"scope": [
|
"scope": [
|
||||||
@@ -27,8 +30,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systemTray": {
|
"systemTray": {
|
||||||
"iconPath": "icons/tray-icon.png",
|
"iconPath": "icons/tray-icon-light.png",
|
||||||
"iconAsTemplate": true,
|
"iconAsTemplate": false,
|
||||||
"menuOnLeftClick": false
|
"menuOnLeftClick": false
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
|
|||||||
Reference in New Issue
Block a user