chore: 简化部分代码
This commit is contained in:
parent
d684dbef40
commit
ad3262dd5c
|
|
@ -601,3 +601,42 @@ select[aria-expanded="true"] {
|
|||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
/* ============ Switch Toggle ============ */
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 22px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
inset: 0;
|
||||
background-color: #ccc;
|
||||
transition: 0.3s;
|
||||
border-radius: 22px;
|
||||
}
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
left: 3px;
|
||||
bottom: 3px;
|
||||
background-color: white;
|
||||
transition: 0.3s;
|
||||
border-radius: 50%;
|
||||
}
|
||||
input:checked + .slider {
|
||||
background-color: var(--accent-primary);
|
||||
}
|
||||
input:checked + .slider:before {
|
||||
transform: translateX(18px);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -561,13 +561,7 @@ textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--border-input);
|
|||
.info-item { font-size: 0.8rem; color: var(--text-primary); word-break: break-all; }
|
||||
.info-item.sub { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.2rem; }
|
||||
|
||||
/* 开关 */
|
||||
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
|
||||
.switch input { opacity: 0; width: 0; height: 0; }
|
||||
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #ccc; transition: 0.3s; border-radius: 22px; }
|
||||
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; }
|
||||
input:checked + .slider { background-color: var(--accent-primary); }
|
||||
input:checked + .slider:before { transform: translateX(18px); }
|
||||
/* 开关样式已移至全局 style.css */
|
||||
|
||||
/* 操作按钮 */
|
||||
.ops-buttons { display: flex; flex-wrap: nowrap; gap: 0.5rem; }
|
||||
|
|
|
|||
|
|
@ -110,12 +110,7 @@ onMounted(fetchData)
|
|||
.params-col { width: 30%; }
|
||||
.param-tag { display: inline-block; padding: 0.2rem 0.5rem; background: var(--bg-code); border-radius: 4px; font-size: 0.75rem; color: var(--text-secondary); margin: 0.15rem; }
|
||||
.switch-col { text-align: center; }
|
||||
.switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
|
||||
.switch input { opacity: 0; width: 0; height: 0; }
|
||||
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #ccc; transition: 0.3s; border-radius: 24px; }
|
||||
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; }
|
||||
input:checked + .slider { background-color: #16a34a; }
|
||||
input:checked + .slider:before { transform: translateX(20px); }
|
||||
/* switch 样式已移至全局 style.css */
|
||||
.loading { text-align: center; padding: 4rem; }
|
||||
.error-msg { text-align: center; padding: 2rem; color: var(--accent-primary); background: var(--accent-primary-light); border-radius: 12px; }
|
||||
.spinner { width: 40px; height: 40px; border: 3px solid var(--border-light); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
|
||||
|
|
|
|||
|
|
@ -83,8 +83,7 @@ def send_message(
|
|||
)
|
||||
db.add(user_message)
|
||||
|
||||
from datetime import datetime, timezone, timedelta
|
||||
conversation.updated_at = datetime.now(timezone(timedelta(hours=8)))
|
||||
conversation.updated_at = datetime.now()
|
||||
|
||||
response = chat_service.non_stream_response(
|
||||
conversation=conversation,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ def list_tools(
|
|||
):
|
||||
"""Get available tools list"""
|
||||
# Get tool definitions directly from registry to access category
|
||||
from luxx.tools.core import ToolDefinition
|
||||
|
||||
if category:
|
||||
all_tools = [t for t in registry._tools.values() if t.category == category]
|
||||
|
|
|
|||
Loading…
Reference in New Issue