Compare commits

...

2 Commits

Author SHA1 Message Date
e1727caa5f Update. 2025-05-18 17:48:22 +02:00
c45b61681d Update. 2025-05-18 16:57:14 +02:00
4 changed files with 39 additions and 8 deletions

View File

@ -8,7 +8,7 @@ import mimetypes
import html
# --- Theme selection (choose one: "light1", "light2", "dark1", "dark2") ---
THEME = "dark2" # Change this to "light2", "dark1", or "dark2" as desired
THEME = "light1" # Change this to "light2", "dark1", or "dark2" as desired
THEMES = {
"light1": """
@ -86,7 +86,7 @@ def HTML_TEMPLATE(content, theme=THEME):
REPO_ROOT = os.path.abspath(".")
LOG_FILE = os.path.join(REPO_ROOT, "gitlog.jsonl")
PORT = 8000
PORT = 8481
def format_diff_to_html(diff_text: str) -> str:
lines = diff_text.strip().splitlines()
@ -107,11 +107,11 @@ def format_diff_to_html(diff_text: str) -> str:
if line.startswith('+++') or line.startswith('---'):
html_lines.append(f'<div style="color: #0000aa;">{escaped}</div>')
elif line.startswith('@@'):
html_lines.append(f'<div style="background-color: #eaf5ff; color: #005cc5;">{escaped}</div>')
html_lines.append(f'<div style="color: #005cc5;">{escaped}</div>')
elif line.startswith('+'):
html_lines.append(f'<div style="background-color: #e6ffed; color: #22863a;">{escaped}</div>')
html_lines.append(f'<div style="color: #22863a;">{escaped}</div>')
elif line.startswith('-'):
html_lines.append(f'<div style="background-color: #ffeef0; color: #b31d28;">{escaped}</div>')
html_lines.append(f'<div style="color: #b31d28;">{escaped}</div>')
elif line.startswith('\\'):
html_lines.append(f'<div style="color: #6a737d;">{escaped}</div>')
else:

View File

@ -15,7 +15,7 @@ class ChannelAttachmentService(BaseService):
attachment["mime_type"] = mimetypes.guess_type(name)[0]
attachment['resource_type'] = "file"
real_file_name = f"{attachment['uid']}-{name}"
attachment["relative_url"] = urllib.parse.quote(f"{attachment['uid']}/{name}")
attachment["relative_url"] = (f"{attachment['uid']}-{name}")
attachment_folder = await self.services.channel.get_attachment_folder(channel_uid)
attachment_path = attachment_folder.joinpath(real_file_name)
attachment["path"] = str(attachment_path)

View File

@ -3,7 +3,7 @@
{% block header_text %}Drive{% endblock %}
{% block main %}
<div class="container">
<div class="container" style="overflow-y: auto;">
<file-manager path="{{path}}" style="flex: 1"></file-manager>
</div>
{% endblock %}

View File

@ -14,7 +14,7 @@
* { margin:0; padding:0; box-sizing:border-box; }
body {
font-family: 'Segoe UI',sans-serif;
background: #111;
background: #000;
color: #eee;
line-height:1.5;
}
@ -187,6 +187,7 @@
.btn { width: 100%; box-sizing: border-box; text-align:center; }
}
</style>
<link rel="stylesheet" href="/static/sandbox.css" />
</head>
<body>
@ -284,5 +285,35 @@ snek serve
<p>&copy; 2025 Snek Join our global community of developers, testers &amp; AI enthusiasts.</p>
</footer>
<script>
// number of stars you want
const STAR_COUNT = 200;
const body = document.body;
for (let i = 0; i < STAR_COUNT; i++) {
const star = document.createElement('div');
star.classList.add('star');
// random position within the viewport
star.style.left = Math.random() * 100 + '%';
star.style.top = Math.random() * 100 + '%';
// random size (optional)
const size = Math.random() * 2 + 1; // between 1px and 3px
star.style.width = size + 'px';
star.style.height = size + 'px';
// random animation timing for natural flicker
const duration = Math.random() * 3 + 2; // 2s5s
const delay = Math.random() * 5; // 0s5s
star.style.animationDuration = duration + 's';
star.style.animationDelay = delay + 's';
body.appendChild(star);
}
</script>
</body>
</html>