feat: 重构侧栏布局,优化用户菜单和同步功能
This commit is contained in:
@@ -479,60 +479,6 @@ export function AlphaPage({
|
||||
account?.connection_status === "expired";
|
||||
return (
|
||||
<>
|
||||
<div className="page-heading">
|
||||
<div>
|
||||
<h1>Alpha 管理</h1>
|
||||
</div>
|
||||
<div className="inline-actions">
|
||||
<Button type="tertiary" onClick={() => setImporting(true)}>
|
||||
导入 Alpha ID
|
||||
</Button>
|
||||
<Button
|
||||
theme="solid"
|
||||
disabled={!connected}
|
||||
onClick={() => {
|
||||
setSyncingScope(submission);
|
||||
onOverlay();
|
||||
}}
|
||||
>
|
||||
按天同步
|
||||
</Button>
|
||||
{submission === "SUBMITTED" && (
|
||||
<Button
|
||||
loading={busy === "full_sync"}
|
||||
disabled={!connected}
|
||||
onClick={() => void newTask("full_sync")}
|
||||
>
|
||||
全量同步已提交
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="library-stats">
|
||||
<div>
|
||||
<span>已同步 Alpha</span>
|
||||
<strong>{Number(facets.total ?? 0).toLocaleString()}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>我的收藏</span>
|
||||
<strong>{Number(facets.favorites ?? 0).toLocaleString()}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>覆盖地区</span>
|
||||
<strong>
|
||||
{Array.isArray(facets.region) ? facets.region.length : 0}
|
||||
</strong>
|
||||
</div>
|
||||
<div className="last-sync">
|
||||
<span>最近数据更新</span>
|
||||
<strong>
|
||||
{formatTime(
|
||||
typeof facets.last_sync === "string" ? facets.last_sync : null,
|
||||
account?.timezone,
|
||||
)}
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
{!connected && (
|
||||
<Banner
|
||||
type="info"
|
||||
@@ -548,15 +494,26 @@ export function AlphaPage({
|
||||
)}
|
||||
{error && <Banner type="danger" description={error} />}
|
||||
<section className="library-panel" ref={tablePanel}>
|
||||
<Tabs
|
||||
className="alpha-submission-tabs"
|
||||
activeKey={submission}
|
||||
onChange={changeSubmission}
|
||||
tabList={[
|
||||
{ itemKey: "UNSUBMITTED", tab: "待提交" },
|
||||
{ itemKey: "SUBMITTED", tab: "已提交" },
|
||||
]}
|
||||
/>
|
||||
<div className="alpha-tabs-header">
|
||||
<Tabs
|
||||
className="alpha-submission-tabs"
|
||||
activeKey={submission}
|
||||
onChange={changeSubmission}
|
||||
tabList={[
|
||||
{ itemKey: "UNSUBMITTED", tab: "待提交" },
|
||||
{ itemKey: "SUBMITTED", tab: "已提交" },
|
||||
]}
|
||||
/>
|
||||
<span className="alpha-last-sync">
|
||||
最近数据更新{" "}
|
||||
<span>
|
||||
{formatTime(
|
||||
typeof facets.last_sync === "string" ? facets.last_sync : null,
|
||||
account?.timezone,
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<SavedViews
|
||||
filters={{ ...filters, submission, sort, direction, limit: pageSize }}
|
||||
columns={visibleColumns}
|
||||
@@ -856,6 +813,34 @@ export function AlphaPage({
|
||||
导出
|
||||
</Button>
|
||||
</a>
|
||||
<Button
|
||||
size="small"
|
||||
type="tertiary"
|
||||
onClick={() => setImporting(true)}
|
||||
>
|
||||
导入 Alpha ID
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
theme="solid"
|
||||
disabled={!connected}
|
||||
onClick={() => {
|
||||
setSyncingScope(submission);
|
||||
onOverlay();
|
||||
}}
|
||||
>
|
||||
按天同步
|
||||
</Button>
|
||||
{submission === "SUBMITTED" && (
|
||||
<Button
|
||||
size="small"
|
||||
loading={busy === "full_sync"}
|
||||
disabled={!connected}
|
||||
onClick={() => void newTask("full_sync")}
|
||||
>
|
||||
全量同步已提交
|
||||
</Button>
|
||||
)}
|
||||
<Popover
|
||||
trigger="click"
|
||||
position="bottomRight"
|
||||
|
||||
Reference in New Issue
Block a user