333 lines
16 KiB
HTML
333 lines
16 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Delete Integration Log{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex align-items-center mb-3">
|
|
<div>
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="{% url 'core:dashboard' %}">Dashboard</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'core:integration_log_list' %}">Integration Logs</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'core:integration_log_detail' object.pk %}">Log #{{ object.pk }}</a></li>
|
|
<li class="breadcrumb-item active">Delete</li>
|
|
</ol>
|
|
<h1 class="page-header mb-0">Delete Integration Log</h1>
|
|
</div>
|
|
<div class="ms-auto">
|
|
<a href="{% url 'core:integration_log_detail' object.pk %}" class="btn btn-secondary">
|
|
<i class="fas fa-arrow-left me-2"></i>Back to Log
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row justify-content-center">
|
|
<div class="col-xl-8">
|
|
<div class="card">
|
|
<div class="card-header bg-danger text-white">
|
|
<h4 class="card-title mb-0">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
Confirm Integration Log Deletion
|
|
</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-warning">
|
|
<h5 class="alert-heading">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
Are you sure you want to delete this integration log?
|
|
</h5>
|
|
<p class="mb-0">
|
|
This action cannot be undone. The integration log and all associated data will be permanently removed.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Integration Log Details -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-exchange-alt me-2"></i>Integration Information
|
|
</h6>
|
|
<div class="mb-2">
|
|
<strong>Integration:</strong> {{ object.integration_name }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Operation:</strong> {{ object.get_operation_type_display }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Status:</strong>
|
|
<span class="badge bg-{% if object.status == 'success' %}success{% elif object.status == 'failed' %}danger{% elif object.status == 'running' %}info{% else %}warning{% endif %}">
|
|
{{ object.get_status_display }}
|
|
</span>
|
|
</div>
|
|
<div>
|
|
<strong>External ID:</strong> {{ object.external_id|default:"Not provided" }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-clock me-2"></i>Timing Information
|
|
</h6>
|
|
<div class="mb-2">
|
|
<strong>Started:</strong>
|
|
{% if object.started_at %}
|
|
{{ object.started_at|date:"M d, Y g:i A" }}
|
|
{% else %}
|
|
Not started
|
|
{% endif %}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Completed:</strong>
|
|
{% if object.completed_at %}
|
|
{{ object.completed_at|date:"M d, Y g:i A" }}
|
|
{% else %}
|
|
Not completed
|
|
{% endif %}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Execution Time:</strong>
|
|
{% if object.execution_time %}
|
|
{{ object.execution_time }} ms
|
|
{% else %}
|
|
Not recorded
|
|
{% endif %}
|
|
</div>
|
|
<div>
|
|
<strong>Retry Count:</strong> {{ object.retry_count|default:0 }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if object.error_message %}
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-exclamation-circle me-2 text-danger"></i>Error Information
|
|
</h6>
|
|
<div class="alert alert-danger mb-0">
|
|
{{ object.error_message }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if object.request_data or object.response_data %}
|
|
<div class="row mb-4">
|
|
{% if object.request_data %}
|
|
<div class="col-md-6">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-arrow-up me-2 text-primary"></i>Request Data
|
|
</h6>
|
|
<pre class="bg-white p-2 border rounded small" style="max-height: 200px; overflow-y: auto;">{{ object.request_data }}</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if object.response_data %}
|
|
<div class="col-md-6">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-arrow-down me-2 text-success"></i>Response Data
|
|
</h6>
|
|
<pre class="bg-white p-2 border rounded small" style="max-height: 200px; overflow-y: auto;">{{ object.response_data }}</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Deletion Form -->
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
|
|
<div class="mb-3">
|
|
<label for="deletion_reason" class="form-label">
|
|
<strong>Reason for Deletion *</strong>
|
|
</label>
|
|
<select class="form-select" id="deletion_reason" name="deletion_reason" required>
|
|
<option value="">Select a reason</option>
|
|
<option value="data_cleanup">Data Cleanup</option>
|
|
<option value="privacy_request">Privacy Request</option>
|
|
<option value="duplicate_entry">Duplicate Entry</option>
|
|
<option value="test_data">Test Data</option>
|
|
<option value="system_error">System Error</option>
|
|
<option value="compliance">Compliance Requirement</option>
|
|
<option value="retention_policy">Retention Policy</option>
|
|
<option value="other">Other</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="deletion_notes" class="form-label">
|
|
<strong>Additional Notes</strong>
|
|
</label>
|
|
<textarea class="form-control"
|
|
id="deletion_notes"
|
|
name="deletion_notes"
|
|
rows="3"
|
|
placeholder="Provide additional details about why this log is being deleted..."></textarea>
|
|
<div class="form-text">
|
|
These notes will be recorded for audit purposes.
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input"
|
|
type="checkbox"
|
|
id="confirm_deletion"
|
|
name="confirm_deletion"
|
|
required>
|
|
<label class="form-check-label" for="confirm_deletion">
|
|
I understand that this action cannot be undone and confirm the deletion of this integration log.
|
|
</label>
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
<h6 class="alert-heading">
|
|
<i class="fas fa-info-circle me-2"></i>What happens when you delete this log?
|
|
</h6>
|
|
<ul class="mb-0">
|
|
<li>The integration log record will be permanently removed</li>
|
|
<li>All request and response data will be lost</li>
|
|
<li>Error information and debugging data will be deleted</li>
|
|
<li>This action will be recorded in the audit log</li>
|
|
<li>Integration statistics may be affected</li>
|
|
<li>Related system logs will remain intact</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-between">
|
|
<a href="{% url 'core:integration_log_detail' object.pk %}" class="btn btn-secondary">
|
|
<i class="fas fa-times me-2"></i>Cancel
|
|
</a>
|
|
<button type="submit" class="btn btn-danger" onclick="return confirmDeletion()">
|
|
<i class="fas fa-trash me-2"></i>Delete Integration Log
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Impact Warning -->
|
|
{% if object.status == 'running' or object.retry_count > 0 %}
|
|
<div class="card mt-4">
|
|
<div class="card-header bg-warning text-dark">
|
|
<h5 class="card-title mb-0">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
Special Considerations
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if object.status == 'running' %}
|
|
<div class="alert alert-warning">
|
|
<strong>Active Operation:</strong> This integration is currently running.
|
|
Deleting this log may affect monitoring and debugging capabilities.
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if object.retry_count > 0 %}
|
|
<div class="alert alert-info">
|
|
<strong>Retry History:</strong> This operation has been retried {{ object.retry_count }} time{{ object.retry_count|pluralize }}.
|
|
Deleting this log will remove the retry history.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Related Information -->
|
|
<div class="card mt-4">
|
|
<div class="card-header">
|
|
<h5 class="card-title">
|
|
<i class="fas fa-link me-2"></i>
|
|
Related Information
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h6>Integration Details</h6>
|
|
<ul class="list-unstyled">
|
|
<li><strong>Log ID:</strong> {{ object.pk }}</li>
|
|
<li><strong>Created:</strong> {{ object.created_at|date:"M d, Y g:i A" }}</li>
|
|
<li><strong>Last Updated:</strong> {{ object.updated_at|date:"M d, Y g:i A" }}</li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h6>System Information</h6>
|
|
<ul class="list-unstyled">
|
|
<li><strong>Integration Name:</strong> {{ object.integration_name }}</li>
|
|
<li><strong>Operation Type:</strong> {{ object.get_operation_type_display }}</li>
|
|
{% if object.metadata %}
|
|
<li><strong>Has Metadata:</strong> Yes</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function confirmDeletion() {
|
|
const reason = document.getElementById('deletion_reason').value;
|
|
const confirmed = document.getElementById('confirm_deletion').checked;
|
|
|
|
if (!reason) {
|
|
alert('Please select a reason for deletion.');
|
|
return false;
|
|
}
|
|
|
|
if (!confirmed) {
|
|
alert('Please confirm that you understand this action cannot be undone.');
|
|
return false;
|
|
}
|
|
|
|
const logId = "{{ object.pk }}";
|
|
const integrationName = "{{ object.integration_name }}";
|
|
const operationType = "{{ object.get_operation_type_display }}";
|
|
const status = "{{ object.get_status_display }}";
|
|
|
|
const message = `Are you absolutely sure you want to delete this integration log?\n\nLog ID: ${logId}\nIntegration: ${integrationName}\nOperation: ${operationType}\nStatus: ${status}\n\nThis action cannot be undone.`;
|
|
|
|
return confirm(message);
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Auto-focus on deletion reason
|
|
document.getElementById('deletion_reason').focus();
|
|
|
|
// Show/hide additional notes based on reason
|
|
const reasonSelect = document.getElementById('deletion_reason');
|
|
const notesTextarea = document.getElementById('deletion_notes');
|
|
|
|
reasonSelect.addEventListener('change', function() {
|
|
if (this.value === 'other') {
|
|
notesTextarea.required = true;
|
|
notesTextarea.placeholder = 'Please specify the reason for deletion...';
|
|
} else {
|
|
notesTextarea.required = false;
|
|
notesTextarea.placeholder = 'Provide additional details about why this log is being deleted...';
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|