Supports display license status (#10408)

Co-authored-by: Garfield Dai <dai.hai@foxmail.com>
This commit is contained in:
NFish 2024-11-15 17:59:48 +08:00 • committed by GitHub
commit 1f87676d52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 187 additions and 53 deletions

View file

@ -4,6 +4,20 @@ export enum SSOProtocol {
OAuth2 = 'oauth2',
}
export enum LicenseStatus {
NONE = 'none',
INACTIVE = 'inactive',
ACTIVE = 'active',
EXPIRING = 'expiring',
EXPIRED = 'expired',
LOST = 'lost',
}
type License = {
status: LicenseStatus
expired_at: string | null
}
export type SystemFeatures = {
sso_enforced_for_signin: boolean
sso_enforced_for_signin_protocol: SSOProtocol | ''
@ -15,6 +29,7 @@ export type SystemFeatures = {
enable_social_oauth_login: boolean
is_allow_create_workspace: boolean
is_allow_register: boolean
license: License
}
export const defaultSystemFeatures: SystemFeatures = {
@ -28,4 +43,8 @@ export const defaultSystemFeatures: SystemFeatures = {
enable_social_oauth_login: false,
is_allow_create_workspace: false,
is_allow_register: false,
license: {
status: LicenseStatus.NONE,
expired_at: '',
},
}