- Add boxes_crates database table with BIGINT IDs and 8-digit auto-numbered box_numbers - Implement boxes CRUD operations (add, edit, update, delete, delete_multiple) - Create boxes route handlers with POST actions for all operations - Add boxes.html template with 3-panel layout matching warehouse locations module - Implement barcode generation and printing with JsBarcode and QZ Tray integration - Add browser print fallback for when QZ Tray is not available - Simplify create box form to single button with auto-generation - Fix JavaScript null reference errors with proper element validation - Convert tuple data to dictionaries for Jinja2 template compatibility - Register boxes blueprint in Flask app initialization
160 lines
6.0 KiB
HTML
160 lines
6.0 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Logs Explorer - Settings{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid py-4">
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<h1 class="mb-2">
|
|
<i class="fas fa-file-alt"></i> Logs Explorer
|
|
</h1>
|
|
<p class="text-muted">View and manage application log files</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Log Statistics -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-3">
|
|
<div class="card shadow-sm">
|
|
<div class="card-body text-center">
|
|
<div class="display-6 text-primary mb-2">{{ log_stats.total_files }}</div>
|
|
<p class="card-text mb-0">Log Files</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="card shadow-sm">
|
|
<div class="card-body text-center">
|
|
<div class="display-6 text-info mb-2">{{ log_stats.total_size_mb }} MB</div>
|
|
<p class="card-text mb-0">Total Size</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
<p class="card-text mb-1"><small><strong>Newest:</strong> {{ log_stats.newest_log or 'N/A' }}</small></p>
|
|
<p class="card-text mb-0"><small><strong>Oldest:</strong> {{ log_stats.oldest_log or 'N/A' }}</small></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Search Section -->
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card shadow-sm">
|
|
<div class="card-header bg-light">
|
|
<h5 class="mb-0"><i class="fas fa-search"></i> Search Logs</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="GET" action="{{ url_for('settings.search_logs') }}" class="form-inline">
|
|
<input type="text" name="q" class="form-control mr-2" placeholder="Search term..." style="flex: 1; margin-right: 10px;">
|
|
<select name="file" class="form-control mr-2" style="width: auto;">
|
|
<option value="">All Files</option>
|
|
{% for log_file in log_files %}
|
|
<option value="{{ log_file.name }}">{{ log_file.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fas fa-search"></i> Search
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Log Files Table -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card shadow-sm">
|
|
<div class="card-header bg-light">
|
|
<h5 class="mb-0"><i class="fas fa-list"></i> Log Files</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if log_files %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>File Name</th>
|
|
<th>Size</th>
|
|
<th>Last Modified</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for log_file in log_files %}
|
|
<tr>
|
|
<td>
|
|
<i class="fas fa-file-lines text-primary"></i>
|
|
{{ log_file.name }}
|
|
</td>
|
|
<td>
|
|
<span class="badge bg-info">{{ log_file.size_mb }} MB</span>
|
|
</td>
|
|
<td>
|
|
<small class="text-muted">{{ log_file.modified_at }}</small>
|
|
</td>
|
|
<td>
|
|
<a href="{{ url_for('settings.view_log', filename=log_file.name) }}"
|
|
class="btn btn-sm btn-outline-primary" title="View">
|
|
<i class="fas fa-eye"></i> View
|
|
</a>
|
|
<a href="{{ url_for('settings.download_log', filename=log_file.name) }}"
|
|
class="btn btn-sm btn-outline-success" title="Download">
|
|
<i class="fas fa-download"></i> Download
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="alert alert-info mb-0">
|
|
<i class="fas fa-info-circle"></i> No log files found
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.form-inline {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
}
|
|
|
|
.form-inline input,
|
|
.form-inline select,
|
|
.form-inline button {
|
|
flex: 1;
|
|
min-width: 150px;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.form-inline {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.form-inline input,
|
|
.form-inline select,
|
|
.form-inline button {
|
|
flex: 1;
|
|
min-width: 100%;
|
|
}
|
|
}
|
|
|
|
.btn.btn-outline-primary,
|
|
.btn.btn-outline-success {
|
|
margin-right: 5px;
|
|
}
|
|
</style>
|
|
{% endblock %}
|