mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
Enable key reassignment on UI + Show 'updated at' column for key in all keys table (#10960)
* feat(key_edit_view.tsx): initial commit enabling reassigning keys to teams * style(key_edit_view.tsx): cleaner implementation with teams in dropdown * fix(all_keys_table.tsx): set max width to keys column * feat(all_keys_table.tsx): show last updated at column for key
This commit is contained in:
parent
edfd8a138d
commit
8eccc787ba
3 changed files with 28 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
|
@ -276,7 +276,11 @@ export function AllKeysTable({
|
|||
cell: (info) => {
|
||||
const userId = info.getValue() as string;
|
||||
const user = userList.find(u => u.user_id === userId);
|
||||
return user?.user_email ? user.user_email : "-";
|
||||
return user?.user_email ? (
|
||||
<Tooltip title={user?.user_email}>
|
||||
<span>{user?.user_email.slice(0, 20)}...</span>
|
||||
</Tooltip>
|
||||
) : "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -310,6 +314,15 @@ export function AllKeysTable({
|
|||
return value ? value : "Unknown";
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "updated_at",
|
||||
accessorKey: "updated_at",
|
||||
header: "Updated At",
|
||||
cell: (info) => {
|
||||
const value = info.getValue();
|
||||
return value ? new Date(value as string).toLocaleDateString() : "Never";
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "expires",
|
||||
accessorKey: "expires",
|
||||
|
|
|
|||
|
|
@ -169,6 +169,20 @@ export function KeyEditView({
|
|||
<Input.TextArea rows={10} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="Team ID" name="team_id">
|
||||
<Select
|
||||
placeholder="Select team"
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
{/* Only show All Team Models if team has models */}
|
||||
{teams?.map(team => (
|
||||
<Select.Option key={team.team_id} value={team.team_id}>
|
||||
{`${team.team_alias} (${team.team_id})`}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
{/* Hidden form field for token */}
|
||||
<Form.Item name="token" hidden>
|
||||
<Input />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue