improved system page
This commit is contained in:
parent
e77016ea9b
commit
2b5a86ce53
@ -11,31 +11,39 @@
|
||||
{% block content %}
|
||||
|
||||
<h1>{% trans 'System' %}</h1>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<h3>{% trans 'System Information' %}</h3>
|
||||
|
||||
{% blocktrans %}
|
||||
Django Recipes is an open source free software application. It can be found on
|
||||
<a href="https://github.com/vabene1111/recipes">GitHub</a>.
|
||||
Changelogs can be found <a href="https://github.com/vabene1111/recipes/releases">here</a>.
|
||||
{% endblocktrans %}
|
||||
<br/>
|
||||
<br/>
|
||||
Current Version: {% if version and version != '' %}
|
||||
<a href="https://github.com/vabene1111/recipes/releases/tag/{{ version }}">{{ version }}</a>{% else %}
|
||||
{{ version }}{% endif %}<br/>
|
||||
Ref: <a href="https://github.com/vabene1111/recipes/commit/{{ ref }}">{{ ref }}</a>
|
||||
|
||||
<pre>{{ version_info }}</pre>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<h4>{% trans 'Media Serving' %} <span class="badge badge-{% if gunicorn_media %}danger{% else %}success{% endif %}">{% if gunicorn_media %}
|
||||
<h3 class="mt-5">{% trans 'System Information' %}</h3>
|
||||
|
||||
<span class="mt-3">
|
||||
Current Version: {% if version and version != '' %}
|
||||
<a href="https://github.com/vabene1111/recipes/releases/tag/{{ version }}">{{ version }}</a>{% else %}
|
||||
{{ version }}{% endif %}<br/>
|
||||
</span>
|
||||
|
||||
<div class="list-group">
|
||||
{% for v in version_info %}
|
||||
<div class="list-group-item list-group-item-action">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
{% if v.website %}
|
||||
<a href="{{ v.website }}" target="_blank"><h5 class="mb-1">{{ v.name }}</h5></a>
|
||||
{% else %}
|
||||
<h5 class="mb-1">{{ v.name }}</h5>
|
||||
{% endif %}
|
||||
</div>
|
||||
<pre class="card-text">{{ v.version }}</pre>
|
||||
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<h4 class="mt-3">{% trans 'Media Serving' %} <span class="badge badge-{% if gunicorn_media %}danger{% else %}success{% endif %}">{% if gunicorn_media %}
|
||||
{% trans 'Warning' %}{% else %}{% trans 'Ok' %}{% endif %}</span></h4>
|
||||
{% if gunicorn_media %}
|
||||
{% blocktrans %}Serving media files directly using gunicorn/python is <b>not recommend</b>!
|
||||
|
@ -319,8 +319,21 @@ def system(request):
|
||||
secret_key = False if os.getenv('SECRET_KEY') else True
|
||||
|
||||
r = subprocess.check_output(['git', 'show', '-s'], cwd=BASE_DIR)
|
||||
r = subprocess.check_output(['git', 'show', '-s'], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', 'enterprise_plugin'))
|
||||
version_info = r.decode()
|
||||
# r = subprocess.check_output(['git', 'show', '-s'], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', 'enterprise_plugin'))
|
||||
version_info = []
|
||||
version_info.append({
|
||||
'name': 'Tandoor',
|
||||
'version': re.sub(r'<.*>', '', r.decode()),
|
||||
'website': 'https://github.com/TandoorRecipes/recipes',
|
||||
})
|
||||
|
||||
for p in PLUGINS:
|
||||
r = subprocess.check_output(['git', 'show', '-s'], cwd=p['base_path'])
|
||||
version_info.append({
|
||||
'name': p['name'],
|
||||
'version': re.sub(r'<.*>', '', r.decode()),
|
||||
'website': p['website']
|
||||
})
|
||||
|
||||
return render(request, 'system.html', {
|
||||
'gunicorn_media': settings.GUNICORN_MEDIA,
|
||||
|
@ -149,6 +149,7 @@ try:
|
||||
plugin_config = {
|
||||
'name': plugin_class.verbose_name if hasattr(plugin_class, 'verbose_name') else plugin_class.name,
|
||||
'version': plugin_class.VERSION if hasattr(plugin_class, 'VERSION') else 'unknown',
|
||||
'website': plugin_class.website if hasattr(plugin_class, 'website') else '',
|
||||
'module': f'recipes.plugins.{d}',
|
||||
'base_path': os.path.join(BASE_DIR, 'recipes', 'plugins', d),
|
||||
'base_url': plugin_class.base_url,
|
||||
|
Loading…
Reference in New Issue
Block a user