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
41a20fe3
Commit
41a20fe3
authored
Feb 23, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added version info of dependencys in about section
parent
0277d087
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
21 deletions
+72
-21
main.js
cps/static/js/main.js
+3
-2
stats.html
cps/templates/stats.html
+50
-16
web.py
cps/web.py
+19
-3
No files found.
cps/static/js/main.js
View file @
41a20fe3
...
@@ -36,7 +36,7 @@ $(function() {
...
@@ -36,7 +36,7 @@ $(function() {
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
'#spinner'
).
show
();
$
(
'#spinner'
).
show
();
displaytext
=
data
.
text
;
displaytext
=
data
.
text
;
window
.
setTimeout
(
restartTimer
,
3000
);}
setTimeout
(
restartTimer
,
3000
);}
});
});
});
});
$
(
"#shutdown"
).
click
(
function
()
{
$
(
"#shutdown"
).
click
(
function
()
{
...
@@ -110,7 +110,8 @@ function updateTimer() {
...
@@ -110,7 +110,8 @@ function updateTimer() {
$
(
'#UpdateprogressDialog #updateFinished'
).
removeClass
(
'hidden'
);
$
(
'#UpdateprogressDialog #updateFinished'
).
removeClass
(
'hidden'
);
$
(
"#check_for_update"
).
removeClass
(
'hidden'
);
$
(
"#check_for_update"
).
removeClass
(
'hidden'
);
$
(
"#perform_update"
).
addClass
(
'hidden'
);
$
(
"#perform_update"
).
addClass
(
'hidden'
);
}
},
timeout
:
2000
});
});
}
}
...
...
cps/templates/stats.html
View file @
41a20fe3
{% extends "layout.html" %}
{% extends "layout.html" %}
{% block body %}
{% block body %}
<h3>
{{_('Calibre library statistics')}}
</h3>
<table
id=
"stats"
class=
"table"
>
<tbody>
<tr>
<th>
{{bookcounter}}
</th>
<td>
{{_('Books in this Library')}}
</td>
</tr>
<tr>
<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>
<h3>
{{_('Linked libraries')}}
</h3>
<h3>
{{_('Linked libraries')}}
</h3>
<table
id=
"libs"
class=
"table"
>
<table
id=
"libs"
class=
"table"
>
<thead>
<thead>
<tr>
<tr>
...
@@ -24,30 +44,44 @@
...
@@ -24,30 +44,44 @@
</tr>
</tr>
<tr>
<tr>
<th>
PyPDF2
</th>
<th>
PyPDF2
</th>
<td>
{{versions['PyPdfVersion']}}
</td>
<td>
v
{{versions['PyPdfVersion']}}
</td>
</tr>
</tr>
</tbody>
</table>
<h3>
{{_('Calibre library statistics')}}
</h3>
<table
id=
"stats"
class=
"table"
>
<tbody>
<tr>
<tr>
<th>
{{bookcounter}}
</th>
<th>
Babel
</th>
<td>
{{_('Books in this Library')
}}
</td>
<td>
v{{versions['babel']
}}
</td>
</tr>
</tr>
<tr>
<tr>
<th>
{{authorcounter}}
</th>
<th>
SqlAlchemy
</th>
<td>
{{_('Authors in this Library')
}}
</td>
<td>
v{{versions['sqlalchemy']
}}
</td>
</tr>
</tr>
<tr>
<tr>
<th>
{{categorycounter}}
</th>
<th>
Flask
</th>
<td>
{{_('Categories in this Library')
}}
</td>
<td>
v{{versions['flask']
}}
</td>
</tr>
</tr>
<tr>
<tr>
<th>
{{seriecounter}}
</th>
<th>
Flask Login
</th>
<td>
{{_('Series in this Library')
}}
</td>
<td>
v{{versions['flasklogin']
}}
</td>
</tr>
</tr>
<tr>
<th>
Flask Principal
</th>
<td>
v{{versions['flask_principal']}}
</td>
</tr>
<tr>
<th>
Tornado web server
</th>
<td>
v{{versions['tornado']}}
</td>
</tr>
<tr>
<th>
ISO639 Languages
</th>
<td>
v{{versions['iso639']}}
</td>
</tr>
<tr>
<th>
Requests
</th>
<td>
v{{versions['requests']}}
</td>
</tr>
</tbody>
</tbody>
</table>
</table>
{% endblock %}
{% endblock %}
cps/web.py
View file @
41a20fe3
...
@@ -4,8 +4,9 @@ import mimetypes
...
@@ -4,8 +4,9 @@ import mimetypes
import
logging
import
logging
from
logging.handlers
import
RotatingFileHandler
from
logging.handlers
import
RotatingFileHandler
import
textwrap
import
textwrap
from
flask
import
Flask
,
render_template
,
session
,
request
,
Response
,
redirect
,
url_for
,
send_from_directory
,
\
from
flask
import
Flask
,
render_template
,
request
,
Response
,
redirect
,
url_for
,
send_from_directory
,
\
make_response
,
g
,
flash
,
abort
make_response
,
g
,
flash
,
abort
from
flask
import
__version__
as
flaskVersion
import
ub
import
ub
from
ub
import
config
from
ub
import
config
import
helper
import
helper
...
@@ -14,9 +15,12 @@ import errno
...
@@ -14,9 +15,12 @@ import errno
from
sqlalchemy.sql.expression
import
func
from
sqlalchemy.sql.expression
import
func
from
sqlalchemy.sql.expression
import
false
from
sqlalchemy.sql.expression
import
false
from
sqlalchemy.exc
import
IntegrityError
from
sqlalchemy.exc
import
IntegrityError
from
sqlalchemy
import
__version__
as
sqlalchemyVersion
from
math
import
ceil
from
math
import
ceil
from
flask_login
import
LoginManager
,
login_user
,
logout_user
,
login_required
,
current_user
from
flask_login
import
LoginManager
,
login_user
,
logout_user
,
login_required
,
current_user
from
flask_login
import
__version__
as
flask_loginVersion
from
flask_principal
import
Principal
,
Identity
,
AnonymousIdentity
,
identity_changed
from
flask_principal
import
Principal
,
Identity
,
AnonymousIdentity
,
identity_changed
from
flask_login
import
__version__
as
flask_principalVersion
from
flask_babel
import
Babel
from
flask_babel
import
Babel
from
flask_babel
import
gettext
as
_
from
flask_babel
import
gettext
as
_
import
requests
import
requests
...
@@ -24,6 +28,7 @@ import zipfile
...
@@ -24,6 +28,7 @@ import zipfile
from
werkzeug.security
import
generate_password_hash
,
check_password_hash
from
werkzeug.security
import
generate_password_hash
,
check_password_hash
from
babel
import
Locale
as
LC
from
babel
import
Locale
as
LC
from
babel
import
negotiate_locale
from
babel
import
negotiate_locale
from
babel
import
__version__
as
babelVersion
from
babel.dates
import
format_date
from
babel.dates
import
format_date
from
functools
import
wraps
from
functools
import
wraps
import
base64
import
base64
...
@@ -32,16 +37,16 @@ import json
...
@@ -32,16 +37,16 @@ import json
import
urllib
import
urllib
import
datetime
import
datetime
from
iso639
import
languages
as
isoLanguages
from
iso639
import
languages
as
isoLanguages
from
iso639
import
__version__
as
iso639Version
from
uuid
import
uuid4
from
uuid
import
uuid4
import
os.path
import
os.path
import
sys
import
sys
import
subprocess
import
subprocess
import
re
import
re
import
db
import
db
import
thread
from
shutil
import
move
,
copyfile
from
shutil
import
move
,
copyfile
from
tornado.ioloop
import
IOLoop
from
tornado.ioloop
import
IOLoop
from
tornado
import
version
as
tornadoVersion
try
:
try
:
from
wand.image
import
Image
from
wand.image
import
Image
...
@@ -1042,6 +1047,15 @@ def stats():
...
@@ -1042,6 +1047,15 @@ def stats():
if
re
.
search
(
'Amazon kindlegen
\
('
,
lines
):
if
re
.
search
(
'Amazon kindlegen
\
('
,
lines
):
versions
[
'KindlegenVersion'
]
=
lines
versions
[
'KindlegenVersion'
]
=
lines
versions
[
'PythonVersion'
]
=
sys
.
version
versions
[
'PythonVersion'
]
=
sys
.
version
versions
[
'babel'
]
=
babelVersion
versions
[
'sqlalchemy'
]
=
sqlalchemyVersion
versions
[
'flask'
]
=
flaskVersion
versions
[
'flasklogin'
]
=
flask_loginVersion
versions
[
'flask_principal'
]
=
flask_principalVersion
versions
[
'tornado'
]
=
tornadoVersion
versions
[
'iso639'
]
=
iso639Version
versions
[
'requests'
]
=
requests
.
__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
,
categorycounter
=
categorys
,
seriecounter
=
series
,
title
=
_
(
u"Statistics"
))
categorycounter
=
categorys
,
seriecounter
=
series
,
title
=
_
(
u"Statistics"
))
...
@@ -1796,6 +1810,8 @@ def edit_mailsettings():
...
@@ -1796,6 +1810,8 @@ def edit_mailsettings():
category
=
"success"
)
category
=
"success"
)
else
:
else
:
flash
(
_
(
u"There was an error sending the Test E-Mail:
%(res)
s"
,
res
=
result
),
category
=
"error"
)
flash
(
_
(
u"There was an error sending the Test E-Mail:
%(res)
s"
,
res
=
result
),
category
=
"error"
)
else
:
flash
(
_
(
u"E-Mail settings updated"
),
category
=
"success"
)
return
render_title_template
(
"email_edit.html"
,
content
=
content
,
title
=
_
(
u"Edit mail settings"
))
return
render_title_template
(
"email_edit.html"
,
content
=
content
,
title
=
_
(
u"Edit mail settings"
))
...
...
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