mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: optim
This commit is contained in:
26
AWESOME.md
26
AWESOME.md
@@ -1,26 +0,0 @@
|
|||||||
# Awesome ChatGPT
|
|
||||||
|
|
||||||
- [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) - This repo includes ChatGPT prompt curation to use ChatGPT better.
|
|
||||||
- [Awesome ChatGPT](https://github.com/humanloop/awesome-chatgpt) - Curated list of awesome tools, demos, docs for ChatGPT and GPT-3
|
|
||||||
|
|
||||||
## Extension
|
|
||||||
|
|
||||||
`Browser`
|
|
||||||
|
|
||||||
- [ChatGPT Export and Share](https://github.com/liady/ChatGPT-pdf) - A Chrome extension for downloading your ChatGPT history to PNG, PDF or creating a sharable link
|
|
||||||
- [ChatGPT for Google](https://github.com/wong2/chat-gpt-google-extension) - A browser extension to display ChatGPT response alongside Google Search results
|
|
||||||
- [ChatGPT Extension](https://github.com/kazuki-sf/ChatGPT_Extension) - ChatGPT Extension is a really simple Chrome Extension (manifest v3) that you can access OpenAI's ChatGPT from anywhere on the web.
|
|
||||||
- [ChatGPT-Google](https://github.com/ZohaibAhmed/ChatGPT-Google) - Chrome Extension that Integrates ChatGPT (Unofficial) into Google Search
|
|
||||||
|
|
||||||
`VSCode`
|
|
||||||
|
|
||||||
- [ChatGPT Extension for VSCode](https://github.com/mpociot/chatgpt-vscode) - A VSCode extension that allows you to use ChatGPT
|
|
||||||
|
|
||||||
`Bot`
|
|
||||||
|
|
||||||
- [ChatGPT Telegram Bot](https://github.com/altryne/chatGPT-telegram-bot) - This is a very early attempt at having chatGPT work within a telegram bot
|
|
||||||
|
|
||||||
## Tools
|
|
||||||
|
|
||||||
- [commitgpt](https://github.com/RomanHotsiy/commitgpt) - Automatically generate commit messages using ChatGPT
|
|
||||||
- [ShareGPT](https://sharegpt.com/) - ShareGPT: Share your wildest ChatGPT conversations with one click.
|
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
# UPDATE LOG
|
# UPDATE LOG
|
||||||
|
|
||||||
|
## v0.10.2
|
||||||
|
|
||||||
|
Fix:
|
||||||
|
|
||||||
|
- PNG and PDF buttons do not work (https://github.com/lencx/ChatGPT/issues/274)
|
||||||
|
|
||||||
## v0.10.1
|
## v0.10.1
|
||||||
|
|
||||||
Fix:
|
Fix:
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
# ChatGPT Model
|
|
||||||
|
|
||||||
- [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts)
|
|
||||||
@@ -81,6 +81,7 @@ pub fn init() -> Menu {
|
|||||||
CustomMenuItem::new("control_center".to_string(), "Control Center")
|
CustomMenuItem::new("control_center".to_string(), "Control Center")
|
||||||
.accelerator("CmdOrCtrl+Shift+P")
|
.accelerator("CmdOrCtrl+Shift+P")
|
||||||
.into(),
|
.into(),
|
||||||
|
CustomMenuItem::new("app_website".to_string(), "ChatGPT User's Guide").into(),
|
||||||
MenuItem::Separator.into(),
|
MenuItem::Separator.into(),
|
||||||
stay_on_top_menu.into(),
|
stay_on_top_menu.into(),
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
@@ -143,7 +144,6 @@ pub fn init() -> Menu {
|
|||||||
.into(),
|
.into(),
|
||||||
CustomMenuItem::new("clear_conf".to_string(), "Clear Config").into(),
|
CustomMenuItem::new("clear_conf".to_string(), "Clear Config").into(),
|
||||||
MenuItem::Separator.into(),
|
MenuItem::Separator.into(),
|
||||||
CustomMenuItem::new("awesome".to_string(), "Awesome ChatGPT").into(),
|
|
||||||
CustomMenuItem::new("buy_coffee".to_string(), "Buy lencx a coffee").into(),
|
CustomMenuItem::new("buy_coffee".to_string(), "Buy lencx a coffee").into(),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
@@ -247,7 +247,13 @@ pub fn menu_handler(event: WindowMenuEvent<tauri::Wry>) {
|
|||||||
"inject_script" => open(&app, script_path),
|
"inject_script" => open(&app, script_path),
|
||||||
"go_conf" => utils::open_file(utils::app_root()),
|
"go_conf" => utils::open_file(utils::app_root()),
|
||||||
"clear_conf" => utils::clear_conf(&app),
|
"clear_conf" => utils::clear_conf(&app),
|
||||||
"awesome" => open(&app, conf::AWESOME_URL.to_string()),
|
"app_website" => window::cmd::wa_window(
|
||||||
|
app,
|
||||||
|
"app_website".into(),
|
||||||
|
"ChatGPT User's Guide".into(),
|
||||||
|
conf::APP_WEBSITE.into(),
|
||||||
|
None,
|
||||||
|
),
|
||||||
"buy_coffee" => open(&app, conf::BUY_COFFEE.to_string()),
|
"buy_coffee" => open(&app, conf::BUY_COFFEE.to_string()),
|
||||||
"popup_search" => {
|
"popup_search" => {
|
||||||
let app_conf = AppConf::read();
|
let app_conf = AppConf::read();
|
||||||
@@ -396,22 +402,29 @@ pub fn menu_handler(event: WindowMenuEvent<tauri::Wry>) {
|
|||||||
// --- SystemTray Menu
|
// --- SystemTray Menu
|
||||||
pub fn tray_menu() -> SystemTray {
|
pub fn tray_menu() -> SystemTray {
|
||||||
if cfg!(target_os = "macos") {
|
if cfg!(target_os = "macos") {
|
||||||
SystemTray::new().with_menu(
|
let mut tray_menu = SystemTrayMenu::new()
|
||||||
SystemTrayMenu::new()
|
.add_item(CustomMenuItem::new(
|
||||||
.add_item(CustomMenuItem::new(
|
"control_center".to_string(),
|
||||||
"control_center".to_string(),
|
"Control Center",
|
||||||
"Control Center",
|
))
|
||||||
))
|
.add_native_item(SystemTrayMenuItem::Separator);
|
||||||
.add_native_item(SystemTrayMenuItem::Separator)
|
|
||||||
.add_item(CustomMenuItem::new(
|
if AppConf::read().hide_dock_icon {
|
||||||
"show_dock_icon".to_string(),
|
tray_menu = tray_menu.add_item(CustomMenuItem::new(
|
||||||
"Show Dock Icon",
|
"show_dock_icon".to_string(),
|
||||||
))
|
"Show Dock Icon",
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
tray_menu = tray_menu
|
||||||
.add_item(CustomMenuItem::new(
|
.add_item(CustomMenuItem::new(
|
||||||
"hide_dock_icon".to_string(),
|
"hide_dock_icon".to_string(),
|
||||||
"Hide Dock Icon",
|
"Hide Dock Icon",
|
||||||
))
|
))
|
||||||
.add_item(CustomMenuItem::new("show_core".to_string(), "Show ChatGPT"))
|
.add_item(CustomMenuItem::new("show_core".to_string(), "Show ChatGPT"));
|
||||||
|
}
|
||||||
|
|
||||||
|
SystemTray::new().with_menu(
|
||||||
|
tray_menu
|
||||||
.add_native_item(SystemTrayMenuItem::Separator)
|
.add_native_item(SystemTrayMenuItem::Separator)
|
||||||
.add_item(CustomMenuItem::new("quit".to_string(), "Quit ChatGPT")),
|
.add_item(CustomMenuItem::new("quit".to_string(), "Quit ChatGPT")),
|
||||||
)
|
)
|
||||||
@@ -440,17 +453,19 @@ pub fn tray_handler(handle: &AppHandle, event: SystemTrayEvent) {
|
|||||||
let app_conf = AppConf::read();
|
let app_conf = AppConf::read();
|
||||||
|
|
||||||
if !app_conf.hide_dock_icon {
|
if !app_conf.hide_dock_icon {
|
||||||
let core_win = handle.get_window("core").unwrap();
|
if let Some(core_win) = handle.get_window("core") {
|
||||||
core_win.minimize().unwrap();
|
core_win.minimize().unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tray_win = handle.get_window("tray").unwrap();
|
if let Some(tray_win) = handle.get_window("tray") {
|
||||||
tray_win.move_window(Position::TrayCenter).unwrap();
|
tray_win.move_window(Position::TrayCenter).unwrap();
|
||||||
|
|
||||||
if tray_win.is_visible().unwrap() {
|
if tray_win.is_visible().unwrap() {
|
||||||
tray_win.hide().unwrap();
|
tray_win.hide().unwrap();
|
||||||
} else {
|
} else {
|
||||||
tray_win.show().unwrap();
|
tray_win.show().unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
|
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
|
||||||
@@ -472,13 +487,14 @@ pub fn tray_handler(handle: &AppHandle, event: SystemTrayEvent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"show_core" => {
|
"show_core" => {
|
||||||
let core_win = app.get_window("core").unwrap();
|
if let Some(core_win) = app.get_window("core") {
|
||||||
let tray_win = app.get_window("tray").unwrap();
|
let tray_win = app.get_window("tray").unwrap();
|
||||||
if !core_win.is_visible().unwrap() {
|
if !core_win.is_visible().unwrap() {
|
||||||
core_win.show().unwrap();
|
core_win.show().unwrap();
|
||||||
core_win.set_focus().unwrap();
|
core_win.set_focus().unwrap();
|
||||||
tray_win.hide().unwrap();
|
tray_win.hide().unwrap();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
"quit" => std::process::exit(0),
|
"quit" => std::process::exit(0),
|
||||||
_ => (),
|
_ => (),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
|
|||||||
let handle = app.app_handle();
|
let handle = app.app_handle();
|
||||||
|
|
||||||
tauri::async_runtime::spawn(async move {
|
tauri::async_runtime::spawn(async move {
|
||||||
|
info!("stepup_tray");
|
||||||
window::tray_window(&handle);
|
window::tray_window(&handle);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -56,6 +57,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
|
|||||||
} else {
|
} else {
|
||||||
&url
|
&url
|
||||||
};
|
};
|
||||||
|
info!("main_window: {}", link);
|
||||||
let mut main_win = WindowBuilder::new(&app, "core", WindowUrl::App(link.into()))
|
let mut main_win = WindowBuilder::new(&app, "core", WindowUrl::App(link.into()))
|
||||||
.title("ChatGPT")
|
.title("ChatGPT")
|
||||||
.resizable(true)
|
.resizable(true)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ pub mod cmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
pub async fn wa_window(
|
pub fn wa_window(
|
||||||
app: tauri::AppHandle,
|
app: tauri::AppHandle,
|
||||||
label: String,
|
label: String,
|
||||||
title: String,
|
title: String,
|
||||||
@@ -148,16 +148,13 @@ pub mod cmd {
|
|||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
});
|
});
|
||||||
} else {
|
}
|
||||||
if !win.clone().unwrap().is_visible().unwrap() {
|
if let Some(v) = win {
|
||||||
win.clone().unwrap().show().unwrap();
|
if !v.is_visible().unwrap() {
|
||||||
|
v.show().unwrap();
|
||||||
}
|
}
|
||||||
win
|
v.eval("window.location.reload()").unwrap();
|
||||||
.clone()
|
v.set_focus().unwrap();
|
||||||
.unwrap()
|
|
||||||
.eval("window.location.reload()")
|
|
||||||
.unwrap();
|
|
||||||
win.unwrap().set_focus().unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ use tauri::TitleBarStyle;
|
|||||||
|
|
||||||
use crate::utils::{app_root, create_file, exists};
|
use crate::utils::{app_root, create_file, exists};
|
||||||
|
|
||||||
|
pub const APP_WEBSITE: &str = "https://lencx.github.io/app/";
|
||||||
pub const ISSUES_URL: &str = "https://github.com/lencx/ChatGPT/issues";
|
pub const ISSUES_URL: &str = "https://github.com/lencx/ChatGPT/issues";
|
||||||
pub const UPDATE_LOG_URL: &str = "https://github.com/lencx/ChatGPT/blob/main/UPDATE_LOG.md";
|
pub const UPDATE_LOG_URL: &str = "https://github.com/lencx/ChatGPT/blob/main/UPDATE_LOG.md";
|
||||||
pub const AWESOME_URL: &str = "https://github.com/lencx/ChatGPT/blob/main/AWESOME.md";
|
|
||||||
pub const BUY_COFFEE: &str = "https://www.buymeacoffee.com/lencx";
|
pub const BUY_COFFEE: &str = "https://www.buymeacoffee.com/lencx";
|
||||||
pub const GITHUB_PROMPTS_CSV_URL: &str =
|
pub const GITHUB_PROMPTS_CSV_URL: &str =
|
||||||
"https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv";
|
"https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv";
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ mod utils;
|
|||||||
|
|
||||||
use app::{cmd, fs_extra, gpt, menu, setup, window};
|
use app::{cmd, fs_extra, gpt, menu, setup, window};
|
||||||
use conf::AppConf;
|
use conf::AppConf;
|
||||||
|
use log::info;
|
||||||
use tauri_plugin_autostart::MacosLauncher;
|
use tauri_plugin_autostart::MacosLauncher;
|
||||||
use tauri_plugin_log::{
|
use tauri_plugin_log::{
|
||||||
fern::colors::{Color, ColoredLevelConfig},
|
fern::colors::{Color, ColoredLevelConfig},
|
||||||
|
|||||||
@@ -156,25 +156,25 @@ pub async fn get_data(
|
|||||||
pub fn run_check_update(app: AppHandle<Wry>, silent: bool, has_msg: Option<bool>) {
|
pub fn run_check_update(app: AppHandle<Wry>, silent: bool, has_msg: Option<bool>) {
|
||||||
info!("run_check_update: silent={} has_msg={:?}", silent, has_msg);
|
info!("run_check_update: silent={} has_msg={:?}", silent, has_msg);
|
||||||
tauri::async_runtime::spawn(async move {
|
tauri::async_runtime::spawn(async move {
|
||||||
let result = app.updater().check().await;
|
if let Ok(update_resp) = app.updater().check().await {
|
||||||
let update_resp = result.unwrap();
|
if update_resp.is_update_available() {
|
||||||
if update_resp.is_update_available() {
|
if silent {
|
||||||
if silent {
|
tauri::async_runtime::spawn(async move {
|
||||||
tauri::async_runtime::spawn(async move {
|
silent_install(app, update_resp).await.unwrap();
|
||||||
silent_install(app, update_resp).await.unwrap();
|
});
|
||||||
});
|
} else {
|
||||||
} else {
|
tauri::async_runtime::spawn(async move {
|
||||||
tauri::async_runtime::spawn(async move {
|
prompt_for_install(app, update_resp).await.unwrap();
|
||||||
prompt_for_install(app, update_resp).await.unwrap();
|
});
|
||||||
});
|
}
|
||||||
}
|
} else if let Some(v) = has_msg {
|
||||||
} else if let Some(v) = has_msg {
|
if v {
|
||||||
if v {
|
tauri::api::dialog::message(
|
||||||
tauri::api::dialog::message(
|
app.app_handle().get_window("core").as_ref(),
|
||||||
app.app_handle().get_window("core").as_ref(),
|
"ChatGPT",
|
||||||
"ChatGPT",
|
"Your ChatGPT is up to date",
|
||||||
"Your ChatGPT is up to date",
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user