mirror of
https://github.com/krateng/maloja.git
synced 2025-04-22 11:30:28 +03:00
Added About page
This commit is contained in:
parent
a1f8e96ae4
commit
765ab493cb
maloja
@ -52,11 +52,12 @@ def invalidate_caches(scrobbletime):
|
||||
def trim_cache():
|
||||
ramprct = psutil.virtual_memory().percent
|
||||
if ramprct > malojaconfig["DB_MAX_MEMORY"]:
|
||||
log(f"{ramprct}% RAM usage, reducing caches!",module="debug")
|
||||
log(f"{ramprct}% RAM usage, reducing caches!")
|
||||
ratio = (malojaconfig["DB_MAX_MEMORY"] / ramprct) ** 3
|
||||
targetsize = max(int(len(cache) * ratio),100)
|
||||
c.set_size(targetsize)
|
||||
c.set_size(HIGH_NUMBER)
|
||||
log(f"New RAM usage: {psutil.virtual_memory().percent}%")
|
||||
|
||||
|
||||
def serialize(obj):
|
||||
|
@ -2,7 +2,7 @@ from .. import database_packed
|
||||
from . import filters
|
||||
from ..globalconf import malojaconfig
|
||||
|
||||
from .. import database, database_packed, malojatime, utilities, malojauri, thirdparty
|
||||
from .. import database, database_packed, malojatime, utilities, malojauri, thirdparty, __pkginfo__
|
||||
from doreah.regular import repeatdaily
|
||||
|
||||
import urllib
|
||||
@ -32,6 +32,7 @@ def update_jinja_environment():
|
||||
"mlj_uri": malojauri,
|
||||
"settings": malojaconfig,
|
||||
"thirdparty": thirdparty,
|
||||
"pkginfo": __pkginfo__,
|
||||
# external
|
||||
"urllib": urllib,
|
||||
"math":math,
|
||||
|
34
maloja/web/jinja/about.jinja
Normal file
34
maloja/web/jinja/about.jinja
Normal file
@ -0,0 +1,34 @@
|
||||
{% extends "abstracts/base.jinja" %}
|
||||
{% block title %}Maloja - About{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<table class="top_info">
|
||||
<tr>
|
||||
<td class="image">
|
||||
|
||||
<div style="background-image:url('/favicon.png');">
|
||||
</div>
|
||||
</td>
|
||||
<td class="text">
|
||||
<h1 class="headerwithextra">Maloja</h1>
|
||||
<br/>
|
||||
<span>Version {{ pkginfo.VERSION }}</span>
|
||||
|
||||
<p class="stats">
|
||||
<a href="https://github.com/krateng/maloja" class="hidelink">
|
||||
<img src="https://img.shields.io/github/v/tag/krateng/maloja?label=GitHub&style=for-the-badge" />
|
||||
</a>
|
||||
<a href="https://pypi.org/project/malojaserver/" class="hidelink">
|
||||
<img src="https://img.shields.io/pypi/v/malojaserver?label=PyPI&style=for-the-badge" />
|
||||
</a>
|
||||
<a href="https://hub.docker.com/r/krateng/maloja" class="hidelink">
|
||||
<img src="https://img.shields.io/docker/v/krateng/maloja?label=Docker&style=for-the-badge" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
@ -48,11 +48,12 @@
|
||||
|
||||
<div class="footer">
|
||||
<div>
|
||||
<span>Get your own charts on
|
||||
<!--<span>Get your own charts on
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://github.com/krateng/maloja">GitHub</a>,
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://pypi.org/project/malojaserver/">PyPI</a> or
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://hub.docker.com/r/krateng/maloja">Dockerhub</a>
|
||||
</span>
|
||||
</span>-->
|
||||
<span><a href="/about">About</a></span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/"><span style="font-weight:bold;">Maloja {% if settings["DEV_MODE"] %}[Developer Mode]{% endif %}</span></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user