mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add API endpoint to get site usage summary
Summary: The summary includes a count of documents that are approaching limits, in grace period, or delete-only. The endpoint is only accessible to site owners, and is currently unused. A follow-up diff will add usage banners to the site home page, which will use the response from the endpoint to communicate usage information to owners. Test Plan: Browser and server tests. Reviewers: alexmojaki Reviewed By: alexmojaki Differential Revision: https://phab.getgrist.com/D3420
This commit is contained in:
@@ -9,7 +9,7 @@ import {ApiError} from 'app/common/ApiError';
|
||||
import {mapSetOrClear} from 'app/common/AsyncCreate';
|
||||
import {BrowserSettings} from 'app/common/BrowserSettings';
|
||||
import {DocCreationInfo, DocEntry, DocListAPI, OpenDocMode, OpenLocalDocResult} from 'app/common/DocListAPI';
|
||||
import {DocUsage} from 'app/common/DocUsage';
|
||||
import {FilteredDocUsageSummary} from 'app/common/DocUsage';
|
||||
import {Invite} from 'app/common/sharing';
|
||||
import {tbind} from 'app/common/tbind';
|
||||
import {NEW_DOCUMENT_CODE} from 'app/common/UserAPI';
|
||||
@@ -320,9 +320,9 @@ export class DocManager extends EventEmitter {
|
||||
activeDoc.getUserOverride(docSession),
|
||||
]);
|
||||
|
||||
let docUsage: DocUsage | undefined;
|
||||
let docUsage: FilteredDocUsageSummary | undefined;
|
||||
try {
|
||||
docUsage = await activeDoc.getFilteredDocUsage(docSession);
|
||||
docUsage = await activeDoc.getFilteredDocUsageSummary(docSession);
|
||||
} catch (e) {
|
||||
log.warn("DocManager.openDoc failed to get doc usage", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user