feat(server): support selfhost licenses (#8947)

This commit is contained in:
forehalo
2025-01-22 10:21:07 +00:00
parent 22e424d7de
commit 994d758c07
31 changed files with 1653 additions and 127 deletions

View File

@@ -7,6 +7,7 @@ import {
TeamDeleteInOneMonth,
TeamExpired,
TeamExpireSoon,
TeamLicense,
TeamWorkspaceDeleted,
TeamWorkspaceUpgraded,
} from './teams';
@@ -175,3 +176,8 @@ export const renderTeamWorkspaceExpiredMail = make(
TeamExpired,
props => `Your ${props.workspace.name} team workspace has expired`
);
export const renderTeamLicenseMail = make(
TeamLicense,
'Your AFFiNE Self-Hosted Team Workspace license is ready'
);

View File

@@ -23,6 +23,7 @@ export {
type TeamExpireSoonProps,
} from './expire-soon';
export { default as TeamExpired, type TeamExpiredProps } from './expired';
export { default as TeamLicense, type TeamLicenseProps } from './license';
export {
default as TeamWorkspaceUpgraded,
type TeamWorkspaceUpgradedProps,

View File

@@ -0,0 +1,33 @@
import {
Bold,
Content,
OnelineCodeBlock,
P,
Template,
Title,
} from '../components';
export interface TeamLicenseProps {
license: string;
}
export default function TeamLicense(props: TeamLicenseProps) {
const { license } = props;
return (
<Template>
<Title>Here is your license key.</Title>
<Content>
<OnelineCodeBlock>{license}</OnelineCodeBlock>
<P>
You can use this key to upgrade your selfhost workspace in{' '}
<Bold>Settings &gt; Workspace &gt; License</Bold>.
</P>
</Content>
</Template>
);
}
TeamLicense.PreviewProps = {
license: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
};