mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-04-05 00:34:24 +00:00
Fix foreign user data transmission for admins
This commit is contained in:
parent
8d201a29ae
commit
d4e81b11e0
@ -47,7 +47,7 @@ def user_data_stream_init():
|
|||||||
def foreign_user_data_stream_init(user_id):
|
def foreign_user_data_stream_init(user_id):
|
||||||
socketio.start_background_task(user_data_stream,
|
socketio.start_background_task(user_data_stream,
|
||||||
current_app._get_current_object(),
|
current_app._get_current_object(),
|
||||||
user_id, request.sid, True)
|
user_id, request.sid, foreign=True)
|
||||||
|
|
||||||
|
|
||||||
def user_data_stream(app, user_id, session_id, foreign=False):
|
def user_data_stream(app, user_id, session_id, foreign=False):
|
||||||
|
@ -7,20 +7,21 @@ var nopaque = {};
|
|||||||
// nopaque ressources
|
// nopaque ressources
|
||||||
nopaque.socket = undefined;
|
nopaque.socket = undefined;
|
||||||
|
|
||||||
nopaque.corpora = undefined;
|
// User data
|
||||||
nopaque.corporaSubscribers = [];
|
|
||||||
nopaque.jobs = undefined;
|
|
||||||
nopaque.jobsSubscribers = [];
|
|
||||||
|
|
||||||
nopaque.foreignCorpora = undefined;
|
|
||||||
nopaque.foreignCorporaSubscribers = [];
|
|
||||||
nopaque.foreignJobs = undefined;
|
|
||||||
nopaque.foreignJobsSubscribers = [];
|
|
||||||
|
|
||||||
nopaque.user = {};
|
nopaque.user = {};
|
||||||
nopaque.user.isAuthenticated = undefined;
|
nopaque.user.isAuthenticated = undefined;
|
||||||
nopaque.user.settings = {}
|
nopaque.user.settings = {};
|
||||||
nopaque.user.settings.darkMode = undefined;
|
nopaque.user.settings.darkMode = undefined;
|
||||||
|
nopaque.corporaSubscribers = [];
|
||||||
|
nopaque.jobsSubscribers = [];
|
||||||
|
|
||||||
|
// Foreign user (user inspected with admin credentials) data
|
||||||
|
nopaque.foreignUser = {};
|
||||||
|
nopaque.foreignUser.isAuthenticated = undefined;
|
||||||
|
nopaque.foreignUser.settings = {};
|
||||||
|
nopaque.foreignUser.settings.darkMode = undefined;
|
||||||
|
nopaque.foreignCorporaSubscribers = [];
|
||||||
|
nopaque.foreignJobsSubscribers = [];
|
||||||
|
|
||||||
nopaque.flashedMessages = undefined;
|
nopaque.flashedMessages = undefined;
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@
|
|||||||
var corpusList = new RessourceList("corpora", nopaque.foreignCorporaSubscribers, "corpus");
|
var corpusList = new RessourceList("corpora", nopaque.foreignCorporaSubscribers, "corpus");
|
||||||
var jobList = new RessourceList("jobs", nopaque.foreignJobsSubscribers, "job");
|
var jobList = new RessourceList("jobs", nopaque.foreignJobsSubscribers, "job");
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
nopaque.socket.emit("foreign_user_ressources_init", {{ user.id }});
|
nopaque.socket.emit("foreign_user_data_stream_init", {{ user.id }});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -213,7 +213,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
var informationUpdater = new InformationUpdater({{ corpus.id }}, true);
|
var informationUpdater = new InformationUpdater({{ corpus.id }}, true);
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
nopaque.socket.emit("subscribe_foreign_user_ressources", {{ corpus.user_id }});
|
nopaque.socket.emit("foreign_user_data_stream_init", {{ corpus.user_id }});
|
||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
@ -254,7 +254,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
var informationUpdater = new InformationUpdater({{ job.id }}, true);
|
var informationUpdater = new InformationUpdater({{ job.id }}, true);
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
nopaque.socket.emit("foreign_user_ressources_init", {{ job.user_id }});
|
nopaque.socket.emit("foreign_user_data_stream_init", {{ job.user_id }});
|
||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user