MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / displayOrganizationDetails

Function displayOrganizationDetails

admin/src/utils/display.ts:24–165  ·  view source on GitHub ↗
(
  organization: OrganizationWithDetails,
  options: DisplayOptions = {},
)

Source from the content-addressed store, hash-verified

22}
23
24export function displayOrganizationDetails(
25 organization: OrganizationWithDetails,
26 options: DisplayOptions = {},
27) {
28 console.log(`\n${'='.repeat(80)}`);
29 console.log(chalk.bold.yellow(`\n📊 ORGANIZATION: ${organization.name}`));
30 console.log(`${'='.repeat(80)}\n`);
31
32 // Organization Details
33 console.log(chalk.bold('Organization Details:'));
34 console.log(` ${chalk.gray('ID:')} ${organization.id}`);
35 console.log(` ${chalk.gray('Name:')} ${organization.name}`);
36 console.log(
37 ` ${chalk.gray('Created:')} ${organization.createdAt.toISOString()}`,
38 );
39 console.log(` ${chalk.gray('Timezone:')} ${organization.timezone || 'UTC'}`);
40
41 // Subscription info
42 if (organization.subscriptionStatus) {
43 console.log(
44 ` ${chalk.gray('Subscription Status:')} ${getSubscriptionStatusColor(organization.subscriptionStatus)}`,
45 );
46 if (organization.subscriptionPriceId) {
47 console.log(
48 ` ${chalk.gray('Price ID:')} ${organization.subscriptionPriceId}`,
49 );
50 }
51 if (organization.subscriptionPeriodEventsLimit) {
52 const usage = `${organization.subscriptionPeriodEventsCount}/${organization.subscriptionPeriodEventsLimit}`;
53 const percentage =
54 (organization.subscriptionPeriodEventsCount /
55 organization.subscriptionPeriodEventsLimit) *
56 100;
57 const color =
58 percentage > 90
59 ? chalk.red
60 : percentage > 70
61 ? chalk.yellow
62 : chalk.green;
63 console.log(
64 ` ${chalk.gray('Event Usage:')} ${color(usage)} (${percentage.toFixed(1)}%)`,
65 );
66 }
67 if (organization.subscriptionStartsAt) {
68 console.log(
69 ` ${chalk.gray('Starts:')} ${organization.subscriptionStartsAt.toISOString()}`,
70 );
71 }
72 if (organization.subscriptionEndsAt) {
73 console.log(
74 ` ${chalk.gray('Ends:')} ${organization.subscriptionEndsAt.toISOString()}`,
75 );
76 }
77 }
78
79 if (organization.deleteAt) {
80 console.log(
81 ` ${chalk.red.bold('⚠️ Scheduled for deletion:')} ${organization.deleteAt.toISOString()}`,

Callers 4

lookupByClientFunction · 0.90
lookupByProjectFunction · 0.90
lookupByEmailFunction · 0.90
lookupByOrgFunction · 0.90

Calls 5

getRoleBadgeFunction · 0.85
getClientTypeBadgeFunction · 0.85
joinMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected