Spaces:
Sleeping
Sleeping
Rename templates/index.html to templates/base.html
Browse files- templates/base.html +67 -0
- templates/index.html +0 -68
templates/base.html
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>{% block title %}Telegram to YouTube Uploader{% endblock %}</title>
|
| 7 |
+
<!-- Bootstrap CSS (CDN) -->
|
| 8 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
+
<!-- Optional: Add your own CSS here -->
|
| 10 |
+
<style>
|
| 11 |
+
body {
|
| 12 |
+
padding-top: 20px;
|
| 13 |
+
}
|
| 14 |
+
.log-container {
|
| 15 |
+
height: 300px;
|
| 16 |
+
overflow-y: auto;
|
| 17 |
+
background-color: #f8f9fa;
|
| 18 |
+
border: 1px solid #dee2e6;
|
| 19 |
+
padding: 10px;
|
| 20 |
+
font-family: monospace;
|
| 21 |
+
font-size: 0.9em;
|
| 22 |
+
}
|
| 23 |
+
.status-card {
|
| 24 |
+
margin-bottom: 20px;
|
| 25 |
+
}
|
| 26 |
+
.confirmation-prompt {
|
| 27 |
+
animation: fadeIn 0.5s;
|
| 28 |
+
}
|
| 29 |
+
@keyframes fadeIn {
|
| 30 |
+
from { opacity: 0; }
|
| 31 |
+
to { opacity: 1; }
|
| 32 |
+
}
|
| 33 |
+
</style>
|
| 34 |
+
</head>
|
| 35 |
+
<body>
|
| 36 |
+
<div class="container">
|
| 37 |
+
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-4">
|
| 38 |
+
<div class="container-fluid">
|
| 39 |
+
<a class="navbar-brand" href="{{ url_for('dashboard') }}">TG2YT Uploader</a>
|
| 40 |
+
<div class="d-flex">
|
| 41 |
+
{% if session.user_authenticated %}
|
| 42 |
+
<a class="btn btn-outline-secondary" href="{{ url_for('logout') }}">Logout</a>
|
| 43 |
+
{% endif %}
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
+
</nav>
|
| 47 |
+
|
| 48 |
+
{% with messages = get_flashed_messages(with_categories=true) %}
|
| 49 |
+
{% if messages %}
|
| 50 |
+
{% for category, message in messages %}
|
| 51 |
+
<div class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show" role="alert">
|
| 52 |
+
{{ message }}
|
| 53 |
+
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
| 54 |
+
</div>
|
| 55 |
+
{% endfor %}
|
| 56 |
+
{% endif %}
|
| 57 |
+
{% endwith %}
|
| 58 |
+
|
| 59 |
+
{% block content %}{% endblock %}
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<!-- Bootstrap JS Bundle with Popper (CDN) -->
|
| 63 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
| 64 |
+
<!-- Optional: Add your own JavaScript here -->
|
| 65 |
+
{% block scripts %}{% endblock %}
|
| 66 |
+
</body>
|
| 67 |
+
</html>
|
templates/index.html
DELETED
|
@@ -1,68 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Uploader Dashboard</title>
|
| 7 |
-
<style>
|
| 8 |
-
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 700px; margin: auto; padding: 20px; background-color: #f4f7f6; }
|
| 9 |
-
.container { background-color: white; border: 1px solid #ccc; padding: 30px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
|
| 10 |
-
.header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 20px;}
|
| 11 |
-
h1 { color: #333; margin: 0; font-size: 24px; }
|
| 12 |
-
.form-group { margin-bottom: 15px; }
|
| 13 |
-
label { display: block; margin-bottom: 5px; font-weight: bold; }
|
| 14 |
-
input[type="number"] { width: 100px; padding: 8px; border-radius: 4px; border: 1px solid #ccc; }
|
| 15 |
-
.btn { padding: 12px 18px; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; transition: background-color 0.2s; text-decoration: none;}
|
| 16 |
-
.btn:disabled { background-color: #a0a0a0; cursor: not-allowed; }
|
| 17 |
-
.btn-primary { background-color: #007bff; }
|
| 18 |
-
.btn-secondary { background-color: #6c757d; }
|
| 19 |
-
.btn-logout { background-color: #dc3545; font-size: 14px; padding: 8px 12px;}
|
| 20 |
-
#continue-container { display: none; margin-top: 20px; padding: 15px; border: 1px dashed #007bff; border-radius: 5px; background-color: #e7f3ff; }
|
| 21 |
-
#response { margin-top: 20px; padding: 15px; border: 1px solid #eee; background-color: #f9f9f9; white-space: pre-wrap; font-family: monospace; border-radius: 5px; max-height: 300px; overflow-y: auto; }
|
| 22 |
-
</style>
|
| 23 |
-
</head>
|
| 24 |
-
<body>
|
| 25 |
-
<div class="container">
|
| 26 |
-
<div class="header">
|
| 27 |
-
<h1>Uploader Dashboard</h1>
|
| 28 |
-
<a href="{{ url_for('logout') }}" class="btn btn-logout">Logout</a>
|
| 29 |
-
</div>
|
| 30 |
-
<div id="controls-container">
|
| 31 |
-
<div class="form-group">
|
| 32 |
-
<label for="limit">Videos to check per batch:</label>
|
| 33 |
-
<input type="number" id="limit" name="limit" value="5" min="1" max="50">
|
| 34 |
-
</div>
|
| 35 |
-
<button id="start-btn" class="btn btn-primary">Start Workflow</button>
|
| 36 |
-
</div>
|
| 37 |
-
<div id="continue-container">
|
| 38 |
-
<p><strong>All videos in the last batch were already processed.</strong></p>
|
| 39 |
-
<p>Do you want to check the next batch?</p>
|
| 40 |
-
<button id="continue-btn" class="btn btn-secondary">Continue to Next Batch</button>
|
| 41 |
-
</div>
|
| 42 |
-
<div id="response">Awaiting instructions...</div>
|
| 43 |
-
<input type="hidden" id="next-offset" value="0">
|
| 44 |
-
</div>
|
| 45 |
-
<script>
|
| 46 |
-
const startBtn = document.getElementById('start-btn'), continueBtn = document.getElementById('continue-btn'), continueContainer = document.getElementById('continue-container'), responseDiv = document.getElementById('response'), limitInput = document.getElementById('limit'), nextOffsetInput = document.getElementById('next-offset');
|
| 47 |
-
startBtn.addEventListener('click', () => { nextOffsetInput.value = '0'; runWorkflow(); });
|
| 48 |
-
continueBtn.addEventListener('click', () => { runWorkflow(); });
|
| 49 |
-
function runWorkflow() {
|
| 50 |
-
const limit = limitInput.value, offset = nextOffsetInput.value;
|
| 51 |
-
responseDiv.textContent = `Processing batch... (Limit: ${limit}, Starting from offset: ${offset})`;
|
| 52 |
-
startBtn.disabled = true; continueBtn.disabled = true; continueContainer.style.display = 'none';
|
| 53 |
-
const formData = new FormData(); formData.append('limit', limit); formData.append('offset', offset);
|
| 54 |
-
fetch('/start-workflow', { method: 'POST', body: new URLSearchParams(formData) })
|
| 55 |
-
.then(response => {
|
| 56 |
-
if (!response.ok) { return response.json().then(err => { throw new Error(err.error || `HTTP error! status: ${response.status}`) }); }
|
| 57 |
-
return response.json();
|
| 58 |
-
})
|
| 59 |
-
.then(data => {
|
| 60 |
-
responseDiv.textContent = 'Batch completed:\n' + JSON.stringify(data, null, 2);
|
| 61 |
-
if (data.continue_prompt) { nextOffsetInput.value = data.next_offset; continueContainer.style.display = 'block'; }
|
| 62 |
-
})
|
| 63 |
-
.catch(error => { responseDiv.textContent = 'Error: ' + error.message; })
|
| 64 |
-
.finally(() => { startBtn.disabled = false; continueBtn.disabled = false; });
|
| 65 |
-
}
|
| 66 |
-
</script>
|
| 67 |
-
</body>
|
| 68 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|