mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95a9f12b68 | ||
|
|
252b0f3e15 | ||
|
|
e2319f2fda | ||
|
|
9ec69631f3 | ||
|
|
be9846dc22 | ||
|
|
f071e0d6bc | ||
|
|
2f8ff36638 | ||
|
|
38e319a215 | ||
|
|
05057d06ad |
@@ -22,9 +22,9 @@
|
||||
|
||||
**最新版:**
|
||||
|
||||
- `Mac`: [ChatGPT_0.6.5_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.5/ChatGPT_0.6.5_x64.dmg)
|
||||
- `Linux`: [chat-gpt_0.6.5_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.5/chat-gpt_0.6.5_amd64.deb)
|
||||
- `Windows`: [ChatGPT_0.6.5_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.5/ChatGPT_0.6.5_x64_en-US.msi)
|
||||
- `Mac`: [ChatGPT_0.6.10_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64.dmg)
|
||||
- `Linux`: [chat-gpt_0.6.10_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/chat-gpt_0.6.10_amd64.deb)
|
||||
- `Windows`: [ChatGPT_0.6.10_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64_en-US.msi)
|
||||
|
||||
[其他版本...](https://github.com/lencx/ChatGPT/releases)
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
**Latest:**
|
||||
|
||||
- `Mac`: [ChatGPT_0.6.5_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.5/ChatGPT_0.6.5_x64.dmg)
|
||||
- `Linux`: [chat-gpt_0.6.5_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.5/chat-gpt_0.6.5_amd64.deb)
|
||||
- `Windows`: [ChatGPT_0.6.5_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.5/ChatGPT_0.6.5_x64_en-US.msi)
|
||||
- `Mac`: [ChatGPT_0.6.10_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64.dmg)
|
||||
- `Linux`: [chat-gpt_0.6.10_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/chat-gpt_0.6.10_amd64.deb)
|
||||
- `Windows`: [ChatGPT_0.6.10_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64_en-US.msi)
|
||||
|
||||
[Other version...](https://github.com/lencx/ChatGPT/releases)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# UPDATE LOG
|
||||
|
||||
## v0.6.5
|
||||
## v0.6.10
|
||||
|
||||
fix: unable to synchronize
|
||||
fix: sync failure on windows
|
||||
|
||||
## v0.6.4
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{conf::ChatConfJson, utils};
|
||||
use crate::{conf::ChatConfJson, utils::{self, exists}};
|
||||
use std::{collections::HashMap, fs, path::PathBuf};
|
||||
use tauri::{api, command, AppHandle, Manager};
|
||||
|
||||
@@ -151,6 +151,13 @@ pub fn sync_prompts(app: AppHandle, data: String, time: u64) {
|
||||
let model_cmd = chat_root().join("chat.model.cmd.json");
|
||||
let chatgpt_prompts = chat_root().join("cache_model").join("chatgpt_prompts.json");
|
||||
|
||||
if !exists(&model) {
|
||||
fs::write(&model, serde_json::json!({
|
||||
"name": "ChatGPT Model",
|
||||
"link": "https://github.com/lencx/ChatGPT"
|
||||
}).to_string()).unwrap();
|
||||
}
|
||||
|
||||
// chatgpt_prompts.json
|
||||
fs::write(
|
||||
chatgpt_prompts,
|
||||
|
||||
@@ -5,11 +5,11 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
|
||||
let chat_conf = ChatConfJson::get_chat_conf();
|
||||
let url = chat_conf.origin.to_string();
|
||||
let theme = ChatConfJson::theme();
|
||||
// let handle = app.app_handle();
|
||||
let handle = app.app_handle();
|
||||
|
||||
// std::thread::spawn(move || {
|
||||
// window::tray_window(&handle);
|
||||
// });
|
||||
std::thread::spawn(move || {
|
||||
window::tray_window(&handle);
|
||||
});
|
||||
|
||||
if chat_conf.hide_dock_icon {
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
@@ -34,7 +34,7 @@ pub fn control_window(handle: &tauri::AppHandle) {
|
||||
std::thread::spawn(move || {
|
||||
WindowBuilder::new(&app, "main", WindowUrl::App("index.html".into()))
|
||||
.title("ChatGPT")
|
||||
.resizable(false)
|
||||
.resizable(true)
|
||||
.fullscreen(false)
|
||||
.inner_size(800.0, 600.0)
|
||||
.min_inner_size(800.0, 600.0)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "ChatGPT",
|
||||
"version": "0.6.5"
|
||||
"version": "0.6.10"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"fs": {
|
||||
"all": true,
|
||||
"scope": [
|
||||
"*"
|
||||
"$HOME/.chatgpt/**"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
14
src/main.scss
vendored
14
src/main.scss
vendored
@@ -45,6 +45,12 @@ html, body {
|
||||
}
|
||||
}
|
||||
|
||||
.chat-table-tip {
|
||||
> span {
|
||||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-sync-path {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
@@ -52,6 +58,14 @@ html, body {
|
||||
margin-bottom: 5px;
|
||||
line-height: 16px;
|
||||
|
||||
> div {
|
||||
max-width: 400px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #2a2a2a;
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
// background-color: #d8d8d8;
|
||||
|
||||
14
src/utils.ts
vendored
14
src/utils.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { readTextFile, writeTextFile, exists, createDir, BaseDirectory } from '@tauri-apps/api/fs';
|
||||
import { readTextFile, writeTextFile, exists, createDir } from '@tauri-apps/api/fs';
|
||||
import { homeDir, join, dirname } from '@tauri-apps/api/path';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
@@ -28,7 +28,11 @@ type readJSONOpts = { defaultVal?: Record<string, any>, isRoot?: boolean, isList
|
||||
export const readJSON = async (path: string, opts: readJSONOpts = {}) => {
|
||||
const { defaultVal = {}, isRoot = false, isList = false } = opts;
|
||||
const root = await chatRoot();
|
||||
const file = await join(isRoot ? '' : root, path);
|
||||
let file = path;
|
||||
|
||||
if (!isRoot) {
|
||||
file = await join(root, path);
|
||||
}
|
||||
|
||||
if (!await exists(file)) {
|
||||
if (await dirname(file) !== root) {
|
||||
@@ -52,7 +56,11 @@ type writeJSONOpts = { dir?: string, isRoot?: boolean };
|
||||
export const writeJSON = async (path: string, data: Record<string, any>, opts: writeJSONOpts = {}) => {
|
||||
const { isRoot = false } = opts;
|
||||
const root = await chatRoot();
|
||||
const file = await join(isRoot ? '' : root, path);
|
||||
let file = path;
|
||||
|
||||
if (!isRoot) {
|
||||
file = await join(root, path);
|
||||
}
|
||||
|
||||
if (isRoot && !await exists(await dirname(file))) {
|
||||
await createDir(await dirname(file), { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user