Skip to content

Commit

Permalink
feat: readable subscription levels (coaidev#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Mar 8, 2024
1 parent 15b7e20 commit e12fd20
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/src/components/admin/UserTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ type OperationMenuProps = {
onRefresh?: () => void;
};

export enum UserType {
normal = "normal",
basic_plan = "basic_plan",
standard_plan = "standard_plan",
pro_plan = "pro_plan",
}

export const userTypeArray = [
UserType.normal,
UserType.basic_plan,
UserType.standard_plan,
UserType.pro_plan,
];

function doToast(t: any, toast: any, resp: CommonResponse) {
if (!resp.status)
toast({
Expand Down Expand Up @@ -405,7 +419,7 @@ function UserTable() {
<TableCell>{user.quota}</TableCell>
<TableCell>{user.used_quota}</TableCell>
<TableCell>{t(user.is_subscribed.toString())}</TableCell>
<TableCell>{user.level}</TableCell>
<TableCell className={`whitespace-nowrap`}>{t(`admin.identity.${userTypeArray[user.level]}`)}</TableCell>
<TableCell>{user.total_month}</TableCell>
{useDeeptrain && (
<TableCell>{t(user.enterprise.toString())}</TableCell>
Expand Down

0 comments on commit e12fd20

Please sign in to comment.