- added statistics for Tags and series
- Loglevel is displayed as text instead of value
This commit is contained in:
parent
e00a6741c7
commit
e9d0bff559
|
@ -66,7 +66,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{config.config_calibre_dir}}</td>
|
<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_port}}</td>
|
||||||
<td>{{config.config_books_per_page}}</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>
|
<td>{% if config.config_uploading %}<span class="glyphicon glyphicon-ok"></span>{% else %}<span class="glyphicon glyphicon-remove"></span>{% endif %}</td>
|
||||||
|
|
|
@ -40,6 +40,14 @@
|
||||||
<th>{{authorcounter}}</th>
|
<th>{{authorcounter}}</th>
|
||||||
<td>{{_('Authors in this Library')}}</td>
|
<td>{{_('Authors in this Library')}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{categorycounter}}</th>
|
||||||
|
<td>{{_('Categories in this Library')}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{seriecounter}}</th>
|
||||||
|
<td>{{_('Series in this Library')}}</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
13
cps/ub.py
13
cps/ub.py
|
@ -288,8 +288,17 @@ class Config:
|
||||||
def get_main_dir(self):
|
def get_main_dir(self):
|
||||||
return self.config_main_dir
|
return self.config_main_dir
|
||||||
|
|
||||||
#def is_Calibre_Configured(self):
|
def get_Log_Level(self):
|
||||||
# return self.db_configured
|
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
|
# Migrate database to current version, has to be updated after every database change. Currently migration from
|
||||||
|
|
|
@ -973,6 +973,8 @@ def admin_forbidden():
|
||||||
def stats():
|
def stats():
|
||||||
counter = len(db.session.query(db.Books).all())
|
counter = len(db.session.query(db.Books).all())
|
||||||
authors = len(db.session.query(db.Authors).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()
|
versions = uploader.book_formats.get_versions()
|
||||||
vendorpath = os.path.join(config.get_main_dir + "vendor" + os.sep)
|
vendorpath = os.path.join(config.get_main_dir + "vendor" + os.sep)
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
|
@ -989,7 +991,7 @@ def stats():
|
||||||
versions['KindlegenVersion'] = lines
|
versions['KindlegenVersion'] = lines
|
||||||
versions['PythonVersion'] = sys.version
|
versions['PythonVersion'] = sys.version
|
||||||
return render_title_template('stats.html', bookcounter=counter, authorcounter=authors, versions=versions,
|
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")
|
@app.route("/shutdown")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user