mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added About page
This commit is contained in:
parent
a1f8e96ae4
commit
765ab493cb
@ -52,11 +52,12 @@ def invalidate_caches(scrobbletime):
|
|||||||
def trim_cache():
|
def trim_cache():
|
||||||
ramprct = psutil.virtual_memory().percent
|
ramprct = psutil.virtual_memory().percent
|
||||||
if ramprct > malojaconfig["DB_MAX_MEMORY"]:
|
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
|
ratio = (malojaconfig["DB_MAX_MEMORY"] / ramprct) ** 3
|
||||||
targetsize = max(int(len(cache) * ratio),100)
|
targetsize = max(int(len(cache) * ratio),100)
|
||||||
c.set_size(targetsize)
|
c.set_size(targetsize)
|
||||||
c.set_size(HIGH_NUMBER)
|
c.set_size(HIGH_NUMBER)
|
||||||
|
log(f"New RAM usage: {psutil.virtual_memory().percent}%")
|
||||||
|
|
||||||
|
|
||||||
def serialize(obj):
|
def serialize(obj):
|
||||||
|
@ -2,7 +2,7 @@ from .. import database_packed
|
|||||||
from . import filters
|
from . import filters
|
||||||
from ..globalconf import malojaconfig
|
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
|
from doreah.regular import repeatdaily
|
||||||
|
|
||||||
import urllib
|
import urllib
|
||||||
@ -32,6 +32,7 @@ def update_jinja_environment():
|
|||||||
"mlj_uri": malojauri,
|
"mlj_uri": malojauri,
|
||||||
"settings": malojaconfig,
|
"settings": malojaconfig,
|
||||||
"thirdparty": thirdparty,
|
"thirdparty": thirdparty,
|
||||||
|
"pkginfo": __pkginfo__,
|
||||||
# external
|
# external
|
||||||
"urllib": urllib,
|
"urllib": urllib,
|
||||||
"math":math,
|
"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 class="footer">
|
||||||
<div>
|
<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://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://pypi.org/project/malojaserver/">PyPI</a> or
|
||||||
<a target="_blank" rel="noopener noreferrer" href="https://hub.docker.com/r/krateng/maloja">Dockerhub</a>
|
<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>
|
||||||
<div>
|
<div>
|
||||||
<a href="/"><span style="font-weight:bold;">Maloja {% if settings["DEV_MODE"] %}[Developer Mode]{% endif %}</span></a>
|
<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