mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 15:25:50 +00:00
feat(export): adjust path actions and compact sns card
This commit is contained in:
@@ -51,36 +51,52 @@
|
|||||||
.path-value {
|
.path-value {
|
||||||
border: 1px dashed var(--border-color);
|
border: 1px dashed var(--border-color);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 10px 12px;
|
background: var(--bg-secondary);
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-link {
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
background: var(--bg-secondary);
|
text-align: left;
|
||||||
|
padding: 10px 12px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
|
||||||
|
|
||||||
.path-link {
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: left;
|
|
||||||
|
|
||||||
&:hover:not(:disabled) {
|
&:hover {
|
||||||
border-color: var(--primary);
|
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:disabled {
|
&:focus-visible {
|
||||||
cursor: not-allowed;
|
outline: none;
|
||||||
opacity: 0.65;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.path-actions {
|
.path-change-btn {
|
||||||
display: flex;
|
border: none;
|
||||||
gap: 8px;
|
border-left: 1px dashed var(--border-color);
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 12px;
|
||||||
|
cursor: pointer;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: var(--primary);
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.write-layout-control {
|
.write-layout-control {
|
||||||
@@ -1072,9 +1088,8 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.path-actions {
|
.path-inline-row > .secondary-btn {
|
||||||
width: 100%;
|
margin-left: auto;
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1174,7 +1174,6 @@ function ExportPage() {
|
|||||||
label: '朋友圈',
|
label: '朋友圈',
|
||||||
stats: [
|
stats: [
|
||||||
{ label: '朋友圈条数', value: snsStats.totalPosts },
|
{ label: '朋友圈条数', value: snsStats.totalPosts },
|
||||||
{ label: '好友数', value: snsStats.totalFriends },
|
|
||||||
{ label: '已导出朋友圈条数', value: snsExportedCount }
|
{ label: '已导出朋友圈条数', value: snsExportedCount }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1373,30 +1372,7 @@ function ExportPage() {
|
|||||||
() => visibleSessions.map(renderRow),
|
() => visibleSessions.map(renderRow),
|
||||||
[visibleSessions, selectedSessions, sessionMetrics, activeTab, runningSessionIds, queuedSessionIds, nowTick, lastExportBySession]
|
[visibleSessions, selectedSessions, sessionMetrics, activeTab, runningSessionIds, queuedSessionIds, nowTick, lastExportBySession]
|
||||||
)
|
)
|
||||||
|
const chooseExportFolder = useCallback(async () => {
|
||||||
return (
|
|
||||||
<div className="export-board-page">
|
|
||||||
<div className="export-top-panel">
|
|
||||||
<div className="global-export-controls">
|
|
||||||
<div className="path-control">
|
|
||||||
<span className="control-label">导出位置</span>
|
|
||||||
<div className="path-inline-row">
|
|
||||||
<button
|
|
||||||
className="path-value path-link"
|
|
||||||
type="button"
|
|
||||||
title={exportFolder}
|
|
||||||
disabled={!exportFolder}
|
|
||||||
onClick={() => exportFolder && void window.electronAPI.shell.openPath(exportFolder)}
|
|
||||||
>
|
|
||||||
{exportFolder || '未设置'}
|
|
||||||
</button>
|
|
||||||
<div className="path-actions">
|
|
||||||
<button className="secondary-btn" onClick={() => exportFolder && void window.electronAPI.shell.openPath(exportFolder)}>
|
|
||||||
<ExternalLink size={14} /> 打开
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="secondary-btn"
|
|
||||||
onClick={async () => {
|
|
||||||
const result = await window.electronAPI.dialog.openFile({
|
const result = await window.electronAPI.dialog.openFile({
|
||||||
title: '选择导出目录',
|
title: '选择导出目录',
|
||||||
properties: ['openDirectory']
|
properties: ['openDirectory']
|
||||||
@@ -1406,11 +1382,31 @@ function ExportPage() {
|
|||||||
setExportFolder(nextPath)
|
setExportFolder(nextPath)
|
||||||
await configService.setExportPath(nextPath)
|
await configService.setExportPath(nextPath)
|
||||||
}
|
}
|
||||||
}}
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="export-board-page">
|
||||||
|
<div className="export-top-panel">
|
||||||
|
<div className="global-export-controls">
|
||||||
|
<div className="path-control">
|
||||||
|
<span className="control-label">导出位置</span>
|
||||||
|
<div className="path-inline-row">
|
||||||
|
<div className="path-value">
|
||||||
|
<button
|
||||||
|
className="path-link"
|
||||||
|
type="button"
|
||||||
|
title={exportFolder}
|
||||||
|
onClick={() => void chooseExportFolder()}
|
||||||
>
|
>
|
||||||
<FolderOpen size={14} /> 更换
|
{exportFolder || '未设置'}
|
||||||
|
</button>
|
||||||
|
<button className="path-change-btn" type="button" onClick={() => void chooseExportFolder()}>
|
||||||
|
更换
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<button className="secondary-btn" onClick={() => exportFolder && void window.electronAPI.shell.openPath(exportFolder)}>
|
||||||
|
<ExternalLink size={14} /> 打开
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user