140 lines
9.1 KiB
Django/Jinja

<!-- General Configuration Tab -->
<div class="tab-pane active">
<div class="config-form">
<div class="card">
<div class="card-header">
<h5>General Configuration</h5>
</div>
<div class="card-body">
<!-- include flash messages template -->
{% include "partials/flash_messages.html.jinja" %}
<div class="row">
<!-- General Settings Column -->
<div class="col-md-6">
<form action="{{ url_for('config.update_general') }}" method="post">
<div class="form-section">
<h6>Scraper Volume</h6>
<p class="text-muted">Configure the total number of papers to scrape per day.</p>
<div class="mb-3">
<label for="totalVolume" class="form-label">Papers per day:</label>
<input type="number" class="form-control" id="totalVolume" name="total_volume"
min="1" max="{{ max_volume }}" value="{{ volume_config.volume }}" required>
<div class="form-text">Enter a value between 1 and {{ max_volume }}</div>
</div>
</div>
<div class="form-section">
<h6>Download Path</h6>
<p class="text-muted">Base directory where scraped paper files will be stored.</p>
<div class="mb-3">
<label for="downloadPath" class="form-label">Download Directory:</label>
<input type="text" class="form-control" id="downloadPath" name="download_path"
value="{{ download_path_config.path }}" required>
<div class="form-text">Enter the full path to the download directory (e.g.,
/data/papers).
Ensure the directory exists and the application has write permissions.</div>
</div>
</div>
<div class="form-section">
<h6>Scheduler Timezone</h6>
<p class="text-muted">Configure the timezone for the APScheduler to use for job
scheduling.</p>
<div class="mb-3">
<label for="timezone" class="form-label">Timezone:</label>
<select class="form-control" id="timezone" name="timezone" required>
<option value="UTC" {% if timezone_config.timezone=='UTC' %}selected{% endif %}>
UTC</option>
<option value="Europe/Berlin" {% if timezone_config.timezone=='Europe/Berlin'
%}selected{% endif %}>Europe/Berlin (CET/CEST)</option>
<option value="Europe/London" {% if timezone_config.timezone=='Europe/London'
%}selected{% endif %}>Europe/London (GMT/BST)</option>
<option value="Europe/Paris" {% if timezone_config.timezone=='Europe/Paris'
%}selected{% endif %}>Europe/Paris (CET/CEST)</option>
<option value="Europe/Rome" {% if timezone_config.timezone=='Europe/Rome'
%}selected{% endif %}>Europe/Rome (CET/CEST)</option>
<option value="US/Eastern" {% if timezone_config.timezone=='US/Eastern'
%}selected{% endif %}>US/Eastern (EST/EDT)</option>
<option value="US/Central" {% if timezone_config.timezone=='US/Central'
%}selected{% endif %}>US/Central (CST/CDT)</option>
<option value="US/Mountain" {% if timezone_config.timezone=='US/Mountain'
%}selected{% endif %}>US/Mountain (MST/MDT)</option>
<option value="US/Pacific" {% if timezone_config.timezone=='US/Pacific'
%}selected{% endif %}>US/Pacific (PST/PDT)</option>
<option value="Asia/Tokyo" {% if timezone_config.timezone=='Asia/Tokyo'
%}selected{% endif %}>Asia/Tokyo (JST)</option>
<option value="Asia/Shanghai" {% if timezone_config.timezone=='Asia/Shanghai'
%}selected{% endif %}>Asia/Shanghai (CST)</option>
<option value="Australia/Sydney" {% if
timezone_config.timezone=='Australia/Sydney' %}selected{% endif %}>
Australia/Sydney (AEST/AEDT)</option>
</select>
<div class="form-text">Current: {{ timezone_config.timezone }}</div>
</div>
</div>
<div class="form-section">
<h6>System Settings</h6>
<p class="text-muted">Configure general system behavior.</p>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="enableNotifications" checked>
<label class="form-check-label" for="enableNotifications">
Enable email notifications
</label>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="enableLogging" checked>
<label class="form-check-label" for="enableLogging">
Enable detailed activity logging
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">Save General Settings</button>
</form>
</div>
<!-- Scraper Module Column -->
<div class="col-md-6">
<form method="post" action="{{ url_for('config.update_scraper_module') }}">
<div class="form-section">
<div class="d-flex justify-content-between align-items-center mb-2">
<h6>Scraper Module</h6>
<button type="button" class="btn btn-outline-info btn-sm"
onclick="showScraperOverview()" title="View scraper modules overview">
<i class="fas fa-info-circle"></i> How Scrapers Work
</button>
</div>
<p class="text-muted">Select which scraper module to use for processing papers.</p>
<div class="mb-3">
<label for="scraper_module" class="form-label">Active Scraper Module:</label>
<select class="form-control" id="scraper_module" name="scraper_module">
{% for module in available_scraper_modules %}
<option value="{{ module }}" {% if module==current_scraper_module %} selected {%
endif %}>
{{ module }}
{% if scraper_details[module] %}
- {{ scraper_details[module].description[:50] }}...
{% endif %}
</option>
{% endfor %}
</select>
<div class="form-text">
Current module: <strong>{{ current_scraper_module }}</strong>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Update Scraper Module</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>