release: v1.1.0 — S3 multi-backend storage and admin UI
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s

This commit is contained in:
O96u committed 2026-08-26 14:49:46 +08:00
1 parent 7c45a78572
commit acc64751ef
46 files changed
+4005 -480

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
import { requireAdminAuth } from '../../../utils/access'
import {
getBackendUsageStats,
isStorageEnvConfigured,
listStorageBackends
} from '../../../utils/storage-backends'
import { buildBackendCapacity } from '../../../utils/storage-capacity'
import { getActiveBackendRow } from '../../../utils/storage/resolver'
import type { StorageBackendInfo } from '../../../utils/storage/types'
export default defineEventHandler(async (event) => {
await requireAdminAuth(event)
const rows = listStorageBackends()
const backends = await Promise.all(rows.map(async (backend: StorageBackendInfo & {
secretsMasked: Record<string, string>
}) => {
const usage = getBackendUsageStats(backend.id)
const capacity = await buildBackendCapacity(
backend.id,
backend.type,
usage.bytes,
backend.quotaBytes
)
return {
...backend,
usage,
capacity
}
}))
const activeBackend = getActiveBackendRow()
return {
backends,
activeBackendId: activeBackend?.id ?? 'local',
envOverride: isStorageEnvConfigured()
}
})