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
aca53249
Commit
aca53249
authored
Oct 06, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix arrange shelf
Bugfix remote login Bugfix perform Update
parent
d8f9e2fe
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
27 deletions
+13
-27
admin.py
cps/admin.py
+1
-0
main.js
cps/static/js/main.js
+3
-3
shelforder.js
cps/static/js/shelforder.js
+5
-0
admin.html
cps/templates/admin.html
+1
-0
remote_login.html
cps/templates/remote_login.html
+2
-23
shelf_order.html
cps/templates/shelf_order.html
+1
-0
usermanagement.py
cps/usermanagement.py
+0
-1
No files found.
cps/admin.py
View file @
aca53249
...
@@ -1745,6 +1745,7 @@ def ldap_import_create_user(user, user_data):
...
@@ -1745,6 +1745,7 @@ def ldap_import_create_user(user, user_data):
content
.
kindle_mail
=
kindlemail
content
.
kindle_mail
=
kindlemail
content
.
default_language
=
config
.
config_default_language
content
.
default_language
=
config
.
config_default_language
content
.
locale
=
config
.
config_default_locale
content
.
locale
=
config
.
config_default_locale
content
.
role
=
config
.
config_default_role
content
.
sidebar_view
=
config
.
config_default_show
content
.
sidebar_view
=
config
.
config_default_show
content
.
allowed_tags
=
config
.
config_allowed_tags
content
.
allowed_tags
=
config
.
config_allowed_tags
content
.
denied_tags
=
config
.
config_denied_tags
content
.
denied_tags
=
config
.
config_denied_tags
...
...
cps/static/js/main.js
View file @
aca53249
...
@@ -263,7 +263,7 @@ $(function() {
...
@@ -263,7 +263,7 @@ $(function() {
function
updateTimer
()
{
function
updateTimer
()
{
$
.
ajax
({
$
.
ajax
({
dataType
:
"json"
,
dataType
:
"json"
,
url
:
window
.
location
.
pathname
+
"/../..
/get_updater_status"
,
url
:
getPath
()
+
"
/get_updater_status"
,
success
:
function
success
(
data
)
{
success
:
function
success
(
data
)
{
$
(
"#DialogContent"
).
html
(
updateText
[
data
.
status
]);
$
(
"#DialogContent"
).
html
(
updateText
[
data
.
status
]);
if
(
data
.
status
>
6
)
{
if
(
data
.
status
>
6
)
{
...
@@ -462,8 +462,8 @@ $(function() {
...
@@ -462,8 +462,8 @@ $(function() {
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
dataType
:
"json"
,
dataType
:
"json"
,
data
:
{
start
:
"True"
},
data
:
{
start
:
"True"
},
url
:
window
.
location
.
pathname
+
"/../..
/get_updater_status"
,
url
:
getPath
()
+
"
/get_updater_status"
,
success
:
function
success
(
data
)
{
success
:
function
success
(
data
)
{
updateText
=
data
.
text
;
updateText
=
data
.
text
;
$
(
"#DialogContent"
).
html
(
updateText
[
data
.
status
]);
$
(
"#DialogContent"
).
html
(
updateText
[
data
.
status
]);
...
...
cps/static/js/shelforder.js
View file @
aca53249
...
@@ -35,6 +35,7 @@ function sendData(path) {
...
@@ -35,6 +35,7 @@ function sendData(path) {
var
form
=
document
.
createElement
(
"form"
);
var
form
=
document
.
createElement
(
"form"
);
form
.
setAttribute
(
"method"
,
"post"
);
form
.
setAttribute
(
"method"
,
"post"
);
form
.
setAttribute
(
"action"
,
path
);
form
.
setAttribute
(
"action"
,
path
);
// form.setAttribute("csrf_token", );
for
(
counter
=
0
;
counter
<
maxElements
;
counter
++
)
{
for
(
counter
=
0
;
counter
<
maxElements
;
counter
++
)
{
tmp
[
counter
]
=
elements
[
counter
].
getAttribute
(
"id"
);
tmp
[
counter
]
=
elements
[
counter
].
getAttribute
(
"id"
);
...
@@ -44,6 +45,10 @@ function sendData(path) {
...
@@ -44,6 +45,10 @@ function sendData(path) {
hiddenField
.
setAttribute
(
"value"
,
String
(
counter
+
1
));
hiddenField
.
setAttribute
(
"value"
,
String
(
counter
+
1
));
form
.
appendChild
(
hiddenField
);
form
.
appendChild
(
hiddenField
);
}
}
$
(
"<input type='hidden'/>"
)
.
attr
(
"name"
,
"csrf_token"
).
val
(
$
(
"input[name='csrf_token']"
).
val
())
.
appendTo
(
form
);
document
.
body
.
appendChild
(
form
);
document
.
body
.
appendChild
(
form
);
form
.
submit
();
form
.
submit
();
}
}
cps/templates/admin.html
View file @
aca53249
...
@@ -186,6 +186,7 @@
...
@@ -186,6 +186,7 @@
</table>
</table>
{% if feature_support['updater'] %}
{% if feature_support['updater'] %}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
>
<div
class=
"hidden"
id=
"update_error"
>
<span>
{{update_error}}
</span></div>
<div
class=
"hidden"
id=
"update_error"
>
<span>
{{update_error}}
</span></div>
<div
class=
"btn btn-primary"
id=
"check_for_update"
>
{{_('Check for Update')}}
</div>
<div
class=
"btn btn-primary"
id=
"check_for_update"
>
{{_('Check for Update')}}
</div>
<div
class=
"btn btn-primary hidden"
id=
"perform_update"
data-toggle=
"modal"
data-target=
"#StatusDialog"
>
{{_('Perform Update')}}
</div>
<div
class=
"btn btn-primary hidden"
id=
"perform_update"
data-toggle=
"modal"
data-target=
"#StatusDialog"
>
{{_('Perform Update')}}
</div>
...
...
cps/templates/remote_login.html
View file @
aca53249
{% extends "layout.html" %}
{% extends "layout.html" %}
{% block body %}
{% block body %}
<div
class=
"well"
>
<div
class=
"well"
>
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
>
<h2
style=
"margin-top: 0"
>
{{_('Magic Link - Authorise New Device')}}
</h2>
<h2
style=
"margin-top: 0"
>
{{_('Magic Link - Authorise New Device')}}
</h2>
<p>
<p>
{{_('On another device, login and visit:')}}
{{_('On another device, login and visit:')}}
<h4><a
id=
"verify_url"
data-token=
"{{token}}"
href=
"{{verify_url}}"
>
{{verify_url}}
</a></b>
<h4><a
id=
"verify_url"
data-token=
"{{token}}"
href=
"{{verify_url}}"
>
{{verify_url}}
</a><
b><
/b>
</h4>
</h4>
<p>
<p>
{{_('Once verified, you will automatically be logged in on this device.')}}
{{_('Once verified, you will automatically be logged in on this device.')}}
...
@@ -17,26 +18,4 @@
...
@@ -17,26 +18,4 @@
{% block js %}
{% block js %}
<script
src=
"{{ url_for('static', filename='js/remote_login.js') }}"
></script>
<script
src=
"{{ url_for('static', filename='js/remote_login.js') }}"
></script>
<!--script type="text/javascript">
(function () {
// Poll the server to check if the user has authenticated
var t = setInterval(function () {
$.post('{{url_for("remotelogin.token_verified")}}', { token: '{{token}}' })
.done(function(response) {
if (response.status === 'success') {
// Wait a tick so cookies are updated
setTimeout(function () {
window.location.href = '{{url_for("web.index")}}';
}, 0);
}
})
.fail(function (xhr) {
clearInterval(t);
var response = JSON.parse(xhr.responseText);
alert(response.message);
});
}, 5000);
})()
</script-->
{% endblock %}
{% endblock %}
cps/templates/shelf_order.html
View file @
aca53249
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<div
class=
"col-sm-8 col-lg-8 col-xs-12"
>
<div
class=
"col-sm-8 col-lg-8 col-xs-12"
>
<h2>
{{title}}
</h2>
<h2>
{{title}}
</h2>
<div>
{{_('Drag to Rearrange Order')}}
</div>
<div>
{{_('Drag to Rearrange Order')}}
</div>
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
>
<div
id=
"sortTrue"
class=
"list-group"
>
<div
id=
"sortTrue"
class=
"list-group"
>
{% for entry in entries %}
{% for entry in entries %}
<div
id=
"{{entry['Books']['id']}}"
class=
"list-group-item"
>
<div
id=
"{{entry['Books']['id']}}"
class=
"list-group-item"
>
...
...
cps/usermanagement.py
View file @
aca53249
...
@@ -23,7 +23,6 @@ from sqlalchemy.sql.expression import func
...
@@ -23,7 +23,6 @@ from sqlalchemy.sql.expression import func
from
werkzeug.security
import
check_password_hash
from
werkzeug.security
import
check_password_hash
from
flask_login
import
login_required
,
login_user
from
flask_login
import
login_required
,
login_user
from
.
import
lm
,
ub
,
config
,
constants
,
services
from
.
import
lm
,
ub
,
config
,
constants
,
services
try
:
try
:
...
...
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