Add files via upload

This commit is contained in:
公明
2026-05-22 10:30:19 +08:00
committed by GitHub
parent 9b82f265fd
commit 0358d3a67d
5 changed files with 99 additions and 20 deletions
+58 -1
View File
@@ -20223,9 +20223,66 @@ button.chat-files-dropdown-item:hover:not(:disabled) {
width: 100%;
}
/* 文件管理:重命名 / 新建文件夹 — 紧凑表单弹窗,无全局紫色标题条 */
.chat-files-form-modal {
align-items: center;
justify-content: center;
padding: 24px 16px;
}
.chat-files-form-modal-content {
width: 100%;
max-width: 420px;
margin: 0;
border-radius: 12px;
box-shadow:
0 16px 48px rgba(15, 23, 42, 0.14),
0 4px 12px rgba(15, 23, 42, 0.06);
}
.chat-files-form-modal-header {
padding: 18px 24px !important;
border-bottom: 1px solid var(--border-color) !important;
background: var(--bg-primary) !important;
}
.chat-files-form-modal-header::after {
display: none !important;
}
.chat-files-form-modal-header h2 {
font-size: 1.0625rem !important;
font-weight: 600 !important;
color: var(--text-primary) !important;
background: none !important;
-webkit-background-clip: unset !important;
-webkit-text-fill-color: var(--text-primary) !important;
background-clip: unset !important;
letter-spacing: -0.02em !important;
}
.chat-files-form-modal-header h2::before {
display: none !important;
}
.chat-files-form-modal-close {
width: 32px !important;
height: 32px !important;
font-size: 1.25rem !important;
border-radius: 8px !important;
border: none !important;
}
.chat-files-form-modal-close:hover {
background: var(--bg-secondary) !important;
color: var(--text-primary) !important;
transform: none !important;
border-color: transparent !important;
}
/* 新建文件夹弹窗:层次清晰、留白舒适,无强装饰 */
.chat-files-mkdir-modal-content {
max-width: 480px;
max-width: 420px;
}
.chat-files-mkdir-body {
+1
View File
@@ -1531,6 +1531,7 @@
"confirmDelete": "Delete this file?",
"editTitle": "Edit file",
"renameTitle": "Rename",
"renameCurrentFile": "Current file",
"newFileName": "New file name",
"empty": "No chat uploads yet",
"errorLoad": "Failed to load",
+1
View File
@@ -1520,6 +1520,7 @@
"confirmDelete": "确定删除该文件?",
"editTitle": "编辑文件",
"renameTitle": "重命名",
"renameCurrentFile": "当前文件",
"newFileName": "新文件名",
"empty": "暂无对话附件",
"errorLoad": "加载失败",
+15 -4
View File
@@ -1052,15 +1052,26 @@ async function saveChatFilesEdit() {
function openChatFilesRename(relativePath, currentName) {
chatFilesRenameRelativePath = relativePath;
const input = document.getElementById('chat-files-rename-input');
const hint = document.getElementById('chat-files-rename-path-hint');
const modal = document.getElementById('chat-files-rename-modal');
if (input) input.value = currentName || '';
if (modal) modal.style.display = 'block';
setTimeout(() => { if (input) input.focus(); }, 100);
const pathText = relativePath ? ('chat_uploads/' + String(relativePath).replace(/\\/g, '/')) : 'chat_uploads';
if (hint) hint.textContent = pathText;
if (input) {
input.value = currentName || '';
input.select();
}
if (modal) modal.style.display = 'flex';
if (modal && typeof window.applyTranslations === 'function') {
window.applyTranslations(modal);
}
setTimeout(() => { if (input) { input.focus(); input.select(); } }, 100);
}
function closeChatFilesRenameModal() {
const modal = document.getElementById('chat-files-rename-modal');
if (modal) modal.style.display = 'none';
const hint = document.getElementById('chat-files-rename-path-hint');
if (hint) hint.textContent = '';
chatFilesRenameRelativePath = '';
}
@@ -1095,7 +1106,7 @@ function openChatFilesMkdirModal() {
const p = chatFilesBrowsePath.join('/');
if (hint) hint.textContent = p ? ('chat_uploads/' + p) : 'chat_uploads';
if (input) input.value = '';
if (modal) modal.style.display = 'block';
if (modal) modal.style.display = 'flex';
if (modal && typeof window.applyTranslations === 'function') {
window.applyTranslations(modal);
}