Process all missing kids task, urls views cleaner, adding language filter WIP
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<!-- Markdown -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<style>
|
||||
@@ -34,10 +36,63 @@
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
</style>
|
||||
.table {
|
||||
table-layout: auto;
|
||||
width: 100%;
|
||||
}
|
||||
th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
td {
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
.sidebar {
|
||||
min-width: 110px; /* Minimum width */
|
||||
max-width: 200px; /* Maximum width */
|
||||
width: 100%; /* Make it take full width within the defined min and max */
|
||||
padding: 5px;
|
||||
box-sizing: border-box; /* Ensure padding doesn't increase the overall width */
|
||||
transition: width 0.3s ease-in-out; /* Smooth transition for resizing */
|
||||
background-color: #f4f4f4;
|
||||
box-sizing: border-box;
|
||||
word-wrap: break-word; /* Allow wrapping of long words */
|
||||
overflow-wrap: break-word; /* Ensures wrapping across browsers */
|
||||
white-space: normal; /* Ensure normal word wrapping */
|
||||
}
|
||||
|
||||
.dark-mode .sidebar {
|
||||
background-color: #1e1e1e;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<script>
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
//////////////////////////////////////////////
|
||||
// Timestamp to local timezone
|
||||
document.querySelectorAll(".ts-fetch").forEach(element => {
|
||||
let utcDate = element.getAttribute("data-ts"); // Get timestamp from data attribute
|
||||
let options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12:false};
|
||||
if (utcDate) {
|
||||
let localDate = new Date(utcDate).toLocaleString("en-GB", options); // Convert to local timezone
|
||||
element.textContent = localDate; // Update the text content
|
||||
}
|
||||
});
|
||||
document.querySelectorAll(".ts-publish").forEach(element => {
|
||||
let utcDate = element.getAttribute("data-ts"); // Get timestamp from data attribute
|
||||
let options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12:false};
|
||||
if (utcDate) {
|
||||
let localDate = new Date(utcDate).toLocaleString("en-GB", options); // Convert to local timezone
|
||||
element.textContent = localDate; // Update the text content
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function fetchDetails(urlId, url) {
|
||||
// Show the loading spinner
|
||||
@@ -54,15 +109,13 @@
|
||||
}
|
||||
|
||||
// Fetch URL
|
||||
let fetchUrl = `/api/url/${urlId}/fetch/?url=${encodeURIComponent(url)}&model=${encodeURIComponent(selectedModel)}&text=${encodeURIComponent(inputText)}`;
|
||||
let fetchUrl = `/urls/${urlId}/fetch/?url=${encodeURIComponent(url)}&model=${encodeURIComponent(selectedModel)}&text=${encodeURIComponent(inputText)}`;
|
||||
|
||||
let resultContainer = $("#chat-output");
|
||||
resultContainer.html(""); // Clear previous content before fetching
|
||||
|
||||
let fetchButton = $("button[onclick^='fetchDetails']"); // Select the button
|
||||
fetchButton.prop("disabled", true); // Disable button
|
||||
|
||||
|
||||
fetch(fetchUrl/*, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
@@ -89,7 +142,6 @@
|
||||
fetchButton.prop("disabled", false); // Re-enable button when done
|
||||
return;
|
||||
}
|
||||
|
||||
// Decode the streamed chunk
|
||||
let chunk = decoder.decode(value);
|
||||
// Append to the accumulated text
|
||||
@@ -111,14 +163,21 @@
|
||||
// Hide the loading spinner after request is complete
|
||||
document.getElementById("loading-spinner").style.display = "none";
|
||||
});
|
||||
;
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="button-container">
|
||||
<button id="homeButton" class="home-button">🏠</button>
|
||||
<button id="themeToggle" class="theme-button">🌙</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="container mt-4">
|
||||
<h2>URL Details</h2>
|
||||
<!-- <h2>URL Details</h2> -->
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>URL</th>
|
||||
@@ -126,7 +185,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Fetch Date</th>
|
||||
<td>{{ url_item.ts_fetch }} UTC</td>
|
||||
<td> <span class="ts-fetch" data-ts="{{ url_item.ts_fetch|date:'c' }}"></span> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Source</th>
|
||||
@@ -142,59 +201,59 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>URL host</th>
|
||||
<td><a href="{{ url_content.url_host|safe }}" target="_blank">{{ url_content.url_host }}</a></td>
|
||||
<td> <a href="{{ url_content.url_host|safe }}" target="_blank">{{ url_content.url_host }}</a> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Site name</th>
|
||||
<td>{{ url_content.site_name }}</td>
|
||||
<td>{{ url_content.site_name|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Published Date</th>
|
||||
<td>{{ url_content.date_published }} UTC</td>
|
||||
<td> <span class="ts-publish" data-ts="{{ url_content.date_published|date:'c' }}"></span> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Valid news article content?</th>
|
||||
<th>Valid news content?</th>
|
||||
<td>{{ url_content.valid_content }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Tags</th>
|
||||
<td>{{ url_content.tags }}</td>
|
||||
<td>{{ url_content.tags|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Authors</th>
|
||||
<td>{{ url_content.authors }}</td>
|
||||
<td>{{ url_content.authors|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Keywords</th>
|
||||
<td>{{ url_content.keywords }}</td>
|
||||
<td>{{ url_content.keywords|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Language</th>
|
||||
<td>{{ url_content.language }}</td>
|
||||
<td>{{ url_content.language|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Main image</th>
|
||||
<td><a href="{{ url_content.image_main_url|safe }}" target="_blank">{{ url_content.image_main_url }}</a></td>
|
||||
<td><a href="{{ url_content.image_main_url|safe }}" target="_blank">{{ url_content.image_main_url|default:"" }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image URLs</th>
|
||||
<td>{{ url_content.image_urls }}</td>
|
||||
<td>{{ url_content.image_urls|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Video URLs</th>
|
||||
<td>{{ url_content.videos_url }}</td>
|
||||
<td>{{ url_content.videos_url|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td>{{ url_content.title }}</td>
|
||||
<td>{{ url_content.title|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<td>{{ url_content.description }}</td>
|
||||
<td>{{ url_content.description|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Content</th>
|
||||
<td>{{ url_content.content }}</td>
|
||||
<td>{{ url_content.content|default:"" }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -232,9 +291,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
{% block extra_js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user