Show available space of storages.

This commit is contained in:
2025-05-13 12:51:15 +08:00
parent 04d679f3f4
commit 545432b4f1
2 changed files with 5 additions and 1 deletions

View File

@@ -79,6 +79,7 @@ export default function StorageView() {
<tr> <tr>
<td>{t("Name")}</td> <td>{t("Name")}</td>
<td>{t("Created At")}</td> <td>{t("Created At")}</td>
<td>{t("Size")}</td>
<td>{t("Action")}</td> <td>{t("Action")}</td>
</tr> </tr>
</thead> </thead>
@@ -92,6 +93,9 @@ export default function StorageView() {
<td> <td>
{(new Date(s.createdAt)).toLocaleString()} {(new Date(s.createdAt)).toLocaleString()}
</td> </td>
<td>
{(s.currentSize/1024/1024).toFixed(2)} / {s.maxSize/1024/1024} MB
</td>
<td> <td>
<button className={"btn btn-square"} type={"button"} onClick={() => { <button className={"btn btn-square"} type={"button"} onClick={() => {
const dialog = document.getElementById(`confirm_delete_dialog_${s.id}`) as HTMLDialogElement; const dialog = document.getElementById(`confirm_delete_dialog_${s.id}`) as HTMLDialogElement;

View File

@@ -336,7 +336,7 @@ function CreateFileDialog({resourceId}: { resourceId: number }) {
<option value={""} disabled>{t("Select Storage")}</option> <option value={""} disabled>{t("Select Storage")}</option>
{ {
storages.current?.map((s) => { storages.current?.map((s) => {
return <option key={s.id} value={s.id}>{s.name}</option> return <option key={s.id} value={s.id}>{s.name}({(s.currentSize/1024/1024).toFixed(2)}/{s.maxSize/1024/1024}MB)</option>
}) })
} }
</select> </select>