mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-08-30 20:54:52 +08:00
feat: show D1 storage capacity in admin (#1117)
* feat: show D1 storage usage in admin * test: add D1 storage E2E coverage * test: use exact D1 storage labels
This commit is contained in:
@@ -219,11 +219,13 @@ export default {
|
||||
},
|
||||
getVersion: async (c: Context<HonoCustomType>) => {
|
||||
const version = await utils.getSetting(c, CONSTANTS.DB_VERSION_KEY);
|
||||
const sizeResult = await c.env.DB.prepare("SELECT 1").run();
|
||||
return c.json({
|
||||
need_initialization: !version,
|
||||
need_migration: version && version != CONSTANTS.DB_VERSION,
|
||||
current_db_version: version,
|
||||
code_db_version: CONSTANTS.DB_VERSION
|
||||
code_db_version: CONSTANTS.DB_VERSION,
|
||||
database_size: sizeResult.meta.size_after ?? null
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user