This commit is contained in:
@@ -89,78 +89,81 @@ export function LibraryStorageSection() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="library-storage-panel">
|
<details className="settings-details" open={!policyConfigured}>
|
||||||
<h4>保留与依赖保护</h4>
|
<summary>保留策略与清理预览(未设置时按“全部保留”处理)</summary>
|
||||||
<p>
|
<div className="library-storage-panel">
|
||||||
{policyConfigured
|
<h4>保留与依赖保护</h4>
|
||||||
? `策略:${[
|
<p>
|
||||||
plan && plan.policy.keep_versions > 0 ? `保留最近 ${plan.policy.keep_versions} 个版本` : '',
|
{policyConfigured
|
||||||
plan && plan.policy.keep_days > 0 ? `保留 ${plan.policy.keep_days} 天` : '',
|
? `策略:${[
|
||||||
]
|
plan && plan.policy.keep_versions > 0 ? `保留最近 ${plan.policy.keep_versions} 个版本` : '',
|
||||||
.filter(Boolean)
|
plan && plan.policy.keep_days > 0 ? `保留 ${plan.policy.keep_days} 天` : '',
|
||||||
.join(' + ')}`
|
]
|
||||||
: '策略:未设置(不生成清理候选)'}
|
.filter(Boolean)
|
||||||
</p>
|
.join(' + ')}`
|
||||||
<p>
|
: '策略:未设置(不生成清理候选)'}
|
||||||
受保护版本 {plan?.protected.length ?? 0} 个:生产生效、每库最近封存、每次生产预备份、在飞作业引用,
|
</p>
|
||||||
不论多久都不会进入候选。
|
<p>
|
||||||
</p>
|
受保护版本 {plan?.protected.length ?? 0} 个:生产生效、每库最近封存、每次生产预备份、运行中作业引用,
|
||||||
{data.versions.filter((item) => item.protected).length > 0 ? (
|
不论多久都不会进入候选。
|
||||||
<ul className="library-storage-versions">
|
</p>
|
||||||
{data.versions
|
{data.versions.filter((item) => item.protected).length > 0 ? (
|
||||||
.filter((item) => item.protected)
|
<ul className="library-storage-versions">
|
||||||
.map((item) => (
|
{data.versions
|
||||||
<li key={item.id}>
|
.filter((item) => item.protected)
|
||||||
<code>{item.id.slice(0, 12)}</code> {item.kind} · {(item.protected_by ?? []).join('、')}
|
.map((item) => (
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="library-storage-panel">
|
|
||||||
<h4>清理预览</h4>
|
|
||||||
{policyConfigured ? (
|
|
||||||
plan && plan.candidates.length > 0 ? (
|
|
||||||
<>
|
|
||||||
<p>
|
|
||||||
按策略可考虑清理 {plan.candidates.length} 个版本,独占字节上限{' '}
|
|
||||||
{formatBytes(plan.reclaim_preview_bytes)}(共享 blob 不会因此释放,这不是可回收空间)。
|
|
||||||
</p>
|
|
||||||
<ul className="library-storage-versions">
|
|
||||||
{plan.candidates.map((item) => (
|
|
||||||
<li key={item.id}>
|
<li key={item.id}>
|
||||||
<code>{item.id.slice(0, 12)}</code> {item.kind} · {item.reason.join(';')} ·{' '}
|
<code>{item.id.slice(0, 12)}</code> {item.kind} · {(item.protected_by ?? []).join('、')}
|
||||||
{formatBytes(item.exclusive_bytes)}
|
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</>
|
) : null}
|
||||||
) : (
|
</div>
|
||||||
<p>按当前策略没有可清理的候选版本。</p>
|
|
||||||
)
|
|
||||||
) : (
|
|
||||||
<p className="library-storage-warn">
|
|
||||||
保留数量与天数都未设置,按「全部保留」处理:不生成候选,也不提供默认值。
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
{plan?.blocked.length ? (
|
|
||||||
<ul className="library-storage-blocked-list">
|
|
||||||
{plan.blocked.map((item) => (
|
|
||||||
<li key={item}>{item}</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul className="library-storage-limits">
|
<div className="library-storage-panel">
|
||||||
<li>自动清理:{data.automatic_cleanup ? '开启' : '保持关闭'}(页面不提供删除动作)</li>
|
<h4>清理预览</h4>
|
||||||
<li>实际删除需要单独授权,本页只给预览</li>
|
{policyConfigured ? (
|
||||||
<li>以上数字都不是「可回收空间」,不能用来估算清理收益</li>
|
plan && plan.candidates.length > 0 ? (
|
||||||
{data.notes.map((note) => (
|
<>
|
||||||
<li key={note}>{note}</li>
|
<p>
|
||||||
))}
|
按策略可考虑清理 {plan.candidates.length} 个版本,独占字节上限{' '}
|
||||||
</ul>
|
{formatBytes(plan.reclaim_preview_bytes)}(共享归档文件不会因此释放,这不是可回收空间)。
|
||||||
|
</p>
|
||||||
|
<ul className="library-storage-versions">
|
||||||
|
{plan.candidates.map((item) => (
|
||||||
|
<li key={item.id}>
|
||||||
|
<code>{item.id.slice(0, 12)}</code> {item.kind} · {item.reason.join(';')} ·{' '}
|
||||||
|
{formatBytes(item.exclusive_bytes)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<p>按当前策略没有可清理的候选版本。</p>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<p className="library-storage-warn">
|
||||||
|
保留数量与天数都未设置,按「全部保留」处理:不生成候选,也不提供默认值。
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
{plan?.blocked.length ? (
|
||||||
|
<ul className="library-storage-blocked-list">
|
||||||
|
{plan.blocked.map((item) => (
|
||||||
|
<li key={item}>{item}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul className="library-storage-limits">
|
||||||
|
<li>自动清理:{data.automatic_cleanup ? '开启' : '保持关闭'}(页面不提供删除动作)</li>
|
||||||
|
<li>实际删除需要单独授权,本页只给预览</li>
|
||||||
|
<li>以上数字都不是「可回收空间」,不能用来估算清理收益</li>
|
||||||
|
{data.notes.map((note) => (
|
||||||
|
<li key={note}>{note}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -148,8 +148,11 @@ export function ProductionBindingsView(props: ProductionBindingsViewProps) {
|
|||||||
) : null}
|
) : null}
|
||||||
{bindings && !bindings.production_connected ? (
|
{bindings && !bindings.production_connected ? (
|
||||||
<p className="hint">
|
<p className="hint">
|
||||||
生产端核对不可用:{bindings.production_message}。
|
生产端核对不可用:
|
||||||
{bindings.production_base_url ? `(生产地址:${bindings.production_base_url})` : ''}
|
{/api key file/i.test(bindings.production_message)
|
||||||
|
? '生产 API 读取凭据未配置(不影响整库执行器;整库同步走独立数据库/索引/存储通道)'
|
||||||
|
: bindings.production_message}
|
||||||
|
。{bindings.production_base_url ? `(生产地址:${bindings.production_base_url})` : ''}
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
{bindings && bindings.production_connected && bindings.production_base_url ? (
|
{bindings && bindings.production_connected && bindings.production_base_url ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user