Update to RSS Release Info. general frontend update
This commit is contained in:
@@ -6,3 +6,4 @@ cryptography==41.0.7
|
|||||||
bcrypt==4.1.2
|
bcrypt==4.1.2
|
||||||
python-dotenv==1.0.0
|
python-dotenv==1.0.0
|
||||||
gunicorn==21.2.0
|
gunicorn==21.2.0
|
||||||
|
requests==2.32.5
|
||||||
22
src/app.py
22
src/app.py
@@ -11,6 +11,8 @@ import secrets
|
|||||||
import hashlib
|
import hashlib
|
||||||
import hmac
|
import hmac
|
||||||
import re
|
import re
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
import requests
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
@@ -516,6 +518,26 @@ def internal_error(e):
|
|||||||
logger.error(f"Internal server error: {str(e)}")
|
logger.error(f"Internal server error: {str(e)}")
|
||||||
return jsonify({'error': 'Internal server error'}), 500
|
return jsonify({'error': 'Internal server error'}), 500
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/rss")
|
||||||
|
def rss_proxy():
|
||||||
|
url = "https://rattatwinko.servecounterstrike.com/gitea/rattatwinko/bytechat-desktop/releases.rss"
|
||||||
|
resp = requests.get(url)
|
||||||
|
resp.raise_for_status()
|
||||||
|
|
||||||
|
root = ET.fromstring(resp.text)
|
||||||
|
items = []
|
||||||
|
for item in root.findall("./channel/item"):
|
||||||
|
items.append({
|
||||||
|
"title": item.findtext("title"),
|
||||||
|
"link": item.findtext("link"),
|
||||||
|
"pubDate": item.findtext("pubDate"),
|
||||||
|
"author": item.findtext("author"),
|
||||||
|
"description": item.findtext("description"),
|
||||||
|
})
|
||||||
|
|
||||||
|
return jsonify(items)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
start_cleanup_task()
|
start_cleanup_task()
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ function setupSecurityFeatures() {
|
|||||||
clearSensitiveData();
|
clearSensitiveData();
|
||||||
});
|
});
|
||||||
|
|
||||||
const securityIndicator = document.getElementById('securityIndicator');
|
//const securityIndicator = document.getElementById('securityIndicator');
|
||||||
securityIndicator.style.display = 'block';
|
//securityIndicator.style.display = 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearSensitiveData() {
|
function clearSensitiveData() {
|
||||||
|
|||||||
@@ -101,20 +101,104 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Release Notes Placeholder -->
|
|
||||||
<!--
|
|
||||||
<div style="margin-top: 2rem; padding: 1rem; border: 1px solid #333; border-radius: 8px; background: rgba(0, 0, 0, 0.2);">
|
<div style="margin-top: 2rem; padding: 1rem; border: 1px solid #333; border-radius: 8px; background: rgba(0, 0, 0, 0.2);">
|
||||||
<h3 style="font-size: clamp(1rem, 4vw, 1.25rem); margin-bottom: 0.75rem; color: #ffffff;">Release Information</h3>
|
<h3 style="font-size: clamp(1rem, 4vw, 1.25rem); margin-bottom: 0.75rem; color: #ffffff;">Release Information</h3>
|
||||||
<div style="font-size: clamp(0.8rem, 3vw, 0.95rem); color: #888; line-height: 1.5;">
|
<div style="font-size: clamp(0.8rem, 3vw, 0.95rem); color: #888; line-height: 1.5;">
|
||||||
<p>
|
<div id="rss-feed" style="padding: 1rem; color: #ccc;">
|
||||||
</p>
|
<p>Loading release notes...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<script async>
|
||||||
|
async function loadRSS() {
|
||||||
|
try {
|
||||||
|
const response = await fetch("/rss");
|
||||||
|
const items = await response.json();
|
||||||
|
|
||||||
|
const container = document.getElementById("rss-feed");
|
||||||
|
|
||||||
|
if (!items.length) {
|
||||||
|
container.innerHTML = "<p>No releases found.</p>";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let html = "<ul class='release-list'>";
|
||||||
|
items.forEach(item => {
|
||||||
|
html += `
|
||||||
|
<li>
|
||||||
|
<a href="${item.link}" target="_blank">${item.title}</a>
|
||||||
|
<div class="pub-date">${item.pubDate ? new Date(item.pubDate).toLocaleString() : ""}</div>
|
||||||
|
<div class="author">by ${item.author || "Unknown"}</div>
|
||||||
|
</li>
|
||||||
|
`;
|
||||||
|
});
|
||||||
|
html += "</ul>";
|
||||||
|
|
||||||
|
container.innerHTML = html;
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Failed to load RSS:", err);
|
||||||
|
document.getElementById("rss-feed").innerHTML = "<p>Failed to load feed.</p>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", loadRSS);
|
||||||
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
ul.release-list {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.release-list li {
|
||||||
|
background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 10px rgba(0,0,0,0.5);
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
transition: transform 0.2s, box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.release-list li:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
box-shadow: 0 8px 20px rgba(0,0,0,0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.release-list a {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-style: italic;
|
||||||
|
color: #00f683;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.release-list a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pub-date {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #a0a0a0;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
color: #7a7a7a;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.release-content {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: #c0c0c0;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
.laptopimg:hover {
|
.laptopimg:hover {
|
||||||
transform: translateY(-5px);
|
transform: translateY(-5px);
|
||||||
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
|
||||||
|
|||||||
Reference in New Issue
Block a user