Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
e9d0bff5
Commit
e9d0bff5
authored
Jan 28, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added statistics for Tags and series
- Loglevel is displayed as text instead of value
parent
e00a6741
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
+23
-4
admin.html
cps/templates/admin.html
+1
-1
stats.html
cps/templates/stats.html
+8
-0
ub.py
cps/ub.py
+11
-2
web.py
cps/web.py
+3
-1
No files found.
cps/templates/admin.html
View file @
e9d0bff5
...
@@ -66,7 +66,7 @@
...
@@ -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>
...
...
cps/templates/stats.html
View file @
e9d0bff5
...
@@ -40,6 +40,14 @@
...
@@ -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 %}
cps/ub.py
View file @
e9d0bff5
...
@@ -288,8 +288,17 @@ class Config:
...
@@ -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
...
...
cps/web.py
View file @
e9d0bff5
...
@@ -973,6 +973,8 @@ def admin_forbidden():
...
@@ -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():
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment