mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1607261e8f | ||
|
|
508875a944 | ||
|
|
f585f58987 | ||
|
|
0d897e0176 | ||
|
|
dc33c6eb4f |
19
AWESOME.md
19
AWESOME.md
@@ -1,19 +0,0 @@
|
||||
# Awesome ChatGPT
|
||||
|
||||
- [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.
|
||||
|
||||
`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
|
||||
22
README.md
22
README.md
@@ -5,24 +5,18 @@
|
||||
|
||||
> ChatGPT Desktop Application
|
||||
|
||||
[Awesome ChatGPT](./AWESOME.md)
|
||||
|
||||
## Downloads
|
||||
|
||||
[](https://github.com/lencx/ChatGPT/releases)
|
||||
|
||||
<!-- download start -->
|
||||
|
||||
**Latest:**
|
||||
|
||||
- `Mac`: [ChatGPT_0.1.7_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.1.7/ChatGPT_0.1.7_x64.dmg)
|
||||
- `Linux`: [chat-gpt_0.1.7_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.1.7/chat-gpt_0.1.7_amd64.deb)
|
||||
- `Windows`: [ChatGPT_0.1.7_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.1.7/ChatGPT_0.1.7_x64_en-US.msi)
|
||||
- `Mac`: [ChatGPT_0.1.6_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.1.5/ChatGPT_0.1.6_x64.dmg)
|
||||
- `Linux`: [chat-gpt_0.1.6_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.1.5/chat-gpt_0.1.6_amd64.deb)
|
||||
- `Windows`: [ChatGPT_0.1.6_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.1.5/ChatGPT_0.1.6_x64_en-US.msi)
|
||||
|
||||
[Other version...](https://github.com/lencx/ChatGPT/releases)
|
||||
|
||||
<!-- download end -->
|
||||
|
||||
## Features
|
||||
|
||||
- multi-platform: `macOS` `Linux` `Windows`
|
||||
@@ -31,14 +25,14 @@
|
||||
- inject script
|
||||
- auto updater
|
||||
- app menu
|
||||
- tray window
|
||||
- system tray
|
||||
- shortcut
|
||||
|
||||
## Preview
|
||||
|
||||
<img width="360" src="./assets/install.png" alt="install"> <img width="360" src="./assets/chat.png" alt="chat">
|
||||
<img width="360" src="./assets/export.png" alt="export"> <img width="360" src="./assets/tray.png" alt="tray">
|
||||
<img width="360" src="./assets/auto-update.png" alt="auto update">
|
||||
<img width="360" src="./assets/export.png" alt="export"> <img width="360" src="./assets/auto-update.png" alt="auto update">
|
||||
|
||||
## FAQ
|
||||
|
||||
### Is it safe?
|
||||
@@ -80,6 +74,4 @@ yarn build
|
||||
|
||||
## Related
|
||||
|
||||
- [Tauri](https://tauri.app) - Build an optimized, secure, and frontend-independent application for multi-platform deployment.
|
||||
- [ChatGPT](https://openai.com/blog/chatgpt) - ChatGPT: Optimizing Language Models for Dialogue.
|
||||
- [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 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
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# UPDATE LOG
|
||||
|
||||
## v0.1.7
|
||||
|
||||
feat: tray window
|
||||
|
||||
## v0.1.6
|
||||
|
||||
feat:
|
||||
|
||||
BIN
assets/tray.png
BIN
assets/tray.png
Binary file not shown.
|
Before Width: | Height: | Size: 543 KiB |
@@ -6,7 +6,6 @@
|
||||
"build": "yarn tauri build",
|
||||
"updater": "tr updater",
|
||||
"release": "tr release --git",
|
||||
"download": "node ./scripts/download.js",
|
||||
"tr": "tr",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
|
||||
26
scripts/download.js
vendored
26
scripts/download.js
vendored
@@ -1,26 +0,0 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const argv = process.argv.slice(2);
|
||||
|
||||
async function init() {
|
||||
const content = fs.readFileSync('README.md', 'utf8').split('\n');
|
||||
const startRe = /<!-- download start -->/;
|
||||
const endRe = /<!-- download end -->/;
|
||||
|
||||
let flag = false;
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
if (startRe.test(content[i])) {
|
||||
flag = true;
|
||||
}
|
||||
if (flag) {
|
||||
content[i] = content[i].replace(/(\d+).(\d+).(\d+)/g, argv[0]);
|
||||
}
|
||||
if (endRe.test(content[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFileSync('README.md', content.join('\n'), 'utf8');
|
||||
}
|
||||
|
||||
init().catch(console.error);
|
||||
@@ -17,7 +17,6 @@ tauri-build = {version = "1.2.1", features = [] }
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.2.1", features = ["api-all", "devtools", "system-tray", "updater"] }
|
||||
tauri-plugin-positioner = { version = "1.0.4", features = ["system-tray"] }
|
||||
anyhow = "1.0.66"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -3,7 +3,6 @@ use tauri::{
|
||||
utils::assets::EmbeddedAssets, AboutMetadata, AppHandle, Context, CustomMenuItem, Manager,
|
||||
Menu, MenuItem, Submenu, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowMenuEvent,
|
||||
};
|
||||
use tauri_plugin_positioner::{on_tray_event, Position, WindowExt};
|
||||
|
||||
// --- Menu
|
||||
pub fn init(chat_conf: &conf::ChatConfJson, context: &Context<EmbeddedAssets>) -> Menu {
|
||||
@@ -160,19 +159,16 @@ pub fn tray_menu() -> SystemTray {
|
||||
}
|
||||
|
||||
// --- SystemTray Event
|
||||
pub fn tray_handler(handle: &AppHandle, event: SystemTrayEvent) {
|
||||
let core_win = handle.get_window("core").unwrap();
|
||||
on_tray_event(handle, &event);
|
||||
pub fn tray_handler(app: &AppHandle, event: SystemTrayEvent) {
|
||||
let win = app.get_window("core").unwrap();
|
||||
|
||||
if let SystemTrayEvent::LeftClick { .. } = event {
|
||||
core_win.minimize().unwrap();
|
||||
let mini_win = handle.get_window("mini").unwrap();
|
||||
mini_win.move_window(Position::TrayCenter).unwrap();
|
||||
|
||||
if mini_win.is_visible().unwrap() {
|
||||
mini_win.hide().unwrap();
|
||||
// TODO: tray window
|
||||
if win.is_visible().unwrap() {
|
||||
win.hide().unwrap();
|
||||
} else {
|
||||
mini_win.show().unwrap();
|
||||
win.show().unwrap();
|
||||
win.set_focus().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
pub mod cmd;
|
||||
pub mod menu;
|
||||
pub mod setup;
|
||||
pub mod window;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::{app::window, conf, utils};
|
||||
use tauri::{utils::config::WindowUrl, window::WindowBuilder, App, Manager};
|
||||
use crate::{conf, utils};
|
||||
use tauri::{utils::config::WindowUrl, window::WindowBuilder, App};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
use tauri::TitleBarStyle;
|
||||
@@ -10,7 +10,6 @@ pub fn init(
|
||||
) -> std::result::Result<(), Box<dyn std::error::Error>> {
|
||||
let conf = utils::get_tauri_conf().unwrap();
|
||||
let url = conf.build.dev_path.to_string();
|
||||
window::mini_window(&app.app_handle());
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
WindowBuilder::new(app, "core", WindowUrl::App(url.into()))
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
use crate::{conf, utils};
|
||||
use tauri::{utils::config::WindowUrl, window::WindowBuilder};
|
||||
|
||||
pub fn mini_window(handle: &tauri::AppHandle) {
|
||||
let conf = utils::get_tauri_conf().unwrap();
|
||||
let url = conf.build.dev_path.to_string();
|
||||
|
||||
WindowBuilder::new(handle, "mini", WindowUrl::App(url.into()))
|
||||
.resizable(false)
|
||||
.fullscreen(false)
|
||||
.inner_size(360.0, 540.0)
|
||||
.decorations(false)
|
||||
.always_on_top(true)
|
||||
.initialization_script(&utils::user_script())
|
||||
.initialization_script(include_str!("../assets/html2canvas.js"))
|
||||
.initialization_script(include_str!("../assets/jspdf.js"))
|
||||
.initialization_script(include_str!("../assets/core.js"))
|
||||
.initialization_script(include_str!("../assets/export.js"))
|
||||
.user_agent(conf::PHONE_USER_AGENT)
|
||||
.menu(tauri::Menu::new())
|
||||
.build()
|
||||
.unwrap()
|
||||
.hide()
|
||||
.unwrap();
|
||||
}
|
||||
6
src-tauri/src/assets/core.js
vendored
6
src-tauri/src/assets/core.js
vendored
@@ -40,12 +40,6 @@ window.invoke = invoke;
|
||||
window.transformCallback = transformCallback;
|
||||
|
||||
async function init() {
|
||||
if (__TAURI_METADATA__.__currentWindow.label === 'mini') {
|
||||
document.getElementsByTagName('html')[0].style['font-size'] = '70%';
|
||||
}
|
||||
|
||||
if (__TAURI_METADATA__.__currentWindow.label !== 'core') return;
|
||||
|
||||
async function platform() {
|
||||
return invoke('platform', {
|
||||
__tauriModule: 'Os',
|
||||
|
||||
@@ -4,7 +4,6 @@ use std::path::PathBuf;
|
||||
use std::sync::Mutex;
|
||||
|
||||
pub const USER_AGENT: &str = "5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36";
|
||||
pub const PHONE_USER_AGENT: &str = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1";
|
||||
pub const ISSUES_URL: &str = "https://github.com/lencx/ChatGPT/issues";
|
||||
pub const AWESOME_URL: &str = "https://github.com/lencx/ChatGPT/blob/main/AWESOME.md";
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ fn main() {
|
||||
cmd::open_link
|
||||
])
|
||||
.setup(|app| setup::init(app, chat_conf2))
|
||||
.plugin(tauri_plugin_positioner::init())
|
||||
.menu(menu::init(&chat_conf, &context))
|
||||
.system_tray(menu::tray_menu())
|
||||
.on_menu_event(menu::menu_handler)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "ChatGPT",
|
||||
"version": "0.1.7"
|
||||
"version": "0.1.6"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
||||
Reference in New Issue
Block a user