delete api key

main
alex 2023-07-03 21:37:56 +02:00
parent 16f3cbf1d2
commit b1d41640f3
4 changed files with 35 additions and 0 deletions

View File

@ -3,6 +3,7 @@
"buttonCancel": "Abbrechen", "buttonCancel": "Abbrechen",
"buttonClose": "Schließen", "buttonClose": "Schließen",
"buttonSave": "Speichern", "buttonSave": "Speichern",
"buttonDelete": "Löschen",
"sideMenu.dashboard": "Dashboard", "sideMenu.dashboard": "Dashboard",
"sideMenu.groupTasks": "Gruppenaufgaben", "sideMenu.groupTasks": "Gruppenaufgaben",
"sideMenu.groupTasks.overview": "Übersicht", "sideMenu.groupTasks.overview": "Übersicht",
@ -140,6 +141,9 @@
"userProfile.column.expiresAt": "Läuft ab am", "userProfile.column.expiresAt": "Läuft ab am",
"userProfile.column.action": "Maßnahme", "userProfile.column.action": "Maßnahme",
"userProfile.column.action.signOut": "Abmelden", "userProfile.column.action.signOut": "Abmelden",
"userProfile.column.deleteApiKey": "Löschen",
"userProfile.column.deleteApiKey.popconfirm.title": "Sind Sie sicher, dass Sie diesen API-Schlüssel löschen möchten?",
"userProfile.column.deleteApiKey.popconfirm.description": "Anfragen, die diesen API-Schlüssel noch verwenden, werden zukünftig abgelehnt",
"userProfile.column.createdAt": "Erstellt am", "userProfile.column.createdAt": "Erstellt am",
"userProfile.column.usageCount": "Anzahl der Nutzungen", "userProfile.column.usageCount": "Anzahl der Nutzungen",
"userProfile.column.name": "Name", "userProfile.column.name": "Name",

View File

@ -3,6 +3,7 @@
"buttonCancel": "Cancel", "buttonCancel": "Cancel",
"buttonClose": "Close", "buttonClose": "Close",
"buttonSave": "Save", "buttonSave": "Save",
"buttonDelete": "Delete",
"sideMenu.dashboard": "Dashboard", "sideMenu.dashboard": "Dashboard",
"sideMenu.groupTasks": "Group Tasks", "sideMenu.groupTasks": "Group Tasks",
"sideMenu.groupTasks.overview": "Overview", "sideMenu.groupTasks.overview": "Overview",
@ -140,6 +141,9 @@
"userProfile.column.expiresAt": "Expires at", "userProfile.column.expiresAt": "Expires at",
"userProfile.column.action": "Action", "userProfile.column.action": "Action",
"userProfile.column.action.signOut": "Sign out", "userProfile.column.action.signOut": "Sign out",
"userProfile.column.deleteApiKey": "Delete",
"userProfile.column.deleteApiKey.popconfirm.title": "Are you sure you want to delete this API key?",
"userProfile.column.deleteApiKey.popconfirm.description": "Requests that still use this API key will be irejected in the future",
"userProfile.column.createdAt": "Created at", "userProfile.column.createdAt": "Created at",
"userProfile.column.usageCount": "Usage count", "userProfile.column.usageCount": "Usage count",
"userProfile.column.name": "Name", "userProfile.column.name": "Name",

View File

@ -154,6 +154,32 @@ export default function UserProfile() {
dataIndex: "createdAt", dataIndex: "createdAt",
key: "createdAt", key: "createdAt",
}, },
{
title: t("scanners.column.action"),
dataIndex: "action",
key: "action",
render: (_, record) => (
<Space size="middle">
<Popconfirm
placement="left"
title={t("userProfile.column.deleteApiKey.popconfirm.title")}
description={t(
"userProfile.column.deleteApiKey.popconfirm.description"
)}
okText={t("buttonDelete")}
cancelText={t("buttonCancel")}
onConfirm={() =>
webSocketContext.SendSocketMessage(
SentMessagesCommands.DeleteUserApiKey,
{ Id: record.key }
)
}
>
<Link to="#">{t("userProfile.column.deleteApiKey")}</Link>
</Popconfirm>
</Space>
),
},
]; ];
}; };

View File

@ -216,6 +216,7 @@ export const SentMessagesCommands = {
GroupTasksCheckingForCategoryGroupChanges: 17, GroupTasksCheckingForCategoryGroupChanges: 17,
HandleUserActionTaskStep: 18, HandleUserActionTaskStep: 18,
CreateNewUserApiKey: 19, CreateNewUserApiKey: 19,
DeleteUserApiKey: 20,
}; };
export function WebSocketProvider({ export function WebSocketProvider({