From c0b3b8b60eccd806010370c6845472cc045af4b3 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Fri, 4 Oct 2024 19:26:41 +0200 Subject: [PATCH] Add available seats in About CISO Assistant modal --- enterprise/backend/enterprise_core/views.py | 7 ++++--- frontend/messages/en.json | 3 ++- frontend/src/lib/components/Modals/DisplayJSONModal.svelte | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/enterprise/backend/enterprise_core/views.py b/enterprise/backend/enterprise_core/views.py index 68ce2e16b..97e5043e7 100644 --- a/enterprise/backend/enterprise_core/views.py +++ b/enterprise/backend/enterprise_core/views.py @@ -1,9 +1,6 @@ -import mimetypes import magic import structlog -from core.views import BaseModelViewSet -from django.http import HttpResponse from rest_framework import status from rest_framework.permissions import AllowAny from rest_framework.decorators import ( @@ -16,6 +13,9 @@ from django.conf import settings +from core.views import BaseModelViewSet +from iam.models import User + from .models import ClientSettings from .serializers import ClientSettingsReadSerializer @@ -145,6 +145,7 @@ def get_build(request): "version": VERSION, "build": BUILD, "license_seats": LICENSE_SEATS, + "available_seats": LICENSE_SEATS - len(User.get_editors()), "license_expiration": LICENSE_EXPIRATION, } ) diff --git a/frontend/messages/en.json b/frontend/messages/en.json index db7c28861..164c357f0 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -751,5 +751,6 @@ "ShowAllNodesMessage": "Show all", "ShowOnlyAssessable": "Only assessable", "NoPreviewMessage": "No preview available.", - "errorLicenseSeatsExceeded": "The number of license seats is exceeded, you will not be able to grant editing rights to this user. Please contact your administrator." + "errorLicenseSeatsExceeded": "The number of license seats is exceeded, you will not be able to grant editing rights to this user. Please contact your administrator.", + "availableSeats": "Available seats" } diff --git a/frontend/src/lib/components/Modals/DisplayJSONModal.svelte b/frontend/src/lib/components/Modals/DisplayJSONModal.svelte index eeeeb115a..2e10174d0 100644 --- a/frontend/src/lib/components/Modals/DisplayJSONModal.svelte +++ b/frontend/src/lib/components/Modals/DisplayJSONModal.svelte @@ -1,4 +1,5 @@