Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions web/src/bulk-records.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.bulk-backup-form { min-width: 0; }
.bulk-backup-fields { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.bulk-mode-switch { display: flex; gap: 4px; padding: 4px; background: #f2f5fa; border-radius: 8px; }
.bulk-mode-switch button { border: 0; flex: 1; padding: 8px 12px; border-radius: 6px; background: transparent; color: #64748b; }
.bulk-mode-switch button[aria-pressed="true"] { color: var(--accent); background: #fff; box-shadow: 0 1px 4px #172b4d12; font-weight: 600; }
.bulk-mode-switch { display: flex; gap: 4px; padding: 4px; background: var(--raised); border-radius: 8px; }
.bulk-mode-switch button { border: 0; flex: 1; padding: 8px 12px; border-radius: 6px; background: transparent; color: var(--secondary); }
.bulk-mode-switch button[aria-pressed="true"] { color: var(--accent); background: var(--paper); box-shadow: inset 0 0 0 1px var(--border); font-weight: 600; }
.bulk-picker-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 13px; }
.bulk-picker-heading strong { color: #344969; }
.bulk-picker-heading strong { color: var(--text); }
.bulk-picker-actions { display: flex; gap: 18px; margin-top: -5px; }
.bulk-asset-list { border: 1px solid var(--border); border-radius: 8px; max-height: 190px; overflow-y: auto; overscroll-behavior: contain; }
.bulk-asset-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-height: 38px; cursor: pointer; }
.bulk-asset-option + .bulk-asset-option { border-top: 1px solid #f0f3f8; }
.bulk-asset-option:hover { background: #f7f9fe; }
.bulk-asset-option { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 36px; cursor: pointer; }
.bulk-asset-option + .bulk-asset-option { border-top: 1px solid var(--border); }
.bulk-asset-option:hover { background: var(--page); }
.bulk-asset-option span { min-width: 0; overflow-wrap: anywhere; }
.bulk-shared-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 4px; }
.bulk-shared-fields .field:last-child { grid-column: 1 / -1; }
Expand All @@ -18,7 +18,7 @@
.bulk-preview { min-width: 0; margin-top: 18px; display: grid; gap: 10px; }
.bulk-preview .table-scroll { max-height: 280px; border: 1px solid var(--border); border-radius: 8px; overscroll-behavior: contain; }
.bulk-preview-table { table-layout: fixed; font-size: 12px; }
.bulk-preview-table th { position: sticky; top: 0; background: #f7f9fd; padding: 10px 12px; }
.bulk-preview-table th { position: sticky; top: 0; background: var(--raised); padding: 10px 12px; }
.bulk-preview-table td { padding: 10px 12px; overflow-wrap: anywhere; vertical-align: top; }
.bulk-preview-table th:nth-child(1) { width: 29%; }
.bulk-preview-table th:nth-child(2) { width: 26%; }
Expand All @@ -39,5 +39,5 @@
.bulk-preview-table tr { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.bulk-preview-table tr:last-child { border-bottom: 0; }
.bulk-preview-table td { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; padding: 3px 0; border: 0; }
.bulk-preview-table td::before { content: attr(data-label); color: #7283a0; }
.bulk-preview-table td::before { content: attr(data-label); color: var(--muted); }
}
4 changes: 2 additions & 2 deletions web/src/features/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ export function Overview(actions: OverviewActions) {
};
return <><PageHeading title="资料目录" action={folder?.kind !== 'file' ? <div className="heading-actions">{actions.onBulk&&!showingRecords?bulkSelecting?<><button className="button primary" disabled={!selectedVisible.length||pending} onClick={registerSelected}><ListPlus size={18}/>{selectedVisible.length?`登记所选(${selectedVisible.length})`:'登记所选'}</button>{actions.onPaste?<button className="button secondary" onClick={()=>{cancelSelection();actions.onPaste!();}}>粘贴表格</button>:null}<button className="button secondary" aria-label="取消批量登记" onClick={cancelSelection}>取消</button></>:<button className="button secondary" onClick={()=>{cancelDrag();setSelected([]);setBulkSelecting(true);}}><ListPlus size={18}/>批量登记</button>:null}{!bulkSelecting?<><button className="button secondary" onClick={() => actions.onCreate('file', folderId)}><FilePlus2 size={19} />添加文件</button><button className="button primary" onClick={() => actions.onCreate('folder', folderId)}><FolderPlus size={20} />新建文件夹</button></>:null}</div> : undefined} />
<div className="directory-toolbar"><nav className="breadcrumbs" aria-label="资料目录路径">{folder ? <button className="up-button" aria-label="返回上级目录" onClick={() => actions.onFolder(folder.parent_id ?? null)}><ArrowUp size={18} /></button> : null}<button onClick={() => actions.onFolder(null)}>全部</button>{[...ancestors, ...(folder ? [folder] : [])].map((entry, index, all) => <span key={entry.id}><ChevronRight size={16} />{index === all.length - 1 ? <strong aria-current="location">{entry.name}</strong> : <button onClick={() => actions.onFolder(entry.id)}>{entry.name}</button>}</span>)}</nav>
{showingRecords ? null : <div className="toolbar explorer-toolbar"><div className="directory-search"><select aria-label="搜索范围" value={searchScope} onChange={event => { setSearchScope(event.target.value as DirectorySearchScope); setSelected([]); }}><option value="current">当前目录</option><option value="all">全部</option></select><label className="search-field"><Search size={19} /><input aria-label={searchScope === 'all' ? '搜索全部资料' : '搜索当前目录'} placeholder={searchScope === 'all' ? '搜索全部资料' : '搜索当前目录'} value={keyword} onChange={event => { setKeyword(event.target.value); setSelected([]); }} /></label></div><select aria-label="目录排序" value={sort} onChange={e => changeSort(e.target.value as DirectorySort)}><option value="manual">目录排序</option><option value="name-asc">名称升序</option><option value="name-desc">名称降序</option><option value="newest">最新备份优先</option><option value="oldest">最久未备份优先</option><option value="notes-asc">备份说明升序</option><option value="notes-desc">备份说明降序</option></select></div>}</div>
{showingRecords ? null : <div className="toolbar explorer-toolbar"><div className="directory-search"><select aria-label="搜索范围" value={searchScope} onChange={event => { setSearchScope(event.target.value as DirectorySearchScope); setSelected([]); }}><option value="current">当前目录</option><option value="all">全部</option></select><label className="search-field"><Search size={19} /><input aria-label={searchScope === 'all' ? '搜索全部资料' : '搜索当前目录'} placeholder="搜索资料" value={keyword} onChange={event => { setKeyword(event.target.value); setSelected([]); }} /></label></div><select aria-label="目录排序" value={sort} onChange={e => changeSort(e.target.value as DirectorySort)}><option value="manual">目录排序</option><option value="name-asc">名称升序</option><option value="name-desc">名称降序</option><option value="newest">最新备份优先</option><option value="oldest">最久未备份优先</option><option value="notes-asc">备份说明升序</option><option value="notes-desc">备份说明降序</option></select></div>}</div>
{orderError ? <div className="connection-error" role="alert"><span>{orderError}</span><button className="button secondary compact" disabled={pending} onClick={()=>void actions.onRefresh().then(()=>setOrderError(''))}>刷新目录</button></div> : null}
{showingRecords ? <AssetDetail asset={folder} state={state} onEditRecords={() => actions.onEditRecords(folder.id)} onAddRecord={() => actions.onAddRecord(folder.id)} /> : <div className="surface explorer-surface" aria-busy={pending}>{!rows.length ? keyword ? <EmptyState title={searchingAll ? '没有匹配的资料' : '当前目录没有匹配的资料'} action={<button className="text-button" onClick={() => { setKeyword(''); setSelected([]); }}>清除搜索</button>} /> : <EmptyState title={folder ? '暂无下级资料' : '暂无资料'} action={folder ? <div className="empty-actions"><button className="button secondary" onClick={() => actions.onDetail(folder.id)}>备份信息</button><button className="button primary" disabled={actions.marking} onClick={() => actions.onMark(folder)}>设为备份对象</button></div> : undefined} /> : <table className={`explorer-table${showBackupNotes ? ' with-backup-notes' : ''}`}>
{showingRecords ? <AssetDetail asset={folder} state={state} onEditRecords={() => actions.onEditRecords(folder.id)} onAddRecord={() => actions.onAddRecord(folder.id)} /> : <div className="surface explorer-surface" aria-busy={pending}>{!rows.length ? keyword ? <EmptyState title={searchingAll ? '没有匹配的资料' : '当前目录没有匹配的资料'} action={<button className="text-button" onClick={() => { setKeyword(''); setSelected([]); }}>清除搜索</button>} /> : <EmptyState title={folder ? '此目录为空' : '暂无资料'} action={folder ? <div className="empty-actions"><button className="button secondary" onClick={() => actions.onDetail(folder.id)}>备份信息</button><button className="button primary" disabled={actions.marking} onClick={() => actions.onMark(folder)}>设为备份对象</button></div> : undefined} /> : <table className={`explorer-table${showBackupNotes ? ' with-backup-notes' : ''}`}>
<colgroup>
<col className="directory-name-column" />
<col className="directory-time-column" />
Expand Down
Loading