mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Teams - allow setting custom key duration + show many user + service account keys have been created (#12722)
* fix(team_info.tsx): allow setting custom key duration more flexible than previous pre-set options * feat(team_info.tsx): show how many user + service account keys have been created within a team
This commit is contained in:
parent
b77c9f5de2
commit
bc2ab84342
2 changed files with 22 additions and 14 deletions
|
|
@ -19,6 +19,7 @@ import {
|
|||
TableBody,
|
||||
Table,
|
||||
Icon,
|
||||
TextInput,
|
||||
} from "@tremor/react";
|
||||
import TeamMembersComponent from "./team_member_view";
|
||||
import MemberPermissions from "./member_permissions";
|
||||
|
|
@ -478,6 +479,21 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
|||
</div>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<Text className="font-semibold text-gray-900">Virtual Keys</Text>
|
||||
<div className="mt-2">
|
||||
<Text>
|
||||
User Keys: {teamData.keys.filter(key => key.user_id).length}
|
||||
</Text>
|
||||
<Text>
|
||||
Service Account Keys: {teamData.keys.filter(key => !key.user_id).length}
|
||||
</Text>
|
||||
<Text className="text-gray-500">
|
||||
Total: {teamData.keys.length}
|
||||
</Text>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<ObjectPermissionsView
|
||||
objectPermission={info.object_permission}
|
||||
variant="card"
|
||||
|
|
@ -605,15 +621,11 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
|||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Team Member Key Duration"
|
||||
label="Team Member Key Duration (eg: 1d, 1mo)"
|
||||
name="team_member_key_duration"
|
||||
tooltip="Set a limit to the duration of a team member's key."
|
||||
tooltip="Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)"
|
||||
>
|
||||
<Select placeholder="n/a">
|
||||
<Select.Option value="1d">1 day</Select.Option>
|
||||
<Select.Option value="1w">1 week</Select.Option>
|
||||
<Select.Option value="1mo">1 month</Select.Option>
|
||||
</Select>
|
||||
<TextInput placeholder="e.g., 30d" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="Reset Budget" name="budget_duration">
|
||||
|
|
|
|||
|
|
@ -1340,15 +1340,11 @@ const Teams: React.FC<TeamProps> = ({
|
|||
<NumericalInput step={0.01} precision={2} width={200} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="Team Member Key Duration"
|
||||
label="Team Member Key Duration (eg: 1d, 1mo)"
|
||||
name="team_member_key_duration"
|
||||
tooltip="Set a limit to the duration of a team member's key."
|
||||
tooltip="Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)"
|
||||
>
|
||||
<Select2 defaultValue={null} placeholder="n/a">
|
||||
<Select2.Option value="1d">1 day</Select2.Option>
|
||||
<Select2.Option value="1w">1 week</Select2.Option>
|
||||
<Select2.Option value="1mo">1 month</Select2.Option>
|
||||
</Select2>
|
||||
<TextInput placeholder="e.g., 30d" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="Metadata"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue