- added statistics for Tags and series

- Loglevel is displayed as text instead of value
This commit is contained in:
OzzieIsaacs 2017-01-28 20:54:31 +01:00
parent e00a6741c7
commit e9d0bff559
4 changed files with 23 additions and 4 deletions

View file

@ -66,7 +66,7 @@
</tr>
<tr>
<td>{{config.config_calibre_dir}}</td>
<td>{{config.config_log_level}}</td>
<td>{{config.get_Log_Level()}}</td>
<td>{{config.config_port}}</td>
<td>{{config.config_books_per_page}}</td>
<td>{% if config.config_uploading %}<span class="glyphicon glyphicon-ok"></span>{% else %}<span class="glyphicon glyphicon-remove"></span>{% endif %}</td>

View file

@ -40,6 +40,14 @@
<th>{{authorcounter}}</th>
<td>{{_('Authors in this Library')}}</td>
</tr>
<tr>
<th>{{categorycounter}}</th>
<td>{{_('Categories in this Library')}}</td>
</tr>
<tr>
<th>{{seriecounter}}</th>
<td>{{_('Series in this Library')}}</td>
</tr>
</tbody>
</table>
{% endblock %}

View file

@ -288,8 +288,17 @@ class Config:
def get_main_dir(self):
return self.config_main_dir
#def is_Calibre_Configured(self):
# return self.db_configured
def get_Log_Level(self):
ret_value=""
if self.config_log_level == logging.INFO:
ret_value='INFO'
elif self.config_log_level == logging.DEBUG:
ret_value='DEBUG'
elif self.config_log_level == logging.WARNING:
ret_value='WARNING'
elif self.config_log_level == logging.ERROR:
ret_value='ERROR'
return ret_value
# Migrate database to current version, has to be updated after every database change. Currently migration from

View file

@ -973,6 +973,8 @@ def admin_forbidden():
def stats():
counter = len(db.session.query(db.Books).all())
authors = len(db.session.query(db.Authors).all())
categorys = len(db.session.query(db.Tags).all())
series = len(db.session.query(db.Series).all())
versions = uploader.book_formats.get_versions()
vendorpath = os.path.join(config.get_main_dir + "vendor" + os.sep)
if sys.platform == "win32":
@ -989,7 +991,7 @@ def stats():
versions['KindlegenVersion'] = lines
versions['PythonVersion'] = sys.version
return render_title_template('stats.html', bookcounter=counter, authorcounter=authors, versions=versions,
title=_(u"Statistics"))
categorycounter=categorys, seriecounter=series, title=_(u"Statistics"))
@app.route("/shutdown")