1
0
mirror of https://github.com/lencx/ChatGPT.git synced 2024-10-01 01:06:13 -04:00

Merge pull request #40 from lencx/fix

This commit is contained in:
lencx 2022-12-17 21:51:09 +08:00 committed by GitHub
commit 1b71bf8f26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 14 deletions

View File

@ -22,9 +22,9 @@
**最新版:**
- `Mac`: [ChatGPT_0.4.0_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.4.0/ChatGPT_0.4.0_x64.dmg)
- `Linux`: [chat-gpt_0.4.0_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.4.0/chat-gpt_0.4.0_amd64.deb)
- `Windows`: [ChatGPT_0.4.0_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.4.0/ChatGPT_0.4.0_x64_en-US.msi)
- `Mac`: [ChatGPT_0.4.1_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.4.1/ChatGPT_0.4.1_x64.dmg)
- `Linux`: [chat-gpt_0.4.1_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.4.1/chat-gpt_0.4.1_amd64.deb)
- `Windows`: [ChatGPT_0.4.1_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.4.1/ChatGPT_0.4.1_x64_en-US.msi)
[其他版本...](https://github.com/lencx/ChatGPT/releases)

View File

@ -23,9 +23,9 @@
**Latest:**
- `Mac`: [ChatGPT_0.4.0_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.4.0/ChatGPT_0.4.0_x64.dmg)
- `Linux`: [chat-gpt_0.4.0_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.4.0/chat-gpt_0.4.0_amd64.deb)
- `Windows`: [ChatGPT_0.4.0_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.4.0/ChatGPT_0.4.0_x64_en-US.msi)
- `Mac`: [ChatGPT_0.4.1_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.4.1/ChatGPT_0.4.1_x64.dmg)
- `Linux`: [chat-gpt_0.4.1_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.4.1/chat-gpt_0.4.1_amd64.deb)
- `Windows`: [ChatGPT_0.4.1_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.4.1/ChatGPT_0.4.1_x64_en-US.msi)
[Other version...](https://github.com/lencx/ChatGPT/releases)

View File

@ -1,5 +1,10 @@
# UPDATE LOG
## v0.4.1
fix:
- tray window style optimization
## v0.4.0
feat:

View File

@ -7,7 +7,6 @@ function init() {
}
.chat-model-cmd-list {
position: absolute;
width: 400px;
bottom: 60px;
max-height: 100px;
overflow: auto;
@ -31,13 +30,17 @@ function init() {
}
.chat-model-cmd-list .cmd-item b {
display: inline-block;
width: 120px;
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border-radius: 4px;
margin-right: 10px;
color: #2a2a2a;
}
.chat-model-cmd-list .cmd-item i {
width: 270px;
width: 100%;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -64,6 +67,12 @@ async function cmdTip() {
const modelDom = document.createElement('div');
modelDom.classList.add('chat-model-cmd-list');
// fix: tray window
if (__TAURI_METADATA__.__currentWindow.label === 'tray') {
modelDom.style.bottom = '40px';
}
document.querySelector('form').appendChild(modelDom);
const itemDom = (v) => `<div class="cmd-item" data-prompt="${encodeURIComponent(v.prompt)}"><b>/${v.cmd}</b><i>${v.act}</i></div>`;
const searchInput = document.querySelector('form textarea');

View File

@ -7,7 +7,7 @@
},
"package": {
"productName": "ChatGPT",
"version": "0.4.0"
"version": "0.4.1"
},
"tauri": {
"allowlist": {

View File

@ -2,6 +2,7 @@ import { useState, useRef, useEffect } from 'react';
import { Table, Button, Modal, message } from 'antd';
import { invoke } from '@tauri-apps/api';
import useInit from '@/hooks/useInit';
import useChatModel from '@/hooks/useChatModel';
import useColumns from '@/hooks/useColumns';
import useData from '@/hooks/useData';
@ -30,6 +31,11 @@ export default function LanguageModel() {
}
}, [opInfo.opType, formRef]);
useInit(async () => {
const path = await chatModelPath();
setChatModelPath(path);
})
const hide = () => {
setVisible(false);
opInfo.resetRecord();
@ -53,10 +59,8 @@ export default function LanguageModel() {
})
};
const handleOpenFile = async () => {
const path = await chatModelPath();
setChatModelPath(path);
invoke('open_file', { path });
const handleOpenFile = () => {
invoke('open_file', { path: modelPath });
};
const modalTitle = `${({ new: 'Create', edit: 'Edit' })[opInfo.opType]} Language Model`;