feat:添加设置按钮
- 包含通用设置,里面有语言啊,主题色啊等设置 - 还包含规则设置,里面有系统规则设置等
This commit is contained in:
@ -8,7 +8,16 @@ import {
|
||||
getMoreOptionsComponentStyles,
|
||||
getMoreOptionsComponentScript,
|
||||
} from "./moreOptionsComponent";
|
||||
import { userAvatarIconSvg, moreIconSvg } from "../constants/toolIcons";
|
||||
import {
|
||||
getSettingsComponentContent,
|
||||
getSettingsComponentStyles,
|
||||
getSettingsComponentScript,
|
||||
} from "./settingsComponent";
|
||||
import {
|
||||
userAvatarIconSvg,
|
||||
moreIconSvg,
|
||||
setting,
|
||||
} from "../constants/toolIcons";
|
||||
|
||||
/**
|
||||
* 获取会话历史栏的 HTML 内容
|
||||
@ -45,6 +54,12 @@ export function getConversationHistoryBarContent(): string {
|
||||
${getUserInfoComponentContent()}
|
||||
</div>
|
||||
|
||||
<div class='setting'>
|
||||
<button class="setting-btn" title="设置" onclick="openSettingsModal()">
|
||||
${setting}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class='more-container'>
|
||||
<button class="more-button" title="更多选项" onclick="toggleMoreOptionsDropdown()">
|
||||
${moreIconSvg}
|
||||
@ -53,6 +68,8 @@ export function getConversationHistoryBarContent(): string {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${getSettingsComponentContent()}
|
||||
`;
|
||||
}
|
||||
|
||||
@ -88,8 +105,8 @@ export function getConversationHistoryBarStyles(): string {
|
||||
}
|
||||
|
||||
.user-avatar-icon-button {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: var(--vscode-foreground);
|
||||
@ -123,13 +140,44 @@ export function getConversationHistoryBarStyles(): string {
|
||||
|
||||
${getUserInfoComponentStyles()}
|
||||
|
||||
${getSettingsComponentStyles()}
|
||||
|
||||
.setting {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.setting-btn {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: var(--vscode-foreground);
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.2s ease;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.setting-btn:hover {
|
||||
background: var(--vscode-toolbar-hoverBackground);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.setting-btn:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.more-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.more-button {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: var(--vscode-foreground);
|
||||
@ -266,8 +314,8 @@ export function getConversationHistoryBarStyles(): string {
|
||||
}
|
||||
|
||||
.new-conversation-button {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: var(--vscode-foreground);
|
||||
@ -324,6 +372,8 @@ export function getConversationHistoryBarScript(): string {
|
||||
|
||||
${getMoreOptionsComponentScript()}
|
||||
|
||||
${getSettingsComponentScript()}
|
||||
|
||||
// 更新用户头像图标按钮显示
|
||||
function updateUserAvatarIconButton(userInfo) {
|
||||
const userAvatarIconButton = document.getElementById('userAvatarIconButton');
|
||||
|
||||
Reference in New Issue
Block a user