chore: optim

This commit is contained in:
lencx 2022-12-29 19:29:33 +08:00
parent 9a9fb24de8
commit f1fa859961
6 changed files with 9 additions and 8 deletions

View File

@ -58,7 +58,7 @@ cask "popcorn-time", args: { "no-quarantine": true }
![chat cmd](./assets/chat-cmd-1.png)
![chat cmd](./assets/chat-cmd-2.png)
数据导入完成后,可以重新启动应用来使配置生效(`Menu -> Preferences -> Restart ChatGPT`)。
<!-- 数据导入完成后,可以重新启动应用来使配置生效(`Menu -> Preferences -> Restart ChatGPT`)。 -->
在 ChatGPT 文本输入区域,键入 `/` 开头的字符,则会弹出指令提示,按下空格键,它会默认将命令关联的文本填充到输入区域(注意:如果包含多个指令提示,它只会选择第一个作为填充,你可以持续输入,直到第一个提示命令为你想要时,再按下空格键。或者使用鼠标来点击多条指令中的某一个)。填充完成后,你只需要按下回车键即可。斜杠命令下,使用 TAB 键修改 `{q}` 标签内容(仅支持单个修改 [#54](https://github.com/lencx/ChatGPT/issues/54))。使用键盘 `⇧``⇩`(上下键)来选择斜杠指令。

View File

@ -60,7 +60,7 @@ You can look at [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-p
![chat cmd](./assets/chat-cmd-1.png)
![chat cmd](./assets/chat-cmd-2.png)
After the data import is done, you can restart the app to make the configuration take effect (`Menu -> Preferences -> Restart ChatGPT`).
<!-- After the data import is done, you can restart the app to make the configuration take effect (`Menu -> Preferences -> Restart ChatGPT`). -->
In the chatgpt text input area, type a character starting with `/` to bring up the command prompt, press the spacebar, and it will fill the input area with the text associated with the command by default (note: if it contains multiple command prompts, it will only select the first one as the fill, you can keep typing until the first prompted command is the one you want, then press the spacebar. Or use the mouse to click on one of the multiple commands). When the fill is complete, you simply press the Enter key. Under the slash command, use the tab key to modify the contents of the `{q}` tag (only single changes are supported [#54](https://github.com/lencx/ChatGPT/issues/54)). Use the keyboard `⇧` (arrow up) and `⇩` (arrow down) keys to select the slash command.

View File

@ -24,7 +24,7 @@ csv = "1.1.6"
thiserror = "1.0.38"
walkdir = "2.3.2"
regex = "1.7.0"
# tokio = { version = "1.23.0", features = ["macros"] }
tokio = { version = "1.23.0", features = ["macros"] }
# reqwest = "0.11.13"
[dependencies.tauri-plugin-log]

View File

@ -9,7 +9,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
let theme = ChatConfJson::theme();
let handle = app.app_handle();
std::thread::spawn(move || {
tokio::spawn(async move {
window::tray_window(&handle);
});
@ -43,7 +43,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
app.set_activation_policy(tauri::ActivationPolicy::Accessory);
} else {
let app = app.handle();
std::thread::spawn(move || {
tokio::spawn(async move {
#[cfg(target_os = "macos")]
WindowBuilder::new(&app, "core", WindowUrl::App(url.into()))
.title("ChatGPT")

View File

@ -6,7 +6,7 @@ pub fn tray_window(handle: &tauri::AppHandle) {
let theme = conf::ChatConfJson::theme();
let app = handle.clone();
std::thread::spawn(move || {
tokio::spawn(async move {
WindowBuilder::new(&app, "tray", WindowUrl::App(chat_conf.origin.into()))
.title("ChatGPT")
.resizable(false)
@ -28,7 +28,7 @@ pub fn tray_window(handle: &tauri::AppHandle) {
pub fn control_window(handle: &tauri::AppHandle) {
let app = handle.clone();
std::thread::spawn(move || {
tokio::spawn(async move {
WindowBuilder::new(&app, "main", WindowUrl::App("index.html".into()))
.title("ChatGPT")
.resizable(true)

View File

@ -15,7 +15,8 @@ use tauri_plugin_log::{
LogTarget, LoggerBuilder,
};
fn main() {
#[tokio::main]
async fn main() {
ChatConfJson::init();
// If the file does not exist, creating the file will block menu synchronization
utils::create_chatgpt_prompts();