/** * Predefined Action Handlers * * Contains configuration for common action patterns */ /** * Docker Container Handler */ export const dockerContainerHandler = { urlTemplate: '/admin/infrastructure/docker/api/containers/{id}/{action}', method: 'POST', confirmations: { stop: 'Are you sure you want to stop this container?', restart: 'Are you sure you want to restart this container?' }, loadingTexts: { start: 'Starting...', stop: 'Stopping...', restart: 'Restarting...', reload: 'Reloading...', logs: 'Loading logs...' }, successMessages: { start: 'Container started successfully', stop: 'Container stopped successfully', restart: 'Container restarted successfully', reload: 'Container reloaded successfully' }, errorMessages: { start: 'Failed to start container', stop: 'Failed to stop container', restart: 'Failed to restart container', reload: 'Failed to reload container' } }; /** * Generic API Handler */ export const genericApiHandler = { urlTemplate: '/api/{entity}/{id}/{action}', method: 'POST', confirmations: { delete: 'Are you sure you want to delete this item?' }, loadingTexts: { delete: 'Deleting...', update: 'Updating...', create: 'Creating...' }, successMessages: { delete: 'Item deleted successfully', update: 'Item updated successfully', create: 'Item created successfully' }, errorMessages: { delete: 'Failed to delete item', update: 'Failed to update item', create: 'Failed to create item' } }; /** * Bulk Operations Handler */ export const bulkOperationsHandler = { urlTemplate: '/admin/api/{entity}/bulk/{action}', method: 'POST', confirmations: { delete: 'Are you sure you want to delete the selected items?', publish: 'Are you sure you want to publish the selected items?', unpublish: 'Are you sure you want to unpublish the selected items?' }, loadingTexts: { delete: 'Deleting...', publish: 'Publishing...', unpublish: 'Unpublishing...', tag: 'Tagging...' }, successMessages: { delete: 'Items deleted successfully', publish: 'Items published successfully', unpublish: 'Items unpublished successfully', tag: 'Items tagged successfully' }, errorMessages: { delete: 'Failed to delete items', publish: 'Failed to publish items', unpublish: 'Failed to unpublish items', tag: 'Failed to tag items' } }; /** * Default handler for actions without specific handler */ export const defaultHandler = { method: 'POST', loadingTexts: { default: 'Processing...' } };