fix for ui

This commit is contained in:
onysd 2026-09-03 10:19:17 +03:00
parent 5a7618aaba
commit a20f5b8b33
3 changed files with 108 additions and 87 deletions

View file

@ -23,7 +23,7 @@
})(); })();
</script> </script>
<script type="module" crossorigin src="/assets/index-DL3krfqb.js"></script> <script type="module" crossorigin src="/assets/index-_FsSjZOI.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B7j2PW0q.css"> <link rel="stylesheet" crossorigin href="/assets/index-B7j2PW0q.css">
</head> </head>
<body> <body>

View file

@ -661,6 +661,10 @@ function LimitsRetentionSection() {
{!loaded ? ( {!loaded ? (
<p style={{ color: "var(--muted)" }}>{"Loading current settings..."}</p> <p style={{ color: "var(--muted)" }}>{"Loading current settings..."}</p>
) : ( ) : (
<div className="card-body">
<div className="action-groups">
<section className="section-block">
<SectionHead title={"Size limits"} />
<div className="card-body"> <div className="card-body">
<div className="attr-block"> <div className="attr-block">
<ByteSizeField <ByteSizeField
@ -687,8 +691,20 @@ function LimitsRetentionSection() {
<Alert>{"This exceeds the protocol's own ~4GB upload ceiling and will be refused when the server restarts."}</Alert> <Alert>{"This exceeds the protocol's own ~4GB upload ceiling and will be refused when the server restarts."}</Alert>
)} )}
</div> </div>
</div>
</section>
<div className="attr-block" style={{ marginTop: "1.5em" }}> <section className="section-block">
<SectionHead
title={"Retention"}
action={
<button className="btn compact-btn icon-text" type="button" onClick={() => setCategoryModalOpen(true)}>
<Settings2 size={14} /> {"Per-category..."}
</button>
}
/>
<div className="card-body">
<div className="attr-block">
<label className="duration-field"> <label className="duration-field">
<span>{"Retention mode"}</span> <span>{"Retention mode"}</span>
<select value={retentionMode} onChange={(event) => setRetentionMode(event.target.value)}> <select value={retentionMode} onChange={(event) => setRetentionMode(event.target.value)}>
@ -711,32 +727,20 @@ function LimitsRetentionSection() {
(retentionMode === "hard" (retentionMode === "hard"
? "How old the media itself must be, counted from when it was uploaded, before its bytes are purged." ? "How old the media itself must be, counted from when it was uploaded, before its bytes are purged."
: "How long a document or photo must have had zero references before its file is deleted.") + : "How long a document or photo must have had zero references before its file is deleted.") +
" Set to 0 to disable the sweep by default and only clean up categories you explicitly override below." " Set to 0 to disable the sweep by default and only clean up categories you explicitly override via Per-category."
} }
minutes={retentionAgeMinutes} minutes={retentionAgeMinutes}
disabled={retentionMode === "off"} disabled={retentionMode === "off"}
onChange={setRetentionAgeMinutes} onChange={setRetentionAgeMinutes}
/> />
</div> </div>
<div className="attr-block" style={{ marginTop: "1.5em" }}>
<button className="btn icon-text" type="button" onClick={() => setCategoryModalOpen(true)}>
<Settings2 size={15} /> {"Per-category overrides..."}
</button>
<span className="env-field-desc">
{"Optional -- give Photo/Video/GIF/Music/Voice/File/Avatar their own retention age instead of the shared one above."}
</span>
</div> </div>
{categoryModalOpen && ( </section>
<CategoryRetentionModal
categoryAgeMinutes={categoryAgeMinutes}
onChange={(key, minutes) => setCategoryAgeMinutes((prev) => ({ ...prev, [key]: minutes }))}
disabled={retentionMode === "off"}
onClose={() => setCategoryModalOpen(false)}
/>
)}
<div className="attr-block" style={{ marginTop: "1.5em" }}> <section className="section-block">
<SectionHead title={"Reclaim space"} />
<div className="card-body">
<div className="attr-block">
<label className="checkline"> <label className="checkline">
<input <input
type="checkbox" type="checkbox"
@ -746,11 +750,16 @@ function LimitsRetentionSection() {
{" "}{"Actively reclaim space once over budget"} {" "}{"Actively reclaim space once over budget"}
</label> </label>
<p className="env-field-desc"> <p className="env-field-desc">
{"Once total physical storage exceeds the Max total storage budget above, actively delete the oldest files (regardless of category or age) until back under budget -- the same way \"hard\" retention mode purges files. Independent of the retention mode above: this can run even when that's Off. Off by default, since this changes the storage budget from block-new-uploads-only to also reclaiming from existing files."} {"Once total physical storage exceeds the Max total storage budget, actively delete the oldest files (regardless of category or age) until back under budget -- the same way \"hard\" retention mode purges files. Independent of the retention mode: this can run even when that's Off. Off by default, since this changes the storage budget from block-new-uploads-only to also reclaiming from existing files."}
</p> </p>
</div> </div>
</div>
</section>
<div className="attr-block" style={{ marginTop: "1.5em" }}> <section className="section-block">
<SectionHead title={"Manual purge"} />
<div className="card-body">
<div className="attr-block">
<button className="btn danger icon-text" type="button" onClick={() => setManualPurgeOpen(true)}> <button className="btn danger icon-text" type="button" onClick={() => setManualPurgeOpen(true)}>
<Settings2 size={15} /> {"Manually purge storage..."} <Settings2 size={15} /> {"Manually purge storage..."}
</button> </button>
@ -758,6 +767,18 @@ function LimitsRetentionSection() {
{"Delete media file bytes right now by hand-picked category and an optional age cutoff, independent of the retention settings above."} {"Delete media file bytes right now by hand-picked category and an optional age cutoff, independent of the retention settings above."}
</span> </span>
</div> </div>
</div>
</section>
</div>
{categoryModalOpen && (
<CategoryRetentionModal
categoryAgeMinutes={categoryAgeMinutes}
onChange={(key, minutes) => setCategoryAgeMinutes((prev) => ({ ...prev, [key]: minutes }))}
disabled={retentionMode === "off"}
onClose={() => setCategoryModalOpen(false)}
/>
)}
{manualPurgeOpen && <ManualPurgeStorageModal onClose={() => setManualPurgeOpen(false)} />} {manualPurgeOpen && <ManualPurgeStorageModal onClose={() => setManualPurgeOpen(false)} />}
<div className="gift-table-actions env-save-row"> <div className="gift-table-actions env-save-row">