improved system info even more
This commit is contained in:
parent
2b5a86ce53
commit
22dfb40fd5
@ -19,30 +19,32 @@
|
|||||||
|
|
||||||
<h3 class="mt-5">{% trans 'System Information' %}</h3>
|
<h3 class="mt-5">{% trans 'System Information' %}</h3>
|
||||||
|
|
||||||
<span class="mt-3">
|
<div class="row">
|
||||||
Current Version: {% if version and version != '' %}
|
<div class="col col-md-6">
|
||||||
<a href="https://github.com/vabene1111/recipes/releases/tag/{{ version }}">{{ version }}</a>{% else %}
|
<div class="list-group">
|
||||||
{{ version }}{% endif %}<br/>
|
{% for v in version_info %}
|
||||||
</span>
|
<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 %}
|
||||||
|
{% if v.commit_link %}
|
||||||
|
<a href="{{ v.commit_link }}" target="_blank">Commit</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<pre class="card-text">{{ v.version }}</pre>
|
||||||
|
|
||||||
<div class="list-group">
|
</div>
|
||||||
{% 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>
|
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endfor %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="mt-3">{% trans 'Media Serving' %} <span class="badge badge-{% if gunicorn_media %}danger{% else %}success{% endif %}">{% if gunicorn_media %}
|
<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>
|
{% trans 'Warning' %}{% else %}{% trans 'Ok' %}{% endif %}</span></h4>
|
||||||
{% if gunicorn_media %}
|
{% if gunicorn_media %}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import traceback
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
@ -321,25 +322,30 @@ def system(request):
|
|||||||
r = subprocess.check_output(['git', 'show', '-s'], cwd=BASE_DIR)
|
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'))
|
# r = subprocess.check_output(['git', 'show', '-s'], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', 'enterprise_plugin'))
|
||||||
version_info = []
|
version_info = []
|
||||||
version_info.append({
|
try:
|
||||||
'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({
|
version_info.append({
|
||||||
'name': p['name'],
|
'name': 'Tandoor ' + VERSION_NUMBER,
|
||||||
'version': re.sub(r'<.*>', '', r.decode()),
|
'version': re.sub(r'<.*>', '', r.decode()),
|
||||||
'website': p['website']
|
'website': 'https://github.com/TandoorRecipes/recipes',
|
||||||
|
'commit_link': 'https://github.com/TandoorRecipes/recipes/commit/' + r.decode().split('\n')[0].split(' ')[1],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
for p in PLUGINS:
|
||||||
|
r = subprocess.check_output(['git', 'show', '-s'], cwd=p['base_path'])
|
||||||
|
version_info.append({
|
||||||
|
'name': 'Plugin: ' + p['name'],
|
||||||
|
'version': re.sub(r'<.*>', '', r.decode()),
|
||||||
|
'website': p['website'],
|
||||||
|
'commit_link': p['website'] + '/commit/' + r.decode().split('\n')[0].split(' ')[1],
|
||||||
|
})
|
||||||
|
except:
|
||||||
|
if settings.DEBUG:
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
return render(request, 'system.html', {
|
return render(request, 'system.html', {
|
||||||
'gunicorn_media': settings.GUNICORN_MEDIA,
|
'gunicorn_media': settings.GUNICORN_MEDIA,
|
||||||
'debug': settings.DEBUG,
|
'debug': settings.DEBUG,
|
||||||
'postgres': postgres,
|
'postgres': postgres,
|
||||||
'version': VERSION_NUMBER,
|
|
||||||
'version_info': version_info,
|
'version_info': version_info,
|
||||||
'ref': BUILD_REF,
|
'ref': BUILD_REF,
|
||||||
'plugins': PLUGINS,
|
'plugins': PLUGINS,
|
||||||
|
@ -150,6 +150,7 @@ try:
|
|||||||
'name': plugin_class.verbose_name if hasattr(plugin_class, 'verbose_name') else plugin_class.name,
|
'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',
|
'version': plugin_class.VERSION if hasattr(plugin_class, 'VERSION') else 'unknown',
|
||||||
'website': plugin_class.website if hasattr(plugin_class, 'website') else '',
|
'website': plugin_class.website if hasattr(plugin_class, 'website') else '',
|
||||||
|
'github': plugin_class.github if hasattr(plugin_class, 'github') else '',
|
||||||
'module': f'recipes.plugins.{d}',
|
'module': f'recipes.plugins.{d}',
|
||||||
'base_path': os.path.join(BASE_DIR, 'recipes', 'plugins', d),
|
'base_path': os.path.join(BASE_DIR, 'recipes', 'plugins', d),
|
||||||
'base_url': plugin_class.base_url,
|
'base_url': plugin_class.base_url,
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
VERSION_NUMBER = "0.0.0"
|
VERSION_NUMBER = ""
|
||||||
BUILD_REF = ""
|
BUILD_REF = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user