Improved API key delete confirmation dialog (references #2625)

This commit is contained in:
Bernd Bestel 2024-12-29 20:18:10 +01:00
parent 5f26e914a2
commit 0270f6aa08
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 8 additions and 0 deletions

View File

@ -29,11 +29,18 @@ $(document).on('click', '.apikey-delete-button', function(e)
{ {
var button = $(e.currentTarget); var button = $(e.currentTarget);
var objectName = button.attr('data-apikey-key'); var objectName = button.attr('data-apikey-key');
var objectDescription = button.attr('data-apikey-description');
var objectId = button.attr('data-apikey-id'); var objectId = button.attr('data-apikey-id');
if (objectDescription)
{
objectName = objectDescription;
}
bootbox.confirm({ bootbox.confirm({
message: __t('Are you sure you want to delete API key "%s"?', objectName), message: __t('Are you sure you want to delete API key "%s"?', objectName),
closeButton: false, closeButton: false,
className: "text-break",
buttons: { buttons: {
confirm: { confirm: {
label: __t('Yes'), label: __t('Yes'),

View File

@ -92,6 +92,7 @@
href="#" href="#"
data-apikey-id="{{ $apiKey->id }}" data-apikey-id="{{ $apiKey->id }}"
data-apikey-key="{{ $apiKey->api_key }}" data-apikey-key="{{ $apiKey->api_key }}"
data-apikey-description="{{ $apiKey->description }}"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('Delete this item') }}"> title="{{ $__t('Delete this item') }}">
<i class="fa-solid fa-trash"></i> <i class="fa-solid fa-trash"></i>