mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +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):
|
||||
socketio.start_background_task(user_data_stream,
|
||||
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):
|
||||
|
@ -7,20 +7,21 @@ var nopaque = {};
|
||||
// nopaque ressources
|
||||
nopaque.socket = undefined;
|
||||
|
||||
nopaque.corpora = undefined;
|
||||
nopaque.corporaSubscribers = [];
|
||||
nopaque.jobs = undefined;
|
||||
nopaque.jobsSubscribers = [];
|
||||
|
||||
nopaque.foreignCorpora = undefined;
|
||||
nopaque.foreignCorporaSubscribers = [];
|
||||
nopaque.foreignJobs = undefined;
|
||||
nopaque.foreignJobsSubscribers = [];
|
||||
|
||||
// User data
|
||||
nopaque.user = {};
|
||||
nopaque.user.isAuthenticated = undefined;
|
||||
nopaque.user.settings = {}
|
||||
nopaque.user.settings = {};
|
||||
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;
|
||||
|
||||
|
@ -104,7 +104,7 @@
|
||||
var corpusList = new RessourceList("corpora", nopaque.foreignCorporaSubscribers, "corpus");
|
||||
var jobList = new RessourceList("jobs", nopaque.foreignJobsSubscribers, "job");
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
nopaque.socket.emit("foreign_user_ressources_init", {{ user.id }});
|
||||
nopaque.socket.emit("foreign_user_data_stream_init", {{ user.id }});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -213,7 +213,7 @@
|
||||
{% else %}
|
||||
var informationUpdater = new InformationUpdater({{ corpus.id }}, true);
|
||||
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 %}
|
||||
</script>
|
||||
|
@ -254,7 +254,7 @@
|
||||
{% else %}
|
||||
var informationUpdater = new InformationUpdater({{ job.id }}, true);
|
||||
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 %}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user