fix some ui stuff
This commit is contained in:
parent
ceeb6c375d
commit
8ffcf4d65c
@ -1,4 +1,8 @@
|
|||||||
{% extends "base.html.jinja" %} {% block content %}
|
{% extends "base.html.jinja" %}
|
||||||
|
|
||||||
|
{% block title %}About{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
<h1 class="mb-4">📘 About This App</h1>
|
<h1 class="mb-4">📘 About This App</h1>
|
||||||
|
|
||||||
<p class="lead">
|
<p class="lead">
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{% extends "base.html.jinja" %}
|
{% extends "base.html.jinja" %}
|
||||||
|
|
||||||
|
{% block title %}Home - SciPaperLoader{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="container text-center">
|
<div class="container text-center">
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{% extends "base.html.jinja" %}
|
{% extends "base.html.jinja" %}
|
||||||
|
|
||||||
|
{% block title %}Logs{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Activity Logs</h1>
|
<h1>Activity Logs</h1>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url_for('scraper.index') }}">Scraper</a>
|
<a class="nav-link" href="{{ url_for('scraper.index') }}">Control Panel</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url_for('upload.upload') }}">Import CSV</a>
|
<a class="nav-link" href="{{ url_for('upload.upload') }}">Import CSV</a>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
{% extends "base.html.jinja" %}
|
{% extends "base.html.jinja" %}
|
||||||
|
|
||||||
{% block title %}Papers{% endblock title %}
|
{% block title %}Papers{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{# --- Sort direction logic for each column --- #}
|
{# --- Sort direction logic for each column --- #}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends "base.html.jinja" %}
|
{% extends "base.html.jinja" %}
|
||||||
|
|
||||||
{% block title %}Paper Scraper Control Panel{% endblock title %}
|
{% block title %}Control Panel{% endblock title %}
|
||||||
|
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
@ -34,14 +34,6 @@
|
|||||||
height: 400px;
|
height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 20px;
|
|
||||||
right: 20px;
|
|
||||||
max-width: 350px;
|
|
||||||
z-index: 1050;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-results-container {
|
.search-results-container {
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@ -636,23 +628,47 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateVolume() {
|
function updateVolume() {
|
||||||
const volume = document.getElementById('volumeInput').value;
|
const volumeInput = document.getElementById('volumeInput');
|
||||||
|
const volume = volumeInput.value;
|
||||||
|
const submitButton = document.querySelector('#volumeForm button[type="submit"]');
|
||||||
|
|
||||||
fetch('/scraper/update_config', {
|
// Basic validation
|
||||||
method: 'POST',
|
if (!volume || volume < 1 || volume > {{ max_volume }} ) { // <-- Corrected line
|
||||||
headers: {
|
showFlashMessage('Please enter a valid volume between 1 and {{ max_volume }}', 'warning');
|
||||||
'Content-Type': 'application/json'
|
volumeInput.focus();
|
||||||
},
|
return;
|
||||||
body: JSON.stringify({ volume: volume })
|
}
|
||||||
|
|
||||||
|
// Disable button and show loading state
|
||||||
|
submitButton.disabled = true;
|
||||||
|
const originalText = submitButton.innerHTML;
|
||||||
|
submitButton.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Updating...';
|
||||||
|
|
||||||
|
fetch('/scraper/update_config', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ volume: volume })
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
if (data.success) {
|
||||||
|
// Use the backend message for success
|
||||||
|
showFlashMessage(data.message || 'Volume updated successfully', 'success');
|
||||||
|
} else {
|
||||||
|
showFlashMessage(data.message || 'Failed to update volume', 'error');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.catch(error => {
|
||||||
.then(data => {
|
console.error('Error updating volume:', error);
|
||||||
if (data.success) {
|
showFlashMessage('Network error while updating volume. Please try again.', 'error');
|
||||||
showFlashMessage('Volume updated successfully', 'success');
|
})
|
||||||
} else {
|
.finally(() => {
|
||||||
showFlashMessage(data.message, 'error');
|
// Re-enable button and restore original text
|
||||||
}
|
submitButton.disabled = false;
|
||||||
});
|
submitButton.innerHTML = originalText;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleNotifications() {
|
function toggleNotifications() {
|
||||||
@ -903,13 +919,20 @@
|
|||||||
// Flash message function
|
// Flash message function
|
||||||
function showFlashMessage(message, type) {
|
function showFlashMessage(message, type) {
|
||||||
const flashContainer = document.createElement('div');
|
const flashContainer = document.createElement('div');
|
||||||
flashContainer.className = `alert alert-${type === 'error' ? 'danger' : type} alert-dismissible fade show notification`;
|
flashContainer.className = `alert alert-${type === 'error' ? 'danger' : type} alert-dismissible fade show`;
|
||||||
flashContainer.innerHTML = `
|
flashContainer.innerHTML = `
|
||||||
${message}
|
${message}
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
document.body.appendChild(flashContainer);
|
// Use the existing client flash container at the top of the page
|
||||||
|
const clientFlashContainer = document.getElementById('clientFlashContainer');
|
||||||
|
if (clientFlashContainer) {
|
||||||
|
clientFlashContainer.appendChild(flashContainer);
|
||||||
|
} else {
|
||||||
|
// Fallback to body if container not found
|
||||||
|
document.body.appendChild(flashContainer);
|
||||||
|
}
|
||||||
|
|
||||||
// Auto dismiss after 5 seconds
|
// Auto dismiss after 5 seconds
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
{% extends "base.html.jinja" %} {% block content %}
|
{% extends "base.html.jinja" %}
|
||||||
|
|
||||||
|
{% block title %}Import CSV{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
<h1>Welcome to SciPaperLoader</h1>
|
<h1>Welcome to SciPaperLoader</h1>
|
||||||
|
|
||||||
<div id="results-container"></div>
|
<div id="results-container"></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user