MM-63728: Add license load metric endpoint and UI indicator (#30700)

* Add license load metric endpoint and UI indicator

Adds an API endpoint to calculate and return license usage as a load metric, and displays this metric in the About dialog. The metric is calculated as (MAU/licensed users)*100.

Additionally:
- Renamed function to be consistent with API endpoint name
- Added proper i18n strings for error messages and UI elements

* Fix TypeScript null check in about_build_modal.tsx

* MM-63728: Update OpenAPI documentation for license load metric

Update the OpenAPI documentation and code comments to correctly describe the license load metric calculation as using a multiplier of 1000 instead of percentage.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Use float for license load metric calculation

Modify the license load metric calculation to use floats throughout the computation process while still returning an integer result. This maintains the existing API but improves the precision of the calculation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* improve tests manually

* Update server/channels/api4/license_test.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* Update server/channels/api4/license_test.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Этот коммит содержится в:
Jesse Hallam
2025-04-17 17:29:46 -03:00
коммит произвёл GitHub
родитель 10bff401ee
Коммит 4a93939359
9 изменённых файлов: 337 добавлений и 1 удалений

Просмотреть файл

@@ -611,6 +611,37 @@
$ref: "#/components/responses/BadRequest"
"501":
$ref: "#/components/responses/NotImplemented"
/api/v4/license/load_metric:
get:
tags:
- system
summary: Get license load metric
description: >
Get the current license load metric, calculated based on monthly active users
against the licensed user count. Returns a value of 0 when there is no license loaded or
the license doesn't have a user count.
__Minimum server version__: 10.8
##### Permissions
Must be logged in.
operationId: GetLicenseLoadMetric
responses:
"200":
description: License load metric retrieval successful
content:
application/json:
schema:
type: object
properties:
load:
type: integer
description: Current license load metric as an integer
"401":
$ref: "#/components/responses/Unauthorized"
"500":
$ref: "#/components/responses/InternalServerError"
/api/v4/license/renewal:
get:
tags: